Toquetechant includes

This commit is contained in:
2025-02-20 13:56:07 +01:00
parent e1d6aff724
commit 4dd6c94730
66 changed files with 4462 additions and 3097 deletions

View File

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

View File

@@ -1,11 +1,11 @@
#pragma once
#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
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <SDL2/SDL_stdinc.h> // Para Uint8
#include <string> // Para string
#include <vector> // Para vector
#include "movingsprite.h" // Para MovingSprite
class Texture;
struct animation_t

View File

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

View File

@@ -1,7 +1,7 @@
#pragma once
#include <string> // for string
#include <vector> // for vector
#include <string> // Para string
#include <vector> // Para vector
enum assetType
{
@@ -27,7 +27,7 @@ private:
std::string file; // Ruta del fichero desde la raiz del directorio
enum assetType type; // Indica el tipo de recurso
bool required; // Indica si es un fichero que debe de existir
//bool absolute; // Indica si la ruta que se ha proporcionado es una ruta absoluta
// bool absolute; // Indica si la ruta que se ha proporcionado es una ruta absoluta
};
// Variables

View File

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

View File

@@ -1,7 +1,7 @@
#pragma once
#include <string> // for string
#include <vector> // for vector
#include <string> // Para string
#include <vector> // Para vector
class Screen;
struct options_t;

View File

@@ -1,8 +1,9 @@
#include "debug.h"
#include <algorithm> // for max
#include "asset.h" // for Asset
#include "text.h" // for Text
#include "texture.h" // for Texture
#include <algorithm> // Para max
#include "asset.h" // Para Asset
#include "text.h" // Para Text
#include "texture.h" // Para Texture
#include "utils.h"
class Screen;
// Constructor
@@ -56,7 +57,7 @@ void Debug::render()
y = 0;
for (auto l : log)
{
text->writeColored(x + 10, y, l, {255, 255, 255});
text->writeColored(x + 10, y, l, color_t(255, 255, 255));
y += text->getCharacterSize() + 1;
}
}

View File

@@ -1,9 +1,9 @@
#pragma once
#include <SDL2/SDL_rect.h> // for SDL_Point
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <string> // for string
#include <vector> // for vector
#include <SDL2/SDL_rect.h> // Para SDL_Point
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <string> // Para string
#include <vector> // Para vector
class Asset;
class Screen;
class Text;

View File

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

View File

@@ -1,8 +1,8 @@
#pragma once
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_video.h> // for SDL_Window
#include <string> // for string, basic_string
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <SDL2/SDL_video.h> // Para SDL_Window
#include <string> // Para string, basic_string
class Asset;
class Credits;
class Debug;

View File

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

View File

@@ -1,9 +1,9 @@
#pragma once
#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
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <string> // Para basic_string, string
#include "utils.h" // Para palette_e, color_t
class AnimatedSprite;
struct animatedSprite_t;

View File

@@ -1,17 +1,17 @@
#include "gamestate_credits.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 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
#include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND
#include <SDL2/SDL_error.h> // Para SDL_GetError
#include <SDL2/SDL_pixels.h> // Para SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
#include <algorithm> // Para min
#include <iostream> // Para char_traits, basic_ostream, operator<<
#include "animatedsprite.h" // Para AnimatedSprite
#include "const.h" // Para GAMECANVAS_HEIGHT, GAMECANVAS_WIDTH
#include "input.h" // Para Input, REPEAT_FALSE, inputs_e
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "text.h" // Para Text, TXT_CENTER, TXT_COLOR
class Asset;
// Constructor

View File

@@ -1,11 +1,11 @@
#pragma once
#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
#include <SDL2/SDL_events.h> // Para SDL_Event
#include <SDL2/SDL_render.h> // Para SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // Para Uint32
#include <string> // Para basic_string, string
#include <vector> // Para vector
#include "utils.h" // Para color_t
class AnimatedSprite;
class Asset;
class Input;

View File

@@ -1,16 +1,16 @@
#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...
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
#include <iostream> // Para basic_ostream, basic_ios, operator<<, cout
#include "asset.h" // Para Asset
#include "const.h" // Para BLOCK, PLAY_AREA_WIDTH, SECTION_DEMO
#include "input.h" // Para Input, REPEAT_FALSE, inputs_e
#include "item_tracker.h" // Para ItemTracker
#include "resource.h" // Para Resource
#include "room.h" // Para Room
#include "screen.h" // Para Screen
#include "text.h" // Para Text, TXT_CENTER, TXT_COLOR
#include "utils.h" // Para color_t, stringToColor, options_t, secti...
class Debug;
// Constructor

