Toquetechant includes

This commit is contained in:
2025-02-20 13:34:18 +01:00
parent bcb2e96069
commit e1d6aff724
65 changed files with 615 additions and 495 deletions

1
.gitignore vendored
View File

@@ -15,3 +15,4 @@ sync_jail_engine.sh
jaildoctors_dilemma*
todo
build/
linux_utils/

View File

@@ -1,4 +1,8 @@
#include "animatedsprite.h"
#include <fstream> // for basic_ostream, operator<<, basic_istream, basic...
#include <iostream> // for cout
#include <sstream> // for basic_stringstream
#include "texture.h" // for Texture
// Carga la animación desde un fichero
animatedSprite_t loadAnimationFromFile(Texture *texture, std::string filePath, bool verbose)

View File

@@ -1,15 +1,12 @@
#pragma once
#include <SDL2/SDL.h>
#include "movingsprite.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#ifndef ANIMATEDSPRITE_H
#define ANIMATEDSPRITE_H
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint8
#include <string> // for string
#include <vector> // for vector
#include "movingsprite.h" // for MovingSprite
class Texture;
struct animation_t
{
@@ -99,5 +96,3 @@ public:
// Reinicia la animación
void resetAnimation();
};
#endif

View File

@@ -1,5 +1,8 @@
#include "asset.h"
#include <iostream>
#include <SDL2/SDL_rwops.h> // for SDL_RWFromFile, SDL_RWclose, SDL_RWops
#include <SDL2/SDL_stdinc.h> // for SDL_max
#include <stddef.h> // for size_t
#include <iostream> // for basic_ostream, operator<<, cout, endl
// Constructor
Asset::Asset(std::string executablePath)

View File

@@ -1,11 +1,7 @@
#pragma once
#include <SDL2/SDL.h>
#include <string>
#include <vector>
#ifndef ASSET_H
#define ASSET_H
#include <string> // for string
#include <vector> // for vector
enum assetType
{
@@ -62,5 +58,3 @@ public:
// Establece si ha de mostrar texto por pantalla
void setVerbose(bool value);
};
#endif

View File

@@ -1,5 +1,10 @@
#include "cheevos.h"
#include <iostream>
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_rwops.h> // for SDL_RWFromFile, SDL_RWclose, SDL_RWwrite
#include <stddef.h> // for NULL
#include <iostream> // for basic_ostream, operator<<, cout, endl
#include "screen.h" // for Screen
#include "utils.h" // for options_t
// Constructor
Cheevos::Cheevos(Screen *screen, options_t *options, std::string file)

View File

@@ -1,12 +1,9 @@
#pragma once
#include <SDL2/SDL.h>
#include "screen.h"
#include "utils.h"
#include <string>
#include <vector>
#ifndef CHEEVOS_H
#define CHEEVOS_H
#include <string> // for string
#include <vector> // for vector
class Screen;
struct options_t;
struct cheevos_t
{
@@ -76,5 +73,3 @@ public:
// Vuelve a cargar los logros desde el origen
void reload();
};
#endif

View File

@@ -1,4 +1,9 @@
#include "debug.h"
#include <algorithm> // for max
#include "asset.h" // for Asset
#include "text.h" // for Text
#include "texture.h" // for Texture
class Screen;
// Constructor
Debug::Debug(SDL_Renderer *renderer, Screen *screen, Asset *asset)

View File

@@ -1,17 +1,13 @@
#pragma once
#include <SDL2/SDL.h>
#include "const.h"
#include "asset.h"
#include "screen.h"
#include "text.h"
#include "texture.h"
#include "utils.h"
#include <string>
#include <vector>
#ifndef DEBUG_H
#define DEBUG_H
#include <SDL2/SDL_rect.h> // for SDL_Point
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <string> // for string
#include <vector> // for vector
class Asset;
class Screen;
class Text;
class Texture;
// Clase Debug
class Debug
@@ -68,5 +64,3 @@ public:
// Cambia el valor de la variable
void switchEnabled();
};
#endif

View File

@@ -1,10 +1,40 @@
#include "utils.h"
#include "director.h"
#include <errno.h>
#include <iostream>
#include <string>
#include <sys/stat.h>
#include <unistd.h>
#include <SDL2/SDL.h> // for SDL_Init, SDL_Quit, SDL_INIT_E...
#include <SDL2/SDL_audio.h> // for AUDIO_S16
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_gamecontroller.h> // for SDL_CONTROLLER_BUTTON_B, SDL_C...
#include <SDL2/SDL_hints.h> // for SDL_SetHint, SDL_HINT_RENDER_D...
#include <SDL2/SDL_scancode.h> // for SDL_SCANCODE_A, SDL_SCANCODE_E...
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <errno.h> // for errno, EEXIST, EACCES, ENAMETO...
#include <stdio.h> // for printf, perror
#include <string.h> // for strcmp
#include <sys/stat.h> // for mkdir, stat, S_IRWXU
#include <unistd.h> // for getuid
#include <cstdlib> // for exit, EXIT_FAILURE, srand
#include <fstream> // for basic_ofstream, basic_ifstream
#include <iostream> // for basic_ostream, operator<<, cout
#include <string> // for basic_string, operator+, char_...
#include <vector> // for vector
#include "asset.h" // for Asset, assetType
#include "const.h" // for SECTION_LOGO, SECTION_TITLE
#include "debug.h" // for Debug
#include "gamestate_credits.h" // for Credits
#include "gamestate_demo.h" // for Demo
#include "gamestate_ending.h" // for Ending
#include "gamestate_ending2.h" // for Ending2
#include "gamestate_game.h" // for Game
#include "gamestate_game_over.h" // for GameOver
#include "gamestate_loading_screen.h" // for LoadingScreen
#include "gamestate_logo.h" // for Logo
#include "gamestate_title.h" // for Title
#include "input.h" // for Input, inputs_e
#include "jail_audio.h" // for JA_GetMusicState, JA_DeleteMusic
#include "resource.h" // for Resource
#include "screen.h" // for Screen, FILTER_NEAREST, FILTER...
#include "utils.h" // for options_t, section_t, op_notif...
#ifndef _WIN32
#include <pwd.h>

