eliminats tots els #ifndef. Sembla que #pragma once ja funciona, no com fa quatre anys 😌

This commit is contained in:
2024-07-26 10:45:29 +02:00
parent 89cea1c93e
commit 9886f314b5
32 changed files with 33 additions and 185 deletions

View File

@@ -5,9 +5,6 @@
#include "common/asset.h" #include "common/asset.h"
#include "common/movingsprite.h" #include "common/movingsprite.h"
#ifndef BACKGROUND_H
#define BACKGROUND_H
// Clase Background // Clase Background
class Background class Background
{ {
@@ -99,6 +96,4 @@ public:
// Establece la transparencia de la atenuación // Establece la transparencia de la atenuación
void setAlpha(int alpha); void setAlpha(int alpha);
}; };
#endif

View File

@@ -6,9 +6,6 @@
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#ifndef BALLOON_H
#define BALLOON_H
// Cantidad de elementos del vector con los valores de la deformación del globo al rebotar // Cantidad de elementos del vector con los valores de la deformación del globo al rebotar
#define MAX_BOUNCE 10 #define MAX_BOUNCE 10
@@ -249,6 +246,4 @@ public:
// Obtiene le valor de la variable // Obtiene le valor de la variable
Uint8 getPower(); Uint8 getPower();
}; };
#endif

View File

@@ -4,9 +4,6 @@
#include "common/sprite.h" #include "common/sprite.h"
#include "common/utils.h" #include "common/utils.h"
#ifndef BULLET_H
#define BULLET_H
// Tipos de bala // Tipos de bala
#define BULLET_UP 1 #define BULLET_UP 1
#define BULLET_LEFT 2 #define BULLET_LEFT 2
@@ -80,5 +77,3 @@ public:
// Obtiene el circulo de colisión // Obtiene el circulo de colisión
circle_t &getCollider(); circle_t &getCollider();
}; };
#endif

View File

@@ -8,9 +8,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#ifndef ANIMATEDSPRITE_H
#define ANIMATEDSPRITE_H
struct animation_t struct animation_t
{ {
std::string name; // Nombre de la animacion std::string name; // Nombre de la animacion
@@ -98,6 +95,4 @@ public:
// Reinicia la animación // Reinicia la animación
void resetAnimation(); void resetAnimation();
}; };
#endif

View File

@@ -4,9 +4,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#ifndef ASSET_H
#define ASSET_H
enum assetType enum assetType
{ {
t_bitmap, t_bitmap,
@@ -64,6 +61,4 @@ public:
// Devuelve la lista de recursos de un tipo // Devuelve la lista de recursos de un tipo
std::vector<std::string> getListByType(assetType type); std::vector<std::string> getListByType(assetType type);
}; };
#endif

View File

