Convertit "param" a variable global en lloc de anar marejant amb punterets i passant 8.000.000 de paràmetres
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
#include "logo.h"
|
||||
#include "param.h"
|
||||
#include <iostream>
|
||||
|
||||
// Constructor
|
||||
Logo::Logo(Screen *screen, Asset *asset, Input *input, options_t *options, param_t *param, section_t *section)
|
||||
Logo::Logo(Screen *screen, Asset *asset, Input *input, options_t *options, section_t *section)
|
||||
{
|
||||
// Copia la dirección de los objetos
|
||||
this->screen = screen;
|
||||
this->asset = asset;
|
||||
this->input = input;
|
||||
this->options = options;
|
||||
this->param = param;
|
||||
this->section = section;
|
||||
SDL_Renderer *renderer = screen->getRenderer();
|
||||
|
||||
@@ -17,7 +17,7 @@ Logo::Logo(Screen *screen, Asset *asset, Input *input, options_t *options, param
|
||||
eventHandler = new SDL_Event();
|
||||
jailTexture = new Texture(renderer, asset->get("logo_jailgames.png"));
|
||||
sinceTexture = new Texture(renderer, asset->get("logo_since_1998.png"));
|
||||
sinceSprite = new Sprite((param->game.width - sinceTexture->getWidth()) / 2, 83 + jailTexture->getHeight() + 5, sinceTexture->getWidth(), sinceTexture->getHeight(), sinceTexture);
|
||||
sinceSprite = new Sprite((param.game.width - sinceTexture->getWidth()) / 2, 83 + jailTexture->getHeight() + 5, sinceTexture->getWidth(), sinceTexture->getHeight(), sinceTexture);
|
||||
|
||||
// Inicializa variables
|
||||
counter = 0;
|
||||
@@ -29,8 +29,8 @@ Logo::Logo(Screen *screen, Asset *asset, Input *input, options_t *options, param
|
||||
endLogo_cm = 400;
|
||||
postLogoDuration = 20;
|
||||
speed = 8;
|
||||
dest.x = param->game.gameArea.centerX - jailTexture->getWidth() / 2;
|
||||
dest.y = param->game.gameArea.centerY - jailTexture->getHeight() / 2;
|
||||
dest.x = param.game.gameArea.centerX - jailTexture->getWidth() / 2;
|
||||
dest.y = param.game.gameArea.centerY - jailTexture->getHeight() / 2;
|
||||
sinceSprite->setPosY(dest.y + jailTexture->getHeight() + 5);
|
||||
sinceSprite->setSpriteClip(0, 0, sinceTexture->getWidth(), sinceTexture->getHeight());
|
||||
sinceSprite->setEnabled(false);
|
||||
@@ -41,7 +41,7 @@ Logo::Logo(Screen *screen, Asset *asset, Input *input, options_t *options, param
|
||||
{
|
||||
Sprite *temp = new Sprite(0, i, jailTexture->getWidth(), 1, jailTexture);
|
||||
temp->setSpriteClip(0, i, jailTexture->getWidth(), 1);
|
||||
const int posX = (i % 2 == 0) ? param->game.width + (i * 3) : -jailTexture->getWidth() - (i * 3);
|
||||
const int posX = (i % 2 == 0) ? param.game.width + (i * 3) : -jailTexture->getWidth() - (i * 3);
|
||||
temp->setPosX(posX);
|
||||
temp->setPosY(dest.y + i);
|
||||
jailSprite.push_back(temp);
|
||||
|
||||
Reference in New Issue
Block a user