renomena tipus _t/_e a CamelCase (Circle, Color, Section, ...)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "core/audio/audio.hpp" // for Audio::update
|
||||
#include "core/input/global_inputs.hpp" // for GlobalInputs::handle
|
||||
#include "core/input/input.h" // for Input, REPEAT_FALSE, inputs_e
|
||||
#include "core/input/input.h" // for Input, REPEAT_FALSE, InputAction
|
||||
#include "core/locale/lang.h" // for Lang
|
||||
#include "core/rendering/screen.h" // for Screen
|
||||
#include "core/rendering/sprite.h" // for Sprite
|
||||
@@ -16,10 +16,10 @@
|
||||
#include "core/rendering/texture.h" // for Texture
|
||||
#include "core/resources/resource.h"
|
||||
#include "game/defaults.hpp" // for shdwTxtColor, GAMECANVAS_CENTER_X, GAME...
|
||||
#include "utils/utils.h" // for color_t, section_t
|
||||
#include "utils/utils.h" // for Color, Section
|
||||
|
||||
// Constructor
|
||||
Instructions::Instructions(SDL_Renderer *renderer, section_t *section) {
|
||||
Instructions::Instructions(SDL_Renderer *renderer, Section *section) {
|
||||
// Copia los punteros
|
||||
this->renderer = renderer;
|
||||
this->section = section;
|
||||
@@ -103,7 +103,7 @@ void Instructions::render() {
|
||||
SDL_Rect window = {0, 0, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT};
|
||||
SDL_Rect srcRect = {0, 0, 16, 16};
|
||||
|
||||
const color_t orangeColor = {0xFF, 0x7A, 0x00};
|
||||
const Color orangeColor = {0xFF, 0x7A, 0x00};
|
||||
|
||||
const SDL_Rect destRect1 = {60, 88 + (16 * 0), 16, 16}; // Disquito
|
||||
const SDL_Rect destRect2 = {60, 88 + (16 * 1), 16, 16}; // Gavineixon
|
||||
@@ -231,7 +231,7 @@ void Instructions::checkInput() {
|
||||
}
|
||||
|
||||
// Bucle para la pantalla de instrucciones (compatibilidad)
|
||||
void Instructions::run(mode_e mode) {
|
||||
void Instructions::run(InstructionsMode mode) {
|
||||
start(mode);
|
||||
|
||||
while (!finished) {
|
||||
@@ -250,7 +250,7 @@ void Instructions::run(mode_e mode) {
|
||||
}
|
||||
|
||||
// Inicia las instrucciones (sin bucle)
|
||||
void Instructions::start(mode_e mode) {
|
||||
void Instructions::start(InstructionsMode mode) {
|
||||
this->mode = mode;
|
||||
finished = false;
|
||||
quitRequested = false;
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
class Sprite;
|
||||
class Text;
|
||||
class Texture;
|
||||
struct section_t;
|
||||
struct Section;
|
||||
|
||||
enum mode_e : std::uint8_t {
|
||||
enum InstructionsMode : std::uint8_t {
|
||||
m_manual,
|
||||
m_auto
|
||||
};
|
||||
@@ -24,7 +24,7 @@ class Instructions {
|
||||
SDL_Texture *backbuffer; // Textura para usar como backbuffer
|
||||
Sprite *sprite; // Sprite con la textura de las instrucciones
|
||||
Text *text; // Objeto para escribir texto
|
||||
section_t *section; // Estado del bucle principal para saber si continua o se sale
|
||||
Section *section; // Estado del bucle principal para saber si continua o se sale
|
||||
|
||||
// Variables
|
||||
Uint16 counter; // Contador
|
||||
@@ -32,7 +32,7 @@ class Instructions {
|
||||
Uint32 ticks; // Contador de ticks para ajustar la velocidad del programa
|
||||
Uint32 ticksSpeed; // Velocidad a la que se repiten los bucles del programa
|
||||
bool manualQuit; // Indica si se quiere salir del modo manual
|
||||
mode_e mode{m_auto}; // Modo en el que se van a ejecutar las instrucciones
|
||||
InstructionsMode mode{m_auto}; // Modo en el que se van a ejecutar las instrucciones
|
||||
bool finished; // Indica si las instrucciones han terminado
|
||||
bool quitRequested; // Indica si se ha solicitado salir de la aplicación
|
||||
|
||||
@@ -41,7 +41,7 @@ class Instructions {
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Instructions(SDL_Renderer *renderer, section_t *section);
|
||||
Instructions(SDL_Renderer *renderer, Section *section);
|
||||
|
||||
// Destructor
|
||||
~Instructions();
|
||||
@@ -50,10 +50,10 @@ class Instructions {
|
||||
auto operator=(const Instructions &) -> Instructions & = delete;
|
||||
|
||||
// Bucle principal
|
||||
void run(mode_e mode);
|
||||
void run(InstructionsMode mode);
|
||||
|
||||
// Inicia las instrucciones (sin bucle)
|
||||
void start(mode_e mode);
|
||||
void start(InstructionsMode mode);
|
||||
|
||||
// Actualiza las variables
|
||||
void update();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "core/audio/audio.hpp" // for Audio::get, Audio::update
|
||||
#include "core/input/global_inputs.hpp" // for GlobalInputs::handle
|
||||
#include "core/input/input.h" // for Input, REPEAT_FALSE, inputs_e
|
||||
#include "core/input/input.h" // for Input, REPEAT_FALSE, InputAction
|
||||
#include "core/locale/lang.h" // for Lang
|
||||
#include "core/rendering/screen.h" // for Screen
|
||||
#include "core/rendering/smartsprite.h" // for SmartSprite
|
||||
@@ -15,10 +15,10 @@
|
||||
#include "core/rendering/writer.h" // for Writer
|
||||
#include "core/resources/resource.h"
|
||||
#include "game/defaults.hpp" // for GAMECANVAS_CENTER_X, GAMECANVAS_FIRST_QU...
|
||||
#include "utils/utils.h" // for section_t, color_t
|
||||
#include "utils/utils.h" // for Section, Color
|
||||
|
||||
// Constructor
|
||||
Intro::Intro(SDL_Renderer *renderer, section_t *section) {
|
||||
Intro::Intro(SDL_Renderer *renderer, Section *section) {
|
||||
// Copia los punteros
|
||||
this->renderer = renderer;
|
||||
this->section = section;
|
||||
|
||||
@@ -8,7 +8,7 @@ class Text;
|
||||
class Texture;
|
||||
class Writer;
|
||||
struct JA_Music_t;
|
||||
struct section_t;
|
||||
struct Section;
|
||||
|
||||
// Clase Intro
|
||||
class Intro {
|
||||
@@ -20,7 +20,7 @@ class Intro {
|
||||
std::vector<SmartSprite *> bitmaps; // Vector con los sprites inteligentes para los dibujos de la intro
|
||||
std::vector<Writer *> texts; // Textos de la intro
|
||||
Text *text; // Textos de la intro
|
||||
section_t *section; // Estado del bucle principal para saber si continua o se sale
|
||||
Section *section; // Estado del bucle principal para saber si continua o se sale
|
||||
|
||||
// Variables
|
||||
Uint32 ticks; // Contador de ticks para ajustar la velocidad del programa
|
||||
@@ -42,7 +42,7 @@ class Intro {
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Intro(SDL_Renderer *renderer, section_t *section);
|
||||
Intro(SDL_Renderer *renderer, Section *section);
|
||||
|
||||
// Destructor
|
||||
~Intro();
|
||||
|
||||
@@ -7,21 +7,21 @@
|
||||
|
||||
#include "core/audio/audio.hpp" // for Audio::get, Audio::update
|
||||
#include "core/input/global_inputs.hpp" // for GlobalInputs::handle
|
||||
#include "core/input/input.h" // for Input, REPEAT_FALSE, inputs_e
|
||||
#include "core/input/input.h" // for Input, REPEAT_FALSE, InputAction
|
||||
#include "core/rendering/screen.h" // for Screen
|
||||
#include "core/rendering/sprite.h" // for Sprite
|
||||
#include "core/rendering/texture.h" // for Texture
|
||||
#include "core/resources/asset.h" // for Asset
|
||||
#include "core/resources/resource.h"
|
||||
#include "game/defaults.hpp" // for bgColor, SECTION_PROG_LOGO, SECTION_PROG...
|
||||
#include "utils/utils.h" // for section_t, color_t
|
||||
#include "utils/utils.h" // for Section, Color
|
||||
|
||||
// Valores de inicialización y fin
|
||||
constexpr int INIT_FADE = 100;
|
||||
constexpr int END_LOGO = 200;
|
||||
|
||||
// Constructor
|
||||
Logo::Logo(SDL_Renderer *renderer, section_t *section) {
|
||||
Logo::Logo(SDL_Renderer *renderer, Section *section) {
|
||||
// Copia la dirección de los objetos
|
||||
this->renderer = renderer;
|
||||
this->section = section;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <SDL3/SDL.h>
|
||||
class Sprite;
|
||||
class Texture;
|
||||
struct section_t;
|
||||
struct Section;
|
||||
|
||||
// Clase Logo
|
||||
class Logo {
|
||||
@@ -13,7 +13,7 @@ class Logo {
|
||||
Texture *texture; // Textura con los graficos
|
||||
SDL_Event *eventHandler; // Manejador de eventos
|
||||
Sprite *sprite; // Sprite con la textura del logo
|
||||
section_t *section; // Estado del bucle principal para saber si continua o se sale
|
||||
Section *section; // Estado del bucle principal para saber si continua o se sale
|
||||
|
||||
// Variables
|
||||
Uint32 ticks; // Contador de ticks para ajustar la velocidad del programa
|
||||
@@ -37,7 +37,7 @@ class Logo {
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Logo(SDL_Renderer *renderer, section_t *section);
|
||||
Logo(SDL_Renderer *renderer, Section *section);
|
||||
|
||||
// Destructor
|
||||
~Logo();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "game/ui/menu.h" // for Menu
|
||||
|
||||
// Constructor
|
||||
Title::Title(SDL_Renderer *renderer, section_t *section) {
|
||||
Title::Title(SDL_Renderer *renderer, Section *section) {
|
||||
// Copia las direcciones de los punteros
|
||||
this->renderer = renderer;
|
||||
this->section = section;
|
||||
@@ -112,7 +112,7 @@ void Title::init() {
|
||||
// Pone valores por defecto a las opciones de control
|
||||
Options::inputs.clear();
|
||||
|
||||
input_t inp;
|
||||
InputDevice inp;
|
||||
inp.id = 0;
|
||||
inp.name = "KEYBOARD";
|
||||
inp.deviceType = INPUT_USE_KEYBOARD;
|
||||
@@ -929,7 +929,7 @@ void Title::run() {
|
||||
}
|
||||
|
||||
// Inicia la parte donde se muestran las instrucciones
|
||||
void Title::runInstructions(mode_e mode) {
|
||||
void Title::runInstructions(InstructionsMode mode) {
|
||||
instructions = new Instructions(renderer, section);
|
||||
instructions->start(mode);
|
||||
instructionsActive = true;
|
||||
@@ -1046,7 +1046,7 @@ void Title::checkInputDevices() {
|
||||
}
|
||||
const int numControllers = Input::get()->getNumControllers();
|
||||
availableInputDevices.clear();
|
||||
input_t temp;
|
||||
InputDevice temp;
|
||||
|
||||
// Añade todos los mandos
|
||||
if (numControllers > 0) {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "game/options.hpp" // for Options::Video, Options::Window (per snapshot cancel)
|
||||
#include "game/scenes/instructions.h" // for mode_e
|
||||
#include "utils/utils.h" // for input_t, section_t
|
||||
#include "game/scenes/instructions.h" // for InstructionsMode
|
||||
#include "utils/utils.h" // for InputDevice, Section
|
||||
class AnimatedSprite;
|
||||
class Fade;
|
||||
class Game;
|
||||
@@ -42,7 +42,7 @@ class Title {
|
||||
Instructions *instructions{nullptr}; // Objeto para la sección de las instrucciones
|
||||
Game *demoGame{nullptr}; // Objeto para lanzar la demo del juego
|
||||
SDL_Event *eventHandler; // Manejador de eventos
|
||||
section_t *section; // Indicador para el bucle del titulo
|
||||
Section *section; // Indicador para el bucle del titulo
|
||||
|
||||
Texture *dustTexture; // Textura con los graficos del polvo
|
||||
Texture *coffeeTexture; // Textura con los graficos de la palabra coffee
|
||||
@@ -74,7 +74,7 @@ class Title {
|
||||
float sin[360]; // Vector con los valores del seno precalculados
|
||||
bool menuVisible; // Indicador para saber si se muestra el menu del titulo o la frase intermitente
|
||||
bool demo; // Indica si el modo demo estará activo
|
||||
section_t nextSection; // Indica cual es la siguiente sección a cargar cuando termine el contador del titulo
|
||||
Section nextSection; // Indica cual es la siguiente sección a cargar cuando termine el contador del titulo
|
||||
Uint32 ticksSpeed; // Velocidad a la que se repiten los bucles del programa
|
||||
Uint8 postFade; // Opción a realizar cuando termina el fundido
|
||||
menu_t menu; // Variable con todos los objetos menus y sus variables
|
||||
@@ -82,8 +82,8 @@ class Title {
|
||||
Options::Video prevVideo;
|
||||
Options::Window prevWindow;
|
||||
Options::Settings prevSettings;
|
||||
std::vector<input_t> prevInputs;
|
||||
std::vector<input_t> availableInputDevices; // Vector con todos los metodos de control disponibles
|
||||
std::vector<InputDevice> prevInputs;
|
||||
std::vector<InputDevice> availableInputDevices; // Vector con todos los metodos de control disponibles
|
||||
std::vector<int> deviceIndex; // Indice para el jugador [i] del vector de dispositivos de entrada disponibles
|
||||
|
||||
// Variables para la vibración del título (SUBSECTION_TITLE_2)
|
||||
@@ -95,7 +95,7 @@ class Title {
|
||||
// Variables para sub-estados delegados (instrucciones y demo)
|
||||
bool instructionsActive; // Indica si las instrucciones están activas
|
||||
bool demoGameActive; // Indica si el juego demo está activo
|
||||
mode_e instructionsMode{m_auto}; // Modo de las instrucciones activas
|
||||
InstructionsMode instructionsMode{m_auto}; // Modo de las instrucciones activas
|
||||
bool demoThenInstructions; // Indica si tras la demo hay que mostrar instrucciones
|
||||
|
||||
// Inicializa los valores
|
||||
@@ -123,7 +123,7 @@ class Title {
|
||||
void applyOptions();
|
||||
|
||||
// Ejecuta la parte donde se muestran las instrucciones
|
||||
void runInstructions(mode_e mode);
|
||||
void runInstructions(InstructionsMode mode);
|
||||
|
||||
// Ejecuta el juego en modo demo
|
||||
void runDemoGame();
|
||||
@@ -142,7 +142,7 @@ class Title {
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Title(SDL_Renderer *renderer, section_t *section);
|
||||
Title(SDL_Renderer *renderer, Section *section);
|
||||
|
||||
// Destructor
|
||||
~Title();
|
||||
|
||||
Reference in New Issue
Block a user