From cb3eb7855ef3d410915b08bf4560109f012e4680 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Tue, 18 Jun 2024 07:21:46 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adiendo=20la=20estructura=20param?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/background.cpp | 2 +- source/game.cpp | 6 +++--- source/title.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/background.cpp b/source/background.cpp index aea9a70..534b8b4 100644 --- a/source/background.cpp +++ b/source/background.cpp @@ -14,7 +14,7 @@ Background::Background(SDL_Renderer *renderer, Screen *screen, Asset *asset) cloudsSpeed = 0; transition = 0; counter = 0; - rect = {0, 0, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT}; + rect = {0, 0, param->gameWidth, param->gameHeight}; srcRect = {playArea.x, rect.h - playArea.h, playArea.w, playArea.h}; dstRect = {0, 0, playArea.w, playArea.h}; base = rect.h; diff --git a/source/game.cpp b/source/game.cpp index 2eb8244..6efdf7c 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -1682,7 +1682,7 @@ void Game::renderDeathFade(int counter) { rect[i].x = 0; rect[i].y = i * 16; - rect[i].w = GAMECANVAS_WIDTH; + rect[i].w = param->gameWidth; if (i == 0) { rect[i].h = h; @@ -1696,7 +1696,7 @@ void Game::renderDeathFade(int counter) } else { - SDL_Rect rect = {0, 0, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT}; + SDL_Rect rect = {0, 0, param->gameWidth, param->gameHeight}; SDL_RenderFillRect(renderer, &rect); } } @@ -2421,7 +2421,7 @@ void Game::throwCoffee(int x, int y) ss->setAccelX(0.0f); ss->setAccelY(0.2f); ss->setDestX(x + (ss->getVelX() * 50)); - ss->setDestY(GAMECANVAS_HEIGHT + 1); + ss->setDestY(param->gameHeight + 1); ss->setEnabled(true); ss->setEnabledCounter(1); ss->setSpriteClip(0, 0, 16, 16); diff --git a/source/title.cpp b/source/title.cpp index 2735f0c..ee7bc7f 100644 --- a/source/title.cpp +++ b/source/title.cpp @@ -29,7 +29,7 @@ Title::Title(SDL_Renderer *renderer, Screen *screen, Input *input, Asset *asset, backgroundObj->setGradientNumber(1); backgroundObj->setTransition(0.8f); - tiledbg = new Tiledbg(renderer, screen, asset, {0, 0, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT}); + tiledbg = new Tiledbg(renderer, screen, asset, {0, 0, param->gameWidth, param->gameHeight}); gameLogo = new GameLogo(renderer, screen, asset, GAMECANVAS_CENTER_X, GAMECANVAS_FIRST_QUARTER_Y + 20); gameLogo->enable(); @@ -249,11 +249,11 @@ void Title::render() // 'PULSA 1P o 2P PARA JUGAR' if (counter % 50 > 14) { - text1->writeDX(TXT_CENTER | TXT_SHADOW, GAMECANVAS_CENTER_X, GAMECANVAS_HEIGHT / 5 * 3, lang->getText(23), 1, noColor, 1, shdwTxtColor); + text1->writeDX(TXT_CENTER | TXT_SHADOW, GAMECANVAS_CENTER_X, param->gameHeight / 5 * 3, lang->getText(23), 1, noColor, 1, shdwTxtColor); } // Mini logo - const int pos1 = (GAMECANVAS_HEIGHT / 5 * 4) + BLOCK; + const int pos1 = (param->gameHeight / 5 * 4) + BLOCK; const int pos2 = pos1 + miniLogoSprite->getHeight() + 3; miniLogoSprite->setPosY(pos1); miniLogoSprite->render();