Limpieza de código. Añadida la última versión de jail_audio

This commit is contained in:
2022-09-25 18:44:58 +02:00
parent f6494e69c8
commit 2979a6752c
35 changed files with 200 additions and 328 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "movingsprite.h"
#ifndef ANIMATEDSPRITE_H

View File

@@ -1,4 +1,6 @@
#pragma once
#include <SDL2/SDL.h>
#include "utils.h"
#include "animatedsprite.h"
#include <vector>
@@ -69,6 +71,20 @@
class Balloon
{
private:
// Estructura para las variables para el efecto de los rebotes
struct bouncing
{
bool enabled; // Si el efecto está activo
Uint8 counter; // Countador para el efecto
Uint8 speed; // Velocidad a la que transcurre el efecto
float zoomW; // Zoom aplicado a la anchura
float zoomH; // Zoom aplicado a la altura
float despX; // Desplazamiento de pixeles en el eje X antes de pintar el objeto con zoom
float despY; // Desplazamiento de pixeles en el eje Y antes de pintar el objeto con zoom
std::vector<float> w; // Vector con los valores de zoom para el ancho del globo
std::vector<float> h; // Vector con los valores de zoom para el alto del globo
};
float mPosX; // Posición en el eje X
float mPosY; // Posición en el eje Y
Uint8 mWidth; // Ancho
@@ -99,30 +115,34 @@ private:
float mSpeed; // Velocidad a la que se mueven los globos
Uint8 mSize; // Tamaño del globo
Uint8 mPower; // Cantidad de poder que alberga el globo
bouncing mBouncing; // Contiene las variables para el efecto de rebote
struct bouncing // Estructura para las variables para el efecto de los rebotes
{
bool enabled; // Si el efecto está activo
Uint8 counter; // Countador para el efecto
Uint8 speed; // Velocidad a la que transcurre el efecto
float zoomW; // Zoom aplicado a la anchura
float zoomH; // Zoom aplicado a la altura
float despX; // Desplazamiento de pixeles en el eje X antes de pintar el objeto con zoom
float despY; // Desplazamiento de pixeles en el eje Y antes de pintar el objeto con zoom
std::vector<float> w; // Vector con los valores de zoom para el ancho del globo
std::vector<float> h; // Vector con los valores de zoom para el alto del globo
};
bouncing mBouncing;
// Alinea el circulo de colisión con la posición del objeto globo
void updateColliders();
void updateColliders(); // Alinea el circulo de colisión con la posición del objeto globo
void bounceStart(); // Activa el efecto
void bounceStop(); // Detiene el efecto
void updateBounce(); // Aplica el efecto
void updateState(); // Actualiza los estados del globo
void updateAnimation(); // Establece la animación correspondiente
void setBeingCreated(bool state); // Establece el valor de la variable
void setTimeToLive(Uint16 time); // Establece el valor de la variable
Uint16 getTimeToLive(); // Obtiene del valor de la variable
// Activa el efecto
void bounceStart();
// Detiene el efecto
void bounceStop();
// Aplica el efecto
void updateBounce();
// Actualiza los estados del globo
void updateState();
// Establece la animación correspondiente
void updateAnimation();
// Establece el valor de la variable
void setBeingCreated(bool state);
// Establece el valor de la variable
void setTimeToLive(Uint16 time);
// Obtiene del valor de la variable
Uint16 getTimeToLive();
public:
// Constructor

View File

@@ -1,4 +1,6 @@
#pragma once
#include <SDL2/SDL.h>
#include "utils.h"
#include "sprite.h"

View File

@@ -1,4 +1,6 @@
#pragma once
#include <SDL2/SDL.h>
#include "sprite.h"
#ifndef COFFEEDROP_H

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "utils.h"
#include "lang.h"
@@ -10,18 +11,10 @@
#define BLOCK 8
#define HALF_BLOCK BLOCK / 2
// Tamaño de la pantalla que contendrá la pantalla de juego
//#define REAL_SCREEN_WIDTH 256
//#define REAL_SCREEN_HEIGHT 192
// Tamaño de la pantalla de juego
#define SCREEN_WIDTH 256
#define SCREEN_HEIGHT 192
// Tamaño de la pantalla que se muestra
//const int VIEW_WIDTH = REAL_SCREEN_WIDTH * 3;
//const int VIEW_HEIGHT = REAL_SCREEN_HEIGHT * 3;
// Zona de juego
const int PLAY_AREA_TOP = (0 * BLOCK);
const int PLAY_AREA_BOTTOM = SCREEN_HEIGHT - (4 * BLOCK);

View File

@@ -3,10 +3,6 @@
#include "director.h"
#include <iostream>
#include <string>
#ifdef __MIPSEL__
#include <sys/stat.h>
#include <dirent.h>
#endif
// Constructor
Director::Director(std::string path)
@@ -28,20 +24,6 @@ Director::Director(std::string path)
// Crea el puntero a la estructura y carga el fichero de configuración
mOptions = new options_t;
loadConfigFile();
//if (!loadConfigFile())
//{
// mOptions->fullScreenMode = 0;
// mOptions->windowSize = 3;
// mOptions->language = en_UK;
// mOptions->difficulty = DIFFICULTY_NORMAL;
// mOptions->input[0].deviceType = INPUT_USE_KEYBOARD;
// mOptions->input[1].deviceType = INPUT_USE_GAMECONTROLLER;
// mOptions->filter = FILTER_NEAREST;
// mOptions->vSync = true;
// mOptions->screenHeight = SCREEN_HEIGHT;
// mOptions->screenWidth = SCREEN_WIDTH;
// mOptions->integerScale = true;
//}
// Crea los objetos
mInput = new Input(mFileList[53]);
@@ -56,23 +38,8 @@ Director::Director(std::string path)
initJailAudio();
// Aplica las opciones
//SDL_SetWindowFullscreen(mWindow, mOptions->fullScreenMode);
//SDL_SetWindowSize(mWindow, REAL_SCREEN_WIDTH * mOptions->windowSize, REAL_SCREEN_HEIGHT * mOptions->windowSize);
mLang->setLang(mOptions->language);
#ifdef __MIPSEL__
DIR *dir = opendir("/media/data/local/home/.coffee_crisis");
if (dir)
{
closedir(dir);
}
else if (ENOENT == errno)
{
int status = mkdir("/media/data/local/home/.coffee_crisis", 755);
}
#endif
// Inicializa el resto de variables
init(section);
}
@@ -118,15 +85,9 @@ void Director::init(Uint8 name)
mInput->bindKey(INPUT_RIGHT, SDL_SCANCODE_RIGHT);
mInput->bindKey(INPUT_ACCEPT, SDL_SCANCODE_RETURN);
mInput->bindKey(INPUT_CANCEL, SDL_SCANCODE_ESCAPE);
#ifdef __MIPSEL__
mInput->bindKey(INPUT_BUTTON_1, SDL_SCANCODE_LSHIFT);
mInput->bindKey(INPUT_BUTTON_2, SDL_SCANCODE_SPACE);
mInput->bindKey(INPUT_BUTTON_3, SDL_SCANCODE_LCTRL);
#else
mInput->bindKey(INPUT_BUTTON_1, SDL_SCANCODE_Q);
mInput->bindKey(INPUT_BUTTON_2, SDL_SCANCODE_W);
mInput->bindKey(INPUT_BUTTON_3, SDL_SCANCODE_E);
#endif
mInput->bindKey(INPUT_BUTTON_PAUSE, SDL_SCANCODE_ESCAPE); // PAUSE
mInput->bindKey(INPUT_BUTTON_ESCAPE, SDL_SCANCODE_ESCAPE); // ESCAPE
@@ -218,15 +179,9 @@ void Director::setFileList()
mFileList[i] = "";
// Ficheros binarios
#ifdef __MIPSEL__
mFileList[0] = "/media/data/local/home/.coffee_crisis/score.bin";
mFileList[1] = "/media/data/local/home/.coffee_crisis/demo.bin";
mFileList[2] = "/media/data/local/home/.coffee_crisis/config.bin";
#else
mFileList[0] = mExecutablePath + "/" + "../data/score.bin";
mFileList[1] = mExecutablePath + "/" + "../data/demo.bin";
mFileList[2] = mExecutablePath + "/" + "../data/config.bin";
#endif
// Musicas
mFileList[3] = mExecutablePath + "/" + "../media/music/intro.ogg";

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "sprite.h"
#include "movingsprite.h"
#include "smartsprite.h"

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "ltexture.h"
#ifndef FADE_H

