Pasaeta de include-what-you-use
This commit is contained in:
@@ -2,16 +2,14 @@
|
||||
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint16, Uint32
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint16, Uint32, Uint8
|
||||
#include <memory> // for unique_ptr
|
||||
#include <string> // for string
|
||||
class Background;
|
||||
class Fade;
|
||||
class Text;
|
||||
enum class FadeMode : Uint8;
|
||||
struct JA_Music_t; // lines 14-14
|
||||
|
||||
struct JA_Music_t;
|
||||
class Background; // lines 8-8
|
||||
class Fade; // lines 9-9
|
||||
class Text; // lines 10-10
|
||||
enum class FadeMode : Uint8; // lines 11-11
|
||||
struct JA_Music_t; // lines 12-12
|
||||
|
||||
/*
|
||||
Esta clase gestiona un estado del programa. Se encarga de mostrar la tabla con las puntuaciones
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
#include "instructions.h"
|
||||
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
|
||||
#include <SDL2/SDL_events.h> // for SDL_PollEvent, SDL_Event, SDL_QUIT
|
||||
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
|
||||
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
|
||||
#include <SDL2/SDL_video.h> // for SDL_WINDOWEVENT_SIZE_CHANGED
|
||||
#include <algorithm> // for max
|
||||
#include <string> // for basic_string
|
||||
#include <utility> // for move
|
||||
#include "asset.h" // for Asset
|
||||
#include "fade.h" // for Fade, FadeType::FULLSCREEN, FadeMode::IN
|
||||
#include "global_inputs.h" // for globalInputs::check
|
||||
#include "fade.h" // for Fade, FadeMode, FadeType
|
||||
#include "global_inputs.h" // for check
|
||||
#include "input.h" // for Input
|
||||
#include "jail_audio.h" // for JA_GetMusicState, JA_Music_state
|
||||
#include "lang.h" // for getText
|
||||
#include "param.h" // for param
|
||||
#include "screen.h" // for Screen
|
||||
#include "section.h" // for name, SectionName, options, SectionOptions
|
||||
#include "section.h" // for Name, name, Options, options
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "text.h" // for Text, TEXT_CENTER, TEXT_COLOR, TEXT_SHADOW
|
||||
#include "text.h" // for Text, TEXT_CENTER, TEXT_COLOR, TEXT_...
|
||||
#include "texture.h" // for Texture
|
||||
#include "tiled_bg.h" // for Tiledbg, TILED_MODE_STATIC
|
||||
#include "utils.h" // for Param, ParamGame, Color, shdwT...
|
||||
struct JA_Music_t;
|
||||
#include "utils.h" // for Param, ParamGame, Color, shdw_txt_color
|
||||
struct JA_Music_t; // lines 22-22
|
||||
|
||||
// Constructor
|
||||
Instructions::Instructions(JA_Music_t *music)
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_events.h> // for SDL_Event
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Point, SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Texture, SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <vector> // for vector
|
||||
#include <memory>
|
||||
#include "fade.h"
|
||||
#include "sprite.h"
|
||||
#include "text.h"
|
||||
#include "texture.h"
|
||||
#include "tiled_bg.h"
|
||||
struct JA_Music_t;
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Point, SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Texture, SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <memory> // for unique_ptr, shared_ptr
|
||||
#include <vector> // for vector
|
||||
class Fade;
|
||||
class Sprite;
|
||||
class Text;
|
||||
class Texture;
|
||||
class Tiledbg;
|
||||
struct JA_Music_t; // lines 14-14
|
||||
|
||||
/*
|
||||
Esta clase gestiona un estado del programa. Se encarga de poner en pantalla
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
#include "intro.h"
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
|
||||
#include <SDL2/SDL_video.h> // for SDL_WINDOWEVENT_SIZE_CHANGED
|
||||
#include <string> // for basic_string
|
||||
#include "asset.h" // for Asset
|
||||
#include "global_inputs.h" // for globalInputs::check
|
||||
#include "input.h" // for Input
|
||||
#include "jail_audio.h" // for JA_StopMusic, JA_PlayMusic
|
||||
#include "lang.h" // for getText
|
||||
#include "param.h" // for param
|
||||
#include "screen.h" // for Screen
|
||||
#include "section.h" // for name, SectionName, options, SectionOptions
|
||||
#include "smart_sprite.h" // for SmartSprite
|
||||
#include "text.h" // for Text
|
||||
#include "texture.h" // for Texture
|
||||
#include "utils.h" // for ParamGame, Param, Zone, BLOCK
|
||||
#include "writer.h" // for Writer
|
||||
struct JA_Music_t;
|
||||
#include <SDL2/SDL_events.h> // for SDL_PollEvent, SDL_Event, SDL_QUIT, SDL...
|
||||
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
|
||||
#include <SDL2/SDL_video.h> // for SDL_WINDOWEVENT_SIZE_CHANGED
|
||||
#include <utility> // for move
|
||||
#include "asset.h" // for Asset
|
||||
#include "global_inputs.h" // for check
|
||||
#include "input.h" // for Input
|
||||
#include "jail_audio.h" // for JA_StopMusic, JA_PlayMusic
|
||||
#include "lang.h" // for getText
|
||||
#include "param.h" // for param
|
||||
#include "screen.h" // for Screen
|
||||
#include "section.h" // for Name, name, Options, options
|
||||
#include "smart_sprite.h" // for SmartSprite
|
||||
#include "text.h" // for Text
|
||||
#include "texture.h" // for Texture
|
||||
#include "utils.h" // for Param, ParamGame, Zone, BLOCK, Color
|
||||
#include "writer.h" // for Writer
|
||||
struct JA_Music_t; // lines 19-19
|
||||
|
||||
// Constructor
|
||||
Intro::Intro(JA_Music_t *music)
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_events.h> // for SDL_Event
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32, Uint8
|
||||
#include <vector> // for vector
|
||||
#include <memory>
|
||||
#include "smart_sprite.h"
|
||||
#include "texture.h"
|
||||
#include "text.h"
|
||||
#include "writer.h"
|
||||
struct JA_Music_t;
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32, Uint8
|
||||
#include <memory> // for unique_ptr, shared_ptr
|
||||
#include <vector> // for vector
|
||||
#include "smart_sprite.h" // for SmartSprite
|
||||
#include "writer.h" // for Writer
|
||||
class Text;
|
||||
class Texture;
|
||||
struct JA_Music_t; // lines 11-11
|
||||
|
||||
/*
|
||||
Esta clase gestiona un estado del programa. Se encarga de mostrar la secuencia
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint16
|
||||
#include <string> // for string
|
||||
#include <vector> // for vector
|
||||
#include <memory>
|
||||
#include "utils.h" // for Circle
|
||||
#include "animated_sprite.h"
|
||||
#include "texture.h"
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint16
|
||||
#include <memory> // for shared_ptr, unique_ptr
|
||||
#include <string> // for string
|
||||
#include <vector> // for vector
|
||||
#include "animated_sprite.h" // for AnimatedSprite
|
||||
#include "utils.h" // for Circle
|
||||
class Texture;
|
||||
|
||||
// Tipos de objetos
|
||||
constexpr int ITEM_POINTS_1_DISK = 1;
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
#include "logo.h"
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
|
||||
#include <SDL2/SDL_video.h> // for SDL_WINDOWEVENT_SIZE_CHANGED
|
||||
#include <string> // for basic_string
|
||||
#include "asset.h" // for Asset
|
||||
#include "global_inputs.h" // for globalInputs::check
|
||||
#include "input.h" // for Input
|
||||
#include "jail_audio.h" // for JA_StopMusic
|
||||
#include "param.h" // for param
|
||||
#include "screen.h" // for Screen
|
||||
#include "section.h" // for name, SectionName, options, SectionOptions
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "texture.h" // for Texture
|
||||
#include <SDL2/SDL_events.h> // for SDL_PollEvent, SDL_Event, SDL_QUIT, SDL...
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
|
||||
#include <SDL2/SDL_video.h> // for SDL_WINDOWEVENT_SIZE_CHANGED
|
||||
#include <utility> // for move
|
||||
#include "asset.h" // for Asset
|
||||
#include "global_inputs.h" // for check
|
||||
#include "input.h" // for Input
|
||||
#include "jail_audio.h" // for JA_StopMusic
|
||||
#include "param.h" // for param
|
||||
#include "screen.h" // for Screen
|
||||
#include "section.h" // for Name, name, Options, options
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "texture.h" // for Texture
|
||||
|
||||
// Constructor
|
||||
Logo::Logo()
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_events.h> // for SDL_Event
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Point
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <vector> // for vector
|
||||
#include <memory>
|
||||
#include "utils.h" // for Color
|
||||
#include "sprite.h"
|
||||
#include "texture.h"
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Point
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <memory> // for unique_ptr, shared_ptr
|
||||
#include <vector> // for vector
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "utils.h" // for Color
|
||||
class Texture;
|
||||
|
||||
/*
|
||||
Esta clase gestiona un estado del programa. Se encarga de dibujar por pantalla el
|
||||
|
||||
@@ -7,10 +7,9 @@ Actualizando a la versión "Arcade Edition" en 08/05/2024
|
||||
|
||||
*/
|
||||
|
||||
#include <iostream> // for basic_ostream, char_traits, operator<<, cout
|
||||
#include <string> // for basic_string, operator<<, string
|
||||
#include <memory>
|
||||
#include "director.h" // for Director
|
||||
#include <iostream> // for char_traits, basic_ostream, operator<<, cout
|
||||
#include <memory> // for make_unique, unique_ptr
|
||||
#include "director.h" // for Director
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point
|
||||
#include <SDL2/SDL_render.h> // for SDL_RendererFlip
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint16
|
||||
#include <memory>
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "texture.h"
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point
|
||||
#include <SDL2/SDL_render.h> // for SDL_RendererFlip
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint16
|
||||
#include <memory> // for shared_ptr
|
||||
#include "sprite.h" // for Sprite
|
||||
class Texture;
|
||||
|
||||
// Clase MovingSprite. Añade posicion y velocidad en punto flotante
|
||||
class MovingSprite : public Sprite
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
#include "notify.h"
|
||||
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
|
||||
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
|
||||
#include <string> // for basic_string, char_traits, string
|
||||
#include "jail_audio.h" // for JA_DeleteSound, JA_LoadSound, JA_Pla...
|
||||
#include "options.h" // for options
|
||||
#include "param.h"
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "text.h" // for Text
|
||||
#include "texture.h" // for Texture
|
||||
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
|
||||
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
|
||||
#include <string> // for string
|
||||
#include "jail_audio.h" // for JA_DeleteSound, JA_LoadSound, JA_Pla...
|
||||
#include "param.h" // for param
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "text.h" // for Text
|
||||
#include "texture.h" // for Texture
|
||||
|
||||
// Constructor
|
||||
Notify::Notify(SDL_Renderer *renderer, std::string iconFile, std::string bitmapFile, std::string textFile, const std::string &soundFile)
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <string> // for basic_string, string
|
||||
#include <vector> // for vector
|
||||
#include <memory>
|
||||
#include "utils.h" // for Color
|
||||
#include "text.h"
|
||||
#include "texture.h"
|
||||
#include "sprite.h"
|
||||
struct JA_Sound_t;
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <memory> // for shared_ptr, unique_ptr
|
||||
#include <string> // for string, basic_string
|
||||
#include <vector> // for vector
|
||||
#include "utils.h" // for Color
|
||||
class Sprite;
|
||||
class Text;
|
||||
class Texture;
|
||||
struct JA_Sound_t; // lines 12-12
|
||||
|
||||
class Notify
|
||||
{
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
#include "on_screen_help.h"
|
||||
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
|
||||
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
|
||||
#include <memory> // for make_unique, unique_ptr
|
||||
#include <string> // for basic_string
|
||||
#include "asset.h" // for Asset
|
||||
#include "lang.h" // for getText
|
||||
#include "param.h" // for param
|
||||
#include "screen.h" // for Screen
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "text.h" // for Text
|
||||
#include "texture.h" // for Texture
|
||||
#include "utils.h" // for easeInOutSine, ParamGame, Param
|
||||
#include <SDL2/SDL_blendmode.h> // for SDL_BLENDMODE_BLEND
|
||||
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
|
||||
#include <memory> // for make_unique, make_shared, unique_ptr
|
||||
#include "asset.h" // for Asset
|
||||
#include "lang.h" // for getText
|
||||
#include "param.h" // for param
|
||||
#include "screen.h" // for Screen
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "text.h" // for Text
|
||||
#include "texture.h" // for Texture
|
||||
#include "utils.h" // for easeInOutSine, Param, ParamGame
|
||||
|
||||
// [SINGLETON] Hay que definir las variables estáticas, desde el .h sólo la hemos declarado
|
||||
OnScreenHelp *OnScreenHelp::onScreenHelp = nullptr;
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Texture
|
||||
#include <vector> // for vector
|
||||
#include <memory>
|
||||
#include "sprite.h" // lines 10-10
|
||||
#include "text.h"
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Texture
|
||||
#include <vector> // for vector
|
||||
class Sprite;
|
||||
class Text;
|
||||
|
||||
enum class OnScreenHelpStatus
|
||||
{
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <memory> // for unique_ptr
|
||||
#include <string> // for string, basic_string
|
||||
#include <vector> // for vector
|
||||
#include "animated_sprite.h" // for AnimatedSprite
|
||||
#include "enter_name.h" // for EnterName
|
||||
#include "utils.h" // for Circle
|
||||
#include "texture.h" // lines 12-12
|
||||
enum class ScoreboardMode;
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <memory> // for unique_ptr, shared_ptr
|
||||
#include <string> // for string
|
||||
#include <vector> // for vector
|
||||
#include "animated_sprite.h" // for AnimatedSprite
|
||||
#include "enter_name.h" // for EnterName
|
||||
#include "utils.h" // for Circle
|
||||
class Texture;
|
||||
enum class InputType : int;
|
||||
enum class ScoreboardMode; // lines 12-12
|
||||
|
||||
// Estados del jugador
|
||||
enum class PlayerStatus
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Point, SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <memory> // for unique_ptr
|
||||
#include <string> // for string, basic_string
|
||||
#include <vector> // for vector
|
||||
#include "utils.h" // for Color
|
||||
#include "sprite.h" // lines 11-11
|
||||
#include "text.h" // lines 12-12
|
||||
#include "texture.h" // lines 13-13
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Point, SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <memory> // for unique_ptr, shared_ptr
|
||||
#include <string> // for string
|
||||
#include <vector> // for vector
|
||||
#include "utils.h" // for Color
|
||||
class Sprite;
|
||||
class Text;
|
||||
class Texture;
|
||||
|
||||
// Defines
|
||||
constexpr int SCOREBOARD_LEFT_PANEL = 0;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "animated_sprite.h" // for AnimatedSprite
|
||||
#include "texture.h"
|
||||
#include <memory>
|
||||
#include <memory> // for shared_ptr
|
||||
#include "animated_sprite.h" // for AnimatedSprite
|
||||
class Texture;
|
||||
|
||||
// Clase SmartSprite
|
||||
class SmartSprite : public AnimatedSprite
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include "text.h"
|
||||
#include <fstream> // for char_traits, basic_ostream, basic_ifstream, ope...
|
||||
#include <iostream> // for cout
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "texture.h" // for Texture
|
||||
#include "utils.h" // for Color
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <fstream> // for basic_ostream, basic_ifstream, basic_istream
|
||||
#include <iostream> // for cout
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "texture.h" // for Texture
|
||||
#include "utils.h" // for Color
|
||||
|
||||
// Llena una estructuta TextFile desde un fichero
|
||||
TextFile LoadTextFile(std::string file_path)
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint8
|
||||
#include <memory> // for shared_ptr, unique_ptr
|
||||
#include <string> // for string
|
||||
#include <memory>
|
||||
#include "utils.h"
|
||||
#include "sprite.h"
|
||||
#include "texture.h"
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "utils.h" // for Color
|
||||
class Texture;
|
||||
|
||||
constexpr int TEXT_COLOR = 1;
|
||||
constexpr int TEXT_SHADOW = 2;
|
||||
@@ -33,13 +33,13 @@ class Text
|
||||
{
|
||||
private:
|
||||
// Objetos y punteros
|
||||
std::unique_ptr<Sprite> sprite_; // Objeto con los graficos para el texto
|
||||
std::unique_ptr<Sprite> sprite_; // Objeto con los graficos para el texto
|
||||
std::shared_ptr<Texture> texture_; // Textura con los bitmaps del texto
|
||||
|
||||
// Variables
|
||||
int box_width_; // Anchura de la caja de cada caracter en el png
|
||||
int box_height_; // Altura de la caja de cada caracter en el png
|
||||
bool fixed_width_; // Indica si el texto se ha de escribir con longitud fija en todas las letras
|
||||
int box_width_; // Anchura de la caja de cada caracter en el png
|
||||
int box_height_; // Altura de la caja de cada caracter en el png
|
||||
bool fixed_width_; // Indica si el texto se ha de escribir con longitud fija en todas las letras
|
||||
TextOffset offset_[128]; // Vector con las posiciones y ancho de cada letra
|
||||
|
||||
public:
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
void writeCentered(int x, int y, const std::string &text, int kerning = 1, int lenght = -1);
|
||||
|
||||
// Escribe texto con extras
|
||||
void writeDX(Uint8 flags, int x, int y, const std::string &text, int kerning = 1, Color textColor = {255, 255, 255}, Uint8 shadow_distance = 1, Color shadow_color = {0, 0, 0}, int lenght = -1);
|
||||
void writeDX(Uint8 flags, int x, int y, const std::string &text, int kerning = 1, Color textColor = Color(), Uint8 shadow_distance = 1, Color shadow_color = Color(), int lenght = -1);
|
||||
|
||||
// Obtiene la longitud en pixels de una cadena
|
||||
int lenght(const std::string &text, int kerning = 1) const;
|
||||
|
||||
@@ -62,7 +62,6 @@ bool Texture::loadFromFile(const std::string &path)
|
||||
if (!data)
|
||||
{
|
||||
#ifdef VERBOSE
|
||||
const std::string file_name = path.substr(path.find_last_of("\\/") + 1);
|
||||
std::cout << "Loading image failed: " << stbi_failure_reason() << std::endl;
|
||||
#endif
|
||||
exit(1);
|
||||
@@ -240,14 +239,14 @@ SDL_Texture *Texture::getSDLTexture()
|
||||
}
|
||||
|
||||
// Crea una nueva surface
|
||||
Surface Texture::newSurface(int w, int h)
|
||||
/*Surface Texture::newSurface(int w, int h)
|
||||
{
|
||||
Surface surf = static_cast<Surface>(malloc(sizeof(surface_s)));
|
||||
surf->w = w;
|
||||
surf->h = h;
|
||||
surf->data = static_cast<Uint8 *>(malloc(w * h));
|
||||
return surf;
|
||||
}
|
||||
}*/
|
||||
|
||||
// Elimina una surface
|
||||
void Texture::deleteSurface(Surface surface)
|
||||
@@ -345,7 +344,7 @@ std::vector<Uint32> Texture::loadPal(const std::string &file_name)
|
||||
fread(buffer, size, 1, f);
|
||||
fclose(f);
|
||||
|
||||
const auto pal = LoadPalette(buffer);
|
||||
const auto *pal = LoadPalette(buffer);
|
||||
if (!pal)
|
||||
{
|
||||
return palette;
|
||||
|
||||
@@ -33,7 +33,7 @@ private:
|
||||
int paletteIndex_; // Indice de la paleta en uso
|
||||
|
||||
// Crea una nueva surface
|
||||
Surface newSurface(int w, int h);
|
||||
//Surface newSurface(int w, int h);
|
||||
|
||||
// Elimina una surface
|
||||
void deleteSurface(Surface surface);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include "tiled_bg.h"
|
||||
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
|
||||
#include <SDL2/SDL_stdinc.h> // for SDL_sinf
|
||||
#include <stdlib.h> // for rand
|
||||
#include "screen.h" // for Screen
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "texture.h" // for Texture
|
||||
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
|
||||
#include <SDL2/SDL_stdinc.h> // for SDL_sinf
|
||||
#include <stdlib.h> // for rand
|
||||
#include <memory> // for unique_ptr, make_shared, make_unique
|
||||
#include "screen.h" // for Screen
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "texture.h" // for Texture
|
||||
|
||||
// Constructor
|
||||
Tiledbg::Tiledbg(std::string texture_path, SDL_Rect pos, int mode)
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
#include "title.h"
|
||||
#include <SDL2/SDL_keycode.h> // for SDLK_1, SDLK_2, SDLK_3
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
|
||||
#include <string> // for allocator, basic_string, char_traits
|
||||
#include <vector> // for vector
|
||||
#include "asset.h" // for Asset
|
||||
#include "global_inputs.h" // for globalInputs::check
|
||||
#include "input.h" // for Input, inputs_e, INPUT_DO_NOT_ALLOW_RE...
|
||||
#include "jail_audio.h" // for JA_GetMusicState, JA_Music_state, JA_P...
|
||||
#include "lang.h" // for getText
|
||||
#include "options.h" // for options
|
||||
#include "param.h" // for param
|
||||
#include "screen.h" // for Screen
|
||||
#include "section.h" // for SectionOptions, options, SectionName, name
|
||||
|
||||
struct JA_Music_t;
|
||||
#include <SDL2/SDL_events.h> // for SDL_PollEvent, SDL_Event, SDL_KEYDOWN
|
||||
#include <SDL2/SDL_keycode.h> // for SDLK_1, SDLK_2, SDLK_3
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
|
||||
#include <string> // for char_traits, operator+, to_string, bas...
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector
|
||||
#include "asset.h" // for Asset
|
||||
#include "global_inputs.h" // for check
|
||||
#include "input.h" // for Input, InputType, INPUT_DO_NOT_ALLOW_R...
|
||||
#include "jail_audio.h" // for JA_GetMusicState, JA_Music_state, JA_P...
|
||||
#include "lang.h" // for getText
|
||||
#include "options.h" // for options
|
||||
#include "param.h" // for param
|
||||
#include "screen.h" // for Screen
|
||||
#include "section.h" // for Options, options, Name, name
|
||||
#include "texture.h" // for Texture
|
||||
#include "utils.h" // for Param, OptionsController, Color, Param...
|
||||
struct JA_Music_t; // lines 17-17
|
||||
|
||||
// Constructor
|
||||
Title::Title(JA_Music_t *music)
|
||||
|
||||
@@ -1,24 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_events.h> // for SDL_Event
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <memory>
|
||||
#include "define_buttons.h"
|
||||
#include "fade.h"
|
||||
#include "game_logo.h"
|
||||
#include "text.h"
|
||||
#include "tiled_bg.h"
|
||||
#include "utils.h" // for Section
|
||||
#include "sprite.h"
|
||||
#include "texture.h"
|
||||
#include "section.h"
|
||||
|
||||
class Asset;
|
||||
class Input;
|
||||
class Screen;
|
||||
class Sprite;
|
||||
class Texture;
|
||||
struct JA_Music_t;
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <memory> // for unique_ptr, shared_ptr
|
||||
#include "define_buttons.h" // for DefineButtons
|
||||
#include "fade.h" // for Fade
|
||||
#include "game_logo.h" // for GameLogo
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "text.h" // for Text
|
||||
#include "tiled_bg.h" // for Tiledbg
|
||||
class Input; // lines 17-17
|
||||
class Screen; // lines 18-18
|
||||
class Texture; // lines 20-20
|
||||
namespace section { enum class Name; }
|
||||
struct JA_Music_t; // lines 21-21
|
||||
|
||||
// Textos
|
||||
constexpr const char TEXT_COPYRIGHT[] = "@2020,2024 JailDesigner";
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#include "utils.h"
|
||||
#include <stdlib.h> // for free, malloc
|
||||
#include <algorithm> // for max, min
|
||||
#include <cctype> // for isspace
|
||||
#include <iterator> // for distance
|
||||
#include <cmath>
|
||||
struct JA_Music_t; // lines 3-3
|
||||
struct JA_Sound_t; // lines 4-4
|
||||
#include <algorithm> // for min, clamp, find_if_not, transform
|
||||
#include <cctype> // for tolower, isspace
|
||||
#include <cmath> // for cos, pow, M_PI
|
||||
#include <compare> // for operator<
|
||||
struct JA_Music_t; // lines 7-7
|
||||
struct JA_Sound_t; // lines 8-8
|
||||
|
||||
// Colores
|
||||
const Color bg_color = {0x27, 0x27, 0x36};
|
||||
|
||||
@@ -3,16 +3,19 @@
|
||||
#include <SDL2/SDL_gamecontroller.h> // for SDL_GameControllerButton
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect, SDL_Point
|
||||
#include <SDL2/SDL_render.h> // for SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint8, Uint32
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint8
|
||||
#include <stdint.h> // for int32_t
|
||||
#include <string> // for string, basic_string
|
||||
#include <string> // for string
|
||||
#include <vector> // for vector
|
||||
#include "input.h" // for inputs_e
|
||||
#include "lang.h"
|
||||
struct JA_Music_t;
|
||||
struct JA_Sound_t;
|
||||
enum class ScreenFilter;
|
||||
enum class ScreenVideoMode;
|
||||
enum class InputType : int;
|
||||
enum class ScreenFilter; // lines 14-14
|
||||
enum class ScreenVideoMode; // lines 15-15
|
||||
namespace lang
|
||||
{
|
||||
enum class Code : int;
|
||||
}
|
||||
struct JA_Music_t; // lines 12-12
|
||||
struct JA_Sound_t; // lines 13-13
|
||||
|
||||
// Dificultad del juego
|
||||
enum class GameDifficulty
|
||||
@@ -35,6 +38,7 @@ struct Circle
|
||||
struct Color
|
||||
{
|
||||
Uint8 r, g, b;
|
||||
constexpr Color(int red = 255, int green = 255, int blue = 255) : r(red), g(green), b(blue) {}
|
||||
};
|
||||
|
||||
// Posiciones de las notificaciones
|
||||
@@ -47,13 +51,6 @@ enum class NotifyPosition
|
||||
RIGHT,
|
||||
};
|
||||
|
||||
// Estructura para saber la seccion y subseccion del programa
|
||||
/*struct Section
|
||||
{
|
||||
section::Name name;
|
||||
section::Options options;
|
||||
};*/
|
||||
|
||||
// Estructura para las entradas de la tabla de recirds
|
||||
struct HiScoreEntry
|
||||
{
|
||||
@@ -114,7 +111,7 @@ struct OptionsAudio
|
||||
struct OptionsGame
|
||||
{
|
||||
GameDifficulty difficulty; // Dificultad del juego
|
||||
lang::Code language; // Idioma usado en el juego
|
||||
lang::Code language; // Idioma usado en el juego
|
||||
bool autofire; // Indica si el jugador ha de pulsar repetidamente para disparar o basta con mantener pulsado
|
||||
std::vector<HiScoreEntry> hi_score_table; // Tabla con las mejores puntuaciones
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "writer.h"
|
||||
#include "text.h" // for Text
|
||||
|
||||
// Constructor
|
||||
Writer::Writer(std::shared_ptr<Text> text)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <string> // for string, basic_string
|
||||
#include <memory>
|
||||
#include "text.h"
|
||||
#include <memory> // for shared_ptr
|
||||
#include <string> // for string
|
||||
class Text;
|
||||
|
||||
// Clase Writer. Pinta texto en pantalla letra a letra a partir de una cadena y un objeto Text
|
||||
class Writer
|
||||
|
||||
Reference in New Issue
Block a user