forked from jaildesigner-jailgames/jaildoctors_dilemma
renombrades les clases SSprite a SurfaceSprite
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#include "core/rendering/surface.hpp" // Para Surface
|
||||
#include "core/rendering/surface_sprite.hpp" // Para SSprite
|
||||
#include "core/resources/resource.hpp" // Para Resource
|
||||
#include "game/options.hpp" // Para Options, SectionState, options, Section
|
||||
#include "game/options.hpp" // Para Options, SectionState, options, Section
|
||||
#include "game/scene_manager.hpp" // Para SceneManager
|
||||
#include "utils/defines.hpp" // Para GAME_SPEED
|
||||
#include "utils/global_events.hpp" // Para check
|
||||
@@ -17,35 +17,24 @@
|
||||
Logo::Logo()
|
||||
: jailgames_surface_(Resource::get()->getSurface("jailgames.gif")),
|
||||
since_1998_surface_(Resource::get()->getSurface("since_1998.gif")),
|
||||
since_1998_sprite_(std::make_shared<SSprite>(since_1998_surface_, (256 - since_1998_surface_->getWidth()) / 2, 83 + jailgames_surface_->getHeight() + 5, since_1998_surface_->getWidth(), since_1998_surface_->getHeight())) {
|
||||
since_1998_sprite_(std::make_shared<SurfaceSprite>(since_1998_surface_, (256 - since_1998_surface_->getWidth()) / 2, 83 + jailgames_surface_->getHeight() + 5, since_1998_surface_->getWidth(), since_1998_surface_->getHeight())) {
|
||||
// Configura variables
|
||||
since_1998_sprite_->setClip(0, 0, since_1998_surface_->getWidth(), since_1998_surface_->getHeight());
|
||||
since_1998_color_ = static_cast<Uint8>(PaletteColor::BLACK);
|
||||
jailgames_color_ = static_cast<Uint8>(PaletteColor::BRIGHT_WHITE);
|
||||
|
||||
// Inicializa variables
|
||||
SceneManager::current = SceneManager::Scene::LOGO;
|
||||
|
||||
// Crea los sprites de cada linea
|
||||
for (int i = 0; i < jailgames_surface_->getHeight(); ++i) {
|
||||
jailgames_sprite_.push_back(std::make_shared<SSprite>(jailgames_surface_, 0, i, jailgames_surface_->getWidth(), 1));
|
||||
jailgames_sprite_.push_back(std::make_shared<SurfaceSprite>(jailgames_surface_, 0, i, jailgames_surface_->getWidth(), 1));
|
||||
jailgames_sprite_.back()->setClip(0, i, jailgames_surface_->getWidth(), 1);
|
||||
jailgames_sprite_.at(i)->setX((i % 2 == 0) ? (256 + (i * 3)) : (-181 - (i * 3)));
|
||||
jailgames_sprite_.at(i)->setY(83 + i);
|
||||
}
|
||||
|
||||
// Inicializa variables
|
||||
SceneManager::current = SceneManager::Scene::LOGO;
|
||||
|
||||
// Inicializa el vector de colores
|
||||
const std::vector<Uint8> COLORS = {
|
||||
static_cast<Uint8>(PaletteColor::BLACK),
|
||||
static_cast<Uint8>(PaletteColor::BLUE),
|
||||
static_cast<Uint8>(PaletteColor::RED),
|
||||
static_cast<Uint8>(PaletteColor::MAGENTA),
|
||||
static_cast<Uint8>(PaletteColor::GREEN),
|
||||
static_cast<Uint8>(PaletteColor::CYAN),
|
||||
static_cast<Uint8>(PaletteColor::YELLOW),
|
||||
static_cast<Uint8>(PaletteColor::BRIGHT_WHITE)};
|
||||
for (const auto& color : COLORS) {
|
||||
color_.push_back(color);
|
||||
}
|
||||
initColors(); // Inicializa el vector de colores
|
||||
|
||||
// Cambia el color del borde
|
||||
Screen::get()->setBorderColor(static_cast<Uint8>(PaletteColor::BLACK));
|
||||
@@ -220,3 +209,20 @@ void Logo::endSection() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Inicializa el vector de colores
|
||||
void Logo::initColors() {
|
||||
// Inicializa el vector de colores
|
||||
const std::vector<Uint8> COLORS = {
|
||||
static_cast<Uint8>(PaletteColor::BLACK),
|
||||
static_cast<Uint8>(PaletteColor::BLUE),
|
||||
static_cast<Uint8>(PaletteColor::RED),
|
||||
static_cast<Uint8>(PaletteColor::MAGENTA),
|
||||
static_cast<Uint8>(PaletteColor::GREEN),
|
||||
static_cast<Uint8>(PaletteColor::CYAN),
|
||||
static_cast<Uint8>(PaletteColor::YELLOW),
|
||||
static_cast<Uint8>(PaletteColor::BRIGHT_WHITE)};
|
||||
for (const auto& color : COLORS) {
|
||||
color_.push_back(color);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user