View File

@@ -1,8 +1,4 @@
#include "game.h"
#ifdef __MIPSEL__
#include <sys/stat.h>
#include <dirent.h>
#endif
// Constructor
Game::Game(int numPlayers, SDL_Renderer *renderer, Screen *screen, std::string *filelist, Lang *lang, Input *input, bool demo, options_t *options)
@@ -79,18 +75,6 @@ Game::Game(int numPlayers, SDL_Renderer *renderer, Screen *screen, std::string *
mSpriteGrass = new Sprite();
mSpritePowerMeter = new Sprite();
mSpriteScoreBoard = new Sprite();
#ifdef __MIPSEL__
DIR *dir = opendir("/media/data/local/home/.coffee_crisis");
if (dir)
{
closedir(dir);
}
else if (ENOENT == errno)
{
int status = mkdir("/media/data/local/home/.coffee_crisis", 755);
}
#endif
}
Game::~Game()

View File

@@ -1,9 +1,10 @@
#pragma once
#include <SDL2/SDL.h>
#include "balloon.h"
#include "bullet.h"
#include "const.h"
#include "fade.h"
#include "ifdefs.h"
#include "input.h"
#include "item.h"
#include "jail_audio.h"
@@ -74,13 +75,11 @@ private:
Uint8 numberOfEnemies; // Cantidad de enemigos que forman la formación
enemyInits_t init[MAX_NUMBER_OF_ENEMIES_IN_A_FORMATION]; // Vector con todas las inicializaciones de los enemigos de la formación
};
enemyFormation_t mEnemyFormation[NUMBER_OF_ENEMY_FORMATIONS]; // Vector con todas las formaciones enemigas
struct enemyPool_t
{
enemyFormation_t *set[10]; // Conjunto de formaciones enemigas
};
enemyPool_t mEnemyPool[10]; // Variable con los diferentes conjuntos de formaciones enemigas
struct stage_t // Contiene todas las variables relacionadas con una fase
{
@@ -113,6 +112,23 @@ private:
int itemCoffeeMachineOdds; // Probabilidad de aparición del objeto
};
struct demo_t
{
bool enabled; // Indica si está activo el modo demo
bool recording; // Indica si está activado el modo para grabar la demo
Uint16 counter; // Contador para el modo demo
demoKeys_t keys; // Variable con las pulsaciones de teclas del modo demo
demoKeys_t dataFile[TOTAL_DEMO_DATA]; // Datos del fichero con los movimientos para la demo
};
struct debug_t
{
bool enabled; // Indica si se va a mostrar la información de debug
Uint8 enemySet; // Escoge el set enemigo a generar
Uint8 gradR, gradG, gradB; // Colores RGB para modificar el color del gradiente de fondo
float hudW, hudH; // Multiplica el tamaño del hud de debug;
};
SDL_Renderer *mRenderer; // El renderizador de la ventana
Screen *mScreen; // Objeto encargado de dibujar en pantalla
std::string *mFileList; // Lista de ficheros con los recursos
@@ -231,25 +247,11 @@ private:
float mDifficultyScoreMultiplier; // Multiplicador de puntos en función de la dificultad
struct options_t *mOptions; // Variable con todas las variables de las opciones del programa
Uint8 mOnePlayerControl; // Variable para almacenar el valor de las opciones
enemyFormation_t mEnemyFormation[NUMBER_OF_ENEMY_FORMATIONS]; // Vector con todas las formaciones enemigas
enemyPool_t mEnemyPool[10]; // Variable con los diferentes conjuntos de formaciones enemigas
struct demo_t
{
bool enabled; // Indica si está activo el modo demo
bool recording; // Indica si está activado el modo para grabar la demo
Uint16 counter; // Contador para el modo demo
demoKeys_t keys; // Variable con las pulsaciones de teclas del modo demo
demoKeys_t dataFile[TOTAL_DEMO_DATA]; // Datos del fichero con los movimientos para la demo
};
demo_t mDemo; // Variable con todas las variables relacionadas con el modo demo
struct debug_t
{
bool enabled; // Indica si se va a mostrar la información de debug
Uint8 enemySet; // Escoge el set enemigo a generar
Uint8 gradR, gradG, gradB; // Colores RGB para modificar el color del gradiente de fondo
float hudW, hudH; // Multiplica el tamaño del hud de debug;
};
debug_t mDebug;
debug_t mDebug; // Variable con las opciones de debug
// Inicializa el vector con los valores del seno
void initSin();

