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
|
||||
|
||||
|
||||
192
source/gif.cpp
192
source/gif.cpp
@@ -1,13 +1,13 @@
|
||||
#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,
|
||||
void uncompress(int code_length,
|
||||
const unsigned char *input,
|
||||
int input_length,
|
||||
unsigned char *out )
|
||||
unsigned char *out)
|
||||
{
|
||||
//int maxbits;
|
||||
// int maxbits;
|
||||
int i, bit;
|
||||
int code, prev = -1;
|
||||
dictionary_entry_t *dictionary;
|
||||
@@ -18,15 +18,15 @@ void uncompress( int code_length,
|
||||
int stop_code; // one more than clear code
|
||||
int match_len;
|
||||
|
||||
clear_code = 1 << ( code_length );
|
||||
clear_code = 1 << (code_length);
|
||||
stop_code = clear_code + 1;
|
||||
// To handle clear codes
|
||||
reset_code_length = code_length;
|
||||
|
||||
// Create a dictionary large enough to hold "code_length" entries.
|
||||
// Once the dictionary overflows, code_length increases
|
||||
dictionary = ( dictionary_entry_t * )
|
||||
malloc( sizeof( dictionary_entry_t ) * ( 1 << ( code_length + 1 ) ) );
|
||||
dictionary = (dictionary_entry_t *)
|
||||
malloc(sizeof(dictionary_entry_t) * (1 << (code_length + 1)));
|
||||
|
||||
// Initialize the first 2^code_len entries of the dictionary with their
|
||||
// indices. The rest of the entries will be built up dynamically.
|
||||
@@ -35,14 +35,14 @@ void uncompress( int code_length,
|
||||
// dictionary. The spec says that the encoder "should output a
|
||||
// clear code as the first code in the image data stream". It doesn't
|
||||
// say must, though...
|
||||
for ( dictionary_ind = 0;
|
||||
dictionary_ind < ( 1 << code_length );
|
||||
dictionary_ind++ )
|
||||
for (dictionary_ind = 0;
|
||||
dictionary_ind < (1 << code_length);
|
||||
dictionary_ind++)
|
||||
{
|
||||
dictionary[ dictionary_ind ].byte = dictionary_ind;
|
||||
dictionary[dictionary_ind].byte = dictionary_ind;
|
||||
// XXX this only works because prev is a 32-bit int (> 12 bits)
|
||||
dictionary[ dictionary_ind ].prev = -1;
|
||||
dictionary[ dictionary_ind ].len = 1;
|
||||
dictionary[dictionary_ind].prev = -1;
|
||||
dictionary[dictionary_ind].len = 1;
|
||||
}
|
||||
|
||||
// 2^code_len + 1 is the special "end" code; don't give it an entry here
|
||||
@@ -50,48 +50,48 @@ void uncompress( int code_length,
|
||||
dictionary_ind++;
|
||||
|
||||
// TODO verify that the very last byte is clear_code + 1
|
||||
while ( input_length )
|
||||
while (input_length)
|
||||
{
|
||||
code = 0x0;
|
||||
// Always read one more bit than the code length
|
||||
for ( i = 0; i < ( code_length + 1 ); i++ )
|
||||
for (i = 0; i < (code_length + 1); i++)
|
||||
{
|
||||
// This is different than in the file read example; that
|
||||
// was a call to "next_bit"
|
||||
bit = ( *input & mask ) ? 1 : 0;
|
||||
bit = (*input & mask) ? 1 : 0;
|
||||
mask <<= 1;
|
||||
|
||||
if ( mask == 0x100 )
|
||||
if (mask == 0x100)
|
||||
{
|
||||
mask = 0x01;
|
||||
input++;
|
||||
input_length--;
|
||||
}
|
||||
|
||||
code = code | ( bit << i );
|
||||
code = code | (bit << i);
|
||||
}
|
||||
|
||||
if ( code == clear_code )
|
||||
if (code == clear_code)
|
||||
{
|
||||
code_length = reset_code_length;
|
||||
dictionary = ( dictionary_entry_t * ) realloc( dictionary,
|
||||
sizeof( dictionary_entry_t ) * ( 1 << ( code_length + 1 ) ) );
|
||||
dictionary = (dictionary_entry_t *)realloc(dictionary,
|
||||
sizeof(dictionary_entry_t) * (1 << (code_length + 1)));
|
||||
|
||||
for ( dictionary_ind = 0;
|
||||
dictionary_ind < ( 1 << code_length );
|
||||
dictionary_ind++ )
|
||||
for (dictionary_ind = 0;
|
||||
dictionary_ind < (1 << code_length);
|
||||
dictionary_ind++)
|
||||
{
|
||||
dictionary[ dictionary_ind ].byte = dictionary_ind;
|
||||
dictionary[dictionary_ind].byte = dictionary_ind;
|
||||
// XXX this only works because prev is a 32-bit int (> 12 bits)
|
||||
dictionary[ dictionary_ind ].prev = -1;
|
||||
dictionary[ dictionary_ind ].len = 1;
|
||||
dictionary[dictionary_ind].prev = -1;
|
||||
dictionary[dictionary_ind].len = 1;
|
||||
}
|
||||
dictionary_ind++;
|
||||
dictionary_ind++;
|
||||
prev = -1;
|
||||
continue;
|
||||
}
|
||||
else if ( code == stop_code )
|
||||
else if (code == stop_code)
|
||||
{
|
||||
/*if ( input_length > 1 )
|
||||
{
|
||||
@@ -103,73 +103,73 @@ void uncompress( int code_length,
|
||||
|
||||
// Update the dictionary with this character plus the _entry_
|
||||
// (character or string) that came before it
|
||||
if ( ( prev > -1 ) && ( code_length < 12 ) )
|
||||
if ((prev > -1) && (code_length < 12))
|
||||
{
|
||||
if ( code > dictionary_ind )
|
||||
if (code > dictionary_ind)
|
||||
{
|
||||
fprintf( stderr, "code = %.02x, but dictionary_ind = %.02x\n",
|
||||
code, dictionary_ind );
|
||||
exit( 0 );
|
||||
fprintf(stderr, "code = %.02x, but dictionary_ind = %.02x\n",
|
||||
code, dictionary_ind);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// Special handling for KwKwK
|
||||
if ( code == dictionary_ind )
|
||||
if (code == dictionary_ind)
|
||||
{
|
||||
int ptr = prev;
|
||||
|
||||
while ( dictionary[ ptr ].prev != -1 )
|
||||
while (dictionary[ptr].prev != -1)
|
||||
{
|
||||
ptr = dictionary[ ptr ].prev;
|
||||
ptr = dictionary[ptr].prev;
|
||||
}
|
||||
dictionary[ dictionary_ind ].byte = dictionary[ ptr ].byte;
|
||||
dictionary[dictionary_ind].byte = dictionary[ptr].byte;
|
||||
}
|
||||
else
|
||||
{
|
||||
int ptr = code;
|
||||
while ( dictionary[ ptr ].prev != -1 )
|
||||
while (dictionary[ptr].prev != -1)
|
||||
{
|
||||
ptr = dictionary[ ptr ].prev;
|
||||
ptr = dictionary[ptr].prev;
|
||||
}
|
||||
dictionary[ dictionary_ind ].byte = dictionary[ ptr ].byte;
|
||||
dictionary[dictionary_ind].byte = dictionary[ptr].byte;
|
||||
}
|
||||
|
||||
dictionary[ dictionary_ind ].prev = prev;
|
||||
dictionary[dictionary_ind].prev = prev;
|
||||
|
||||
dictionary[ dictionary_ind ].len = dictionary[ prev ].len + 1;
|
||||
dictionary[dictionary_ind].len = dictionary[prev].len + 1;
|
||||
|
||||
dictionary_ind++;
|
||||
|
||||
// GIF89a mandates that this stops at 12 bits
|
||||
if ( ( dictionary_ind == ( 1 << ( code_length + 1 ) ) ) &&
|
||||
( code_length < 11 ) )
|
||||
if ((dictionary_ind == (1 << (code_length + 1))) &&
|
||||
(code_length < 11))
|
||||
{
|
||||
code_length++;
|
||||
|
||||
dictionary = ( dictionary_entry_t * ) realloc( dictionary,
|
||||
sizeof( dictionary_entry_t ) * ( 1 << ( code_length + 1 ) ) );
|
||||
dictionary = (dictionary_entry_t *)realloc(dictionary,
|
||||
sizeof(dictionary_entry_t) * (1 << (code_length + 1)));
|
||||
}
|
||||
}
|
||||
|
||||
prev = code;
|
||||
|
||||
// Now copy the dictionary entry backwards into "out"
|
||||
match_len = dictionary[ code ].len;
|
||||
while ( code != -1 )
|
||||
match_len = dictionary[code].len;
|
||||
while (code != -1)
|
||||
{
|
||||
out[ dictionary[ code ].len - 1 ] = dictionary[ code ].byte;
|
||||
if ( dictionary[ code ].prev == code )
|
||||
out[dictionary[code].len - 1] = dictionary[code].byte;
|
||||
if (dictionary[code].prev == code)
|
||||
{
|
||||
fprintf( stderr, "Internal error; self-reference." );
|
||||
exit( 0 );
|
||||
fprintf(stderr, "Internal error; self-reference.");
|
||||
exit(0);
|
||||
}
|
||||
code = dictionary[ code ].prev;
|
||||
code = dictionary[code].prev;
|
||||
}
|
||||
|
||||
out += match_len;
|
||||
}
|
||||
}
|
||||
|
||||
static int read_sub_blocks( unsigned char* buffer, unsigned char **data )
|
||||
static int read_sub_blocks(unsigned char *buffer, unsigned char **data)
|
||||
{
|
||||
int data_length;
|
||||
int index;
|
||||
@@ -181,17 +181,17 @@ static int read_sub_blocks( unsigned char* buffer, unsigned char **data )
|
||||
*data = NULL;
|
||||
index = 0;
|
||||
|
||||
while ( 1 )
|
||||
while (1)
|
||||
{
|
||||
READ(&block_size, 1);
|
||||
|
||||
if ( block_size == 0 ) // end of sub-blocks
|
||||
if (block_size == 0) // end of sub-blocks
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
data_length += block_size;
|
||||
*data = (unsigned char*)realloc( *data, data_length );
|
||||
*data = (unsigned char *)realloc(*data, data_length);
|
||||
|
||||
// TODO this could be split across block size boundaries
|
||||
READ(*data + index, block_size);
|
||||
@@ -202,10 +202,10 @@ static int read_sub_blocks( unsigned char* buffer, unsigned char **data )
|
||||
return data_length;
|
||||
}
|
||||
|
||||
unsigned char* process_image_descriptor( unsigned char* buffer,
|
||||
unsigned char *process_image_descriptor(unsigned char *buffer,
|
||||
rgb *gct,
|
||||
int gct_size,
|
||||
int resolution_bits )
|
||||
int resolution_bits)
|
||||
{
|
||||
image_descriptor_t image_descriptor;
|
||||
int compressed_data_length;
|
||||
@@ -221,20 +221,21 @@ unsigned char* process_image_descriptor( unsigned char* buffer,
|
||||
|
||||
READ(&lzw_code_size, 1);
|
||||
|
||||
compressed_data_length = read_sub_blocks( buffer, &compressed_data );
|
||||
compressed_data_length = read_sub_blocks(buffer, &compressed_data);
|
||||
|
||||
// width = image_descriptor.image_width;
|
||||
// height = image_descriptor.image_height;
|
||||
// width = image_descriptor.image_width;
|
||||
// height = image_descriptor.image_height;
|
||||
uncompressed_data_length = image_descriptor.image_width *
|
||||
image_descriptor.image_height;
|
||||
uncompressed_data = (unsigned char*)malloc( uncompressed_data_length );
|
||||
uncompressed_data = (unsigned char *)malloc(uncompressed_data_length);
|
||||
|
||||
uncompress( lzw_code_size, compressed_data, compressed_data_length,
|
||||
uncompressed_data );
|
||||
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 )
|
||||
// if ( uncompressed_data )
|
||||
// free( uncompressed_data );
|
||||
|
||||
return uncompressed_data;
|
||||
@@ -247,10 +248,11 @@ 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;
|
||||
// int color_resolution_bits;
|
||||
|
||||
int global_color_table_size = 0; // number of entries in global_color_table
|
||||
uint32_t *global_color_table = NULL;
|
||||
@@ -258,36 +260,38 @@ uint32_t* LoadPalette(unsigned char *buffer) {
|
||||
READ(header, 6);
|
||||
READ(&screen_descriptor, 7);
|
||||
|
||||
//color_resolution_bits = ((screen_descriptor.fields & 0x70) >> 4) + 1;
|
||||
// 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) {
|
||||
global_color_table[i] = (buffer[0]<<16) + (buffer[1]<<8) + buffer[2];
|
||||
buffer+=3;
|
||||
// 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)
|
||||
{
|
||||
global_color_table[i] = (buffer[0] << 16) + (buffer[1] << 8) + buffer[2];
|
||||
buffer += 3;
|
||||
}
|
||||
}
|
||||
return global_color_table;
|
||||
}
|
||||
|
||||
static unsigned char* process_gif_stream(unsigned char *buffer, unsigned short* w, unsigned short* h)
|
||||
static unsigned char *process_gif_stream(unsigned char *buffer, unsigned short *w, unsigned short *h)
|
||||
{
|
||||
unsigned char header[ 7 ];
|
||||
unsigned char header[7];
|
||||
screen_descriptor_t screen_descriptor;
|
||||
int color_resolution_bits;
|
||||
|
||||
int global_color_table_size =0; // number of entries in global_color_table
|
||||
int global_color_table_size = 0; // number of entries in global_color_table
|
||||
rgb *global_color_table = NULL;
|
||||
|
||||
unsigned char block_type = 0x0;
|
||||
|
||||
// A GIF file starts with a Header (section 17)
|
||||
READ(header, 6);
|
||||
header[ 6 ] = 0x0;
|
||||
header[6] = 0x0;
|
||||
|
||||
// XXX there's another format, GIF87a, that you may still find
|
||||
// floating around.
|
||||
@@ -309,27 +313,26 @@ static unsigned char* process_gif_stream(unsigned char *buffer, unsigned short*
|
||||
*w = screen_descriptor.width;
|
||||
*h = screen_descriptor.height;
|
||||
|
||||
color_resolution_bits = ( ( screen_descriptor.fields & 0x70 ) >> 4 ) + 1;
|
||||
color_resolution_bits = ((screen_descriptor.fields & 0x70) >> 4) + 1;
|
||||
|
||||
if ( screen_descriptor.fields & 0x80 )
|
||||
if (screen_descriptor.fields & 0x80)
|
||||
{
|
||||
//int i;
|
||||
// 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 );
|
||||
global_color_table = (rgb *)malloc(3 * global_color_table_size);
|
||||
|
||||
// XXX this could conceivably return a short count...
|
||||
READ(global_color_table, 3 * global_color_table_size);
|
||||
}
|
||||
|
||||
while ( block_type != TRAILER )
|
||||
while (block_type != TRAILER)
|
||||
{
|
||||
READ(&block_type, 1);
|
||||
|
||||
unsigned char size;
|
||||
switch ( block_type )
|
||||
switch (block_type)
|
||||
{
|
||||
case IMAGE_DESCRIPTOR:
|
||||
return process_image_descriptor(buffer,
|
||||
@@ -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);
|
||||
@@ -354,16 +358,16 @@ static unsigned char* process_gif_stream(unsigned char *buffer, unsigned short*
|
||||
case TRAILER:
|
||||
break;
|
||||
default:
|
||||
fprintf( stderr, "Bailing on unrecognized block type %.02x\n",
|
||||
block_type );
|
||||
fprintf(stderr, "Bailing on unrecognized block type %.02x\n",
|
||||
block_type);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
36
source/gif.h
36
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,34 +38,39 @@ 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;
|
||||
} plaintext_extension_t;
|
||||
|
||||
void uncompress(int code_length, const unsigned char *input, int input_length, unsigned char *out);
|
||||
uint32_t* LoadPalette(unsigned char *buffer);
|
||||
unsigned char* LoadGif(unsigned char *buffer, unsigned short* w, unsigned short* h);
|
||||
uint32_t *LoadPalette(unsigned char *buffer);
|
||||
unsigned char *LoadGif(unsigned char *buffer, unsigned short *w, unsigned short *h);
|
||||
@@ -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()
|
||||
@@ -358,7 +361,7 @@ void Intro::initSprites()
|
||||
SDL_RenderCopy(Screen::get()->getRenderer(), texture, nullptr, &rect);
|
||||
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_NONE);
|
||||
|
||||
//shadow_texture->setAlpha(160);
|
||||
// shadow_texture->setAlpha(160);
|
||||
|
||||
SDL_SetRenderTarget(Screen::get()->getRenderer(), temp);
|
||||
shadow_textures.push_back(shadow_texture);
|
||||
|
||||
@@ -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()
|
||||
@@ -115,15 +112,8 @@ 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
|
||||
@@ -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
|
||||
@@ -28,7 +27,7 @@ MovingSprite::MovingSprite(std::shared_ptr<Texture> texture)
|
||||
rotate_(Rotate()),
|
||||
zoom_w_(1.0f),
|
||||
zoom_h_(1.0f),
|
||||
flip_(SDL_FLIP_NONE) {Sprite::clear(); }
|
||||
flip_(SDL_FLIP_NONE) { Sprite::clear(); }
|
||||
|
||||
// Reinicia todas las variables
|
||||
void MovingSprite::clear()
|
||||
|
||||
@@ -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