FIX: Si saltes el logo talla el so a meitat sonar
FIX: Corregida la lògica del efecte de flash
This commit is contained in:
@@ -172,7 +172,7 @@ void Credits::checkInput()
|
|||||||
{
|
{
|
||||||
// Si todavía estan los creditos en marcha, se pasan solos a toda pastilla
|
// Si todavía estan los creditos en marcha, se pasan solos a toda pastilla
|
||||||
want_to_pass_ = true;
|
want_to_pass_ = true;
|
||||||
ticks_speed_ = 3;
|
ticks_speed_ = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Director::Director(int argc, const char *argv[])
|
|||||||
section::name = section::Name::GAME;
|
section::name = section::Name::GAME;
|
||||||
section::options = section::Options::GAME_PLAY_1P;
|
section::options = section::Options::GAME_PLAY_1P;
|
||||||
#elif DEBUG
|
#elif DEBUG
|
||||||
section::name = section::Name::CREDITS;
|
section::name = section::Name::LOGO;
|
||||||
#else // NORMAL GAME
|
#else // NORMAL GAME
|
||||||
section::name = section::Name::LOGO;
|
section::name = section::Name::LOGO;
|
||||||
section::attract_mode = section::AttractMode::TITLE_TO_DEMO;
|
section::attract_mode = section::AttractMode::TITLE_TO_DEMO;
|
||||||
@@ -105,7 +105,7 @@ void Director::init()
|
|||||||
Resource::init();
|
Resource::init();
|
||||||
Input::init(Asset::get()->get("gamecontrollerdb.txt"));
|
Input::init(Asset::get()->get("gamecontrollerdb.txt"));
|
||||||
bindInputs();
|
bindInputs();
|
||||||
Notifier::init(std::string(), Resource::get()->getText("8bithud"), Asset::get()->get("notify.wav"));
|
Notifier::init(std::string(), Resource::get()->getText("8bithud"));
|
||||||
OnScreenHelp::init();
|
OnScreenHelp::init();
|
||||||
globalInputs::init();
|
globalInputs::init();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ void Game::updateStage()
|
|||||||
++Stage::number;
|
++Stage::number;
|
||||||
JA_PlaySound(Resource::get()->getSound("stage_change.wav"));
|
JA_PlaySound(Resource::get()->getSound("stage_change.wav"));
|
||||||
balloon_manager_->resetBalloonSpeed();
|
balloon_manager_->resetBalloonSpeed();
|
||||||
screen_->flash(flash_color, 100);
|
screen_->flash(flash_color, 3);
|
||||||
screen_->shake();
|
screen_->shake();
|
||||||
|
|
||||||
// Escribe el texto por pantalla
|
// Escribe el texto por pantalla
|
||||||
@@ -1169,7 +1169,7 @@ void Game::checkEvents()
|
|||||||
}
|
}
|
||||||
case SDLK_7: // Flash
|
case SDLK_7: // Flash
|
||||||
{
|
{
|
||||||
screen_->flash(flash_color, 100);
|
screen_->flash(flash_color, 3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SDLK_8:
|
case SDLK_8:
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ Logo::~Logo()
|
|||||||
{
|
{
|
||||||
jail_texture_->setColor(255, 255, 255);
|
jail_texture_->setColor(255, 255, 255);
|
||||||
since_texture_->setColor(255, 255, 255);
|
since_texture_->setColor(255, 255, 255);
|
||||||
|
JA_PauseChannel(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recarga todas las texturas
|
// Recarga todas las texturas
|
||||||
|
|||||||
@@ -88,10 +88,10 @@ void Screen::blit()
|
|||||||
fps_counter_++;
|
fps_counter_++;
|
||||||
|
|
||||||
// Actualiza y dibuja el efecto de flash en la pantalla
|
// Actualiza y dibuja el efecto de flash en la pantalla
|
||||||
doFlash();
|
renderFlash();
|
||||||
|
|
||||||
// Atenua la pantalla
|
// Atenua la pantalla
|
||||||
doAttenuate();
|
renderAttenuate();
|
||||||
|
|
||||||
// Muestra la ayuda por pantalla
|
// Muestra la ayuda por pantalla
|
||||||
OnScreenHelp::get()->render();
|
OnScreenHelp::get()->render();
|
||||||
@@ -254,6 +254,7 @@ void Screen::setBlendMode(SDL_BlendMode blendMode)
|
|||||||
void Screen::update()
|
void Screen::update()
|
||||||
{
|
{
|
||||||
updateShakeEffect();
|
updateShakeEffect();
|
||||||
|
updateFlash();
|
||||||
Notifier::get()->update();
|
Notifier::get()->update();
|
||||||
updateFPS();
|
updateFPS();
|
||||||
OnScreenHelp::get()->update();
|
OnScreenHelp::get()->update();
|
||||||
@@ -312,21 +313,26 @@ void Screen::flash(Color color, int lenght)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actualiza y dibuja el efecto de flash en la pantalla
|
// Actualiza y dibuja el efecto de flash en la pantalla
|
||||||
void Screen::doFlash()
|
void Screen::renderFlash()
|
||||||
{
|
{
|
||||||
if (flash_effect_.enabled)
|
if (flash_effect_.enabled)
|
||||||
{
|
{
|
||||||
// Dibuja el color del flash en la textura
|
|
||||||
SDL_SetRenderDrawColor(renderer_, flash_effect_.color.r, flash_effect_.color.g, flash_effect_.color.b, 0xFF);
|
SDL_SetRenderDrawColor(renderer_, flash_effect_.color.r, flash_effect_.color.g, flash_effect_.color.b, 0xFF);
|
||||||
SDL_RenderClear(renderer_);
|
SDL_RenderClear(renderer_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Actualiza la lógica del efecto
|
// Actualiza el efecto de flash
|
||||||
|
void Screen::updateFlash()
|
||||||
|
{
|
||||||
|
if (flash_effect_.enabled)
|
||||||
|
{
|
||||||
flash_effect_.counter > 0 ? flash_effect_.counter-- : flash_effect_.enabled = false;
|
flash_effect_.counter > 0 ? flash_effect_.counter-- : flash_effect_.enabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Atenua la pantalla
|
// Atenua la pantalla
|
||||||
void Screen::doAttenuate()
|
void Screen::renderAttenuate()
|
||||||
{
|
{
|
||||||
if (attenuate_effect_)
|
if (attenuate_effect_)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -82,11 +82,14 @@ private:
|
|||||||
// Actualiza la logica para agitar la pantalla
|
// Actualiza la logica para agitar la pantalla
|
||||||
void updateShakeEffect();
|
void updateShakeEffect();
|
||||||
|
|
||||||
// Actualiza y dibuja el efecto de flash en la pantalla
|
// Dibuja el efecto de flash en la pantalla
|
||||||
void doFlash();
|
void renderFlash();
|
||||||
|
|
||||||
|
// Actualiza el efecto de flash
|
||||||
|
void updateFlash();
|
||||||
|
|
||||||
// Atenua la pantalla
|
// Atenua la pantalla
|
||||||
void doAttenuate();
|
void renderAttenuate();
|
||||||
|
|
||||||
// Calcula los frames por segundo
|
// Calcula los frames por segundo
|
||||||
void updateFPS();
|
void updateFPS();
|
||||||
|
|||||||
Reference in New Issue
Block a user