forked from jaildesigner-jailgames/jaildoctors_dilemma
canviat Options de struct a namespace
This commit is contained in:
@@ -3,16 +3,16 @@
|
||||
#include <SDL3/SDL.h>
|
||||
#include <stdlib.h> // Para rand
|
||||
|
||||
#include "utils/defines.hpp" // Para GAME_SPEED
|
||||
#include "external/jail_audio.h" // Para JA_PlayMusic, JA_SetVolume, JA_StopMusic
|
||||
#include "utils/global_events.hpp" // Para check
|
||||
#include "core/input/global_inputs.hpp" // Para check
|
||||
#include "game/gameplay/options.hpp" // Para Options, options, SectionState, Options...
|
||||
#include "core/resources/resource.hpp" // Para Resource
|
||||
#include "core/rendering/screen.hpp" // Para Screen
|
||||
#include "core/input/global_inputs.hpp" // Para check
|
||||
#include "core/rendering/screen.hpp" // Para Screen
|
||||
#include "core/rendering/surface.hpp" // Para Surface
|
||||
#include "core/rendering/surface_sprite.hpp" // Para SSprite
|
||||
#include "core/rendering/surface.hpp" // Para Surface
|
||||
#include "utils/utils.hpp" // Para stringToColor, PaletteColor
|
||||
#include "core/resources/resource.hpp" // Para Resource
|
||||
#include "external/jail_audio.h" // Para JA_PlayMusic, JA_SetVolume, JA_StopMusic
|
||||
#include "game/gameplay/options.hpp" // Para Options, options, SectionState, Options...
|
||||
#include "utils/defines.hpp" // Para GAME_SPEED
|
||||
#include "utils/global_events.hpp" // Para check
|
||||
#include "utils/utils.hpp" // Para stringToColor, PaletteColor
|
||||
|
||||
// Constructor
|
||||
LoadingScreen::LoadingScreen()
|
||||
@@ -20,13 +20,13 @@ LoadingScreen::LoadingScreen()
|
||||
color_loading_screen_surface_(Resource::get()->getSurface("loading_screen_color.gif")),
|
||||
mono_loading_screen_sprite_(std::make_shared<SSprite>(mono_loading_screen_surface_, 0, 0, mono_loading_screen_surface_->getWidth(), mono_loading_screen_surface_->getHeight())),
|
||||
color_loading_screen_sprite_(std::make_shared<SSprite>(color_loading_screen_surface_, 0, 0, color_loading_screen_surface_->getWidth(), color_loading_screen_surface_->getHeight())),
|
||||
screen_surface_(std::make_shared<Surface>(options.game.width, options.game.height)) {
|
||||
screen_surface_(std::make_shared<Surface>(Options::game.width, Options::game.height)) {
|
||||
// Configura la superficie donde se van a pintar los sprites
|
||||
screen_surface_->clear(static_cast<Uint8>(PaletteColor::WHITE));
|
||||
|
||||
// Inicializa variables
|
||||
options.section.section = Section::LOADING_SCREEN;
|
||||
options.section.subsection = Subsection::NONE;
|
||||
Options::section.section = Options::Scene::LOADING_SCREEN;
|
||||
Options::section.subsection = Options::SceneOptions::NONE;
|
||||
|
||||
// Establece el orden de las lineas para imitar el direccionamiento de memoria del spectrum
|
||||
for (int i = 0; i < 192; ++i) {
|
||||
@@ -96,8 +96,8 @@ void LoadingScreen::updateLoad() {
|
||||
|
||||
// Comprueba si ha terminado la intro
|
||||
if (load_counter_ >= 768) {
|
||||
options.section.section = Section::TITLE;
|
||||
options.section.subsection = Subsection::TITLE_WITH_LOADING_SCREEN;
|
||||
Options::section.section = Options::Scene::TITLE;
|
||||
Options::section.subsection = Options::SceneOptions::TITLE_WITH_LOADING_SCREEN;
|
||||
JA_StopMusic();
|
||||
}
|
||||
}
|
||||
@@ -130,8 +130,8 @@ void LoadingScreen::renderBorder() {
|
||||
|
||||
// Añade lineas amarillas
|
||||
const Uint8 COLOR = static_cast<Uint8>(PaletteColor::YELLOW);
|
||||
const int WIDTH = options.game.width + (options.video.border.width * 2);
|
||||
const int HEIGHT = options.game.height + (options.video.border.height * 2);
|
||||
const int WIDTH = Options::game.width + (Options::video.border.width * 2);
|
||||
const int HEIGHT = Options::game.height + (Options::video.border.height * 2);
|
||||
bool draw_enabled = rand() % 2 == 0 ? true : false;
|
||||
|
||||
int row = 0;
|
||||
@@ -162,7 +162,7 @@ void LoadingScreen::update() {
|
||||
|
||||
// Dibuja en pantalla
|
||||
void LoadingScreen::render() {
|
||||
if (options.video.border.enabled) {
|
||||
if (Options::video.border.enabled) {
|
||||
// Dibuja el efecto de carga en el borde
|
||||
renderBorder();
|
||||
}
|
||||
@@ -189,7 +189,7 @@ void LoadingScreen::run() {
|
||||
Screen::get()->clearRenderer();
|
||||
Screen::get()->render();
|
||||
|
||||
while (options.section.section == Section::LOADING_SCREEN) {
|
||||
while (Options::section.section == Options::Scene::LOADING_SCREEN) {
|
||||
update();
|
||||
checkEvents();
|
||||
render();
|
||||
|
||||
Reference in New Issue
Block a user