View File

@@ -1,11 +0,0 @@
#include <SDL2/SDL.h>
#ifdef __linux__
#ifdef __MIPSEL__
#include "SDL.h"
#else
#include <SDL2/SDL.h>
#endif
#endif
#define UNUSED

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include <string>
#include <vector>

View File

@@ -1,8 +1,4 @@
#include "instructions.h"
#ifdef __MIPSEL__
#include <sys/stat.h>
#include <dirent.h>
#endif
const Uint8 SELF = 0;

View File

@@ -1,6 +1,7 @@
#pragma once
#include <SDL2/SDL.h>
#include "const.h"
#include "ifdefs.h"
#include "jail_audio.h"
#include "screen.h"
#include "sprite.h"

View File

@@ -1,8 +1,4 @@
#include "intro.h"
#ifdef __MIPSEL__
#include <sys/stat.h>
#include <dirent.h>
#endif
// Constructor
Intro::Intro(SDL_Renderer *renderer, Screen *screen, std::string *fileList, Lang *lang)

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "const.h"
#include "utils.h"
#include "screen.h"
@@ -52,6 +53,9 @@ private:
Uint8 mEvents[INTRO_TOTAL_EVENTS]; // Vector para coordinar los eventos de la intro
JA_Music mMusic; // Musica para la intro
// Carga los recursos
bool loadMedia();
public:
// Constructor
Intro(SDL_Renderer *renderer, Screen *screen, std::string *fileList, Lang *lang);
@@ -62,9 +66,6 @@ public:
// Inicializa las variables
void init();
// Carga los recursos
bool loadMedia();
// Bucle principal
section_t run();
};

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "animatedsprite.h"
#include "utils.h"
@@ -39,6 +40,8 @@ private:
void shiftColliders();
public:
Uint16 mTimeToLive; // Temporizador con el tiempo que el objeto está presente
// Constructor
Item();
@@ -93,9 +96,6 @@ public:
// Obtiene el circulo de colisión
circle_t &getCollider();
// Temporizador con el tiempo que el objeto está presente
Uint16 mTimeToLive;
// Informa si el objeto ha colisionado con el suelo
bool floorCollision();
};

