Pasaeta de IWYU
This commit is contained in:
@@ -9,9 +9,8 @@
|
||||
#include "param.h" // Para Param, ParamGame, param
|
||||
#include "resource.h" // Para Resource
|
||||
#include "screen.h" // Para Screen
|
||||
#include "stage.h" // Para power
|
||||
#include "texture.h" // Para Texture
|
||||
#include "utils.h" // Para Zone, BLOCK, Color, flash_color
|
||||
#include "stage.h" // Para addPower
|
||||
#include "utils.h" // Para Zone, Color, flash_color
|
||||
|
||||
// Constructor
|
||||
BalloonManager::BalloonManager()
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "options.h" // Para OptionsController, Options, options
|
||||
#include "param.h" // Para Param, param, ParamGame, ParamTitle
|
||||
#include "resource.h" // Para Resource
|
||||
#include "section.h" // Para Name, Options, name, options
|
||||
#include "text.h" // Para Text
|
||||
|
||||
// Constructor
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
#include <SDL2/SDL_audio.h> // Para AUDIO_S16
|
||||
#include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND
|
||||
#include <SDL2/SDL_error.h> // Para SDL_GetError
|
||||
#include <SDL2/SDL_events.h> // Para SDL_DISABLE
|
||||
#include <SDL2/SDL_gamecontroller.h> // Para SDL_CONTROLLER_BUTTON_B, SDL_CO...
|
||||
#include <SDL2/SDL_hints.h> // Para SDL_SetHint, SDL_HINT_RENDER_DR...
|
||||
#include <SDL2/SDL_mouse.h> // Para SDL_ShowCursor
|
||||
#include <SDL2/SDL_scancode.h> // Para SDL_SCANCODE_0, SDL_SCANCODE_DOWN
|
||||
#include <SDL2/SDL_stdinc.h> // Para SDL_bool, Uint32
|
||||
#include <SDL2/SDL_stdinc.h> // Para Uint32, SDL_bool
|
||||
#include <errno.h> // Para errno, EEXIST, EACCES, ENAMETOO...
|
||||
#include <stdio.h> // Para printf, perror
|
||||
#include <sys/stat.h> // Para mkdir, stat, S_IRWXU
|
||||
@@ -53,7 +55,7 @@ Director::Director(int argc, const char *argv[])
|
||||
section::name = section::Name::GAME;
|
||||
section::options = section::Options::GAME_PLAY_1P;
|
||||
#elif DEBUG
|
||||
section::name = section::Name::INTRO;
|
||||
section::name = section::Name::LOGO;
|
||||
#else // NORMAL GAME
|
||||
section::name = section::Name::LOGO;
|
||||
section::options = section::Options::NONE;
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#include "enter_name.h"
|
||||
#include "utils.h"
|
||||
#include <stddef.h> // Para size_t
|
||||
#include <algorithm> // Para max, min
|
||||
#include <cassert> // Para assert
|
||||
#include <iostream>
|
||||
#include "utils.h" // Para trim
|
||||
|
||||
// Constructor
|
||||
EnterName::EnterName()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "game.h"
|
||||
#include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND
|
||||
#include <SDL2/SDL_events.h> // Para SDL_PollEvent, SDL_Event, SDL_KEYDOWN
|
||||
#include <SDL2/SDL_events.h> // Para SDL_Event, SDL_PollEvent, SDL_KEYDOWN
|
||||
#include <SDL2/SDL_keycode.h> // Para SDLK_1, SDLK_2, SDLK_3, SDLK_4
|
||||
#include <SDL2/SDL_pixels.h> // Para SDL_PIXELFORMAT_RGBA8888
|
||||
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
|
||||
@@ -14,15 +14,14 @@
|
||||
#include "balloon.h" // Para Balloon, BALLOON_SPEED
|
||||
#include "balloon_manager.h" // Para BalloonManager
|
||||
#include "bullet.h" // Para Bullet, BulletType, BulletMoveStatus
|
||||
#include "enter_name.h" // Para NAME_LENGHT
|
||||
#include "fade.h" // Para Fade, FadeType, FadeMode
|
||||
#include "global_events.h" // Para check
|
||||
#include "global_inputs.h" // Para check, update
|
||||
#include "input.h" // Para InputType, Input, INPUT_DO_NOT_ALL...
|
||||
#include "item.h" // Para Item, ItemType
|
||||
#include "jail_audio.h" // Para JA_PlaySound, JA_GetMusicState
|
||||
#include "lang.h" // Para getText
|
||||
#include "manage_hiscore_table.h" // Para ManageHiScoreTable, HiScoreEntry
|
||||
#include "global_events.h" // Para handleEvent
|
||||
#include "notifier.h" // Para Notifier
|
||||
#include "param.h" // Para Param, param, ParamGame, ParamFade
|
||||
#include "path_sprite.h" // Para Path, PathSprite, createPath, Path...
|
||||
@@ -30,10 +29,10 @@
|
||||
#include "resource.h" // Para Resource
|
||||
#include "scoreboard.h" // Para Scoreboard, ScoreboardMode, SCOREB...
|
||||
#include "screen.h" // Para Screen
|
||||
#include "section.h" // Para Name, name, AttractMode, Options
|
||||
#include "section.h" // Para Name, name, AttractMode, attract_mode
|
||||
#include "smart_sprite.h" // Para SmartSprite
|
||||
#include "stage.h" // Para number, get, Stage, total_power
|
||||
#include "tabe.h" // Para Tabe
|
||||
#include "tabe.h" // Para Tabe, TabeState
|
||||
#include "text.h" // Para Text
|
||||
#include "texture.h" // Para Texture
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "gif.h"
|
||||
#include <stdio.h> // for NULL, fprintf, stderr
|
||||
#include <stdlib.h> // for malloc, realloc, exit, calloc, free
|
||||
#include <stdio.h> // Para NULL, fprintf, stderr
|
||||
#include <stdlib.h> // Para malloc, realloc, exit, calloc, free
|
||||
|
||||
void uncompress(int code_length,
|
||||
const unsigned char *input,
|
||||
@@ -232,7 +232,8 @@ unsigned char* process_image_descriptor( unsigned char* buffer,
|
||||
uncompress(lzw_code_size, compressed_data, compressed_data_length,
|
||||
uncompressed_data);
|
||||
|
||||
if ( compressed_data ) free( compressed_data );
|
||||
if (compressed_data)
|
||||
free(compressed_data);
|
||||
|
||||
// if ( uncompressed_data )
|
||||
// free( uncompressed_data );
|
||||
@@ -247,7 +248,8 @@ unsigned char* process_image_descriptor( unsigned char* buffer,
|
||||
*/
|
||||
#define rb (*(buffer++))
|
||||
|
||||
uint32_t* LoadPalette(unsigned char *buffer) {
|
||||
uint32_t *LoadPalette(unsigned char *buffer)
|
||||
{
|
||||
unsigned char header[7];
|
||||
screen_descriptor_t screen_descriptor;
|
||||
// int color_resolution_bits;
|
||||
@@ -261,12 +263,14 @@ uint32_t* LoadPalette(unsigned char *buffer) {
|
||||
// color_resolution_bits = ((screen_descriptor.fields & 0x70) >> 4) + 1;
|
||||
global_color_table = (uint32_t *)calloc(1, 1024);
|
||||
|
||||
if (screen_descriptor.fields & 0x80) {
|
||||
if (screen_descriptor.fields & 0x80)
|
||||
{
|
||||
global_color_table_size = 1 << (((screen_descriptor.fields & 0x07) + 1));
|
||||
|
||||
// global_color_table = (rgb *)malloc(3 * global_color_table_size);
|
||||
// READ(global_color_table, 3 * global_color_table_size);
|
||||
for (int i=0; i<global_color_table_size;++i) {
|
||||
for (int i = 0; i < global_color_table_size; ++i)
|
||||
{
|
||||
global_color_table[i] = (buffer[0] << 16) + (buffer[1] << 8) + buffer[2];
|
||||
buffer += 3;
|
||||
}
|
||||
@@ -315,8 +319,7 @@ static unsigned char* process_gif_stream(unsigned char *buffer, unsigned short*
|
||||
{
|
||||
// int i;
|
||||
// If bit 7 is set, the next block is a global color table; read it
|
||||
global_color_table_size = 1 <<
|
||||
( ( ( screen_descriptor.fields & 0x07 ) + 1 ) );
|
||||
global_color_table_size = 1 << (((screen_descriptor.fields & 0x07) + 1));
|
||||
|
||||
global_color_table = (rgb *)malloc(3 * global_color_table_size);
|
||||
|
||||
@@ -341,7 +344,8 @@ static unsigned char* process_gif_stream(unsigned char *buffer, unsigned short*
|
||||
buffer++;
|
||||
size = *(buffer++);
|
||||
buffer += size;
|
||||
do {
|
||||
do
|
||||
{
|
||||
size = *(buffer++);
|
||||
buffer += size;
|
||||
} while (size != 0);
|
||||
@@ -362,8 +366,8 @@ static unsigned char* process_gif_stream(unsigned char *buffer, unsigned short*
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
unsigned char* LoadGif(unsigned char *buffer, unsigned short* w, unsigned short* h) {
|
||||
unsigned char *LoadGif(unsigned char *buffer, unsigned short *w, unsigned short *h)
|
||||
{
|
||||
return process_gif_stream(buffer, w, h);
|
||||
}
|
||||
|
||||
|
||||
32
source/gif.h
32
source/gif.h
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h> // for uint32_t
|
||||
#include <string.h> // for memcpy
|
||||
#include <stdint.h> // Para uint32_t
|
||||
#include <string.h> // Para memcpy
|
||||
|
||||
#define EXTENSION_INTRODUCER 0x21
|
||||
#define IMAGE_DESCRIPTOR 0x2C
|
||||
@@ -11,9 +11,12 @@
|
||||
#define COMMENT_EXTENSION 0xFE
|
||||
#define PLAINTEXT_EXTENSION 0x01
|
||||
|
||||
#define READ(dst, size) memcpy(dst, buffer, size); buffer += size
|
||||
#define READ(dst, size) \
|
||||
memcpy(dst, buffer, size); \
|
||||
buffer += size
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
unsigned short width;
|
||||
unsigned short height;
|
||||
unsigned char fields;
|
||||
@@ -21,11 +24,13 @@ typedef struct {
|
||||
unsigned char pixel_aspect_ratio;
|
||||
} screen_descriptor_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
unsigned char r, g, b;
|
||||
} rgb;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
unsigned short image_left_position;
|
||||
unsigned short image_top_position;
|
||||
unsigned short image_width;
|
||||
@@ -33,29 +38,34 @@ typedef struct {
|
||||
unsigned char fields;
|
||||
} image_descriptor_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
unsigned char byte;
|
||||
int prev;
|
||||
int len;
|
||||
} dictionary_entry_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
unsigned char extension_code;
|
||||
unsigned char block_size;
|
||||
} extension_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
unsigned char fields;
|
||||
unsigned short delay_time;
|
||||
unsigned char transparent_color_index;
|
||||
} graphic_control_extension_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
unsigned char application_id[8];
|
||||
unsigned char version[3];
|
||||
} application_extension_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
unsigned short left, top, width, height;
|
||||
unsigned char cell_width, cell_height;
|
||||
unsigned char foreground_color, background_color;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "global_events.h"
|
||||
#include "section.h"
|
||||
#include "mouse.h"
|
||||
#include "resource.h"
|
||||
#include <iostream>
|
||||
#include <SDL2/SDL_video.h> // Para SDL_WINDOWEVENT_SIZE_CHANGED
|
||||
#include <iostream> // Para char_traits, basic_ostream, operator<<
|
||||
#include "mouse.h" // Para handleEvent
|
||||
#include "section.h" // Para Name, Options, name, options
|
||||
|
||||
namespace globalEvents
|
||||
{
|
||||
@@ -17,13 +17,11 @@ namespace globalEvents
|
||||
return;
|
||||
case SDL_RENDER_DEVICE_RESET:
|
||||
case SDL_RENDER_TARGETS_RESET:
|
||||
// Resource::get()->reloadTextures();
|
||||
std::cout << "SDL_RENDER_TARGETS_RESET" << std::endl;
|
||||
break;
|
||||
case SDL_WINDOWEVENT:
|
||||
if (event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED)
|
||||
{
|
||||
// Resource::get()->reloadTextures();
|
||||
std::cout << "SDL_WINDOWEVENT_SIZE_CHANGED" << std::endl;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
#include "global_inputs.h"
|
||||
#include <SDL2/SDL_render.h> // Para SDL_RenderSetIntegerScale
|
||||
#include <SDL2/SDL_stdinc.h> // Para SDL_FALSE, SDL_TRUE
|
||||
#include <string> // Para operator+, string, to_string, basic_string
|
||||
#include <vector> // Para vector
|
||||
#include "asset.h" // Para Asset
|
||||
#include "input.h" // Para Input, InputDeviceToUse, InputType, INPU...
|
||||
#include "input.h" // Para Input, InputDeviceToUse, InputType, INP...
|
||||
#include "jail_audio.h" // Para JA_SetMusicVolume, JA_SetSoundVolume
|
||||
#include "lang.h" // Para Code, getText, change, loadFromFile
|
||||
#include "lang.h" // Para getText, Code, getNextLangCode, loadFro...
|
||||
#include "notifier.h" // Para Notifier
|
||||
#include "on_screen_help.h" // Para OnScreenHelp
|
||||
#include "options.h" // Para Options, options, OptionsGame, OptionsAudio
|
||||
#include "options.h" // Para Options, options, OptionsGame, OptionsV...
|
||||
#include "screen.h" // Para Screen, ScreenVideoMode
|
||||
#include "section.h" // Para Name, Options, name, options
|
||||
#include "utils.h" // Para boolToOnOff, stringInVector
|
||||
#include "section.h" // Para Name, name, Options, options, AttractMode
|
||||
#include "utils.h" // Para boolToOnOff
|
||||
|
||||
namespace globalInputs
|
||||
{
|
||||
@@ -33,7 +35,7 @@ namespace globalInputs
|
||||
// Si la notificación de salir no está activa, muestra la notificación
|
||||
#ifdef ARCADE
|
||||
const int INDEX = code == section::Options::QUIT_WITH_CONTROLLER ? 116 : 94;
|
||||
Notifier::get()->showText({lang::getText(INDEX), std::string()}, -1, CODE);
|
||||
Notifier::get()->show({lang::getText(INDEX), std::string()}, -1, CODE);
|
||||
#else
|
||||
Notifier::get()->show({lang::getText(94), std::string()}, -1, CODE);
|
||||
#endif
|
||||
|
||||
@@ -1,31 +1,29 @@
|
||||
#include "hiscore_table.h"
|
||||
#include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND
|
||||
#include <SDL2/SDL_events.h> // Para SDL_PollEvent, SDL_Event, SDL_QUIT
|
||||
#include <SDL2/SDL_events.h> // Para SDL_PollEvent, SDL_Event
|
||||
#include <SDL2/SDL_pixels.h> // Para SDL_PIXELFORMAT_RGBA8888
|
||||
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
|
||||
#include <SDL2/SDL_video.h> // Para SDL_WINDOWEVENT_SIZE_CHANGED
|
||||
#include <stdlib.h> // Para rand
|
||||
#include <stdlib.h> // Para rand, size_t
|
||||
#include <algorithm> // Para max
|
||||
#include <functional> // Para function
|
||||
#include <vector> // Para vector
|
||||
#include "background.h" // Para Background
|
||||
#include "fade.h" // Para Fade, FadeMode, FadeType
|
||||
#include "global_events.h" // Para check
|
||||
#include "global_inputs.h" // Para check, update
|
||||
#include "input.h" // Para Input
|
||||
#include "jail_audio.h" // Para JA_GetMusicState, JA_Music_state
|
||||
#include "lang.h" // Para getText
|
||||
#include "manage_hiscore_table.h" // Para HiScoreEntry
|
||||
#include "global_events.h" // Para handleEvent
|
||||
#include "options.h" // Para Options, OptionsGame, options
|
||||
#include "param.h" // Para Param, param, ParamGame, ParamFade
|
||||
#include "path_sprite.h" // Para PathSprite, Path, PathType
|
||||
#include "resource.h" // Para Resource
|
||||
#include "screen.h" // Para Screen
|
||||
#include "section.h" // Para Name, name, Options, options, Attr...
|
||||
#include "section.h" // Para Name, name
|
||||
#include "sprite.h" // Para Sprite
|
||||
#include "text.h" // Para Text, TEXT_COLOR, TEXT_SHADOW
|
||||
#include "text.h" // Para Text, TEXT_SHADOW, TEXT_COLOR
|
||||
#include "texture.h" // Para Texture
|
||||
#include "utils.h" // Para Color, easeOutQuint, fade_color
|
||||
#include "utils.h" // Para Color, easeOutQuint, fade_color, Zone
|
||||
|
||||
// Constructor
|
||||
HiScoreTable::HiScoreTable()
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "instructions.h"
|
||||
#include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND
|
||||
#include <SDL2/SDL_events.h> // Para SDL_PollEvent, SDL_Event, SDL_QUIT
|
||||
#include <SDL2/SDL_events.h> // Para SDL_PollEvent, SDL_Event
|
||||
#include <SDL2/SDL_pixels.h> // Para SDL_PIXELFORMAT_RGBA8888
|
||||
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
|
||||
#include <SDL2/SDL_video.h> // Para SDL_WINDOWEVENT_SIZE_CHANGED
|
||||
#include <algorithm> // Para max
|
||||
#include <utility> // Para move
|
||||
#include <vector> // Para vector
|
||||
#include "fade.h" // Para Fade, FadeMode, FadeType
|
||||
#include "global_inputs.h" // Para check
|
||||
#include "input.h" // Para Input
|
||||
#include "global_events.h" // Para check
|
||||
#include "global_inputs.h" // Para check, update
|
||||
#include "jail_audio.h" // Para JA_GetMusicState, JA_Music_state
|
||||
#include "lang.h" // Para getText
|
||||
#include "param.h" // Para Param, param, ParamGame, ParamFade
|
||||
@@ -17,14 +17,8 @@
|
||||
#include "section.h" // Para Name, name, Options, options
|
||||
#include "sprite.h" // Para Sprite
|
||||
#include "text.h" // Para Text, TEXT_CENTER, TEXT_COLOR, TEXT_...
|
||||
#include "texture.h" // Para Texture
|
||||
#include "tiled_bg.h" // Para TiledBG, TiledBGMode
|
||||
#include "utils.h" // Para Color, shdw_txt_color, Zone, no_color
|
||||
#include "global_events.h"
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
|
||||
// Constructor
|
||||
Instructions::Instructions()
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
#include "intro.h"
|
||||
#include <SDL2/SDL_events.h> // Para SDL_PollEvent, SDL_Event, SDL_QUIT, SDL...
|
||||
#include <SDL2/SDL_blendmode.h> // Para SDL_BLENDMODE_BLEND, SDL_BLENDMODE_MOD
|
||||
#include <SDL2/SDL_events.h> // Para SDL_PollEvent, SDL_Event
|
||||
#include <SDL2/SDL_pixels.h> // Para SDL_PIXELFORMAT_RGBA8888
|
||||
#include <SDL2/SDL_rect.h> // Para SDL_Rect
|
||||
#include <SDL2/SDL_render.h> // Para SDL_SetTextureBlendMode, SDL_GetRend...
|
||||
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
|
||||
#include <SDL2/SDL_video.h> // Para SDL_WINDOWEVENT_SIZE_CHANGED
|
||||
#include <array> // Para array
|
||||
#include <functional> // Para function
|
||||
#include <string> // Para basic_string, string
|
||||
#include <utility> // Para move
|
||||
#include "global_inputs.h" // Para check
|
||||
#include "input.h" // Para Input
|
||||
#include "jail_audio.h" // Para JA_StopMusic, JA_PlayMusic
|
||||
#include "global_events.h" // Para check
|
||||
#include "global_inputs.h" // Para check, update
|
||||
#include "jail_audio.h" // Para JA_PlayMusic, JA_StopMusic
|
||||
#include "lang.h" // Para getText
|
||||
#include "param.h" // Para Param, ParamGame, param
|
||||
#include "path_sprite.h" // Para PathSprite, PathType
|
||||
#include "resource.h" // Para Resource
|
||||
#include "screen.h" // Para Screen
|
||||
#include "section.h" // Para Name, name, Options, options
|
||||
#include "path_sprite.h" // Para PathSprite
|
||||
#include "text.h" // Para Text
|
||||
#include "texture.h" // Para Texture
|
||||
#include "utils.h" // Para Zone, BLOCK, Color, bg_color
|
||||
#include "tiled_bg.h" // Para TiledBG, TiledBGMode
|
||||
#include "utils.h" // Para Color, Zone, easeOutQuint, BLOCK
|
||||
#include "writer.h" // Para Writer
|
||||
#include "global_events.h"
|
||||
#include "tiled_bg.h"
|
||||
#include <array>
|
||||
|
||||
// Constructor
|
||||
Intro::Intro()
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_stdinc.h> // Para Uint32
|
||||
#include <SDL2/SDL.h> // Para SDL_Texture
|
||||
#include <memory> // Para unique_ptr, shared_ptr
|
||||
#include <SDL2/SDL_stdinc.h> // Para Uint32, Uint8
|
||||
#include <memory> // Para unique_ptr
|
||||
#include <vector> // Para vector
|
||||
#include "path_sprite.h" // Para PathSprite
|
||||
#include "tiled_bg.h" // Para TiledBG
|
||||
#include "writer.h" // Para Writer
|
||||
#include "tiled_bg.h"
|
||||
class Text; // lines 8-8
|
||||
class Texture; // lines 9-9
|
||||
|
||||
/*
|
||||
Esta clase gestiona un estado del programa. Se encarga de mostrar la secuencia
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
#include "logo.h"
|
||||
#include <SDL2/SDL_events.h> // Para SDL_PollEvent, SDL_Event, SDL_QUIT, SDL...
|
||||
#include <SDL2/SDL_events.h> // Para SDL_PollEvent, SDL_Event
|
||||
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
|
||||
#include <SDL2/SDL_video.h> // Para SDL_WINDOWEVENT_SIZE_CHANGED
|
||||
#include <utility> // Para move
|
||||
#include <iostream>
|
||||
#include "global_inputs.h" // Para check
|
||||
#include "input.h" // Para Input
|
||||
#include "jail_audio.h" // Para JA_StopMusic
|
||||
#include "global_events.h" // Para check
|
||||
#include "global_inputs.h" // Para check, update
|
||||
#include "jail_audio.h" // Para JA_FadeOutMusic, JA_PlaySound, JA_StopC...
|
||||
#include "param.h" // Para Param, ParamGame, param
|
||||
#include "resource.h" // Para Resource
|
||||
#include "screen.h" // Para Screen
|
||||
#include "section.h" // Para Name, name, Options, options
|
||||
#include "section.h" // Para Name, name
|
||||
#include "sprite.h" // Para Sprite
|
||||
#include "texture.h" // Para Texture
|
||||
#include "utils.h" // Para Color, Zone
|
||||
#include "global_events.h"
|
||||
|
||||
// Constructor
|
||||
Logo::Logo()
|
||||
@@ -114,17 +111,10 @@ void Logo::updateJAILGAMES()
|
||||
|
||||
// Comprueba si ha terminado el logo
|
||||
if (counter_ == END_LOGO_COUNTER_MARK + POST_LOGO_DURATION)
|
||||
{
|
||||
state_ = LogoState::RETROWEEKEND;
|
||||
ticks_start_ = SDL_GetTicks();
|
||||
}
|
||||
}
|
||||
|
||||
// Gestiona el logo de RETROWEEKEND
|
||||
void Logo::updateRETROWEEKEND()
|
||||
{
|
||||
section::name = section::Name::INTRO;
|
||||
}
|
||||
}
|
||||
|
||||
// Gestiona el color de las texturas
|
||||
void Logo::updateTextureColors()
|
||||
@@ -165,20 +155,8 @@ void Logo::update()
|
||||
// Comprueba las entradas
|
||||
checkInput();
|
||||
|
||||
switch (state_)
|
||||
{
|
||||
case LogoState::JAILGAMES:
|
||||
updateJAILGAMES();
|
||||
updateTextureColors();
|
||||
break;
|
||||
|
||||
case LogoState::RETROWEEKEND:
|
||||
updateRETROWEEKEND();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Gestiona el contador
|
||||
counter_++;
|
||||
@@ -194,18 +172,7 @@ void Logo::render()
|
||||
Screen::get()->start();
|
||||
Screen::get()->clean();
|
||||
|
||||
switch (state_)
|
||||
{
|
||||
case LogoState::JAILGAMES:
|
||||
renderJAILGAMES();
|
||||
break;
|
||||
|
||||
case LogoState::RETROWEEKEND:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Screen::get()->render();
|
||||
}
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
#include <SDL2/SDL_rect.h> // Para SDL_Point
|
||||
#include <SDL2/SDL_stdinc.h> // Para Uint32
|
||||
#include <SDL2/SDL.h>
|
||||
#include <memory> // Para shared_ptr, unique_ptr
|
||||
#include <vector> // Para vector
|
||||
class Sprite;
|
||||
class Sprite; // lines 8-8
|
||||
class Texture; // lines 9-9
|
||||
struct Color;
|
||||
struct Color; // lines 10-10
|
||||
|
||||
/*
|
||||
Esta clase gestiona un estado del programa. Se encarga de dibujar por pantalla el
|
||||
@@ -17,31 +16,10 @@ struct Color;
|
||||
ZX Spectrum
|
||||
*/
|
||||
|
||||
struct Pixel
|
||||
{
|
||||
int x, y; // Coordenadas del píxel
|
||||
Uint8 r, g, b, a; // Color del píxel
|
||||
|
||||
// Método para ascender y desvanecerse
|
||||
void evaporate()
|
||||
{
|
||||
y -= 1; // Asciende hacia arriba
|
||||
a = (a > 5) ? a - 5 : 0; // Desvanece el alfa (transparencia)
|
||||
// Añadir movimiento zig-zag aleatorio
|
||||
x += (rand() % 3 - 1); // Movimiento horizontal aleatorio (-1, 0, 1)
|
||||
}
|
||||
};
|
||||
|
||||
// Clase Logo
|
||||
class Logo
|
||||
{
|
||||
private:
|
||||
enum class LogoState
|
||||
{
|
||||
JAILGAMES,
|
||||
RETROWEEKEND,
|
||||
};
|
||||
|
||||
// Constantes
|
||||
static constexpr int SHOW_SINCE_SPRITE_COUNTER_MARK = 70; // Tiempo del contador en el que empieza a verse el sprite de "SINCE 1998"
|
||||
static constexpr int INIT_FADE_COUNTER_MARK = 300; // Tiempo del contador cuando inicia el fade a negro
|
||||
@@ -60,8 +38,6 @@ private:
|
||||
int counter_ = 0; // Contador
|
||||
Uint32 ticks_ = 0; // Contador de ticks para ajustar la velocidad del programa
|
||||
SDL_Point dest_; // Posición X donde dibujar el logo
|
||||
LogoState state_ = LogoState::JAILGAMES; // El estado indica qué logo se está procesando
|
||||
Uint32 ticks_start_ = 0; // Almacena el valor actual de los ticks de SDL
|
||||
|
||||
// Actualiza las variables
|
||||
void update();
|
||||
@@ -78,15 +54,9 @@ private:
|
||||
// Gestiona el logo de JAILGAMES
|
||||
void updateJAILGAMES();
|
||||
|
||||
// Gestiona el logo de RETROWEEKEND
|
||||
void updateRETROWEEKEND();
|
||||
|
||||
// Renderiza el logo de JAILGAMES
|
||||
void renderJAILGAMES();
|
||||
|
||||
// Renderiza el logo de RETROWEEKEND
|
||||
void renderRETROWEEKEND();
|
||||
|
||||
// Gestiona el color de las texturas
|
||||
void updateTextureColors();
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include "manage_hiscore_table.h"
|
||||
#include <SDL2/SDL_error.h> // Para SDL_GetError
|
||||
#include <SDL2/SDL_rwops.h> // Para SDL_RWread, SDL_RWwrite, SDL_RWFromFile
|
||||
#include <algorithm> // Para sort
|
||||
#include <algorithm> // Para find_if, sort
|
||||
#include <iostream> // Para basic_ostream, operator<<, cout, endl
|
||||
#include "utils.h" // Para HiScoreEntry, getFileName
|
||||
#include <iterator> // Para distance
|
||||
#include "utils.h" // Para getFileName
|
||||
|
||||
// Resetea la tabla a los valores por defecto
|
||||
void ManageHiScoreTable::clear()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "moving_sprite.h"
|
||||
#include <algorithm> // Para max
|
||||
#include "texture.h" // Para Texture
|
||||
|
||||
// Constructor
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_gamecontroller.h> // Para SDL_CONTROLLER_BUTTON_B, SDL_CO...
|
||||
#include <SDL2/SDL_stdinc.h> // Para Uint32
|
||||
#include <string> // Para string
|
||||
#include <vector> // Para vector
|
||||
#include "input.h" // Para InputType, InputDeviceToUse
|
||||
#include "manage_hiscore_table.h" // Para HiScoreEntry
|
||||
enum class ScreenFilter : int; // lines 10-10
|
||||
enum class ScreenVideoMode : Uint32; // lines 11-11
|
||||
enum class ScreenFilter : int; // lines 8-8
|
||||
enum class ScreenVideoMode : Uint32; // lines 9-9
|
||||
namespace lang
|
||||
{
|
||||
enum class Code : int;
|
||||
} // lines 14-14
|
||||
} // lines 12-12
|
||||
|
||||
// Dificultad del juego
|
||||
enum class GameDifficulty
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_rect.h> // Para SDL_Rect
|
||||
#include <SDL2/SDL_stdinc.h> // Para Uint32
|
||||
#include <string> // Para string
|
||||
#include <vector> // Para vector
|
||||
#include "utils.h" // Para Color, Zone
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
#include <algorithm> // Para find_if
|
||||
#include <iostream> // Para basic_ostream, operator<<, endl, cout, cerr
|
||||
#include <stdexcept> // Para runtime_error
|
||||
#include <utility> // Para pair
|
||||
#include "asset.h" // Para Asset, AssetType
|
||||
#include "jail_audio.h" // Para JA_LoadMusic, JA_LoadSound
|
||||
#include "jail_audio.h" // Para JA_DeleteMusic, JA_DeleteSound, JA_LoadMusic
|
||||
#include "lang.h" // Para getText
|
||||
#include "screen.h" // Para Screen
|
||||
#include "text.h" // Para Text, loadTextFile
|
||||
struct JA_Music_t; // lines 10-10
|
||||
struct JA_Sound_t; // lines 11-11
|
||||
struct JA_Music_t; // lines 11-11
|
||||
struct JA_Sound_t; // lines 12-12
|
||||
|
||||
// [SINGLETON] Hay que definir las variables estáticas, desde el .h sólo la hemos declarado
|
||||
Resource *Resource::resource_ = nullptr;
|
||||
|
||||
@@ -5,13 +5,12 @@
|
||||
#include <math.h> // Para roundf
|
||||
#include <iomanip> // Para operator<<, setfill, setw
|
||||
#include <sstream> // Para basic_ostream, basic_ostringstream
|
||||
#include "enter_name.h" // Para MAX_NAME_LENGHT
|
||||
#include "lang.h" // Para getText
|
||||
#include "resource.h" // Para Resource
|
||||
#include "screen.h" // Para Screen
|
||||
#include "sprite.h" // Para Sprite
|
||||
#include "text.h" // Para Text
|
||||
#include "enter_name.h" // Para NAME_LENGHT
|
||||
#include <iostream>
|
||||
#include "text.h" // Para Text, TEXT_CENTER, TEXT_COLOR
|
||||
|
||||
// [SINGLETON] Hay que definir las variables estáticas, desde el .h sólo la hemos declarado
|
||||
Scoreboard *Scoreboard::scoreboard_ = nullptr;
|
||||
@@ -297,6 +296,7 @@ void Scoreboard::fillPanelTextures()
|
||||
// NAME
|
||||
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, lang::getText(106));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_4_.x, slot4_4_.y, record_name_[i], 1, getColorLikeKnightRider(name_colors_, loop_counter_ / 5));
|
||||
// text_scoreboard_->writeColored(enter_name_pos_.x, enter_name_pos_.y, record_name_[i], getColorLikeKnightRider(name_colors_, loop_counter_ / 5));
|
||||
break;
|
||||
}
|
||||
case ScoreboardMode::GAME_COMPLETED:
|
||||
@@ -439,9 +439,12 @@ void Scoreboard::renderSeparator()
|
||||
// Inicializa el vector de colores para el nombre
|
||||
void Scoreboard::iniNameColors()
|
||||
{
|
||||
// Color color = orange_soft_color;
|
||||
Color color = green_color;
|
||||
|
||||
name_colors_.clear();
|
||||
name_colors_.emplace_back(green_color.lighten(50));
|
||||
name_colors_.emplace_back(green_color.lighten(25));
|
||||
name_colors_.emplace_back(green_color);
|
||||
name_colors_.emplace_back(green_color.darken(25));
|
||||
name_colors_.emplace_back(color.lighten(50));
|
||||
name_colors_.emplace_back(color.lighten(25));
|
||||
name_colors_.emplace_back(color);
|
||||
name_colors_.emplace_back(color.darken(25));
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
#include "screen.h"
|
||||
#include <SDL2/SDL_events.h> // Para SDL_DISABLE, SDL_ENABLE
|
||||
#include <SDL2/SDL_mouse.h> // Para SDL_ShowCursor
|
||||
#include <SDL2/SDL_pixels.h> // Para SDL_PIXELFORMAT_RGBA8888
|
||||
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
|
||||
#include <algorithm> // Para clamp, max, min
|
||||
#include <algorithm> // Para max, min
|
||||
#include <fstream> // Para basic_ifstream, ifstream
|
||||
#include <iterator> // Para istreambuf_iterator, operator==
|
||||
#include <string> // Para allocator, operator+, char_traits, to_s...
|
||||
@@ -11,11 +9,11 @@
|
||||
#include "asset.h" // Para Asset
|
||||
#include "dbgtxt.h" // Para dbg_print
|
||||
#include "global_inputs.h" // Para service_pressed_counter
|
||||
#include "jail_shader.h" // Para init, render
|
||||
#include "mouse.h" // Para updateCursorVisibility
|
||||
#include "notifier.h" // Para Notifier
|
||||
#include "on_screen_help.h" // Para OnScreenHelp
|
||||
#include "options.h" // Para Options, OptionsVideo, options, Options...
|
||||
#include "mouse.h"
|
||||
#include "jail_shader.h" // para init, render
|
||||
|
||||
// [SINGLETON]
|
||||
Screen *Screen::screen_ = nullptr;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "smart_sprite.h"
|
||||
#include "moving_sprite.h" // Para MovingSprite
|
||||
class Texture; // lines 2-2
|
||||
|
||||
// Actualiza la posición y comprueba si ha llegado a su destino
|
||||
void SmartSprite::update()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// IWYU pragma: no_include <bits/std_abs.h>
|
||||
#include "tabe.h"
|
||||
#include <SDL2/SDL_render.h> // Para SDL_FLIP_HORIZONTAL, SDL_FLIP_NONE
|
||||
#include <SDL2/SDL.h>
|
||||
#include <stdlib.h> // Para rand, abs
|
||||
#include <algorithm> // Para max
|
||||
#include "jail_audio.h" // Para JA_PlaySound
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_rect.h> // Para SDL_Rect
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_stdinc.h> // Para Uint32
|
||||
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
|
||||
#include <stdlib.h> // Para rand
|
||||
#include <memory> // Para unique_ptr
|
||||
#include "animated_sprite.h" // Para AnimatedSprite
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "utils.h"
|
||||
#include <SDL2/SDL_rwops.h> // Para SDL_RWFromFile, SDL_RWclose, SDL_RWread
|
||||
#include <stddef.h> // Para size_t
|
||||
#include <algorithm> // Para min, clamp, find_if_not, find, transform
|
||||
#include <cctype> // Para tolower, isspace
|
||||
#include <cmath> // Para cos, pow, M_PI
|
||||
#include <cmath> // Para pow, sin, M_PI, cos
|
||||
#include <compare> // Para operator<
|
||||
#include <filesystem> // Para path
|
||||
#include <iostream> // Para basic_ostream, cout, basic_ios, endl, ios
|
||||
@@ -254,7 +255,6 @@ double easeInElastic(double t)
|
||||
return t == 0 ? 0 : (t == 1 ? 1 : -pow(2, 10 * t - 10) * sin((t * 10 - 10.75) * (2 * M_PI) / 3));
|
||||
}
|
||||
|
||||
|
||||
// Función de suavizado
|
||||
double easeOutBounce(double t)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <SDL2/SDL_render.h> // Para SDL_Renderer
|
||||
#include <SDL2/SDL_stdinc.h> // Para Uint8
|
||||
#include <stdint.h> // Para int32_t
|
||||
#include <algorithm> // Para max, min
|
||||
#include <string> // Para string
|
||||
#include <vector> // Para vector
|
||||
|
||||
|
||||
Reference in New Issue
Block a user