View File

@@ -1,11 +1,11 @@
#pragma once
#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
#include <SDL2/SDL_events.h> // Para SDL_Event
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <SDL2/SDL_stdinc.h> // Para Uint32
#include <string> // Para string, basic_string
#include <vector> // Para vector
#include "scoreboard.h" // Para board_t
class Asset;
class Debug;
class Input;

View File

@@ -1,21 +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
#include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND
#include <SDL2/SDL_error.h> // Para SDL_GetError
#include <SDL2/SDL_pixels.h> // Para SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
#include <algorithm> // Para min
#include <iostream> // Para basic_ostream, operator<<, basic_ios
#include "asset.h" // Para Asset
#include "const.h" // Para GAMECANVAS_HEIGHT, GAMECANVAS_WIDTH
#include "input.h" // Para Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // Para JA_SetVolume, JA_DeleteMusic, JA_Loa...
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "sprite.h" // Para Sprite
#include "text.h" // Para Text, TXT_STROKE
#include "texture.h" // Para Texture
#include "utils.h" // Para 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,10 +1,10 @@
#pragma once
#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 <SDL2/SDL_events.h> // Para SDL_Event
#include <SDL2/SDL_render.h> // Para SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // Para Uint32
#include <string> // Para basic_string, string
#include <vector> // Para vector
class Asset;
class Input;
class Resource;

View File

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

View File

@@ -1,11 +1,11 @@
#pragma once
#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
#include <SDL2/SDL_events.h> // Para SDL_Event
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <SDL2/SDL_stdinc.h> // Para Uint32
#include <string> // Para string
#include <vector> // Para vector
#include "utils.h" // Para color_t
class AnimatedSprite;
class Asset;
class Input;

View File

@@ -1,26 +1,26 @@
#include "gamestate_game.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_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...
#include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND
#include <SDL2/SDL_error.h> // Para SDL_GetError
#include <SDL2/SDL_pixels.h> // Para SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_scancode.h> // Para SDL_SCANCODE_A, SDL_SCANCODE_D, SDL_...
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
#include <iostream> // Para char_traits, basic_ostream, operator<<
#include <vector> // Para vector
#include "asset.h" // Para Asset
#include "cheevos.h" // Para Cheevos
#include "const.h" // Para PLAY_AREA_HEIGHT, GAMECANVAS_WIDTH
#include "debug.h" // Para Debug
#include "input.h" // Para Input, REPEAT_FALSE, inputs_e
#include "item.h" // Para item_t
#include "item_tracker.h" // Para ItemTracker
#include "jail_audio.h" // Para JA_PauseMusic, JA_PlaySound, JA_Resu...
#include "resource.h" // Para res_room_t, Resource
#include "room.h" // Para Room, room_t
#include "room_tracker.h" // Para RoomTracker
#include "screen.h" // Para Screen
#include "stats.h" // Para Stats
#include "text.h" // Para Text, TXT_CENTER, TXT_COLOR
#include "utils.h" // Para 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,12 +1,12 @@
#pragma once
#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
#include <SDL2/SDL_events.h> // Para SDL_Event
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // Para Uint32
#include <string> // Para string, basic_string
#include "player.h" // Para playerSpawn_t
#include "scoreboard.h" // Para board_t
class Asset;
class Cheevos;
class Debug;

View File

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

View File

@@ -1,10 +1,10 @@
#pragma once
#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
#include <SDL2/SDL_events.h> // Para SDL_Event
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <SDL2/SDL_stdinc.h> // Para Uint32
#include <vector> // Para vector
#include "utils.h" // Para color_t
class AnimatedSprite;
class Asset;
class Input;

View File

@@ -1,16 +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...
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
#include <stdlib.h> // Para rand
#include <string> // Para basic_string
#include "asset.h" // Para Asset
#include "const.h" // Para SECTION_LOADING_SCREEN, SECTION_QUIT
#include "input.h" // Para Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // Para JA_DeleteMusic, JA_LoadMusic, JA_PlayMusic
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "sprite.h" // Para Sprite
#include "texture.h" // Para Texture
#include "utils.h" // Para 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)
@@ -222,7 +222,7 @@ void LoadingScreen::renderBorder()
const int width = GAMECANVAS_WIDTH + (options->borderWidth * 2);
const int height = GAMECANVAS_HEIGHT + (options->borderHeight * 2);
bool drawEnabled = rand() % 2 == 0 ? true : false;
// for (int i = 0; i < height; ++i)
// Para (int i = 0; i < height; ++i)
//{
// if (rand() % 2 == 0)
// {

