Pasaeta de include-what-you-use
Afegit fitxer CMakeLists.txt
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
#include "animatedsprite.h"
|
||||
#include <fstream> // for basic_ostream, operator<<, basic_istream, basic...
|
||||
#include <iostream> // for cout
|
||||
#include <sstream> // for basic_stringstream
|
||||
#include "texture.h" // for Texture
|
||||
|
||||
// Carga la animación desde un fichero
|
||||
animatedSprite_t loadAnimationFromFile(Texture *texture, std::string filePath, bool verbose)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "movingsprite.h"
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#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, basic_string
|
||||
#include <vector> // for vector
|
||||
#include "movingsprite.h" // for MovingSprite
|
||||
class Texture;
|
||||
|
||||
struct animation_t
|
||||
{
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "asset.h"
|
||||
#include <iostream>
|
||||
#include <SDL2/SDL_rwops.h> // for SDL_RWFromFile, SDL_RWclose, SDL_RWops
|
||||
#include <SDL2/SDL_stdinc.h> // for SDL_max
|
||||
#include <stddef.h> // for size_t
|
||||
#include <iostream> // for basic_ostream, operator<<, cout, endl
|
||||
|
||||
// Constructor
|
||||
Asset::Asset(std::string executablePath)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <string> // for string, basic_string
|
||||
#include <vector> // for vector
|
||||
|
||||
enum assetType
|
||||
{
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
#include "const.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
|
||||
Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 creationtimer, Texture *texture, std::vector<std::string> *animation, SDL_Renderer *renderer)
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "animatedsprite.h"
|
||||
#include "utils.h"
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint8, Uint16, Uint32
|
||||
#include <string> // for string
|
||||
#include <vector> // for 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
|
||||
#define MAX_BOUNCE 10
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "const.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
|
||||
Bullet::Bullet(int x, int y, int kind, bool poweredUp, int owner, Texture *texture, SDL_Renderer *renderer)
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "sprite.h"
|
||||
#include "utils.h"
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint8
|
||||
#include "utils.h" // for circle_t
|
||||
class Sprite;
|
||||
class Texture;
|
||||
|
||||
// Tipos de bala
|
||||
#define BULLET_UP 1
|
||||
|
||||
@@ -1,11 +1,34 @@
|
||||
#include "utils.h"
|
||||
#include "const.h"
|
||||
#include "director.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <SDL2/SDL.h> // for SDL_Init, SDL_Quit, SDL_INIT_EV...
|
||||
#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_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
|
||||
#include <pwd.h>
|
||||
|
||||
@@ -1,27 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "balloon.h"
|
||||
#include "bullet.h"
|
||||
#include "asset.h"
|
||||
#include "input.h"
|
||||
#include "jail_audio.h"
|
||||
#include "menu.h"
|
||||
#include "movingsprite.h"
|
||||
#include "screen.h"
|
||||
#include "smartsprite.h"
|
||||
#include "sprite.h"
|
||||
#include "text.h"
|
||||
#include "utils.h"
|
||||
#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"
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_video.h> // for SDL_Window
|
||||
#include <string> // for string, basic_string
|
||||
class Asset;
|
||||
class Game;
|
||||
class Input;
|
||||
class Intro;
|
||||
class Lang;
|
||||
class Logo;
|
||||
class Screen;
|
||||
class Title;
|
||||
struct options_t;
|
||||
struct section_t;
|
||||
|
||||
// Textos
|
||||
#define WINDOW_CAPTION "Coffee Crisis"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#include "fade.h"
|
||||
#include "const.h"
|
||||
#include <iostream>
|
||||
#include <SDL2/SDL_error.h> // for SDL_GetError
|
||||
#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
|
||||
Fade::Fade(SDL_Renderer *renderer)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "texture.h"
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint8, Uint16
|
||||
|
||||
// Tipos de fundido
|
||||
#define FADE_FULLSCREEN 0
|
||||
|
||||
@@ -1,4 +1,30 @@
|
||||
#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
|
||||
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)
|
||||
|
||||
@@ -1,24 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "balloon.h"
|
||||
#include "bullet.h"
|
||||
#include "asset.h"
|
||||
#include "input.h"
|
||||
#include "jail_audio.h"
|
||||
#include "menu.h"
|
||||
#include "movingsprite.h"
|
||||
#include "screen.h"
|
||||
#include "smartsprite.h"
|
||||
#include "sprite.h"
|
||||
#include "text.h"
|
||||
#include "utils.h"
|
||||
#include "writer.h"
|
||||
#include "const.h"
|
||||
#include "fade.h"
|
||||
#include "item.h"
|
||||
#include "player.h"
|
||||
#include <iostream>
|
||||
#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 Uint8, Uint16, Uint32
|
||||
#include <string> // for string, basic_string
|
||||
#include <vector> // for vector
|
||||
#include "utils.h" // for demoKeys_t, color_t
|
||||
class Asset;
|
||||
class Balloon;
|
||||
class Bullet;
|
||||
class Fade;
|
||||
class Input;
|
||||
class Item;
|
||||
class Lang;
|
||||
class Menu;
|
||||
class MovingSprite;
|
||||
class Player;
|
||||
class Screen;
|
||||
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
|
||||
#define TOTAL_SCORE_DATA 3
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
#include "input.h"
|
||||
#include <iostream>
|
||||
#include <SDL2/SDL.h> // for SDL_INIT_GAMECONTROLLER, SDL_InitSubS...
|
||||
#include <SDL2/SDL_error.h> // for SDL_GetError
|
||||
#include <SDL2/SDL_events.h> // for SDL_ENABLE
|
||||
#include <SDL2/SDL_joystick.h> // for SDL_NumJoysticks
|
||||
#include <SDL2/SDL_keyboard.h> // for SDL_GetKeyboardState
|
||||
#include <iostream> // for basic_ostream, operator<<, cout, basi...
|
||||
|
||||
// Constructor
|
||||
Input::Input(std::string file)
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <SDL2/SDL_gamecontroller.h> // for SDL_GameControllerButton, SDL_G...
|
||||
#include <SDL2/SDL_scancode.h> // for SDL_Scancode
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint8
|
||||
#include <string> // for string, basic_string
|
||||
#include <vector> // for vector
|
||||
|
||||
enum inputs_e
|
||||
{
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
#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;
|
||||
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "asset.h"
|
||||
#include "input.h"
|
||||
#include "jail_audio.h"
|
||||
#include "screen.h"
|
||||
#include "sprite.h"
|
||||
#include "text.h"
|
||||
#include "utils.h"
|
||||
#include "const.h"
|
||||
#include <SDL2/SDL_events.h> // for SDL_Event
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint16, Uint32
|
||||
#include <vector> // for vector
|
||||
class Asset;
|
||||
class Input;
|
||||
class Lang;
|
||||
class Screen;
|
||||
class Sprite;
|
||||
class Text;
|
||||
class Texture;
|
||||
struct section_t;
|
||||
|
||||
enum mode_e
|
||||
{
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
#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
|
||||
Intro::Intro(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input, Lang *lang, section_t *section)
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "asset.h"
|
||||
#include "input.h"
|
||||
#include "jail_audio.h"
|
||||
#include "screen.h"
|
||||
#include "smartsprite.h"
|
||||
#include "utils.h"
|
||||
#include "writer.h"
|
||||
#include "const.h"
|
||||
#include <vector>
|
||||
#include <SDL2/SDL_events.h> // for SDL_Event
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32, Uint8
|
||||
#include <vector> // for vector
|
||||
class Asset;
|
||||
class Input;
|
||||
class Lang;
|
||||
class Screen;
|
||||
class SmartSprite;
|
||||
class Text;
|
||||
class Texture;
|
||||
class Writer;
|
||||
struct JA_Music_t;
|
||||
struct section_t;
|
||||
|
||||
#ifndef INTRO_H
|
||||
#define INTRO_H
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "const.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
|
||||
Item::Item(Uint8 kind, float x, float y, Texture *texture, std::vector<std::string> *animation, SDL_Renderer *renderer)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "animatedsprite.h"
|
||||
#include "utils.h"
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint8, Uint16
|
||||
#include <string> // for string
|
||||
#include <vector> // for vector
|
||||
#include "utils.h" // for circle_t
|
||||
class AnimatedSprite;
|
||||
class Texture;
|
||||
|
||||
// Tipos de objetos
|
||||
#define ITEM_POINTS_1_DISK 1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "lang.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <fstream> // for basic_ifstream, basic_istream, ifstream
|
||||
#include "asset.h" // for Asset
|
||||
|
||||
// Constructor
|
||||
Lang::Lang(Asset *mAsset)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "asset.h"
|
||||
#include <string>
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint8
|
||||
#include <string> // for string, basic_string
|
||||
class Asset;
|
||||
|
||||
// Códigos de idioma
|
||||
#define es_ES 0
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
#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 END_LOGO 200
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "asset.h"
|
||||
#include "input.h"
|
||||
#include "jail_audio.h"
|
||||
#include "screen.h"
|
||||
#include "sprite.h"
|
||||
#include "utils.h"
|
||||
#include "const.h"
|
||||
#include <SDL2/SDL_events.h> // for SDL_Event
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
class Asset;
|
||||
class Input;
|
||||
class Screen;
|
||||
class Sprite;
|
||||
class Texture;
|
||||
struct section_t;
|
||||
|
||||
// Clase Logo
|
||||
class Logo
|
||||
|
||||
@@ -39,8 +39,8 @@ Reescribiendo el código el 27/09/2022
|
||||
|
||||
*/
|
||||
|
||||
#include "director.h"
|
||||
#include <stdio.h>
|
||||
#include <iostream> // for char_traits, basic_ostream, operator<<, endl
|
||||
#include "director.h" // for Director
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#include "const.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
|
||||
Menu::Menu(SDL_Renderer *renderer, Asset *asset, Input *input, std::string file)
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "asset.h"
|
||||
#include "input.h"
|
||||
#include "jail_audio.h"
|
||||
#include "sprite.h"
|
||||
#include "text.h"
|
||||
#include "utils.h"
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <string> // for string, basic_string
|
||||
#include <vector> // for vector
|
||||
#include "utils.h" // for color_t
|
||||
class Asset;
|
||||
class Input;
|
||||
class Text;
|
||||
struct JA_Sound_t;
|
||||
|
||||
// Tipos de fondos para el menu
|
||||
#define MENU_BACKGROUND_TRANSPARENT 0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "movingsprite.h"
|
||||
#include "texture.h" // for Texture
|
||||
|
||||
// Constructor
|
||||
MovingSprite::MovingSprite(float x, float y, int w, int h, float velx, float vely, float accelx, float accely, Texture *texture, SDL_Renderer *renderer)
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "sprite.h"
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point
|
||||
#include <SDL2/SDL_render.h> // for SDL_RendererFlip, SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint16
|
||||
#include "sprite.h" // for Sprite
|
||||
class Texture;
|
||||
|
||||
// Clase MovingSprite. Añade posicion y velocidad en punto flotante
|
||||
class MovingSprite : public Sprite
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#include "const.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
|
||||
Player::Player(float x, int y, SDL_Renderer *renderer, std::vector<Texture *> texture, std::vector<std::vector<std::string> *> animations)
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "animatedsprite.h"
|
||||
#include "asset.h"
|
||||
#include "input.h"
|
||||
#include "texture.h"
|
||||
#include "utils.h"
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint8, Uint16, Uint32
|
||||
#include <string> // for string
|
||||
#include <vector> // for vector
|
||||
#include "utils.h" // for circle_t
|
||||
class AnimatedSprite;
|
||||
class Texture;
|
||||
|
||||
// Contadores
|
||||
#define DEATH_COUNTER 350
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
#include "screen.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <SDL2/SDL_error.h> // for SDL_GetError
|
||||
#include <SDL2/SDL_events.h> // for SDL_DISABLE, SDL_ENABLE
|
||||
#include <SDL2/SDL_mouse.h> // for SDL_ShowCursor
|
||||
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
|
||||
#include <algorithm> // for max, min
|
||||
#include <iostream> // for basic_ostream, operator<<, cout, endl
|
||||
#include <string> // for basic_string, char_traits, string
|
||||
class Asset;
|
||||
|
||||
// Constructor
|
||||
Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, options_t *options)
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "asset.h"
|
||||
#include "utils.h"
|
||||
#include "const.h"
|
||||
#include <vector>
|
||||
#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 <vector> // for vector
|
||||
#include "utils.h" // for color_t
|
||||
class Asset;
|
||||
|
||||
#define FILTER_NEAREST 0
|
||||
#define FILTER_LINEAL 1
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "smartsprite.h"
|
||||
#include "movingsprite.h" // for MovingSprite
|
||||
class Texture;
|
||||
|
||||
// Constructor
|
||||
SmartSprite::SmartSprite(Texture *texture, SDL_Renderer *renderer)
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "animatedsprite.h"
|
||||
#include "utils.h"
|
||||
#include <vector>
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include "animatedsprite.h" // for AnimatedSprite
|
||||
class Texture;
|
||||
|
||||
// Clase SmartSprite
|
||||
class SmartSprite : public AnimatedSprite
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "sprite.h"
|
||||
#include "texture.h" // for Texture
|
||||
|
||||
// Constructor
|
||||
Sprite::Sprite(int x, int y, int w, int h, Texture *texture, SDL_Renderer *renderer)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "texture.h"
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
class Texture;
|
||||
|
||||
// Clase sprite
|
||||
class Sprite
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
#include "text.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <fstream> // for char_traits, basic_ostream, basic_ifstream, ope...
|
||||
#include <iostream> // for cout
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "texture.h" // for Texture
|
||||
#include "utils.h" // for color_t
|
||||
|
||||
// Llena una estructuta textFile_t desde un fichero
|
||||
textFile_t LoadTextFile(std::string file, bool verbose)
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#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"
|
||||
|
||||
#define TXT_COLOR 1
|
||||
@@ -61,7 +65,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);
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
|
||||
#include "texture.h"
|
||||
#include <SDL2/SDL_error.h> // for SDL_GetError
|
||||
#include <SDL2/SDL_log.h> // for SDL_Log
|
||||
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGB24, SDL_PIXELFORMAT...
|
||||
#include <SDL2/SDL_surface.h> // for SDL_CreateRGBSurfaceWithFormatFrom
|
||||
#include <stdlib.h> // for exit
|
||||
#include <iostream> // for basic_ostream, operator<<, cout, endl
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "stb_image.h"
|
||||
#include <iostream>
|
||||
#include "stb_image.h" // for stbi_failure_reason, stbi_image_free
|
||||
|
||||
// Constructor
|
||||
Texture::Texture(SDL_Renderer *renderer, std::string path, bool verbose)
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <SDL2/SDL_blendmode.h> // for SDL_BlendMode
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Point, SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_FLIP_NONE, SDL_TEX...
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint8
|
||||
#include <string> // for basic_string, string
|
||||
|
||||
class Texture
|
||||
{
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
#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
|
||||
Title::Title(SDL_Renderer *renderer, Screen *screen, Input *input, Asset *asset, options_t *options, Lang *lang, section_t *section)
|
||||
|
||||
@@ -1,21 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "asset.h"
|
||||
#include "input.h"
|
||||
#include "jail_audio.h"
|
||||
#include "menu.h"
|
||||
#include "movingsprite.h"
|
||||
#include "screen.h"
|
||||
#include "smartsprite.h"
|
||||
#include "sprite.h"
|
||||
#include "text.h"
|
||||
#include "utils.h"
|
||||
#include "const.h"
|
||||
#include "fade.h"
|
||||
#include "game.h"
|
||||
#include "instructions.h"
|
||||
#include "item.h"
|
||||
#include <SDL2/SDL_events.h> // for SDL_Event
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32, Uint8
|
||||
#include <vector> // for vector
|
||||
#include "instructions.h" // for mode_e
|
||||
#include "utils.h" // for input_t, options_t, section_t
|
||||
class AnimatedSprite;
|
||||
class Asset;
|
||||
class Fade;
|
||||
class Game;
|
||||
class Input;
|
||||
class Lang;
|
||||
class Menu;
|
||||
class Screen;
|
||||
class SmartSprite;
|
||||
class Sprite;
|
||||
class Text;
|
||||
class Texture;
|
||||
struct JA_Music_t;
|
||||
struct JA_Sound_t;
|
||||
|
||||
// Textos
|
||||
#define TEXT_COPYRIGHT "@2020,2023 JailDesigner (v2.3.1)"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#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
|
||||
double distanceSquared(int x1, int y1, int x2, int y2)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "texture.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#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 <vector> // for vector
|
||||
|
||||
// Dificultad del juego
|
||||
#define DIFFICULTY_EASY 0
|
||||
@@ -49,9 +49,12 @@ struct line_t
|
||||
// Estructura para definir un color
|
||||
struct color_t
|
||||
{
|
||||
Uint8 r;
|
||||
Uint8 g;
|
||||
Uint8 b;
|
||||
Uint8 r;
|
||||
Uint8 g;
|
||||
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
|
||||
@@ -61,16 +64,6 @@ enum palette_e
|
||||
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
|
||||
struct section_t
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "writer.h"
|
||||
#include "text.h" // for Text
|
||||
|
||||
// Constructor
|
||||
Writer::Writer(Text *text)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "sprite.h"
|
||||
#include "text.h"
|
||||
#include <string> // for string, basic_string
|
||||
class Text;
|
||||
|
||||
// Clase Writer. Pinta texto en pantalla letra a letra a partir de una cadena y un bitmap
|
||||
class Writer
|
||||
|
||||
Reference in New Issue
Block a user