forked from jaildesigner-jailgames/jaildoctors_dilemma
Añadidos defines para RELEASE y MACOS_BUNDLE
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
#ifndef CONST_H
|
||||
#define CONST_H
|
||||
|
||||
//#define MACOS_BUNDLE
|
||||
//#define RELEASE
|
||||
|
||||
// Textos
|
||||
#define WINDOW_CAPTION "JailDoctor's Dilemma"
|
||||
#define TEXT_COPYRIGHT "@2022 JailDesigner"
|
||||
|
||||
@@ -9,7 +9,9 @@ Director::Director(int argc, char *argv[])
|
||||
section.name = SECTION_PROG_LOGO;
|
||||
section.subsection = SUBSECTION_LOGO_TO_INTRO;
|
||||
|
||||
section.name = SECTION_PROG_LOGO;
|
||||
#ifndef RELEASE
|
||||
section.name = SECTION_PROG_GAME;
|
||||
#endif
|
||||
|
||||
// Crea e inicializa las opciones del programa
|
||||
iniOptions();
|
||||
@@ -966,11 +968,12 @@ bool Director::initSDL()
|
||||
// Crea el indice de ficheros
|
||||
bool Director::setFileList()
|
||||
{
|
||||
std::string prefix = "";
|
||||
#define _MACOS_BUNDLE
|
||||
#ifdef MACOS_BUNDLE
|
||||
prefix = "/../Resources";
|
||||
const std::string prefix = "/../Resources";
|
||||
#else
|
||||
const std::string prefix = "";
|
||||
#endif
|
||||
|
||||
// Texto
|
||||
asset->add(prefix + "/data/font/smb2.png", t_font);
|
||||
asset->add(prefix + "/data/font/smb2.txt", t_font);
|
||||
|
||||
@@ -18,12 +18,12 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
|
||||
this->debug = debug;
|
||||
this->options = options;
|
||||
|
||||
// ****
|
||||
#ifndef RELEASE
|
||||
currentRoom = "03.room";
|
||||
const int x = 29;
|
||||
const int y = 13;
|
||||
spawnPoint = {x * 8, y * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL};
|
||||
// ****
|
||||
#endif
|
||||
|
||||
// Crea los objetos
|
||||
scoreboard = new ScoreBoard(renderer, resource, asset, options, &board);
|
||||
@@ -92,7 +92,7 @@ void Game::checkEventHandler()
|
||||
case SDL_SCANCODE_ESCAPE:
|
||||
section.name = SECTION_PROG_TITLE;
|
||||
break;
|
||||
|
||||
#ifndef RELEASE
|
||||
case SDL_SCANCODE_G:
|
||||
debug->switchEnabled();
|
||||
options->cheat.invincible = debug->getEnabled();
|
||||
@@ -104,26 +104,30 @@ void Game::checkEventHandler()
|
||||
resource->reLoad();
|
||||
break;
|
||||
|
||||
case SDL_SCANCODE_W:
|
||||
goToRoom(BORDER_TOP);
|
||||
break;
|
||||
|
||||
case SDL_SCANCODE_A:
|
||||
goToRoom(BORDER_LEFT);
|
||||
break;
|
||||
|
||||
case SDL_SCANCODE_S:
|
||||
goToRoom(BORDER_BOTTOM);
|
||||
break;
|
||||
|
||||
case SDL_SCANCODE_D:
|
||||
goToRoom(BORDER_RIGHT);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SDL_SCANCODE_M:
|
||||
board.music = !board.music;
|
||||
board.music ? JA_ResumeMusic() : JA_PauseMusic();
|
||||
break;
|
||||
|
||||
case SDL_SCANCODE_P:
|
||||
if (paused)
|
||||
{
|
||||
player->resume();
|
||||
room->resume();
|
||||
scoreboard->resume();
|
||||
paused = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->pause();
|
||||
room->pause();
|
||||
scoreboard->pause();
|
||||
paused = true;
|
||||
}
|
||||
switchPause();
|
||||
break;
|
||||
|
||||
case SDL_SCANCODE_B:
|
||||
@@ -160,22 +164,6 @@ void Game::checkEventHandler()
|
||||
switchPalette();
|
||||
break;
|
||||
|
||||
case SDL_SCANCODE_W:
|
||||
goToRoom(BORDER_TOP);
|
||||
break;
|
||||
|
||||
case SDL_SCANCODE_A:
|
||||
goToRoom(BORDER_LEFT);
|
||||
break;
|
||||
|
||||
case SDL_SCANCODE_S:
|
||||
goToRoom(BORDER_BOTTOM);
|
||||
break;
|
||||
|
||||
case SDL_SCANCODE_D:
|
||||
goToRoom(BORDER_RIGHT);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -560,3 +548,22 @@ void Game::goToRoom(int border)
|
||||
currentRoom = roomName;
|
||||
}
|
||||
}
|
||||
|
||||
// Pone el juego en pausa
|
||||
void Game::switchPause()
|
||||
{
|
||||
if (paused)
|
||||
{
|
||||
player->resume();
|
||||
room->resume();
|
||||
scoreboard->resume();
|
||||
paused = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->pause();
|
||||
room->pause();
|
||||
scoreboard->pause();
|
||||
paused = true;
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,9 @@ private:
|
||||
// Va a la habitación designada
|
||||
void goToRoom(int border);
|
||||
|
||||
// Pone el juego en pausa
|
||||
void switchPause();
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options, Input *input, Debug *debug);
|
||||
|
||||
Reference in New Issue
Block a user