commit amb mil mini coses, colorets, fitxers que sobraven, comentaris, codi que sobrava, etc...
This commit is contained in:
@@ -27,6 +27,10 @@
|
||||
#include "utils.h" // Para Color, Zone, fade_color, no_color, BLOCK
|
||||
#include "ui/service_menu.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#include <iomanip> // Para std::hex, std::setw, std::setfill
|
||||
#endif
|
||||
|
||||
// Constructor
|
||||
Title::Title()
|
||||
: text_(Resource::get()->getText("smb2_grad")),
|
||||
@@ -107,6 +111,72 @@ void Title::checkEvents()
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event))
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 1)
|
||||
{
|
||||
static Color color = param.title.bg_color;
|
||||
switch (event.key.key)
|
||||
{
|
||||
case SDLK_A:
|
||||
if (color.r < 255)
|
||||
++color.r;
|
||||
break;
|
||||
|
||||
case SDLK_Z:
|
||||
if (color.r > 0)
|
||||
--color.r;
|
||||
break;
|
||||
|
||||
case SDLK_S:
|
||||
if (color.g < 255)
|
||||
++color.g;
|
||||
break;
|
||||
|
||||
case SDLK_X:
|
||||
if (color.g > 0)
|
||||
--color.g;
|
||||
break;
|
||||
|
||||
case SDLK_D:
|
||||
if (color.b < 255)
|
||||
++color.b;
|
||||
break;
|
||||
|
||||
case SDLK_C:
|
||||
if (color.b > 0)
|
||||
--color.b;
|
||||
break;
|
||||
|
||||
case SDLK_F:
|
||||
if (color.r < 255)
|
||||
++color.r;
|
||||
if (color.g < 255)
|
||||
++color.g;
|
||||
if (color.b < 255)
|
||||
++color.b;
|
||||
break;
|
||||
|
||||
case SDLK_V:
|
||||
if (color.r > 0)
|
||||
--color.r;
|
||||
if (color.g > 0)
|
||||
--color.g;
|
||||
if (color.b > 0)
|
||||
--color.b;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
counter_ = 0;
|
||||
tiled_bg_->setColor(color);
|
||||
std::cout << "#"
|
||||
<< std::hex << std::setw(2) << std::setfill('0') << (int)color.r
|
||||
<< std::setw(2) << std::setfill('0') << (int)color.g
|
||||
<< std::setw(2) << std::setfill('0') << (int)color.b
|
||||
<< std::endl;
|
||||
}
|
||||
#endif
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 0)
|
||||
{
|
||||
switch (event.key.key)
|
||||
@@ -477,19 +547,19 @@ void Title::initPlayers()
|
||||
// Actualza los jugadores
|
||||
void Title::updatePlayers()
|
||||
{
|
||||
for (auto &player : players_)
|
||||
{
|
||||
player->update();
|
||||
}
|
||||
for (auto &player : players_)
|
||||
{
|
||||
player->update();
|
||||
}
|
||||
}
|
||||
|
||||
// Renderiza los jugadores
|
||||
void Title::renderPlayers()
|
||||
{
|
||||
for (auto const &player : players_)
|
||||
{
|
||||
player->render();
|
||||
}
|
||||
for (auto const &player : players_)
|
||||
{
|
||||
player->render();
|
||||
}
|
||||
}
|
||||
|
||||
// Obtiene un jugador a partir de su "id"
|
||||
|
||||
Reference in New Issue
Block a user