@@ -4,9 +4,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#ifndef INPUT_H
#define INPUT_H
/* /*
connectedControllers es un vector donde estan todos los mandos encontrados [0 .. n] connectedControllers es un vector donde estan todos los mandos encontrados [0 .. n]
checkInput requiere de un indice para comprobar las pulsaciónes de un controlador en concreto [0 .. n] checkInput requiere de un indice para comprobar las pulsaciónes de un controlador en concreto [0 .. n]
@@ -152,6 +149,4 @@ public:
// Activa todos los inputs. Sirve para evitar inputs sin repeticiones pero que ya vienen pulsados cuando checkInput no estaba monitorizando // Activa todos los inputs. Sirve para evitar inputs sin repeticiones pero que ya vienen pulsados cuando checkInput no estaba monitorizando
void allActive(int index); void allActive(int index);
}; };
#endif

View File

@@ -11,9 +11,6 @@
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#ifndef MENU_H
#define MENU_H
// Tipos de fondos para el menu // Tipos de fondos para el menu
#define MENU_BACKGROUND_TRANSPARENT 0 #define MENU_BACKGROUND_TRANSPARENT 0
#define MENU_BACKGROUND_SOLID 1 #define MENU_BACKGROUND_SOLID 1
@@ -231,6 +228,4 @@ public:
// Establece el rectangulo de fondo del menu // Establece el rectangulo de fondo del menu
void setRectSize(int w = 0, int h = 0); void setRectSize(int w = 0, int h = 0);
}; };
#endif

View File

@@ -3,9 +3,6 @@
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include "sprite.h" #include "sprite.h"
#ifndef MOVINGSPRITE_H
#define MOVINGSPRITE_H
// Clase MovingSprite. Añade posicion y velocidad en punto flotante // Clase MovingSprite. Añade posicion y velocidad en punto flotante
class MovingSprite : public Sprite class MovingSprite : public Sprite
{ {
@@ -162,6 +159,4 @@ public:
// Devuelve el incremento en el eje X en pixels // Devuelve el incremento en el eje X en pixels
int getIncX(); int getIncX();
}; };
#endif

View File

@@ -7,9 +7,6 @@
#include "../const.h" #include "../const.h"
#include <vector> #include <vector>
#ifndef SCREEN_H
#define SCREEN_H
#define FILTER_NEAREST 0 #define FILTER_NEAREST 0
#define FILTER_LINEAL 1 #define FILTER_LINEAL 1
@@ -154,6 +151,4 @@ public:
// Atenua la pantalla // Atenua la pantalla
void attenuate(bool value); void attenuate(bool value);
}; };
#endif

View File

@@ -5,9 +5,6 @@
#include "utils.h" #include "utils.h"
#include <vector> #include <vector>
#ifndef SMARTSPRITE_H
#define SMARTSPRITE_H
// Clase SmartSprite // Clase SmartSprite
class SmartSprite : public AnimatedSprite class SmartSprite : public AnimatedSprite
{ {
@@ -68,6 +65,4 @@ public:
// Obtiene el valor de la variable // Obtiene el valor de la variable
bool hasFinished(); bool hasFinished();
}; };
#endif

View File

@@ -3,9 +3,6 @@
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include "texture.h" #include "texture.h"
#ifndef SPRITE_H
#define SPRITE_H
// Clase sprite // Clase sprite
class Sprite class Sprite
{ {
@@ -97,6 +94,4 @@ public:
// Establece los valores de posición y tamaño del sprite // Establece los valores de posición y tamaño del sprite
void setRect(SDL_Rect rect); void setRect(SDL_Rect rect);
}; };
#endif

View File

@@ -3,9 +3,6 @@
#include "sprite.h" #include "sprite.h"
#include "utils.h" #include "utils.h"
#ifndef TEXT_H
#define TEXT_H
#define TXT_COLOR 1 #define TXT_COLOR 1
#define TXT_SHADOW 2 #define TXT_SHADOW 2
#define TXT_CENTER 4 #define TXT_CENTER 4
@@ -83,6 +80,4 @@ public:
// Establece una paleta de colores para el texto // Establece una paleta de colores para el texto
void setPalette(int index); void setPalette(int index);
}; };
#endif

View File

@@ -5,9 +5,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#ifndef TEXTURE_H
#define TEXTURE_H
// Definiciones de tipos // Definiciones de tipos
struct surface_s struct surface_s
{ {
@@ -98,6 +95,4 @@ public:
// Cambia la paleta de la textura // Cambia la paleta de la textura
void setPalette(int palette); void setPalette(int palette);
}; };
#endif

View File

@@ -7,9 +7,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#ifndef UTILS_H
#define UTILS_H
// Dificultad del juego // Dificultad del juego
#define DIFFICULTY_EASY 0 #define DIFFICULTY_EASY 0
#define DIFFICULTY_NORMAL 1 #define DIFFICULTY_NORMAL 1
@@ -252,6 +249,4 @@ JA_Music_t *getMusic(std::vector<music_file_t> music, std::string name);
hiScoreEntry_t sortHiScoreTable(hiScoreEntry_t entry1, hiScoreEntry_t entry2); hiScoreEntry_t sortHiScoreTable(hiScoreEntry_t entry1, hiScoreEntry_t entry2);
// Dibuja un circulo // Dibuja un circulo
void DrawCircle(SDL_Renderer *renderer, int32_t centerX, int32_t centerY, int32_t radius); void DrawCircle(SDL_Renderer *renderer, int32_t centerX, int32_t centerY, int32_t radius);
#endif

View File

@@ -4,9 +4,6 @@
#include "sprite.h" #include "sprite.h"
#include "text.h" #include "text.h"
#ifndef WRITER_H
#define WRITER_H
// Clase Writer. Pinta texto en pantalla letra a letra a partir de una cadena y un bitmap // Clase Writer. Pinta texto en pantalla letra a letra a partir de una cadena y un bitmap
class Writer class Writer
{ {
@@ -70,6 +67,4 @@ public:
// Obtiene el valor de la variable // Obtiene el valor de la variable
bool hasFinished(); bool hasFinished();
}; };
#endif

View File

@@ -3,9 +3,6 @@
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include "common/utils.h" #include "common/utils.h"
#ifndef CONST_H
#define CONST_H
// Tamaño de bloque // Tamaño de bloque
#define BLOCK 8 #define BLOCK 8
#define HALF_BLOCK BLOCK / 2 #define HALF_BLOCK BLOCK / 2
@@ -68,6 +65,4 @@ const color_t difficultyNormalColor = {255, 122, 0};
const color_t difficultyHardColor = {118, 66, 138}; const color_t difficultyHardColor = {118, 66, 138};
const color_t flashColor = {0xFF, 0xFF, 0xFF}; const color_t flashColor = {0xFF, 0xFF, 0xFF};
const color_t fadeColor = {0x27, 0x27, 0x36}; const color_t fadeColor = {0x27, 0x27, 0x36};
const color_t orangeColor = {0xFF, 0x7A, 0x00}; const color_t orangeColor = {0xFF, 0x7A, 0x00};
#endif

View File

@@ -5,9 +5,6 @@
#include "common/text.h" #include "common/text.h"
#include "const.h" #include "const.h"
#ifndef DEFINE_BUTTONS_H
#define DEFINE_BUTTONS_H
struct db_button_t struct db_button_t
{ {
std::string label; // Texto en pantalla para el botón std::string label; // Texto en pantalla para el botón
@@ -69,6 +66,4 @@ public:
// Comprueba si está habilitado // Comprueba si está habilitado
bool isEnabled(); bool isEnabled();
}; };
#endif

View File

@@ -18,9 +18,6 @@
#include "load_param.h" #include "load_param.h"
#include "manage_hiscore_table.h" #include "manage_hiscore_table.h"
#ifndef DIRECTOR_H
#define DIRECTOR_H
// Textos // Textos
#define WINDOW_CAPTION "Coffee Crisis Arcade Edition" #define WINDOW_CAPTION "Coffee Crisis Arcade Edition"
@@ -126,6 +123,4 @@ public:
// Bucle principal // Bucle principal
void run(); void run();
}; };
#endif

View File

@@ -4,9 +4,6 @@
#include "common/texture.h" #include "common/texture.h"
#include "common/utils.h" #include "common/utils.h"
#ifndef FADE_H
#define FADE_H
// Tipos de fundido // Tipos de fundido
#define FADE_FULLSCREEN 0 #define FADE_FULLSCREEN 0
#define FADE_CENTER 1 #define FADE_CENTER 1
@@ -85,6 +82,4 @@ public:
// Establece la duración posterior // Establece la duración posterior
void setPost(int value); void setPost(int value);
}; };
#endif

View File

@@ -22,9 +22,6 @@
#include "manage_hiscore_table.h" #include "manage_hiscore_table.h"
#include <iostream> #include <iostream>
#ifndef GAME_H
#define GAME_H
// Cantidad de elementos a escribir en los ficheros de datos // Cantidad de elementos a escribir en los ficheros de datos
#define TOTAL_SCORE_DATA 3 #define TOTAL_SCORE_DATA 3
#define TOTAL_DEMO_DATA 2000 #define TOTAL_DEMO_DATA 2000
@@ -478,6 +475,4 @@ public:
// Bucle para el juego // Bucle para el juego
void run(); void run();
}; };
#endif

View File

@@ -7,9 +7,6 @@
#include "common/jail_audio.h" #include "common/jail_audio.h"
#include "const.h" #include "const.h"
#ifndef GAME_LOGO_H
#define GAME_LOGO_H
// Clase GameLogo // Clase GameLogo
class GameLogo class GameLogo
{ {
@@ -84,6 +81,4 @@ public:
// Recarga las texturas // Recarga las texturas
void reLoad(); void reLoad();
}; };
#endif

View File

@@ -13,9 +13,6 @@
#include "fade.h" #include "fade.h"
#include "background.h" #include "background.h"
#ifndef HISCORE_TABLE_H
#define HISCORE_TABLE_H
// Clase HiScoreTable // Clase HiScoreTable
class HiScoreTable class HiScoreTable
{ {
@@ -79,6 +76,4 @@ public:
// Bucle principal // Bucle principal
void run(); void run();
}; };
#endif

View File

@@ -13,9 +13,6 @@
#include "tiledbg.h" #include "tiledbg.h"
#include "fade.h" #include "fade.h"
#ifndef INSTRUCTIONS_H
#define INSTRUCTIONS_H
// Clase Instructions // Clase Instructions
class Instructions class Instructions
{ {
@@ -82,6 +79,4 @@ public:
// Bucle principal // Bucle principal
void run(); void run();
}; };
#endif

View File

@@ -12,9 +12,6 @@
#include "lang.h" #include "lang.h"
#include <vector> #include <vector>
#ifndef INTRO_H
#define INTRO_H
// Clase Intro // Clase Intro
class Intro class Intro
{ {
@@ -67,5 +64,3 @@ public:
// Bucle principal // Bucle principal
void run(); void run();
}; };
#endif

View File

@@ -4,9 +4,6 @@
#include "common/animatedsprite.h" #include "common/animatedsprite.h"
#include "common/utils.h" #include "common/utils.h"
#ifndef ITEM_H
#define ITEM_H
// Tipos de objetos // Tipos de objetos
#define ITEM_POINTS_1_DISK 1 #define ITEM_POINTS_1_DISK 1
#define ITEM_POINTS_2_GAVINA 2 #define ITEM_POINTS_2_GAVINA 2
@@ -92,6 +89,4 @@ public:
// Informa si el objeto ha colisionado con el suelo // Informa si el objeto ha colisionado con el suelo
bool isOnFloor(); bool isOnFloor();
}; };
#endif

View File

@@ -4,9 +4,6 @@
#include "common/asset.h" #include "common/asset.h"
#include <string> #include <string>
#ifndef LANG_H
#define LANG_H
// Códigos de idioma // Códigos de idioma
#define es_ES 0 #define es_ES 0
#define ba_BA 1 #define ba_BA 1
@@ -35,5 +32,4 @@ public:
// Obtiene la cadena de texto del indice // Obtiene la cadena de texto del indice
std::string getText(int index); std::string getText(int index);
}; };
#endif

View File

@@ -4,10 +4,5 @@
#include "common/utils.h" #include "common/utils.h"
#include "const.h" #include "const.h"
#ifndef LOAD_PARAM
#define LOAD_PARAM
// Establece valores para los parametros a partir de un fichero de texto // Establece valores para los parametros a partir de un fichero de texto
void loadParam(param_t *param, std::string filePath); void loadParam(param_t *param, std::string filePath);
#endif

View File

@@ -10,9 +10,6 @@
#include "const.h" #include "const.h"
#include <vector> #include <vector>
#ifndef LOGO_H
#define LOGO_H
class Logo class Logo
{ {
private: private:
@@ -71,5 +68,3 @@ public:
// Bucle principal // Bucle principal
void run(); void run();
}; };
#endif

View File

@@ -7,9 +7,6 @@
#include "common/texture.h" #include "common/texture.h"
#include "common/utils.h" #include "common/utils.h"
#ifndef PLAYER_H
#define PLAYER_H
// Estados del jugador // Estados del jugador
#define PLAYER_STATUS_WALKING_LEFT 0 #define PLAYER_STATUS_WALKING_LEFT 0
#define PLAYER_STATUS_WALKING_RIGHT 1 #define PLAYER_STATUS_WALKING_RIGHT 1
@@ -212,5 +209,3 @@ public:
// Obtiene el valor de la variable // Obtiene el valor de la variable
bool isEnabled(); bool isEnabled();
}; };
#endif

View File

@@ -9,8 +9,12 @@
#include "const.h" #include "const.h"
#include "lang.h" #include "lang.h"
#ifndef SCOREBOARD_H enum scoreboard_modes_e
#define SCOREBOARD_H {
scoreboard_mode_playing,
scoreboard_mode_game_over,
scoreboard_mode_demo,
};
// Clase Scoreboard // Clase Scoreboard
class Scoreboard class Scoreboard
@@ -104,5 +108,3 @@ public:
// Establece el valor de la variable // Establece el valor de la variable
void setPos(SDL_Rect rect); void setPos(SDL_Rect rect);
}; };
#endif

View File

@@ -6,9 +6,6 @@
#include "common/sprite.h" #include "common/sprite.h"
#include "const.h" #include "const.h"
#ifndef TILEDBG_H
#define TILEDBG_H
#define TILED_MODE_CIRCLE 0 #define TILED_MODE_CIRCLE 0
#define TILED_MODE_DIAGONAL 1 #define TILED_MODE_DIAGONAL 1
#define TILED_MODE_RANDOM 2 #define TILED_MODE_RANDOM 2
@@ -54,6 +51,4 @@ public:
// Recarga las texturas // Recarga las texturas
void reLoad(); void reLoad();
}; };
#endif

View File

@@ -22,9 +22,6 @@
#include "game_logo.h" #include "game_logo.h"
#include "define_buttons.h" #include "define_buttons.h"
#ifndef TITLE_H
#define TITLE_H
// Textos // Textos
#define TEXT_COPYRIGHT "@2020,2024 JailDesigner" #define TEXT_COPYRIGHT "@2020,2024 JailDesigner"
@@ -91,6 +88,4 @@ public:
// Bucle para el titulo del juego // Bucle para el titulo del juego
void run(); void run();
}; };
#endif