View File

@@ -1,27 +1,25 @@
#pragma once
#include <SDL2/SDL.h>
#include "asset.h"
#include "debug.h"
#include "input.h"
#include "jail_audio.h"
#include "movingsprite.h"
#include "resource.h"
#include "sprite.h"
#include "text.h"
#include "utils.h"
#include "const.h"
#include "gamestate_credits.h"
#include "gamestate_demo.h"
#include "gamestate_ending.h"
#include "gamestate_ending2.h"
#include "gamestate_game_over.h"
#include "gamestate_game.h"
#include "gamestate_loading_screen.h"
#include "gamestate_logo.h"
#include "gamestate_title.h"
#ifndef DIRECTOR_H
#define DIRECTOR_H
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_video.h> // for SDL_Window
#include <string> // for string, basic_string
class Asset;
class Credits;
class Debug;
class Demo;
class Ending2;
class Ending;
class Game;
class GameOver;
class Input;
class LoadingScreen;
class Logo;
class Resource;
class Screen;
class Title;
struct JA_Music_t;
struct options_t;
struct section_t;
class Director
{
@@ -121,5 +119,3 @@ public:
// Bucle principal
void run();
};
#endif

View File

@@ -1,4 +1,8 @@
#include "enemy.h"
#include <stdlib.h> // for rand
#include <algorithm> // for min
#include "animatedsprite.h" // for AnimatedSprite
#include "texture.h" // for Texture
// Constructor
Enemy::Enemy(enemy_t enemy)

View File

@@ -1,13 +1,11 @@
#pragma once
#include <SDL2/SDL.h>
#include "animatedsprite.h"
#include "asset.h"
#include "utils.h"
#include <string>
#ifndef ENEMY_H
#define ENEMY_H
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <string> // for basic_string, string
#include "utils.h" // for palette_e, color_t
class AnimatedSprite;
struct animatedSprite_t;
// Estructura para pasar los datos de un enemigo
struct enemy_t
@@ -78,5 +76,3 @@ public:
// Asigna la paleta
void setPalette(palette_e pal);
};
#endif

View File

@@ -1,5 +1,18 @@
#include "gamestate_credits.h"
#include <iostream>
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <algorithm> // for min
#include <iostream> // for char_traits, basic_ostream, operator<<
#include "animatedsprite.h" // for AnimatedSprite
#include "const.h" // for GAMECANVAS_HEIGHT, GAMECANVAS_WIDTH
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "resource.h" // for Resource
#include "screen.h" // for Screen
#include "text.h" // for Text, TXT_CENTER, TXT_COLOR
class Asset;
// Constructor
Credits::Credits(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, Input *input, options_t *options, section_t *section)

View File

@@ -1,21 +1,17 @@
#pragma once
#include <SDL2/SDL.h>
#include "animatedsprite.h"
#include "asset.h"
#include "input.h"
#include "jail_audio.h"
#include "resource.h"
#include "screen.h"
#include "sprite.h"
#include "text.h"
#include "texture.h"
#include "utils.h"
#include "const.h"
#include <vector>
#ifndef CREDITS_H
#define CREDITS_H
#include <SDL2/SDL_events.h> // for SDL_Event
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <string> // for basic_string, string
#include <vector> // for vector
#include "utils.h" // for color_t
class AnimatedSprite;
class Asset;
class Input;
class Resource;
class Screen;
class Text;
class Credits
{
@@ -82,5 +78,3 @@ public:
// Bucle principal
void run();
};
#endif

View File

@@ -1,4 +1,17 @@
#include "gamestate_demo.h"
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <iostream> // for basic_ostream, basic_ios, operator<<, cout
#include "asset.h" // for Asset
#include "const.h" // for BLOCK, PLAY_AREA_WIDTH, SECTION_DEMO
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "item_tracker.h" // for ItemTracker
#include "resource.h" // for Resource
#include "room.h" // for Room
#include "screen.h" // for Screen
#include "text.h" // for Text, TXT_CENTER, TXT_COLOR
#include "utils.h" // for color_t, stringToColor, options_t, secti...
class Debug;
// Constructor
Demo::Demo(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, Input *input, options_t *options, section_t *section, Debug *debug)