View File

@@ -1,9 +1,9 @@
#pragma once
#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
#include <SDL2/SDL_events.h> // Para SDL_Event
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <SDL2/SDL_stdinc.h> // Para Uint32
class Asset;
class Input;
class Resource;

View File

@@ -1,13 +1,13 @@
#include "gamestate_logo.h"
#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
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
#include <string> // Para basic_string, string
#include "const.h" // Para SECTION_LOGO, SECTION_TITLE, SUBSECTION_...
#include "input.h" // Para Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // Para JA_StopMusic
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "sprite.h" // Para Sprite
#include "texture.h" // Para Texture
class Asset;
// Constructor

View File

@@ -1,10 +1,10 @@
#pragma once
#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
#include <SDL2/SDL_events.h> // Para SDL_Event
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <SDL2/SDL_stdinc.h> // Para Uint32
#include <vector> // Para vector
#include "utils.h" // Para color_t
class Asset;
class Input;
class Resource;

View File

@@ -1,20 +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
#include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND
#include <SDL2/SDL_error.h> // Para SDL_GetError
#include <SDL2/SDL_pixels.h> // Para SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_scancode.h> // Para SDL_SCANCODE_1, SDL_SCANCODE_2
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
#include <iostream> // Para basic_ostream, operator<<, basic_ios
#include "asset.h" // Para Asset
#include "cheevos.h" // Para cheevos_t, Cheevos
#include "const.h" // Para PLAY_AREA_CENTER_X, GAMECANVAS_WIDTH
#include "input.h" // Para Input, inputs_e, REPEAT_FALSE, REPEA...
#include "resource.h" // Para Resource
#include "screen.h" // Para Screen
#include "sprite.h" // Para Sprite
#include "text.h" // Para Text, TXT_CENTER, TXT_COLOR
#include "texture.h" // Para Texture
#include "utils.h" // Para 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,12 +1,12 @@
#pragma once
#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
#include <SDL2/SDL_events.h> // Para SDL_Event
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // Para Uint32
#include <string> // Para basic_string, string
#include <vector> // Para vector
#include "paleta.h" // Para jSurface
class Asset;
class Cheevos;
class Input;

View File

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

View File

@@ -1,10 +1,10 @@
#pragma once
#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
#include <SDL2/SDL_gamecontroller.h> // Para SDL_GameControllerButton, SDL_G...
#include <SDL2/SDL_scancode.h> // Para SDL_Scancode
#include <SDL2/SDL_stdinc.h> // Para Uint8
#include <string> // Para string, basic_string
#include <vector> // Para vector
enum inputs_e
{

View File

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

View File

@@ -1,24 +1,27 @@
#pragma once
#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
#include <SDL2/SDL_rect.h> // Para SDL_Rect, SDL_Point
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <string> // Para basic_string, string
#include <vector> // Para vector
#include "utils.h" // Para color_t
class Sprite;
class Texture;
struct item_t
{
SDL_Renderer *renderer; // El renderizador de la ventana
Texture *texture; // Textura con los graficos del item
std::string tileSetFile; // Ruta al fichero con los graficos del item
int x; // Posicion del item en pantalla
int y; // Posicion del item en pantalla
int tile; // Numero de tile dentro de la textura
Texture *texture; // Textura con los gráficos del item
std::string tileSetFile; // Ruta al fichero con los gráficos del item
int x; // Posición del item en pantalla
int y; // Posición del item en pantalla
int tile; // Número de tile dentro de la textura
int counter; // Contador inicial. Es el que lo hace cambiar de color
color_t color1; // Uno de los dos colores que se utiliza para el item
color_t color2; // Uno de los dos colores que se utiliza para el item
// Constructor por defecto
item_t() : renderer(nullptr), texture(nullptr), x(0), y(0), tile(0), counter(0), color1(), color2() {}
};
class Item
@@ -57,4 +60,4 @@ public:
// Asigna los colores del objeto
void setColors(color_t col1, color_t col2);
}
};

View File

