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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,10 @@
#pragma once #pragma once
#include <SDL2/SDL_rect.h> // for SDL_Rect #include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer #include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <string> // for string, basic_string #include <string> // Para string, basic_string
#include <vector> // for vector #include <vector> // Para vector
#include "utils.h" // for color_t #include "utils.h" // Para color_t
class Asset; class Asset;
class Input; class Input;
class Resource; class Resource;

View File

@@ -1,5 +1,5 @@
#include "movingsprite.h" #include "movingsprite.h"
#include "texture.h" // for Texture #include "texture.h" // Para Texture
// Constructor // Constructor
MovingSprite::MovingSprite(float x, float y, int w, int h, float velx, float vely, float accelx, float accely, Texture *texture, SDL_Renderer *renderer) 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 #pragma once
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point #include <SDL2/SDL_rect.h> // Para SDL_Rect, SDL_Point
#include <SDL2/SDL_render.h> // for SDL_RendererFlip, SDL_Renderer #include <SDL2/SDL_render.h> // Para SDL_RendererFlip, SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint16 #include <SDL2/SDL_stdinc.h> // Para Uint16
#include "sprite.h" // for Sprite #include "sprite.h" // Para Sprite
class Texture; class Texture;
// Clase MovingSprite. Añade posicion y velocidad en punto flotante // Clase MovingSprite. Añade posicion y velocidad en punto flotante

View File

@@ -1,10 +1,10 @@
#include "notify.h" #include "notify.h"
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND #include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND
#include <string> // for basic_string, string, char_traits #include <string> // Para basic_string, string, char_traits
#include "jail_audio.h" // for JA_DeleteSound, JA_LoadSound, JA_Pla... #include "jail_audio.h" // Para JA_DeleteSound, JA_LoadSound, JA_Pla...
#include "sprite.h" // for Sprite #include "sprite.h" // Para Sprite
#include "text.h" // for Text #include "text.h" // Para Text
#include "texture.h" // for Texture #include "texture.h" // Para Texture
// Constructor // Constructor
Notify::Notify(SDL_Renderer *renderer, std::string iconFile, std::string bitmapFile, std::string textFile, std::string soundFile, options_t *options) 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 #pragma once
#include <SDL2/SDL_rect.h> // for SDL_Rect #include <SDL2/SDL_rect.h> // Para SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer #include <SDL2/SDL_render.h> // Para SDL_Renderer
#include <string> // for basic_string, string #include <string> // Para basic_string, string
#include <vector> // for vector #include <vector> // Para vector
#include "utils.h" // for color_t #include "utils.h" // Para color_t
class Sprite; class Sprite;
class Text; class Text;
class Texture; class Texture;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,12 +1,12 @@
#pragma once #pragma once
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point #include <SDL2/SDL_rect.h> // Para SDL_Rect, SDL_Point
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture #include <SDL2/SDL_render.h> // Para SDL_Renderer, SDL_Texture
#include <string> // for string, basic_string #include <string> // Para string, basic_string
#include <vector> // for vector #include <vector> // Para vector
#include "enemy.h" // for enemy_t #include "enemy.h" // Para enemy_t
#include "item.h" // for item_t #include "item.h" // Para item_t
#include "utils.h" // for h_line_t, color_t, d_line_t, v_line_t #include "utils.h" // Para h_line_t, color_t, d_line_t, v_line_t
class Asset; class Asset;
class Debug; class Debug;
class ItemTracker; class ItemTracker;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,8 +1,8 @@
#pragma once #pragma once
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point #include <SDL2/SDL_rect.h> // Para SDL_Rect, SDL_Point
#include <SDL2/SDL_stdinc.h> // for Uint8, Uint32 #include <SDL2/SDL_stdinc.h> // Para Uint8, Uint32
#include <string> // for string, basic_string #include <string> // Para string, basic_string
// Estructura para definir un circulo // Estructura para definir un circulo
struct circle_t struct circle_t
@@ -42,6 +42,13 @@ struct color_t
Uint8 r; Uint8 r;
Uint8 g; Uint8 g;
Uint8 b; 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 // Tipos de paleta