View File

@@ -1,24 +1,21 @@
#pragma once
#include <SDL2/SDL.h>
#include "animatedsprite.h"
#include "asset.h"
#include "input.h"
#include "debug.h"
#include "input.h"
#include "resource.h"
#include "screen.h"
#include "sprite.h"
#include "text.h"
#include "utils.h"
#include "const.h"
#include "item_tracker.h"
#include "room_tracker.h"
#include "room.h"
#include "scoreboard.h"
#ifndef DEMO_H
#define DEMO_H
#include <SDL2/SDL_events.h> // for SDL_Event
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <string> // for string, basic_string
#include <vector> // for vector
#include "scoreboard.h" // for board_t
class Asset;
class Debug;
class Input;
class ItemTracker;
class Resource;
class Room;
class Screen;
class Text;
struct options_t;
struct section_t;
class Demo
{
@@ -88,5 +85,3 @@ public:
// Bucle para el juego
void run();
};
#endif

View File

@@ -1,4 +1,21 @@
#include "gamestate_ending.h"
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <algorithm> // for min
#include <iostream> // for basic_ostream, operator<<, basic_ios
#include "asset.h" // for Asset
#include "const.h" // for GAMECANVAS_HEIGHT, GAMECANVAS_WIDTH
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // for JA_SetVolume, JA_DeleteMusic, JA_Loa...
#include "resource.h" // for Resource
#include "screen.h" // for Screen
#include "sprite.h" // for Sprite
#include "text.h" // for Text, TXT_STROKE
#include "texture.h" // for Texture
#include "utils.h" // for color_t, stringToColor, options_t
// Constructor
Ending::Ending(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, Input *input, options_t *options, section_t *section)

View File

@@ -1,21 +1,20 @@
#pragma once
#include <SDL2/SDL.h>
#include "asset.h"
#include "input.h"
#include "jail_audio.h"
#include "resource.h"
#include "screen.h"
#include "sprite.h"
#include "sprite.h"
#include "text.h"
#include "texture.h"
#include "utils.h"
#include "const.h"
#include <string>
#include <vector>
#ifndef ENDING_H
#define ENDING_H
#include <SDL2/SDL_events.h> // for SDL_Event
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <string> // for basic_string, string
#include <vector> // for vector
class Asset;
class Input;
class Resource;
class Screen;
class Sprite;
class Text;
class Texture;
struct JA_Music_t;
struct options_t;
struct section_t;
class Ending
{
@@ -126,5 +125,3 @@ public:
// Bucle principal
void run();
};
#endif

View File

@@ -1,5 +1,17 @@
#include "gamestate_ending2.h"
#include <algorithm>
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <algorithm> // for max, min, replace
#include "animatedsprite.h" // for AnimatedSprite
#include "asset.h" // for Asset
#include "const.h" // for GAMECANVAS_HEIGHT, GAMECANVAS_CENTER_X
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // for JA_SetVolume, JA_DeleteMusic, JA_Loa...
#include "movingsprite.h" // for MovingSprite
#include "resource.h" // for Resource
#include "screen.h" // for Screen
#include "text.h" // for Text
#include "texture.h" // for Texture
// Constructor
Ending2::Ending2(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, Input *input, options_t *options, section_t *section)

View File

@@ -1,21 +1,19 @@
#pragma once
#include <SDL2/SDL.h>
#include "animatedsprite.h"
#include "asset.h"
#include "input.h"
#include "jail_audio.h"
#include "resource.h"
#include "screen.h"
#include "sprite.h"
#include "text.h"
#include "texture.h"
#include "utils.h"
#include "const.h"
#include <vector>
#include <string>
#ifndef ENDING2_H
#define ENDING2_H
#include <SDL2/SDL_events.h> // for SDL_Event
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <string> // for string
#include <vector> // for vector
#include "utils.h" // for color_t
class AnimatedSprite;
class Asset;
class Input;
class MovingSprite;
class Resource;
class Screen;
class Text;
struct JA_Music_t;
class Ending2
{
@@ -128,5 +126,3 @@ public:
// Bucle principal
void run();
};
#endif

View File

@@ -1,5 +1,26 @@
#include "gamestate_game.h"
#include <iostream>
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_scancode.h> // for SDL_SCANCODE_A, SDL_SCANCODE_D, SDL_...
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <iostream> // for char_traits, basic_ostream, operator<<
#include <vector> // for vector
#include "asset.h" // for Asset
#include "cheevos.h" // for Cheevos
#include "const.h" // for PLAY_AREA_HEIGHT, GAMECANVAS_WIDTH
#include "debug.h" // for Debug
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "item.h" // for item_t
#include "item_tracker.h" // for ItemTracker
#include "jail_audio.h" // for JA_PauseMusic, JA_PlaySound, JA_Resu...
#include "resource.h" // for res_room_t, Resource
#include "room.h" // for Room, room_t
#include "room_tracker.h" // for RoomTracker
#include "screen.h" // for Screen
#include "stats.h" // for Stats
#include "text.h" // for Text, TXT_CENTER, TXT_COLOR
#include "utils.h" // for options_t, color_t, cheat_t, stringT...
// Constructor
Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options, Input *input, section_t *section, Debug *debug)

