migrant a SDL3
This commit is contained in:
@@ -795,12 +795,12 @@ void Game::createItemText(int x, std::shared_ptr<Texture> texture)
|
||||
const int y2 = -h;
|
||||
|
||||
// Ajusta para que no se dibuje fuera de pantalla
|
||||
x = std::clamp(x, 2, param.game.play_area.rect.w - w - 2);
|
||||
x = std::clamp(x, 2, static_cast<int>(param.game.play_area.rect.w) - w - 2);
|
||||
|
||||
// Inicializa
|
||||
path_sprites_.back()->setWidth(w);
|
||||
path_sprites_.back()->setHeight(h);
|
||||
path_sprites_.back()->setSpriteClip({0, 0, w, h});
|
||||
path_sprites_.back()->setSpriteClip({0, 0, static_cast<float>(w), static_cast<float>(h)});
|
||||
path_sprites_.back()->addPath(y0, y1, PathType::VERTICAL, x, 100, easeOutQuint, 0);
|
||||
path_sprites_.back()->addPath(y1, y2, PathType::VERTICAL, x, 80, easeInQuint, 0);
|
||||
path_sprites_.back()->enable();
|
||||
@@ -1225,24 +1225,20 @@ void Game::checkEvents()
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event))
|
||||
{
|
||||
if (event.type == SDL_WINDOWEVENT)
|
||||
switch (event.type)
|
||||
{
|
||||
switch (event.window.event)
|
||||
{
|
||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||
{
|
||||
pause(!demo_.enabled);
|
||||
break;
|
||||
}
|
||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||
{
|
||||
pause(false);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case SDL_EVENT_WINDOW_FOCUS_LOST:
|
||||
{
|
||||
pause(!demo_.enabled);
|
||||
break;
|
||||
}
|
||||
case SDL_EVENT_WINDOW_FOCUS_GAINED:
|
||||
{
|
||||
pause(false);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -1987,9 +1983,9 @@ void Game::setState(GameState state)
|
||||
// Comprueba los eventos en el modo DEBUG
|
||||
void Game::checkDebugEvents(const SDL_Event &event)
|
||||
{
|
||||
if (event.type == SDL_KEYDOWN && event.key.repeat == 0)
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 0)
|
||||
{
|
||||
switch (event.key.keysym.sym)
|
||||
switch (event.key.key)
|
||||
{
|
||||
case SDLK_1: // Crea una powerball
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user