From b1f936a791e93b0b139213be9fc2d6cd023b264a Mon Sep 17 00:00:00 2001 From: Sergio Date: Sun, 6 Oct 2024 22:43:28 +0200 Subject: [PATCH] Pasaeta de include-what-you-use abans que es desmadre tot --- source/director.h | 9 --------- source/on_screen_help.cpp | 22 ++++++++++++---------- source/on_screen_help.h | 13 +++++-------- source/options.cpp | 13 ++++++------- source/player.h | 10 +++++----- source/scoreboard.h | 9 ++++----- source/screen.cpp | 7 ++++--- 7 files changed, 36 insertions(+), 47 deletions(-) diff --git a/source/director.h b/source/director.h index 37bb666..03ed13f 100644 --- a/source/director.h +++ b/source/director.h @@ -6,15 +6,6 @@ #include // for vector #include "lang.h" // for lang_e #include "utils.h" // for music_file_t, sound_file_t -class Asset; -class Game; -class HiScoreTable; -class Input; -class Instructions; -class Intro; -class Logo; -class Screen; -class Title; // Textos #define WINDOW_CAPTION "Coffee Crisis Arcade Edition" diff --git a/source/on_screen_help.cpp b/source/on_screen_help.cpp index 6308a04..5347d6c 100644 --- a/source/on_screen_help.cpp +++ b/source/on_screen_help.cpp @@ -1,14 +1,16 @@ #include "on_screen_help.h" -#include "screen.h" -#include "asset.h" -#include "input.h" -#include "sprite.h" -#include "texture.h" -#include "lang.h" -#include "param.h" -#include "dbgtxt.h" -#include // Para std::unique_ptr -#include "utils.h" +#include // for SDL_BLENDMODE_BLEND +#include // for SDL_PIXELFORMAT_RGBA8888 +#include // for make_unique, unique_ptr +#include // 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_t, param_t // [SINGLETON] Hay que definir las variables estáticas, desde el .h sólo la hemos declarado OnScreenHelp *OnScreenHelp::onScreenHelp = nullptr; diff --git a/source/on_screen_help.h b/source/on_screen_help.h index d594b09..cd900e2 100644 --- a/source/on_screen_help.h +++ b/source/on_screen_help.h @@ -1,13 +1,10 @@ #pragma once -#include -#include "text.h" -#include -class Screen; -class Asset; -class Input; -class Texture; -class Sprite; +#include // for SDL_Rect +#include // for SDL_Texture +#include // for vector +class Sprite; // lines 10-10 +class Text; enum class OnScreenHelpStatus { diff --git a/source/options.cpp b/source/options.cpp index a7db682..39b0640 100644 --- a/source/options.cpp +++ b/source/options.cpp @@ -1,17 +1,16 @@ #include "options.h" #include // for SDL_GameControllerButton, SDL_C... -#include // for SDL_WINDOW_FULLSCREEN, SDL_WIND... #include // for max, min -#include // for char_traits, basic_ostream, ope... +#include // for basic_ostream, operator<<, basi... #include // for cout #include // for vector #include "input.h" // for inputs_e, INPUT_USE_ANY, INPUT_... #include "lang.h" // for lang_e -#include "screen.h" // for screenFilter::NEAREST, SCREEN_V... +#include "screen.h" // for screenVideoMode, screenFilter #include "utils.h" // for op_controller_t, options_t, op_... -// Variables -options_t options; + // Variables + options_t options; // Declaraciones bool setOptions(std::string var, std::string value); @@ -286,7 +285,7 @@ bool setOptions(std::string var, std::string value) // Opciones de video if (var == "video.mode") { - //options.video.mode = value == std::to_string(static_cast(screenVideoMode::WINDOW)) ? screenVideoMode::WINDOW : screenVideoMode::FULLSCREEN; + // options.video.mode = value == std::to_string(static_cast(screenVideoMode::WINDOW)) ? screenVideoMode::WINDOW : screenVideoMode::FULLSCREEN; options.video.mode = static_cast(std::stoi(value)); } @@ -301,7 +300,7 @@ bool setOptions(std::string var, std::string value) else if (var == "video.filter") { - //options.video.filter = value == std::to_string(static_cast(screenFilter::NEAREST)) ? screenFilter::NEAREST : screenFilter::LINEAL; + // options.video.filter = value == std::to_string(static_cast(screenFilter::NEAREST)) ? screenFilter::NEAREST : screenFilter::LINEAL; options.video.filter = static_cast(std::stoi(value)); } diff --git a/source/player.h b/source/player.h index cc5e826..a2aa46c 100644 --- a/source/player.h +++ b/source/player.h @@ -2,14 +2,14 @@ #include // for SDL_Rect #include // for Uint32 +#include // for unique_ptr #include // for string, basic_string #include // for vector +#include "animated_sprite.h" // for AnimatedSprite +#include "enter_name.h" // for EnterName #include "utils.h" // for circle_t -#include "enter_name.h" -#include "scoreboard.h" -#include -class AnimatedSprite; -class Texture; +class Texture; // lines 12-12 +enum class scoreboardMode; // Estados del jugador enum class playerStatus diff --git a/source/scoreboard.h b/source/scoreboard.h index bc66251..394b4b3 100644 --- a/source/scoreboard.h +++ b/source/scoreboard.h @@ -3,14 +3,13 @@ #include // for SDL_Point, SDL_Rect #include // for SDL_Renderer, SDL_Texture #include // for Uint32 +#include // for unique_ptr #include // for string, basic_string #include // for vector #include "utils.h" // for color_t -#include -class Asset; -class Sprite; -class Text; -class Texture; +class Sprite; // lines 11-11 +class Text; // lines 12-12 +class Texture; // lines 13-13 // Defines constexpr int SCOREBOARD_LEFT_PANEL = 0; diff --git a/source/screen.cpp b/source/screen.cpp index 43aa9e4..2257d60 100644 --- a/source/screen.cpp +++ b/source/screen.cpp @@ -7,14 +7,15 @@ #include // for basic_ifstream, ifstream #include // for istreambuf_iterator, operator!= #include // for basic_string, operator+, to_string, cha... +#include // for vector #include "asset.h" // for Asset #include "dbgtxt.h" // for dbg_print +#include "global_inputs.h" // for servicePressedCounter #include "input.h" // for Input, inputs_e, INPUT_DO_NOT_ALLOW_REPEAT #include "notify.h" // for Notify +#include "on_screen_help.h" // for OnScreenHelp #include "options.h" // for options -#include "param.h" -#include "on_screen_help.h" -#include "global_inputs.h" +#include "param.h" // for param #ifndef NO_SHADERS #include "jail_shader.h" // for init, render