View File

@@ -1,27 +1,27 @@
#pragma once
#include <SDL2/SDL.h>
#include "cheevos.h"
#include "animatedsprite.h"
#include "asset.h"
#include "debug.h"
#include "input.h"
#include "jail_audio.h"
#include "resource.h"
#include "screen.h"
#include "sprite.h"
#include "text.h"
#include "utils.h"
#include "const.h"
#include "item_tracker.h"
#include "player.h"
#include "room_tracker.h"
#include "room.h"
#include "scoreboard.h"
#include "stats.h"
#ifndef GAME_H
#define GAME_H
#include <SDL2/SDL_events.h> // for SDL_Event
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <string> // for string, basic_string
#include "player.h" // for playerSpawn_t
#include "scoreboard.h" // for board_t
class Asset;
class Cheevos;
class Debug;
class Input;
class ItemTracker;
class Resource;
class Room;
class RoomTracker;
class Screen;
class Stats;
class Text;
struct JA_Music_t;
struct JA_Sound_t;
struct options_t;
struct section_t;
class Game
{
@@ -159,5 +159,3 @@ public:
// Bucle para el juego
void run();
};
#endif

View File

@@ -1,4 +1,16 @@
#include "gamestate_game_over.h"
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <algorithm> // for min, max
#include <string> // for basic_string, operator+, to_string, char...
#include "animatedsprite.h" // for AnimatedSprite
#include "asset.h" // for Asset
#include "const.h" // for GAMECANVAS_CENTER_X, SECTION_GAME_OVER
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // for JA_DeleteMusic, JA_LoadMusic, JA_PlayMusic
#include "resource.h" // for Resource
#include "screen.h" // for Screen
#include "text.h" // for Text, TXT_CENTER, TXT_COLOR
#include "texture.h" // for Texture
// Constructor
GameOver::GameOver(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, Input *input, options_t *options, section_t *section)

View File

@@ -1,20 +1,17 @@
#pragma once
#include <SDL2/SDL.h>
#include "animatedsprite.h"
#include "asset.h"
#include "input.h"
#include "jail_audio.h"
#include "resource.h"
#include "screen.h"
#include "sprite.h"
#include "text.h"
#include "texture.h"
#include "utils.h"
#include "const.h"
#include <vector>
#ifndef GAME_OVER_H
#define GAME_OVER_H
#include <SDL2/SDL_events.h> // for SDL_Event
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <vector> // for vector
#include "utils.h" // for color_t
class AnimatedSprite;
class Asset;
class Input;
class Resource;
class Screen;
class Text;
struct JA_Music_t;
class GameOver
{
@@ -78,5 +75,3 @@ public:
// Bucle principal
void run();
};
#endif

View File

@@ -1,4 +1,16 @@
#include "gamestate_loading_screen.h"
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <stdlib.h> // for rand
#include <string> // for basic_string
#include "asset.h" // for Asset
#include "const.h" // for SECTION_LOADING_SCREEN, SECTION_QUIT
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // for JA_DeleteMusic, JA_LoadMusic, JA_PlayMusic
#include "resource.h" // for Resource
#include "screen.h" // for Screen
#include "sprite.h" // for Sprite
#include "texture.h" // for Texture
#include "utils.h" // for options_t, color_t, section_t, stringToC...
// Constructor
LoadingScreen::LoadingScreen(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, Input *input, options_t *options, section_t *section)

View File

@@ -1,21 +1,18 @@
#pragma once
#include <SDL2/SDL.h>
#include "asset.h"
#include "input.h"
#include "jail_audio.h"
#include "resource.h"
#include "screen.h"
#include "sprite.h"
#include "utils.h"
#include "const.h"
#include <vector>
#include <string>
#include "text.h"
#ifndef LOADING_SCREEN_H
#define LOADING_SCREEN_H
#include <SDL2/SDL_events.h> // for SDL_Event
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint32
class Asset;
class Input;
class Resource;
class Screen;
class Sprite;
class Texture;
struct JA_Music_t;
struct options_t;
struct section_t;
class LoadingScreen
{
@@ -87,5 +84,3 @@ public:
// Bucle principal
void run();
};
#endif

View File

@@ -1,5 +1,14 @@
#include "gamestate_logo.h"
#include <iostream>
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <string> // for basic_string, string
#include "const.h" // for SECTION_LOGO, SECTION_TITLE, SUBSECTION_...
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // for JA_StopMusic
#include "resource.h" // for Resource
#include "screen.h" // for Screen
#include "sprite.h" // for Sprite
#include "texture.h" // for Texture
class Asset;
// Constructor
Logo::Logo(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, Input *input, options_t *options, section_t *section)

View File

@@ -1,18 +1,16 @@
#pragma once
#include <SDL2/SDL.h>
#include "asset.h"
#include "input.h"
#include "jail_audio.h"
#include "resource.h"
#include "screen.h"
#include "sprite.h"
#include "utils.h"
#include "const.h"
#include <vector>
#ifndef LOGO_H
#define LOGO_H
#include <SDL2/SDL_events.h> // for SDL_Event
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <vector> // for vector
#include "utils.h" // for color_t
class Asset;
class Input;
class Resource;
class Screen;
class Sprite;
class Texture;
class Logo
{
@@ -74,5 +72,3 @@ public:
// Bucle principal
void run();
};
#endif

