Mil arreglos de paletes, gifs i colors transparents

El gif del jugador de game over estava mal
This commit is contained in:
2025-03-08 20:04:43 +01:00
parent 7b3f82aa34
commit a14f6fcf6f
22 changed files with 61 additions and 193 deletions

View File

@@ -14,8 +14,8 @@
#include "text.h" // for Text, loadTextFile
#include "utils.h" // for getFileName, printWithDots, Color
#include "room.h"
struct JA_Music_t; // lines 12-12
struct JA_Sound_t; // lines 13-13
struct JA_Music_t; // lines 12-12
struct JA_Sound_t; // lines 13-13
// [SINGLETON] Hay que definir las variables estáticas, desde el .h sólo la hemos declarado
Resource *Resource::resource_ = nullptr;
@@ -257,6 +257,15 @@ void Resource::loadSurfaces()
surfaces_.back().surface->setTransparentColor(0);
updateLoadingProgress();
}
// Reconfigura el color transparente de algunas surfaces
getSurface("loading_screen_color.gif")->setTransparentColor();
getSurface("ending1.gif")->setTransparentColor();
getSurface("ending2.gif")->setTransparentColor();
getSurface("ending3.gif")->setTransparentColor();
getSurface("ending4.gif")->setTransparentColor();
getSurface("ending5.gif")->setTransparentColor();
getSurface("standard.gif")->setTransparentColor(16);
}
// Carga las paletas
@@ -434,7 +443,7 @@ void Resource::renderProgress()
const int wired_bar_width = options.game.width - (X_PADDING * 2);
SDL_Rect rect_wired = {X_PADDING, bar_position, wired_bar_width, X_PADDING};
surface->drawRectBorder(&rect_wired, static_cast<Uint8>(PaletteColor::WHITE));
const int full_bar_width = wired_bar_width * count_.getPercentage();
SDL_Rect rect_full = {X_PADDING, bar_position, full_bar_width, X_PADDING};
surface->fillRect(&rect_full, static_cast<Uint8>(PaletteColor::WHITE));