View File

@@ -1,6 +1,7 @@
#ifndef __MIPSEL__
#include "jail_audio.h"
#include "stb_vorbis.c"
#include <SDL2/SDL.h>
#include <stdio.h>
#define JA_MAX_SIMULTANEOUS_CHANNELS 5
@@ -30,16 +31,17 @@ JA_Channel_t channels[JA_MAX_SIMULTANEOUS_CHANNELS];
int JA_freq {48000};
SDL_AudioFormat JA_format {AUDIO_S16};
Uint8 JA_channels {2};
int JA_volume = 128;
void audioCallback(void * userdata, uint8_t * stream, int len) {
SDL_memset(stream, 0, len);
if (current_music != NULL && current_music->state == JA_MUSIC_PLAYING) {
const int size = SDL_min(len, current_music->samples*2-current_music->pos);
SDL_memcpy(stream, current_music->output+current_music->pos, size);
SDL_MixAudioFormat(stream, (Uint8*)(current_music->output+current_music->pos), AUDIO_S16, size, JA_volume);
current_music->pos += size/2;
if (size < len) {
if (current_music->times != 0) {
SDL_memcpy(stream+size, current_music->output, len-size);
SDL_MixAudioFormat(stream+size, (Uint8*)current_music->output, AUDIO_S16, len-size, JA_volume);
current_music->pos = (len-size)/2;
if (current_music->times > 0) current_music->times--;
} else {
@@ -52,11 +54,11 @@ void audioCallback(void * userdata, uint8_t * stream, int len) {
for (int i = 0; i < JA_MAX_SIMULTANEOUS_CHANNELS; i++) {
if (channels[i].state == JA_CHANNEL_PLAYING) {
const int size = SDL_min(len, channels[i].sound->length - channels[i].pos);
SDL_MixAudioFormat(stream, channels[i].sound->buffer + channels[i].pos, AUDIO_S16, size, 64);
SDL_MixAudioFormat(stream, channels[i].sound->buffer + channels[i].pos, AUDIO_S16, size, JA_volume/2);
channels[i].pos += size;
if (size < len) {
if (channels[i].times != 0) {
SDL_MixAudioFormat(stream + size, channels[i].sound->buffer, AUDIO_S16, len-size, 64);
SDL_MixAudioFormat(stream + size, channels[i].sound->buffer, AUDIO_S16, len-size, JA_volume/2);
channels[i].pos = len-size;
if (channels[i].times > 0) channels[i].times--;
} else {
@@ -79,7 +81,19 @@ void JA_Init(const int freq, const SDL_AudioFormat format, const int channels) {
JA_Music JA_LoadMusic(const char* filename) {
int chan, samplerate;
JA_Music music = new JA_Music_t();
music->samples = stb_vorbis_decode_filename(filename, &chan, &samplerate, &music->output);
// [RZC 28/08/22] Carreguem primer el arxiu en memòria i després el descomprimim. Es algo més rapid.
FILE *f = fopen(filename, "rb");
fseek(f, 0, SEEK_END);
long fsize = ftell(f);
fseek(f, 0, SEEK_SET);
Uint8 *buffer = (Uint8*)malloc(fsize + 1);
fread(buffer, fsize, 1, f);
fclose(f);
music->samples = stb_vorbis_decode_memory(buffer, fsize, &chan, &samplerate, &music->output);
free(buffer);
// [RZC 28/08/22] Abans el descomprimiem mentre el teniem obert
// music->samples = stb_vorbis_decode_filename(filename, &chan, &samplerate, &music->output);
SDL_AudioCVT cvt;
SDL_BuildAudioCVT(&cvt, AUDIO_S16, chan, samplerate, JA_format, JA_channels, JA_freq);
@@ -134,6 +148,13 @@ void JA_DeleteMusic(JA_Music music) {
delete music;
}
JA_Sound JA_NewSound(Uint8* buffer, Uint32 length) {
JA_Sound sound = new JA_Sound_t();
sound->buffer = buffer;
sound->length = length;
return sound;
}
JA_Sound JA_LoadSound(const char* filename) {
JA_Sound sound = new JA_Sound_t();
SDL_AudioSpec wavSpec;
@@ -210,4 +231,8 @@ JA_Channel_state JA_GetChannelState(const int channel) {
if (channel < 0 || channel >= JA_MAX_SIMULTANEOUS_CHANNELS) return JA_CHANNEL_INVALID;
return channels[channel].state;
}
#endif
int JA_SetVolume(int volume) {
JA_volume = volume > 128 ? 128 : volume < 0 ? 0 : volume;
return JA_volume;
}

View File

@@ -1,5 +1,5 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
enum JA_Channel_state { JA_CHANNEL_INVALID, JA_CHANNEL_FREE, JA_CHANNEL_PLAYING, JA_CHANNEL_PAUSED };
enum JA_Music_state { JA_MUSIC_INVALID, JA_MUSIC_PLAYING, JA_MUSIC_PAUSED, JA_MUSIC_STOPPED };
@@ -17,6 +17,7 @@ void JA_StopMusic();
JA_Music_state JA_GetMusicState();
void JA_DeleteMusic(JA_Music music);
JA_Sound JA_NewSound(Uint8* buffer, Uint32 length);
JA_Sound JA_LoadSound(const char* filename);
int JA_PlaySound(JA_Sound sound, const int loop = 0);
void JA_PauseChannel(const int channel);
@@ -24,3 +25,5 @@ void JA_ResumeChannel(const int channel);
void JA_StopChannel(const int channel);
JA_Channel_state JA_GetChannelState(const int channel);
void JA_DeleteSound(JA_Sound sound);
int JA_SetVolume(int volume);

View File

@@ -1,106 +0,0 @@
#ifdef __MIPSEL__
#include "jail_audio.h"
#include <SDL2/SDL_mixer.h>
struct JA_Sound_t {
Mix_Chunk *mix_chunk;
};
struct JA_Music_t {
Mix_Music* mix_music;
};
JA_Music current_music{NULL};
void JA_Init(const int freq, const SDL_AudioFormat format, const int channels) {
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 1024);
Mix_AllocateChannels(8);
}
JA_Music JA_LoadMusic(const char* filename) {
int chan, samplerate;
JA_Music music = new JA_Music_t();
music->mix_music = Mix_LoadMUS(filename);
return music;
}
void JA_PlayMusic(JA_Music music, const int loop) {
if (current_music == music) return;
if (current_music != NULL) {
Mix_HaltMusic();
}
current_music = music;
Mix_PlayMusic(music->mix_music, loop);
}
void JA_PauseMusic() {
Mix_PauseMusic();
}
void JA_ResumeMusic() {
Mix_ResumeMusic();
}
void JA_StopMusic() {
Mix_HaltMusic();
}
JA_Music_state JA_GetMusicState() {
if (current_music == NULL) return JA_MUSIC_INVALID;
if (Mix_PausedMusic()) {
return JA_MUSIC_PAUSED;
} else if (Mix_PlayingMusic()) {
return JA_MUSIC_PLAYING;
} else {
return JA_MUSIC_STOPPED;
}
}
void JA_DeleteMusic(JA_Music music) {
if (current_music == music) {
Mix_HaltMusic();
current_music = NULL;
}
Mix_FreeMusic(music->mix_music);
delete music;
}
JA_Sound JA_LoadSound(const char* filename) {
JA_Sound sound = new JA_Sound_t();
sound->mix_chunk = Mix_LoadWAV(filename);
return sound;
}
int JA_PlaySound(JA_Sound sound, const int loop) {
int channel = Mix_PlayChannel(-1, sound->mix_chunk, loop);
return channel;
}
void JA_DeleteSound(JA_Sound sound) {
Mix_FreeChunk(sound->mix_chunk);
delete sound;
}
void JA_PauseChannel(const int channel) {
Mix_Pause(channel);
}
void JA_ResumeChannel(const int channel) {
Mix_Resume(channel);
}
void JA_StopChannel(const int channel) {
Mix_HaltChannel(channel);
}
JA_Channel_state JA_GetChannelState(const int channel) {
if (Mix_Paused(channel)) {
return JA_CHANNEL_PAUSED;
} else if (Mix_Playing(channel)) {
return JA_CHANNEL_PLAYING;
} else {
return JA_CHANNEL_FREE;
}
}
#endif

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include <string>
#ifndef LANG_H

View File

@@ -1,8 +1,4 @@
#include "logo.h"
#ifdef __MIPSEL__
#include <sys/stat.h>
#include <dirent.h>
#endif
#define INIT_FADE 100
#define END_LOGO 200

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "const.h"
#include "utils.h"
#include "sprite.h"

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include <stdio.h>
#include <string>

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "sprite.h"
#include "text.h"
#include "input.h"

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "sprite.h"
#ifndef MOVINGSPRITE_H

View File

@@ -1,4 +1,6 @@
#pragma once
#include <SDL2/SDL.h>
#include "utils.h"
#include "input.h"
#include "animatedsprite.h"

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "utils.h"
#ifndef SCREEN_H

View File

@@ -1,4 +1,6 @@
#pragma once
#include <SDL2/SDL.h>
#include "utils.h"
#include "animatedsprite.h"

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "ltexture.h"
#ifndef SPRITE_H

View File

@@ -1,4 +1,6 @@
#pragma once
#include <SDL2/SDL.h>
#include "sprite.h"
#include "utils.h"

View File

@@ -1,8 +1,4 @@
#include "title.h"
#ifdef __MIPSEL__
#include <sys/stat.h>
#include <dirent.h>
#endif
// Constructor
Title::Title(SDL_Window *window, SDL_Renderer *renderer, Screen *screen, Input *input, std::string *fileList, options_t *options, Lang *lang)
@@ -516,10 +512,6 @@ void Title::updateMenuLabels()
// Aplica las opciones de menu seleccionadas
void Title::applyOptions()
{
//SDL_SetWindowFullscreen(mWindow, mOptions->fullScreenMode);
//if (mOptions->fullScreenMode == 0)
// SDL_SetWindowSize(mWindow, mOptions->screenWidth * mOptions->windowSize, mOptions->screenHeight * mOptions->windowSize);
//SDL_RenderSetLogicalSize(mRenderer, mOptions->screenWidth, mOptions->screenHeight);
mScreen->setVideoMode(mOptions->fullScreenMode);
mLang->setLang(mOptions->language);

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "const.h"
#include "utils.h"
#include "sprite.h"

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ifdefs.h"
#include <SDL2/SDL.h>
#include "ltexture.h"
#include <string>

View File

@@ -1,4 +1,6 @@
#pragma once
#include <SDL2/SDL.h>
#include "sprite.h"
#include "text.h"