View File

@@ -1,4 +1,20 @@
#include "gamestate_title.h"
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_scancode.h> // for SDL_SCANCODE_1, SDL_SCANCODE_2
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <iostream> // for basic_ostream, operator<<, basic_ios
#include "asset.h" // for Asset
#include "cheevos.h" // for cheevos_t, Cheevos
#include "const.h" // for PLAY_AREA_CENTER_X, GAMECANVAS_WIDTH
#include "input.h" // for Input, inputs_e, REPEAT_FALSE, REPEA...
#include "resource.h" // for Resource
#include "screen.h" // for Screen
#include "sprite.h" // for Sprite
#include "text.h" // for Text, TXT_CENTER, TXT_COLOR
#include "texture.h" // for Texture
#include "utils.h" // for color_t, stringToColor, options_t
// Constructor
Title::Title(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, Input *input, options_t *options, section_t *section)

View File

@@ -1,21 +1,22 @@
#pragma once
#include <SDL2/SDL.h>
#include "cheevos.h"
#include "asset.h"
#include "input.h"
#include "jail_audio.h"
#include "resource.h"
#include "paleta.h"
#include "screen.h"
#include "sprite.h"
#include "text.h"
#include "utils.h"
#include "const.h"
#include <vector>
#ifndef TITLE_H
#define TITLE_H
#include <SDL2/SDL_events.h> // for SDL_Event
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <string> // for basic_string, string
#include <vector> // for vector
#include "paleta.h" // for jSurface
class Asset;
class Cheevos;
class Input;
class Resource;
class Screen;
class Sprite;
class Text;
class Texture;
struct options_t;
struct section_t;
class Title
{
@@ -116,5 +117,3 @@ public:
// Bucle principal
void run();
};
#endif

View File

@@ -1,5 +1,10 @@
#include "input.h"
#include <iostream>
#include <SDL2/SDL.h> // for SDL_INIT_GAMECONTROLLER, SDL_InitSubS...
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_events.h> // for SDL_ENABLE
#include <SDL2/SDL_joystick.h> // for SDL_NumJoysticks
#include <SDL2/SDL_keyboard.h> // for SDL_GetKeyboardState
#include <iostream> // for basic_ostream, operator<<, cout, basi...
// Constructor
Input::Input(std::string file)

View File

@@ -1,11 +1,10 @@
#pragma once
#include <SDL2/SDL.h>
#include <string>
#include <vector>
#ifndef INPUT_H
#define INPUT_H
#include <SDL2/SDL_gamecontroller.h> // for SDL_GameControllerButton, SDL_G...
#include <SDL2/SDL_scancode.h> // for SDL_Scancode
#include <SDL2/SDL_stdinc.h> // for Uint8
#include <string> // for string, basic_string
#include <vector> // for vector
enum inputs_e
{
@@ -116,5 +115,3 @@ public:
// Hablita las entradas
void enable();
};
#endif

View File

@@ -1,6 +1,6 @@
#include "item.h"
#include <fstream>
#include <sstream>
#include "sprite.h" // for Sprite
#include "texture.h" // for Texture
// Constructor
Item::Item(item_t item)

View File

@@ -1,13 +1,12 @@
#pragma once
#include <SDL2/SDL.h>
#include "asset.h"
#include "sprite.h"
#include "utils.h"
#include <string>
#ifndef ITEM_H
#define ITEM_H
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <string> // for basic_string, string
#include <vector> // for vector
#include "utils.h" // for color_t
class Sprite;
class Texture;
struct item_t
{
@@ -58,6 +57,4 @@ public:
// Asigna los colores del objeto
void setColors(color_t col1, color_t col2);
};
#endif
}

View File

@@ -1,11 +1,8 @@
#pragma once
#include <SDL2/SDL.h>
#include "utils.h"
#include <string>
#include <vector>
#ifndef ITEM_TRACKER_H
#define ITEM_TRACKER_H
#include <SDL2/SDL_rect.h> // for SDL_Point
#include <string> // for string, basic_string
#include <vector> // for vector
struct item_tracker_t
{
@@ -35,5 +32,3 @@ public:
// Añade el objeto a la lista de objetos cogidos
void addItem(std::string name, SDL_Point pos);
};
#endif

View File

@@ -1,5 +1,13 @@
#include "const.h"
#include "menu.h"
#include <algorithm> // for max
#include <fstream> // for char_traits, basic_ostream, operator<<, basi...
#include <iostream> // for cout
#include <sstream> // for basic_stringstream
#include "asset.h" // for Asset
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // for JA_LoadSound, JA_PlaySound, JA_DeleteSound
#include "resource.h" // for Resource
#include "text.h" // for Text
// Constructor
Menu::Menu(SDL_Renderer *renderer, Resource *resource, Asset *asset, Input *input, std::string file)

View File

