Trabajando en el ending

This commit is contained in:
2022-11-03 21:25:39 +01:00
parent a2d8312bb7
commit 0b1b9f2d15
3 changed files with 198 additions and 52 deletions

View File

@@ -171,8 +171,8 @@ void Credits::fillTexture()
// Rellena la textura de texto
SDL_SetRenderTarget(renderer, textTexture);
const color_t c = stringToColor(options->palette, "black");
SDL_SetRenderDrawColor(renderer, c.r, c.g, c.b, 0x00);
color_t c = stringToColor(options->palette, "black");
SDL_SetRenderDrawColor(renderer, c.r, c.g, c.b, 0xFF);
SDL_RenderClear(renderer);
// Escribe el texto en la textura
@@ -195,7 +195,7 @@ void Credits::fillTexture()
SDL_SetRenderTarget(renderer, nullptr);
// Rellena la textura que cubre el texto
// Rellena la textura que cubre el texto con color transparente
SDL_SetRenderTarget(renderer, coverTexture);
SDL_SetRenderDrawColor(renderer, c.r, c.g, c.b, 0x00);
SDL_RenderClear(renderer);
@@ -288,8 +288,8 @@ void Credits::render()
// Dibuja la textura que cubre el texto
const int offset = std::min(counter / 8, 192 / 2);
SDL_Rect srcRect = {1, 0, 254, 190 - (offset * 2)};
SDL_Rect dstRect = {1, offset * 2, 254, 190 - (offset * 2)};
SDL_Rect srcRect = {0, 0, 256, 192 - (offset * 2)};
SDL_Rect dstRect = {0, offset * 2, 256, 192 - (offset * 2)};
SDL_RenderCopy(renderer, coverTexture, &srcRect, &dstRect);
// Dibuja el sprite con el brillo