Pasaeta de include-what-you-use

Afegit fitxer CMakeLists.txt
This commit is contained in:
2025-02-21 12:02:39 +01:00
parent a08da3b983
commit 788aec0dab
50 changed files with 385 additions and 196 deletions

1
.gitignore vendored
View File

@@ -17,3 +17,4 @@ SDL2.dll
libwinpthread-1.dll libwinpthread-1.dll
libstdc++-6.dll libstdc++-6.dll
libgcc_s_seh-1.dll libgcc_s_seh-1.dll
linux_utils/

View File

@@ -1,4 +1,8 @@
#include "animatedsprite.h" #include "animatedsprite.h"
#include <fstream> // for basic_ostream, operator<<, basic_istream, basic...
#include <iostream> // for cout
#include <sstream> // for basic_stringstream
#include "texture.h" // for Texture
// Carga la animación desde un fichero // 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,12 +1,12 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_rect.h> // for SDL_Rect
#include "movingsprite.h" #include <SDL2/SDL_render.h> // for SDL_Renderer
#include <fstream> #include <SDL2/SDL_stdinc.h> // for Uint8
#include <iostream> #include <string> // for string, basic_string
#include <sstream> #include <vector> // for vector
#include <string> #include "movingsprite.h" // for MovingSprite
#include <vector> class Texture;
struct animation_t struct animation_t
{ {

View File

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

View File

@@ -1,8 +1,7 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <string> // for string, basic_string
#include <string> #include <vector> // for vector
#include <vector>
enum assetType enum assetType
{ {

View File

@@ -1,5 +1,11 @@
#include "const.h"
#include "balloon.h" #include "balloon.h"
#include <bits/std_abs.h> // for abs
#include <math.h> // for abs
#include "animatedsprite.h" // for AnimatedSprite
#include "const.h" // for PLAY_AREA_LEFT, PLAY_AREA_RIGHT, PLAY_AR...
#include "movingsprite.h" // for MovingSprite
#include "sprite.h" // for Sprite
#include "texture.h" // for Texture
// Constructor // Constructor
Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 creationtimer, Texture *texture, std::vector<std::string> *animation, SDL_Renderer *renderer) Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 creationtimer, Texture *texture, std::vector<std::string> *animation, SDL_Renderer *renderer)

View File

@@ -1,10 +1,12 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_render.h> // for SDL_Renderer
#include "animatedsprite.h" #include <SDL2/SDL_stdinc.h> // for Uint8, Uint16, Uint32
#include "utils.h" #include <string> // for string
#include <sstream> #include <vector> // for vector
#include <vector> #include "utils.h" // for circle_t
class AnimatedSprite;
class Texture;
// Cantidad de elementos del vector con los valores de la deformación del globo al rebotar // Cantidad de elementos del vector con los valores de la deformación del globo al rebotar
#define MAX_BOUNCE 10 #define MAX_BOUNCE 10

View File

@@ -1,5 +1,7 @@
#include "const.h"
#include "bullet.h" #include "bullet.h"
#include "const.h" // for NO_KIND, PLAY_AREA_LEFT, PLAY_AREA_RIGHT, PLAY_A...
#include "sprite.h" // for Sprite
class Texture;
// Constructor // Constructor
Bullet::Bullet(int x, int y, int kind, bool poweredUp, int owner, Texture *texture, SDL_Renderer *renderer) Bullet::Bullet(int x, int y, int kind, bool poweredUp, int owner, Texture *texture, SDL_Renderer *renderer)

View File

@@ -1,8 +1,10 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_render.h> // for SDL_Renderer
#include "sprite.h" #include <SDL2/SDL_stdinc.h> // for Uint8
#include "utils.h" #include "utils.h" // for circle_t
class Sprite;
class Texture;
// Tipos de bala // Tipos de bala
#define BULLET_UP 1 #define BULLET_UP 1

View File

@@ -1,11 +1,34 @@
#include "utils.h"
#include "const.h"
#include "director.h" #include "director.h"
#include <iostream> #include <SDL2/SDL.h> // for SDL_Init, SDL_Quit, SDL_INIT_EV...
#include <fstream> #include <SDL2/SDL_audio.h> // for AUDIO_S16
#include <string> #include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
#include <sys/stat.h> #include <SDL2/SDL_error.h> // for SDL_GetError
#include <unistd.h> #include <SDL2/SDL_gamecontroller.h> // for SDL_CONTROLLER_BUTTON_B, SDL_CO...
#include <SDL2/SDL_hints.h> // for SDL_SetHint, SDL_HINT_RENDER_SC...
#include <SDL2/SDL_scancode.h> // for SDL_SCANCODE_ESCAPE, SDL_SCANCO...
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <errno.h> // for errno, EEXIST, EACCES, ENAMETOO...
#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_ostream, operator<<, basi...
#include <iostream> // for cout
#include <string> // for basic_string, operator+, char_t...
#include <vector> // for vector
#include "asset.h" // for Asset, assetType
#include "const.h" // for SECTION_PROG_LOGO, GAMECANVAS_H...
#include "game.h" // for Game
#include "input.h" // for Input, inputs_e, INPUT_USE_GAME...
#include "intro.h" // for Intro
#include "jail_audio.h" // for JA_Init
#include "lang.h" // for Lang, MAX_LANGUAGES, ba_BA, en_UK
#include "logo.h" // for Logo
#include "screen.h" // for FILTER_NEAREST, Screen, FILTER_...
#include "title.h" // for Title
#include "utils.h" // for options_t, input_t, boolToString
#ifndef _WIN32 #ifndef _WIN32
#include <pwd.h> #include <pwd.h>

View File

@@ -1,27 +1,18 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_render.h> // for SDL_Renderer
#include "balloon.h" #include <SDL2/SDL_video.h> // for SDL_Window
#include "bullet.h" #include <string> // for string, basic_string
#include "asset.h" class Asset;
#include "input.h" class Game;
#include "jail_audio.h" class Input;
#include "menu.h" class Intro;
#include "movingsprite.h" class Lang;
#include "screen.h" class Logo;
#include "smartsprite.h" class Screen;
#include "sprite.h" class Title;
#include "text.h" struct options_t;
#include "utils.h" struct section_t;
#include "writer.h"
#include "const.h"
#include "fade.h"
#include "game.h"
#include "intro.h"
#include "item.h"
#include "logo.h"
#include "player.h"
#include "title.h"
// Textos // Textos
#define WINDOW_CAPTION "Coffee Crisis" #define WINDOW_CAPTION "Coffee Crisis"

View File

@@ -1,6 +1,10 @@
#include "fade.h" #include "fade.h"
#include "const.h" #include <SDL2/SDL_error.h> // for SDL_GetError
#include <iostream> #include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_timer.h> // for SDL_Delay
#include <stdlib.h> // for rand
#include <iostream> // for char_traits, basic_ostream, operator<<
#include "const.h" // for GAMECANVAS_HEIGHT, GAMECANVAS_WIDTH
// Constructor // Constructor
Fade::Fade(SDL_Renderer *renderer) Fade::Fade(SDL_Renderer *renderer)

View File

@@ -1,7 +1,8 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_rect.h> // for SDL_Rect
#include "texture.h" #include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // for Uint8, Uint16
// Tipos de fundido // Tipos de fundido
#define FADE_FULLSCREEN 0 #define FADE_FULLSCREEN 0

View File

@@ -1,4 +1,30 @@
#include "game.h" #include "game.h"
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_rwops.h> // for SDL_RWFromFile, SDL_RWclose, SDL_RWwrite
#include <SDL2/SDL_timer.h> // for SDL_GetTicks, SDL_Delay
#include <SDL2/SDL_video.h> // for SDL_WINDOWEVENT_FOCUS_LOST
#include <stdlib.h> // for rand
#include <algorithm> // for max, min
#include <fstream> // for basic_ifstream
#include <iostream> // for basic_ostream, char_traits, operator<<
#include "asset.h" // for Asset
#include "balloon.h" // for Balloon, BALLOON_VELX_NEGATIVE, BALLOON_...
#include "bullet.h" // for Bullet, BULLET_LEFT, BULLET_RIGHT, BULLE...
#include "const.h" // for PLAY_AREA_CENTER_X, BLOCK, PLAY_AREA_CEN...
#include "fade.h" // for Fade, FADE_CENTER
#include "input.h" // for inputs_e, Input, REPEAT_TRUE, REPEAT_FALSE
#include "item.h" // for Item, ITEM_COFFEE_MACHINE, ITEM_CLOCK
#include "jail_audio.h" // for JA_PlaySound, JA_DeleteSound, JA_LoadSound
#include "lang.h" // for Lang
#include "menu.h" // for Menu
#include "movingsprite.h" // for MovingSprite
#include "player.h" // for Player, DEATH_COUNTER
#include "screen.h" // for Screen
#include "smartsprite.h" // for SmartSprite
#include "sprite.h" // for Sprite
#include "text.h" // for Text, TXT_CENTER
#include "texture.h" // for Texture
struct JA_Sound_t;
// Constructor // Constructor
Game::Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *screen, Asset *asset, Lang *lang, Input *input, bool demo, options_t *options, section_t *section) Game::Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *screen, Asset *asset, Lang *lang, Input *input, bool demo, options_t *options, section_t *section)

