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/movingsprite.h"
#ifndef BACKGROUND_H
#define BACKGROUND_H
// Clase Background
class Background
{
@@ -100,5 +97,3 @@ public:
// Establece la transparencia de la atenuación
void setAlpha(int alpha);
};
#endif

View File

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

View File

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

View File

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

View File

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

View File

@@ -4,9 +4,6 @@
#include <string>
#include <vector>
#ifndef INPUT_H
#define INPUT_H
/*
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]
@@ -153,5 +150,3 @@ public:
// Activa todos los inputs. Sirve para evitar inputs sin repeticiones pero que ya vienen pulsados cuando checkInput no estaba monitorizando
void allActive(int index);
};
#endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,9 +7,6 @@
#include <string>
#include <vector>
#ifndef UTILS_H
#define UTILS_H
// Dificultad del juego
#define DIFFICULTY_EASY 0
#define DIFFICULTY_NORMAL 1
@@ -253,5 +250,3 @@ hiScoreEntry_t sortHiScoreTable(hiScoreEntry_t entry1, hiScoreEntry_t entry2);
// Dibuja un circulo
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 "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
class Writer
{
@@ -71,5 +68,3 @@ public:
// Obtiene el valor de la variable
bool hasFinished();
};
#endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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