@@ -1,19 +1,15 @@
#pragma once
#include <SDL2/SDL.h>
#include "asset.h"
#include "input.h"
#include "jail_audio.h"
#include "resource.h"
#include "sprite.h"
#include "text.h"
#include "utils.h"
#include <fstream>
#include <sstream>
#include <vector>
#ifndef MENU_H
#define MENU_H
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <string> // for string, basic_string
#include <vector> // for vector
#include "utils.h" // for color_t
class Asset;
class Input;
class Resource;
class Text;
struct JA_Sound_t;
// Tipos de fondos para el menu
#define MENU_BACKGROUND_TRANSPARENT 0
@@ -222,5 +218,3 @@ public:
// Establece el rectangulo de fondo del menu
void setRectSize(int w = 0, int h = 0);
};
#endif

View File

@@ -1,5 +1,5 @@
#include "const.h"
#include "movingsprite.h"
#include "texture.h" // for Texture
// Constructor
MovingSprite::MovingSprite(float x, float y, int w, int h, float velx, float vely, float accelx, float accely, Texture *texture, SDL_Renderer *renderer)

View File

@@ -1,10 +1,10 @@
#pragma once
#include <SDL2/SDL.h>
#include "sprite.h"
#ifndef MOVINGSPRITE_H
#define MOVINGSPRITE_H
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point
#include <SDL2/SDL_render.h> // for SDL_RendererFlip, SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint16
#include "sprite.h" // for Sprite
class Texture;
// Clase MovingSprite. Añade posicion y velocidad en punto flotante
class MovingSprite : public Sprite
@@ -183,5 +183,3 @@ public:
// Devuelve el incremento en el eje X en pixels
int getIncX();
};
#endif

View File

@@ -1,7 +1,10 @@
#include "notify.h"
#include <string>
#include <stdio.h>
#include <iostream>
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
#include <string> // for basic_string, string, char_traits
#include "jail_audio.h" // for JA_DeleteSound, JA_LoadSound, JA_Pla...
#include "sprite.h" // for Sprite
#include "text.h" // for Text
#include "texture.h" // for Texture
// Constructor
Notify::Notify(SDL_Renderer *renderer, std::string iconFile, std::string bitmapFile, std::string textFile, std::string soundFile, options_t *options)

View File

@@ -1,15 +1,14 @@
#pragma once
#include <SDL2/SDL.h>
#include "jail_audio.h"
#include "sprite.h"
#include "text.h"
#include "texture.h"
#include "utils.h"
#include <vector>
#ifndef NOTIFY_H
#define NOTIFY_H
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <string> // for basic_string, string
#include <vector> // for vector
#include "utils.h" // for color_t
class Sprite;
class Text;
class Texture;
struct JA_Sound_t;
class Notify
{
@@ -83,5 +82,3 @@ public:
// Indica si hay notificaciones activas
bool active();
};
#endif

View File