View File

@@ -1,24 +1,29 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_events.h> // for SDL_Event
#include "balloon.h" #include <SDL2/SDL_rect.h> // for SDL_Rect
#include "bullet.h" #include <SDL2/SDL_render.h> // for SDL_Renderer
#include "asset.h" #include <SDL2/SDL_stdinc.h> // for Uint8, Uint16, Uint32
#include "input.h" #include <string> // for string, basic_string
#include "jail_audio.h" #include <vector> // for vector
#include "menu.h" #include "utils.h" // for demoKeys_t, color_t
#include "movingsprite.h" class Asset;
#include "screen.h" class Balloon;
#include "smartsprite.h" class Bullet;
#include "sprite.h" class Fade;
#include "text.h" class Input;
#include "utils.h" class Item;
#include "writer.h" class Lang;
#include "const.h" class Menu;
#include "fade.h" class MovingSprite;
#include "item.h" class Player;
#include "player.h" class Screen;
#include <iostream> class SmartSprite;
class Sprite;
class Text;
class Texture;
struct JA_Music_t;
struct JA_Sound_t;
// Cantidad de elementos a escribir en los ficheros de datos // Cantidad de elementos a escribir en los ficheros de datos
#define TOTAL_SCORE_DATA 3 #define TOTAL_SCORE_DATA 3