@@ -71,7 +71,7 @@ int ItemTracker::findByPos(int index, SDL_Point pos)
{
int i = 0;
for (auto l:list[index].pos)
for (auto l : list[index].pos)
{
if ((l.x == pos.x) && (l.y == pos.y))
{

View File

@@ -1,8 +1,8 @@
#pragma once
#include <SDL2/SDL_rect.h> // for SDL_Point
#include <string> // for string, basic_string
#include <vector> // for vector
#include <SDL2/SDL_rect.h> // Para SDL_Point
#include <string> // Para string, basic_string
#include <vector> // Para vector
struct item_tracker_t
{

View File

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

View File

@@ -1,10 +1,10 @@
#pragma once
#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
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <string> // Para string, basic_string
#include <vector> // Para vector
#include "utils.h" // Para color_t
class Asset;
class Input;
class Resource;
@@ -87,9 +87,9 @@ private:
bool isCenteredOnY; // Variable para saber si el menu debe estar centrado respecto a un punto en el eje Y
bool areElementsCenteredOnX; // Variable para saber si los elementos van centrados en el eje X
int widestItem; // Anchura del elemento más ancho
JA_Sound_t* soundAccept; // Sonido al aceptar o elegir una opción del menu
JA_Sound_t* soundCancel; // Sonido al cancelar el menu
JA_Sound_t* soundMove; // Sonido al mover el selector
JA_Sound_t *soundAccept; // Sonido al aceptar o elegir una opción del menu
JA_Sound_t *soundCancel; // Sonido al cancelar el menu
JA_Sound_t *soundMove; // Sonido al mover el selector
color_t colorGreyed; // Color para los elementos agrisados
rectangle_t rectBG; // Rectangulo de fondo del menu
std::vector<item_t> item; // Estructura para cada elemento del menu

View File

@@ -1,5 +1,5 @@
#include "movingsprite.h"
#include "texture.h" // for Texture
#include "texture.h" // Para 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,9 +1,9 @@
#pragma once
#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
#include <SDL2/SDL_rect.h> // Para SDL_Rect, SDL_Point
#include <SDL2/SDL_render.h> // Para SDL_RendererFlip, SDL_Renderer
#include <SDL2/SDL_stdinc.h> // Para Uint16
#include "sprite.h" // Para Sprite
class Texture;
// Clase MovingSprite. Añade posicion y velocidad en punto flotante

View File

@@ -1,10 +1,10 @@
#include "notify.h"
#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
#include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND
#include <string> // Para basic_string, string, char_traits
#include "jail_audio.h" // Para JA_DeleteSound, JA_LoadSound, JA_Pla...
#include "sprite.h" // Para Sprite
#include "text.h" // Para Text
#include "texture.h" // Para 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,10 +1,10 @@
#pragma once
#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
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <string> // Para basic_string, string
#include <vector> // Para vector
#include "utils.h" // Para color_t
class Sprite;
class Text;
class Texture;

View File

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

View File

@@ -1,7 +1,7 @@
#pragma once
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint8, Uint32
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <SDL2/SDL_stdinc.h> // Para Uint8, Uint32
typedef struct jSurface_s *jSurface;
@@ -10,7 +10,7 @@ void pDeleteSurface(jSurface surf);
void pSetDest(jSurface surf);
void pSetSource(jSurface surf);
jSurface pLoadSurface(const char* filename);
jSurface pLoadSurface(const char *filename);
void pPutPixel(int x, int y, Uint8 color);
Uint8 pGetPixel(int x, int y);

View File

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

View File

@@ -1,10 +1,10 @@
#pragma once
#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
#include <SDL2/SDL_rect.h> // Para SDL_Rect, SDL_Point
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <string> // Para basic_string, string
#include <vector> // Para vector
#include "utils.h" // Para color_t
class AnimatedSprite;
class Asset;
class Debug;

View File

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

View File

@@ -1,8 +1,8 @@
#pragma once
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <string> // for string, basic_string
#include <vector> // for vector
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <string> // Para string, basic_string
#include <vector> // Para vector
class Asset;
class Texture;
struct animatedSprite_t;

View File

@@ -1,19 +1,19 @@
#include "room.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 <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
#include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND
#include <SDL2/SDL_error.h> // Para SDL_GetError
#include <SDL2/SDL_pixels.h> // Para SDL_PIXELFORMAT_RGBA8888
#include <stdlib.h> // Para rand
#include <fstream> // Para basic_ostream, operator<<, basic_ist...
#include <iostream> // Para cout
#include <sstream> // Para basic_stringstream
#include "asset.h" // Para Asset
#include "const.h" // Para BLOCK, PLAY_AREA_HEIGHT, PLAY_AREA_W...
#include "debug.h" // Para Debug
#include "item_tracker.h" // Para ItemTracker
#include "jail_audio.h" // Para JA_DeleteSound, JA_LoadSound, JA_Pla...
#include "screen.h" // Para Screen
#include "sprite.h" // Para Sprite
#include "texture.h" // Para 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,12 +1,12 @@
#pragma once
#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
#include <SDL2/SDL_rect.h> // Para SDL_Rect, SDL_Point
#include <SDL2/SDL_render.h> // Para SDL_Renderer, SDL_Texture
#include <string> // Para string, basic_string
#include <vector> // Para vector
#include "enemy.h" // Para enemy_t
#include "item.h" // Para item_t
#include "utils.h" // Para h_line_t, color_t, d_line_t, v_line_t
class Asset;
class Debug;
class ItemTracker;

View File

@@ -1,7 +1,7 @@
#pragma once
#include <string> // for string
#include <vector> // for vector
#include <string> // Para string
#include <vector> // Para vector
class RoomTracker
{

View File

@@ -1,11 +1,11 @@
#include "scoreboard.h"
#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
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
#include "animatedsprite.h" // Para AnimatedSprite
#include "const.h" // Para BLOCK, PLAY_AREA_HEIGHT, PLAY_AREA_WIDTH
#include "resource.h" // Para Resource
#include "text.h" // Para Text
#include "texture.h" // Para Texture
class Asset;
// Constructor

View File

@@ -1,10 +1,10 @@
#pragma once
#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
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <SDL2/SDL_stdinc.h> // Para Uint32
#include <string> // Para basic_string, string
#include <vector> // Para vector
#include "utils.h" // Para color_t
class AnimatedSprite;
class Asset;
class Resource;

View File

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

View File

@@ -1,12 +1,12 @@
#pragma once
#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
#include <SDL2/SDL_blendmode.h> // Para SDL_BlendMode
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Renderer, SDL_Texture
#include <SDL2/SDL_video.h> // Para SDL_Window
#include <string> // Para basic_string, string
#include <vector> // Para vector
#include "utils.h" // Para color_t
class Asset;
class Notify;

View File

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

View File

@@ -1,7 +1,7 @@
#pragma once
#include <SDL2/SDL_rect.h> // for SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Renderer
class Texture;
// Clase sprite

View File

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

View File

@@ -1,7 +1,7 @@
#pragma once
#include <string> // for string, basic_string
#include <vector> // for vector
#include <string> // Para string, basic_string
#include <vector> // Para vector
struct options_t;
class Stats

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -1,11 +1,11 @@
#pragma once
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint8
#include <string> // for string
#include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <SDL2/SDL_stdinc.h> // Para Uint8
#include <string> // Para string
class Sprite;
class Texture;
struct color_t;
#include "utils.h"
#define TXT_COLOR 1
#define TXT_SHADOW 2
@@ -63,7 +63,7 @@ public:
void writeCentered(int x, int y, std::string text, int kerning = 1, int lenght = -1);
// Escribe texto con extras
void writeDX(Uint8 flags, int x, int y, std::string text, int kerning = 1, color_t textColor = {255, 255, 255}, Uint8 shadowDistance = 1, color_t shadowColor = {0, 0, 0}, int lenght = -1);
void writeDX(Uint8 flags, int x, int y, std::string text, int kerning = 1, color_t textColor = color_t(255, 255, 255), Uint8 shadowDistance = 1, color_t shadowColor = color_t(0, 0, 0), int lenght = -1);
// Obtiene la longitud en pixels de una cadena
int lenght(std::string text, int kerning = 1);

View File

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

View File

@@ -1,10 +1,10 @@
#pragma once
#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
#include <SDL2/SDL_blendmode.h> // Para SDL_BlendMode
#include <SDL2/SDL_rect.h> // Para SDL_Point, SDL_Rect
#include <SDL2/SDL_render.h> // Para SDL_Renderer, SDL_FLIP_NONE, SDL_TEX...
#include <SDL2/SDL_stdinc.h> // Para Uint8
#include <string> // Para basic_string, string
class Texture
{

View File

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

View File

@@ -1,8 +1,8 @@
#pragma once
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point
#include <SDL2/SDL_stdinc.h> // for Uint8, Uint32
#include <string> // for string, basic_string
#include <SDL2/SDL_rect.h> // Para SDL_Rect, SDL_Point
#include <SDL2/SDL_stdinc.h> // Para Uint8, Uint32
#include <string> // Para string, basic_string
// Estructura para definir un circulo
struct circle_t
@@ -42,6 +42,13 @@ struct color_t
Uint8 r;
Uint8 g;
Uint8 b;
// Constructor por defecto
color_t() : r(0), g(0), b(0) {}
// Constructor
color_t(Uint8 red, Uint8 green, Uint8 blue)
: r(red), g(green), b(blue) {}
};
// Tipos de paleta