@@ -1,6 +1,10 @@
#include "paleta.h"
#include "gif.c"
#include <stdio.h>
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_ARGB8888
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <fcntl.h> // for SEEK_END, SEEK_SET
#include <stdio.h> // for NULL, fseek, fclose, fopen, fread, ftell
#include <stdlib.h> // for malloc, free
#include "gif.c" // for LoadGif, LoadPalette
struct jSurface_s
{

View File

@@ -1,5 +1,7 @@
#pragma once
#include <SDL2/SDL.h>
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint8, Uint32
typedef struct jSurface_s *jSurface;

View File

@@ -1,6 +1,17 @@
#include "player.h"
#include <fstream>
#include <sstream>
#include <bits/std_abs.h> // for abs
#include <stdlib.h> // for rand
#include <algorithm> // for max, min
#include <cmath> // for ceil, abs
#include "animatedsprite.h" // for AnimatedSprite
#include "asset.h" // for Asset
#include "const.h" // for BORDER_TOP, BLOCK, BORDER_BOTTOM, BORDER...
#include "debug.h" // for Debug
#include "input.h" // for Input, inputs_e
#include "jail_audio.h" // for JA_LoadSound, JA_Sound_t, JA_PlaySound
#include "resource.h" // for Resource
#include "room.h" // for Room, tile_e
#include "texture.h" // for Texture
// Constructor
Player::Player(player_t player)

View File

@@ -1,19 +1,17 @@
#pragma once
#include <SDL2/SDL.h>
#include "animatedsprite.h"
#include "asset.h"
#include "debug.h"
#include "input.h"
#include "resource.h"
#include "utils.h"
#include "const.h"
#include "room.h"
#include <string>
#include <vector>
#ifndef PLAYER_H
#define PLAYER_H
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <string> // for basic_string, string
#include <vector> // for vector
#include "utils.h" // for color_t
class AnimatedSprite;
class Asset;
class Debug;
class Input;
class Resource;
class Room;
struct JA_Sound_t;
enum state_e
{
@@ -195,5 +193,3 @@ public:
// Quita el modo pausa del jugador
void resume();
};
#endif

View File

@@ -1,5 +1,13 @@
#include "resource.h"
#include <iostream>
#include <iostream> // for basic_ostream, operator<<, cout, endl
#include "animatedsprite.h" // for animatedSprite_t, loadAnimationFromFile
#include "asset.h" // for Asset
#include "enemy.h" // for enemy_t
#include "item.h" // for item_t
#include "room.h" // for room_t, loadRoomFile, loadRoomTileFile
#include "text.h" // for textFile_t, LoadTextFile
#include "texture.h" // for Texture
#include "utils.h" // for options_t
// Constructor
Resource::Resource(SDL_Renderer *renderer, Asset *asset, options_t *options)

View File

@@ -1,17 +1,14 @@
#pragma once
#include <SDL2/SDL.h>
#include "animatedsprite.h"
#include "asset.h"
#include "room.h"
#include "text.h"
#include "texture.h"
#include "utils.h"
#include <string>
#include <vector>
#ifndef RESOURCE_H
#define RESOURCE_H
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <string> // for string, basic_string
#include <vector> // for vector
class Asset;
class Texture;
struct animatedSprite_t;
struct options_t;
struct room_t;
struct textFile_t;
struct res_texture_t
{
@@ -132,5 +129,3 @@ public:
// Obtiene todas las habitaciones
std::vector<res_room_t> *getAllRooms();
};
#endif

View File

@@ -1,7 +1,19 @@
#include "room.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
#include <stdlib.h> // for rand
#include <fstream> // for basic_ostream, operator<<, basic_ist...
#include <iostream> // for cout
#include <sstream> // for basic_stringstream
#include "asset.h" // for Asset
#include "const.h" // for BLOCK, PLAY_AREA_HEIGHT, PLAY_AREA_W...
#include "debug.h" // for Debug
#include "item_tracker.h" // for ItemTracker
#include "jail_audio.h" // for JA_DeleteSound, JA_LoadSound, JA_Pla...
#include "screen.h" // for Screen
#include "sprite.h" // for Sprite
#include "texture.h" // for Texture
// Carga las variables y texturas desde un fichero de mapa de tiles
std::vector<int> loadRoomTileFile(std::string file_path, bool verbose)

View File

@@ -1,21 +1,19 @@
#pragma once
#include <SDL2/SDL.h>
#include "asset.h"
#include "debug.h"
#include "jail_audio.h"
#include "screen.h"
#include "sprite.h"
#include "utils.h"
#include "const.h"
#include "enemy.h"
#include "item_tracker.h"
#include "item.h"
#include <string>
#include <vector>
#ifndef ROOM_H
#define ROOM_H
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include <string> // for string, basic_string
#include <vector> // for vector
#include "enemy.h" // for enemy_t
#include "item.h" // for item_t
#include "utils.h" // for h_line_t, color_t, d_line_t, v_line_t
class Asset;
class Debug;
class ItemTracker;
class Screen;
class Sprite;
class Texture;
struct JA_Sound_t;
enum tile_e
{
@@ -254,5 +252,3 @@ public:
// Obten la direccion de las superficies automaticas
int getAutoSurfaceDirection();
};
#endif

View File

@@ -1,12 +1,7 @@
#pragma once
#include <SDL2/SDL.h>
#include "utils.h"
#include <string>
#include <vector>
#ifndef ROOM_TRACKER_H
#define ROOM_TRACKER_H
#include <string> // for string
#include <vector> // for vector
class RoomTracker
{
@@ -27,5 +22,3 @@ public:
// Añade la habitación a la lista
bool addRoom(std::string name);
};
#endif

View File

@@ -1,6 +1,12 @@
#include "scoreboard.h"
#include <fstream>
#include <sstream>
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include "animatedsprite.h" // for AnimatedSprite
#include "const.h" // for BLOCK, PLAY_AREA_HEIGHT, PLAY_AREA_WIDTH
#include "resource.h" // for Resource
#include "text.h" // for Text
#include "texture.h" // for Texture
class Asset;
// Constructor
ScoreBoard::ScoreBoard(SDL_Renderer *renderer, Resource *resource, Asset *asset, options_t *options, board_t *board)

View File

@@ -1,16 +1,15 @@
#pragma once
#include <SDL2/SDL.h>
#include "animatedsprite.h"
#include "asset.h"
#include "resource.h"
#include "text.h"
#include "utils.h"
#include "const.h"
#include <string>
#ifndef SCOREBOARD_H
#define SCOREBOARD_H
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <string> // for basic_string, string
#include <vector> // for vector
#include "utils.h" // for color_t
class AnimatedSprite;
class Asset;
class Resource;
class Text;
class Texture;
struct board_t
{
@@ -88,5 +87,3 @@ public:
// Devuelve la cantidad de minutos de juego transcurridos
int getMinutes();
};
#endif

View File

@@ -1,9 +1,16 @@
#include "screen.h"
#include "jail_shader.h"
#include <string>
#include <fstream> // Para basic_ifstream, ifstream
#include <iterator> // Para istreambuf_iterator, operator==
#include <iostream>
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_events.h> // for SDL_DISABLE, SDL_ENABLE
#include <SDL2/SDL_mouse.h> // for SDL_ShowCursor
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
#include <algorithm> // for max, min
#include <fstream> // for basic_ostream, operator<<, basic_ifstream
#include <iostream> // for cout
#include <iterator> // for istreambuf_iterator, operator!=
#include <string> // for basic_string, char_traits, string
#include "asset.h" // for Asset
#include "jail_shader.h" // for init, render
#include "notify.h" // for Notify
// Constructor
Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, options_t *options)