View File

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

View File

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

View File

@@ -1,5 +1,21 @@
#include "instructions.h" #include "instructions.h"
#include <iostream> #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 max
#include <iostream> // for char_traits, basic_ostream, operator<<
#include <string> // for basic_string
#include "asset.h" // for Asset
#include "const.h" // for shdwTxtColor, GAMECANVAS_CENTER_X, GAME...
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // for JA_StopMusic
#include "lang.h" // for Lang
#include "screen.h" // for Screen
#include "sprite.h" // for Sprite
#include "text.h" // for Text, TXT_CENTER, TXT_COLOR, TXT_SHADOW
#include "texture.h" // for Texture
#include "utils.h" // for color_t, section_t
const Uint8 SELF = 0; const Uint8 SELF = 0;

View File

@@ -1,14 +1,17 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_events.h> // for SDL_Event
#include "asset.h" #include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include "input.h" #include <SDL2/SDL_stdinc.h> // for Uint16, Uint32
#include "jail_audio.h" #include <vector> // for vector
#include "screen.h" class Asset;
#include "sprite.h" class Input;
#include "text.h" class Lang;
#include "utils.h" class Screen;
#include "const.h" class Sprite;
class Text;
class Texture;
struct section_t;
enum mode_e enum mode_e
{ {

View File

@@ -1,4 +1,17 @@
#include "intro.h" #include "intro.h"
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <string> // for basic_string
#include "asset.h" // for Asset
#include "const.h" // for GAMECANVAS_CENTER_X, GAMECANVAS_FIRST_QU...
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // for JA_StopMusic, JA_DeleteMusic, JA_LoadMusic
#include "lang.h" // for Lang
#include "screen.h" // for Screen
#include "smartsprite.h" // for SmartSprite
#include "text.h" // for Text
#include "texture.h" // for Texture
#include "utils.h" // for section_t, color_t
#include "writer.h" // for Writer
// Constructor // Constructor
Intro::Intro(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input, Lang *lang, section_t *section) Intro::Intro(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input, Lang *lang, section_t *section)

View File

@@ -1,15 +1,19 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_events.h> // for SDL_Event
#include "asset.h" #include <SDL2/SDL_render.h> // for SDL_Renderer
#include "input.h" #include <SDL2/SDL_stdinc.h> // for Uint32, Uint8
#include "jail_audio.h" #include <vector> // for vector
#include "screen.h" class Asset;
#include "smartsprite.h" class Input;
#include "utils.h" class Lang;
#include "writer.h" class Screen;
#include "const.h" class SmartSprite;
#include <vector> class Text;
class Texture;
class Writer;
struct JA_Music_t;
struct section_t;
#ifndef INTRO_H #ifndef INTRO_H
#define INTRO_H #define INTRO_H

View File

@@ -1,5 +1,8 @@
#include "const.h"
#include "item.h" #include "item.h"
#include <stdlib.h> // for rand
#include "animatedsprite.h" // for AnimatedSprite
#include "const.h" // for PLAY_AREA_LEFT, PLAY_AREA_RIGHT, PLAY_AR...
class Texture;
// Constructor // Constructor
Item::Item(Uint8 kind, float x, float y, Texture *texture, std::vector<std::string> *animation, SDL_Renderer *renderer) Item::Item(Uint8 kind, float x, float y, Texture *texture, std::vector<std::string> *animation, SDL_Renderer *renderer)

View File

@@ -1,8 +1,12 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_render.h> // for SDL_Renderer
#include "animatedsprite.h" #include <SDL2/SDL_stdinc.h> // for Uint8, Uint16
#include "utils.h" #include <string> // for string
#include <vector> // for vector
#include "utils.h" // for circle_t
class AnimatedSprite;
class Texture;
// Tipos de objetos // Tipos de objetos
#define ITEM_POINTS_1_DISK 1 #define ITEM_POINTS_1_DISK 1

View File

@@ -1,6 +1,6 @@
#include "lang.h" #include "lang.h"
#include <iostream> #include <fstream> // for basic_ifstream, basic_istream, ifstream
#include <fstream> #include "asset.h" // for Asset
// Constructor // Constructor
Lang::Lang(Asset *mAsset) Lang::Lang(Asset *mAsset)

View File

@@ -1,8 +1,8 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_stdinc.h> // for Uint8
#include "asset.h" #include <string> // for string, basic_string
#include <string> class Asset;
// Códigos de idioma // Códigos de idioma
#define es_ES 0 #define es_ES 0

View File

@@ -1,4 +1,15 @@
#include "logo.h" #include "logo.h"
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <algorithm> // for min
#include <string> // for basic_string
#include "asset.h" // for Asset
#include "const.h" // for bgColor, SECTION_PROG_LOGO, SECTION_PROG...
#include "input.h" // for Input, REPEAT_FALSE, inputs_e
#include "jail_audio.h" // for JA_StopMusic
#include "screen.h" // for Screen
#include "sprite.h" // for Sprite
#include "texture.h" // for Texture
#include "utils.h" // for section_t, color_t
#define INIT_FADE 100 #define INIT_FADE 100
#define END_LOGO 200 #define END_LOGO 200

View File

@@ -1,13 +1,14 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_events.h> // for SDL_Event
#include "asset.h" #include <SDL2/SDL_render.h> // for SDL_Renderer
#include "input.h" #include <SDL2/SDL_stdinc.h> // for Uint32
#include "jail_audio.h" class Asset;
#include "screen.h" class Input;
#include "sprite.h" class Screen;
#include "utils.h" class Sprite;
#include "const.h" class Texture;
struct section_t;
// Clase Logo // Clase Logo
class Logo class Logo

View File

@@ -39,8 +39,8 @@ Reescribiendo el código el 27/09/2022
*/ */
#include "director.h" #include <iostream> // for char_traits, basic_ostream, operator<<, endl
#include <stdio.h> #include "director.h" // for Director
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {

View File

@@ -1,6 +1,11 @@
#include "const.h"
#include "menu.h" #include "menu.h"
#include <iostream> #include <algorithm> // for max, min
#include <fstream> // for char_traits, basic_ifstream, basic_istream
#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 "text.h" // for Text
// Constructor // Constructor
Menu::Menu(SDL_Renderer *renderer, Asset *asset, Input *input, std::string file) Menu::Menu(SDL_Renderer *renderer, Asset *asset, Input *input, std::string file)

View File

@@ -1,15 +1,14 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_rect.h> // for SDL_Rect
#include "asset.h" #include <SDL2/SDL_render.h> // for SDL_Renderer
#include "input.h" #include <string> // for string, basic_string
#include "jail_audio.h" #include <vector> // for vector
#include "sprite.h" #include "utils.h" // for color_t
#include "text.h" class Asset;
#include "utils.h" class Input;
#include <fstream> class Text;
#include <sstream> struct JA_Sound_t;
#include <vector>
// Tipos de fondos para el menu // Tipos de fondos para el menu
#define MENU_BACKGROUND_TRANSPARENT 0 #define MENU_BACKGROUND_TRANSPARENT 0

View File

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

View File

@@ -1,5 +1,9 @@
#include "const.h"
#include "player.h" #include "player.h"
#include <stdlib.h> // for rand
#include "animatedsprite.h" // for AnimatedSprite
#include "const.h" // for PLAY_AREA_LEFT, PLAY_AREA_RIGHT
#include "input.h" // for inputs_e
#include "texture.h" // for Texture
// Constructor // Constructor
Player::Player(float x, int y, SDL_Renderer *renderer, std::vector<Texture *> texture, std::vector<std::vector<std::string> *> animations) Player::Player(float x, int y, SDL_Renderer *renderer, std::vector<Texture *> texture, std::vector<std::vector<std::string> *> animations)

View File

@@ -1,11 +1,12 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_render.h> // for SDL_Renderer
#include "animatedsprite.h" #include <SDL2/SDL_stdinc.h> // for Uint8, Uint16, Uint32
#include "asset.h" #include <string> // for string
#include "input.h" #include <vector> // for vector
#include "texture.h" #include "utils.h" // for circle_t
#include "utils.h" class AnimatedSprite;
class Texture;
// Contadores // Contadores
#define DEATH_COUNTER 350 #define DEATH_COUNTER 350

View File

@@ -1,6 +1,12 @@
#include "screen.h" #include "screen.h"
#include <string> #include <SDL2/SDL_error.h> // for SDL_GetError
#include <iostream> #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 <iostream> // for basic_ostream, operator<<, cout, endl
#include <string> // for basic_string, char_traits, string
class Asset;
// 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,10 +1,12 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_blendmode.h> // for SDL_BlendMode
#include "asset.h" #include <SDL2/SDL_rect.h> // for SDL_Rect
#include "utils.h" #include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include "const.h" #include <SDL2/SDL_video.h> // for SDL_Window
#include <vector> #include <vector> // for vector
#include "utils.h" // for color_t
class Asset;
#define FILTER_NEAREST 0 #define FILTER_NEAREST 0
#define FILTER_LINEAL 1 #define FILTER_LINEAL 1

View File

@@ -1,4 +1,6 @@
#include "smartsprite.h" #include "smartsprite.h"
#include "movingsprite.h" // for MovingSprite
class Texture;
// Constructor // Constructor
SmartSprite::SmartSprite(Texture *texture, SDL_Renderer *renderer) SmartSprite::SmartSprite(Texture *texture, SDL_Renderer *renderer)

View File

@@ -1,9 +1,8 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_render.h> // for SDL_Renderer
#include "animatedsprite.h" #include "animatedsprite.h" // for AnimatedSprite
#include "utils.h" class Texture;
#include <vector>
// Clase SmartSprite // Clase SmartSprite
class SmartSprite : public AnimatedSprite class SmartSprite : public AnimatedSprite

View File

@@ -1,4 +1,5 @@
#include "sprite.h" #include "sprite.h"
#include "texture.h" // for 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,8 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_rect.h> // for SDL_Rect
#include "texture.h" #include <SDL2/SDL_render.h> // for SDL_Renderer
class Texture;
// Clase sprite // Clase sprite
class Sprite class Sprite

View File

@@ -1,7 +1,10 @@
#include "text.h" #include "text.h"
#include <iostream> #include <fstream> // for char_traits, basic_ostream, basic_ifstream, ope...
#include <fstream> #include <iostream> // for cout
#include "sprite.h" // for Sprite
#include "texture.h" // for Texture
#include "utils.h" // for color_t
// Llena una estructuta textFile_t desde un fichero // 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,6 +1,10 @@
#pragma once #pragma once
#include "sprite.h" #include <SDL2/SDL_render.h> // for SDL_Renderer
#include <SDL2/SDL_stdinc.h> // for Uint8
#include <string> // for string
class Sprite;
class Texture;
#include "utils.h" #include "utils.h"
#define TXT_COLOR 1 #define TXT_COLOR 1
@@ -61,7 +65,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,8 +1,13 @@
#include "texture.h" #include "texture.h"
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_log.h> // for SDL_Log
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGB24, SDL_PIXELFORMAT...
#include <SDL2/SDL_surface.h> // for SDL_CreateRGBSurfaceWithFormatFrom
#include <stdlib.h> // for exit
#include <iostream> // for basic_ostream, operator<<, cout, endl
#define STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h" #include "stb_image.h" // for stbi_failure_reason, stbi_image_free
#include <iostream>
// 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,8 +1,10 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_blendmode.h> // for SDL_BlendMode
#include <stdio.h> #include <SDL2/SDL_rect.h> // for SDL_Point, SDL_Rect
#include <string> #include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_FLIP_NONE, SDL_TEX...
#include <SDL2/SDL_stdinc.h> // for Uint8
#include <string> // for basic_string, string
class Texture class Texture
{ {

View File

@@ -1,4 +1,25 @@
#include "title.h" #include "title.h"
#include <SDL2/SDL_error.h> // for SDL_GetError
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
#include <SDL2/SDL_video.h> // for SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLS...
#include <stdlib.h> // for rand
#include <iostream> // for basic_ostream, operator<<, basic_ostrea...
#include <string> // for basic_string, operator+, char_traits
#include "animatedsprite.h" // for AnimatedSprite
#include "asset.h" // for Asset
#include "const.h" // for GAMECANVAS_CENTER_X, SECTION_PROG_QUIT
#include "fade.h" // for Fade
#include "game.h" // for Game
#include "input.h" // for Input, INPUT_USE_GAMECONTROLLER, INPUT_...
#include "jail_audio.h" // for JA_StopMusic, JA_GetMusicState, JA_Play...
#include "lang.h" // for Lang, ba_BA, en_UK, es_ES
#include "menu.h" // for Menu
#include "screen.h" // for Screen, FILTER_LINEAL, FILTER_NEAREST
#include "smartsprite.h" // for SmartSprite
#include "sprite.h" // for Sprite
#include "text.h" // for Text, TXT_CENTER, TXT_SHADOW
#include "texture.h" // for Texture
// Constructor // Constructor
Title::Title(SDL_Renderer *renderer, Screen *screen, Input *input, Asset *asset, options_t *options, Lang *lang, section_t *section) Title::Title(SDL_Renderer *renderer, Screen *screen, Input *input, Asset *asset, options_t *options, Lang *lang, section_t *section)

View File

@@ -1,21 +1,26 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_events.h> // for SDL_Event
#include "asset.h" #include <SDL2/SDL_rect.h> // for SDL_Rect
#include "input.h" #include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include "jail_audio.h" #include <SDL2/SDL_stdinc.h> // for Uint32, Uint8
#include "menu.h" #include <vector> // for vector
#include "movingsprite.h" #include "instructions.h" // for mode_e
#include "screen.h" #include "utils.h" // for input_t, options_t, section_t
#include "smartsprite.h" class AnimatedSprite;
#include "sprite.h" class Asset;
#include "text.h" class Fade;
#include "utils.h" class Game;
#include "const.h" class Input;
#include "fade.h" class Lang;
#include "game.h" class Menu;
#include "instructions.h" class Screen;
#include "item.h" class SmartSprite;
class Sprite;
class Text;
class Texture;
struct JA_Music_t;
struct JA_Sound_t;
// Textos // Textos
#define TEXT_COPYRIGHT "@2020,2023 JailDesigner (v2.3.1)" #define TEXT_COPYRIGHT "@2020,2023 JailDesigner (v2.3.1)"

View File

@@ -1,5 +1,6 @@
#include "utils.h" #include "utils.h"
#include <math.h> #include <stdlib.h> // for abs, free, malloc
#include <cmath> // for 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,9 +1,9 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point
#include "texture.h" #include <SDL2/SDL_stdinc.h> // for Uint8, Uint32
#include <string> #include <string> // for string, basic_string
#include <vector> #include <vector> // for vector
// Dificultad del juego // Dificultad del juego
#define DIFFICULTY_EASY 0 #define DIFFICULTY_EASY 0
@@ -49,9 +49,12 @@ struct line_t
// Estructura para definir un color // Estructura para definir un color
struct color_t struct color_t
{ {
Uint8 r; Uint8 r;
Uint8 g; Uint8 g;
Uint8 b; Uint8 b;
color_t() : r(0), g(0), b(0) {} // Constructor por defecto
color_t(Uint8 red, Uint8 green, Uint8 blue) : r(red), g(green), b(blue) {}
}; };
// Tipos de paleta // Tipos de paleta
@@ -61,16 +64,6 @@ enum palette_e
p_zxarne p_zxarne
}; };
// Posiciones de las notificaciones
enum not_pos_e
{
pos_top,
pos_bottom,
pos_left,
pos_middle,
pos_right
};
// Estructura para saber la seccion y subseccion del programa // Estructura para saber la seccion y subseccion del programa
struct section_t struct section_t
{ {

View File

@@ -1,4 +1,5 @@
#include "writer.h" #include "writer.h"
#include "text.h" // for Text
// Constructor // Constructor
Writer::Writer(Text *text) Writer::Writer(Text *text)

View File

@@ -1,8 +1,7 @@
#pragma once #pragma once
#include <SDL2/SDL.h> #include <string> // for string, basic_string
#include "sprite.h" class Text;
#include "text.h"
// Clase Writer. Pinta texto en pantalla letra a letra a partir de una cadena y un bitmap // Clase Writer. Pinta texto en pantalla letra a letra a partir de una cadena y un bitmap
class Writer class Writer