Trabajando en la recarga de texturas

This commit is contained in:
2022-10-27 07:25:59 +02:00
parent 02cc3b3527
commit 32dd85525b
7 changed files with 93 additions and 20 deletions

View File

@@ -14,11 +14,11 @@ Title::Title(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *
eventHandler = new SDL_Event();
if (options->palette == p_zxspectrum)
{
texture =resource->getTexture("loading_screen_color.png");
texture = resource->getTexture("loading_screen_color.png");
}
else if (options->palette == p_zxarne)
{
texture =resource->getTexture("loading_screen_color_zxarne.png");
texture = resource->getTexture("loading_screen_color_zxarne.png");
}
sprite = new Sprite(0, 0, texture->getWidth(), texture->getHeight(), texture, renderer);
text = new Text(asset->get("smb2.png"), asset->get("smb2.txt"), renderer);
@@ -107,7 +107,7 @@ void Title::checkEventHandler()
case SDL_SCANCODE_F5:
switchPalette();
reLoadTextures();
// reLoadTextures();
break;
default:
@@ -247,12 +247,19 @@ void Title::switchPalette()
if (options->palette == p_zxspectrum)
{
options->palette = p_zxarne;
texture = resource->getTexture("loading_screen_color_zxarne.png");
sprite->setTexture(texture);
}
else
{
options->palette = p_zxspectrum;
texture = resource->getTexture("loading_screen_color.png");
sprite->setTexture(texture);
}
// resource->reLoadTextures();
// reLoadTextures();
// Cambia el color del borde
screen->setBorderColor(stringToColor(options->palette, "bright_blue"));
}