View File

@@ -1,14 +1,14 @@
#pragma once
#include <SDL2/SDL.h>
#include "asset.h"
#include "notify.h"
#include "utils.h"
#include "const.h"
#include <vector>
#ifndef SCREEN_H
#define SCREEN_H
#include <SDL2/SDL_blendmode.h> // for SDL_BlendMode
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include <SDL2/SDL_video.h> // for SDL_Window
#include <string> // for basic_string, string
#include <vector> // for vector
#include "utils.h" // for color_t
class Asset;
class Notify;
#define FILTER_NEAREST 0
#define FILTER_LINEAL 1
@@ -152,5 +152,3 @@ public:
// Cambia el estado de los shaders
void toggleShaders();
};
#endif

View File

@@ -1,4 +1,5 @@
#include "sprite.h"
#include "texture.h" // for Texture
// Constructor
Sprite::Sprite(int x, int y, int w, int h, Texture *texture, SDL_Renderer *renderer)

View File

@@ -1,10 +1,8 @@
#pragma once
#include <SDL2/SDL.h>
#include "texture.h"
#ifndef SPRITE_H
#define SPRITE_H
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer
class Texture;
// Clase sprite
class Sprite
@@ -96,5 +94,3 @@ public:
// Establece los valores de posición y tamaño del sprite
void setRect(SDL_Rect rect);
};
#endif

View File

@@ -1,8 +1,7 @@
#include "stats.h"
#include <algorithm>
#include <fstream>
#include <iostream>
#include <sstream>
#include <fstream> // for basic_ostream, basic_ifstream, basic_istream, ope...
#include <sstream> // for basic_stringstream
#include "utils.h" // for op_stats_t, options_t
// Constructor
Stats::Stats(std::string file, std::string buffer, options_t *options)

View File

@@ -1,11 +1,8 @@
#pragma once
#include <SDL2/SDL.h>
#include "utils.h"
#include <string>
#include <vector>
#ifndef STATS_H
#define STATS_H
#include <string> // for string, basic_string
#include <vector> // for vector
struct options_t;
class Stats
{
@@ -74,5 +71,3 @@ public:
// Añade una entrada al diccionario
void addDictionary(std::string number, std::string name);
};
#endif

View File

@@ -1,7 +1,9 @@
#include "text.h"
#include <iostream>
#include <fstream>
#include <fstream> // for char_traits, basic_ostream, basic_ifstream, ope...
#include <iostream> // for cout
#include "sprite.h" // for Sprite
#include "texture.h" // for Texture
#include "utils.h" // for color_t
// Llena una estructuta textFile_t desde un fichero
textFile_t LoadTextFile(std::string file, bool verbose)

View File

@@ -1,10 +1,11 @@
#pragma once
#include "sprite.h"
#include "utils.h"
#ifndef TEXT_H
#define TEXT_H
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint8
#include <string> // for string
class Sprite;
class Texture;
struct color_t;
#define TXT_COLOR 1
#define TXT_SHADOW 2
@@ -76,5 +77,3 @@ public:
// Establece si se usa un tamaño fijo de letra
void setFixedWidth(bool value);
};
#endif

View File

@@ -1,8 +1,12 @@
#include "texture.h"
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_log.h> // for SDL_Log
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGB24, SDL_PIXELFORMAT...
#include <SDL2/SDL_surface.h> // for SDL_CreateRGBSurfaceWithFormatFrom
#include <stdlib.h> // for exit
#include <iostream> // for basic_ostream, operator<<, cout, endl
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#include <iostream>
#include "stb_image.h" // for stbi_failure_reason, stbi_image_free
// Constructor
Texture::Texture(SDL_Renderer *renderer, std::string path, bool verbose)

View File

@@ -1,11 +1,10 @@
#pragma once
#include <SDL2/SDL.h>
#include <stdio.h>
#include <string>
#ifndef TEXTURE_H
#define TEXTURE_H
#include <SDL2/SDL_blendmode.h> // for SDL_BlendMode
#include <SDL2/SDL_rect.h> // for SDL_Point, SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_FLIP_NONE, SDL_TEX...
#include <SDL2/SDL_stdinc.h> // for Uint8
#include <string> // for basic_string, string
class Texture
{
@@ -62,5 +61,3 @@ public:
// Obtiene la textura
SDL_Texture *getSDLTexture();
};
#endif

View File

@@ -1,5 +1,6 @@
#include "utils.h"
#include <math.h>
#include <stdlib.h> // for free, malloc, abs
#include <cmath> // for round, abs
// Calcula el cuadrado de la distancia entre dos puntos
double distanceSquared(int x1, int y1, int x2, int y2)

View File

@@ -1,11 +1,8 @@
#pragma once
#include <SDL2/SDL.h>
#include "texture.h"
#include <string>
#ifndef UTILS_H
#define UTILS_H
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point
#include <SDL2/SDL_stdinc.h> // for Uint8, Uint32
#include <string> // for string, basic_string
// Estructura para definir un circulo
struct circle_t
@@ -190,5 +187,3 @@ std::string toLower(std::string str);
// Convierte una cadena a mayúsculas
std::string toUpper(std::string str);
#endif