working on class sections

This commit is contained in:
2021-04-17 23:46:14 +02:00
parent 2330820a15
commit e9ff516b1d
18 changed files with 329 additions and 6375 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include "ltexture.h"
#ifndef UTILS_H
#define UTILS_H
@@ -12,20 +13,19 @@ struct circle_t
Uint8 r;
};
// Estructura para definir todas las entradas que aceptará el programa
struct input_t
// Estructura para definir un color
struct color_t
{
Uint8 up;
Uint8 down;
Uint8 left;
Uint8 right;
Uint8 escape;
Uint8 pause;
Uint8 fire;
Uint8 fireLeft;
Uint8 fireRight;
Uint8 accept;
Uint8 cancel;
Uint8 r;
Uint8 g;
Uint8 b;
};
// Estructura para saber la seccion y subseccion del programa
struct section_t
{
Uint8 name;
Uint8 subsection;
};
// Estructura para mapear el teclado usado en la demo
@@ -39,6 +39,15 @@ struct demoKeys_t
Uint8 fireRight;
};
// Estructura con todas las opciones de configuración del programa
struct options_t
{
Uint32 fullScreenMode; // Contiene el valor del modo de pantalla completa
Uint32 fullScreenModePrevious; // Usado por si se cancelan los cambios en el menu de opciones
Uint8 windowSize; // Contiene el valor del tamaño de la ventana
Uint8 windowSizePrevious; // Usado por si se cancelan los cambios en el menu de opciones
};
// Calcula el cuadrado de la distancia entre dos puntos
double distanceSquared(int x1, int y1, int x2, int y2);
@@ -51,4 +60,7 @@ bool checkCollision(circle_t &a, SDL_Rect &b);
// Detector de colisiones entre un dos rectangulos
bool checkCollision(SDL_Rect a, SDL_Rect b);
// Carga un archivo de imagen en una textura
bool loadTextureFromFile(LTexture *texture, std::string path, SDL_Renderer *renderer);
#endif