Recarga de texturas en el cambio de modo de video
This commit is contained in:
@@ -151,22 +151,27 @@ void Game::checkEventHandler()
|
|||||||
|
|
||||||
case SDL_SCANCODE_F:
|
case SDL_SCANCODE_F:
|
||||||
screen->switchVideoMode();
|
screen->switchVideoMode();
|
||||||
|
reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F1:
|
case SDL_SCANCODE_F1:
|
||||||
screen->setWindowSize(1);
|
screen->setWindowSize(1);
|
||||||
|
reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F2:
|
case SDL_SCANCODE_F2:
|
||||||
screen->setWindowSize(2);
|
screen->setWindowSize(2);
|
||||||
|
reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F3:
|
case SDL_SCANCODE_F3:
|
||||||
screen->setWindowSize(3);
|
screen->setWindowSize(3);
|
||||||
|
reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F4:
|
case SDL_SCANCODE_F4:
|
||||||
screen->setWindowSize(4);
|
screen->setWindowSize(4);
|
||||||
|
reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -258,3 +263,11 @@ void Game::checkScreenBorders()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Recarga las texturas
|
||||||
|
void Game::reLoadTextures()
|
||||||
|
{
|
||||||
|
map->reLoadTextures();
|
||||||
|
player->reLoadTextures();
|
||||||
|
scoreboard->reLoadTexture();
|
||||||
|
}
|
||||||
@@ -58,6 +58,9 @@ private:
|
|||||||
// Comprueba si el jugador está en el borde y se ha de cambiar el mapa
|
// Comprueba si el jugador está en el borde y se ha de cambiar el mapa
|
||||||
void checkScreenBorders();
|
void checkScreenBorders();
|
||||||
|
|
||||||
|
// Recarga las texturas
|
||||||
|
void reLoadTextures();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input, Debug *debug);
|
Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input, Debug *debug);
|
||||||
|
|||||||
@@ -669,3 +669,10 @@ std::string Map::getEnemyFile()
|
|||||||
{
|
{
|
||||||
return enemy_file;
|
return enemy_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Recarga las texturas
|
||||||
|
void Map::reLoadTextures()
|
||||||
|
{
|
||||||
|
texture_tile->reLoad();
|
||||||
|
fillMapTexture();
|
||||||
|
}
|
||||||
@@ -123,6 +123,9 @@ public:
|
|||||||
|
|
||||||
// Obtiene el valor de la variable
|
// Obtiene el valor de la variable
|
||||||
std::string getEnemyFile();
|
std::string getEnemyFile();
|
||||||
|
|
||||||
|
// Recarga las texturas
|
||||||
|
void reLoadTextures();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -481,3 +481,9 @@ int Player::checkActors()
|
|||||||
|
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Recarga las texturas
|
||||||
|
void Player::reLoadTextures()
|
||||||
|
{
|
||||||
|
texture->reLoad();
|
||||||
|
}
|
||||||
@@ -119,6 +119,9 @@ public:
|
|||||||
|
|
||||||
// Pasa la referencia del mapa
|
// Pasa la referencia del mapa
|
||||||
void setMap(Map *map);
|
void setMap(Map *map);
|
||||||
|
|
||||||
|
// Recarga las texturas
|
||||||
|
void reLoadTextures();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user