forked from jaildesigner-jailgames/jaildoctors_dilemma
No se pq el ultim commit ha deixat 4 fitxers per commitar
This commit is contained in:
@@ -46,9 +46,3 @@ constexpr int GAMECANVAS_THIRD_QUARTER_X = (GAMECANVAS_WIDTH / 4) * 3;
|
|||||||
constexpr int GAMECANVAS_CENTER_Y = GAMECANVAS_HEIGHT / 2;
|
constexpr int GAMECANVAS_CENTER_Y = GAMECANVAS_HEIGHT / 2;
|
||||||
constexpr int GAMECANVAS_FIRST_QUARTER_Y = GAMECANVAS_HEIGHT / 4;
|
constexpr int GAMECANVAS_FIRST_QUARTER_Y = GAMECANVAS_HEIGHT / 4;
|
||||||
constexpr int GAMECANVAS_THIRD_QUARTER_Y = (GAMECANVAS_HEIGHT / 4) * 3;
|
constexpr int GAMECANVAS_THIRD_QUARTER_Y = (GAMECANVAS_HEIGHT / 4) * 3;
|
||||||
|
|
||||||
// Colores
|
|
||||||
// const Color borderColor = {0x27, 0x27, 0x36};
|
|
||||||
const Uint8 border_color = 1;
|
|
||||||
// const Color black = {0xFF, 0xFF, 0xFF};
|
|
||||||
const Uint8 black_color = 1;
|
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ Director::Director(int argc, const char *argv[])
|
|||||||
|
|
||||||
// Crea los objetos
|
// Crea los objetos
|
||||||
Screen::init(window_, renderer_);
|
Screen::init(window_, renderer_);
|
||||||
Screen::get()->setBorderColor(border_color);
|
|
||||||
Resource::init();
|
Resource::init();
|
||||||
Notifier::init("", "8bithud");
|
Notifier::init("", "8bithud");
|
||||||
Screen::get()->setNotificationsEnabled(true);
|
Screen::get()->setNotificationsEnabled(true);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void Resource::load()
|
|||||||
{
|
{
|
||||||
calculateTotal();
|
calculateTotal();
|
||||||
Screen::get()->show();
|
Screen::get()->show();
|
||||||
Screen::get()->setBorderColor(1);
|
Screen::get()->setBorderColor(static_cast<Uint8>(PaletteColor::BLACK));
|
||||||
std::cout << "** LOADING RESOURCES" << std::endl;
|
std::cout << "** LOADING RESOURCES" << std::endl;
|
||||||
loadSounds();
|
loadSounds();
|
||||||
loadMusics();
|
loadMusics();
|
||||||
@@ -438,6 +438,8 @@ void Resource::renderProgress()
|
|||||||
const int full_bar_width = wired_bar_width * count_.getPercentage();
|
const int full_bar_width = wired_bar_width * count_.getPercentage();
|
||||||
SDL_Rect rect_full = {X_PADDING, bar_position, full_bar_width, X_PADDING};
|
SDL_Rect rect_full = {X_PADDING, bar_position, full_bar_width, X_PADDING};
|
||||||
surface->fillRect(&rect_full, static_cast<Uint8>(PaletteColor::WHITE));
|
surface->fillRect(&rect_full, static_cast<Uint8>(PaletteColor::WHITE));
|
||||||
|
|
||||||
|
Screen::get()->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comprueba los eventos de la pantalla de carga
|
// Comprueba los eventos de la pantalla de carga
|
||||||
|
|||||||
@@ -92,10 +92,12 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer)
|
|||||||
// Crea la surface donde se dibujan los graficos del juego
|
// Crea la surface donde se dibujan los graficos del juego
|
||||||
game_surface_ = std::make_shared<Surface>(options.game.width, options.game.height);
|
game_surface_ = std::make_shared<Surface>(options.game.width, options.game.height);
|
||||||
game_surface_->setPalette(readPalFile(palettes_.at(current_palette_)));
|
game_surface_->setPalette(readPalFile(palettes_.at(current_palette_)));
|
||||||
|
game_surface_->clear(static_cast<Uint8>(PaletteColor::BLACK));
|
||||||
|
|
||||||
// Crea la surface donde se dibujan los graficos del juego
|
// Crea la surface para el borde de colores
|
||||||
border_surface_ = std::make_shared<Surface>(options.game.width + options.video.border.width * 2, options.game.height + options.video.border.height * 2);
|
border_surface_ = std::make_shared<Surface>(options.game.width + options.video.border.width * 2, options.game.height + options.video.border.height * 2);
|
||||||
border_surface_->setPalette(readPalFile(palettes_.at(current_palette_)));
|
border_surface_->setPalette(readPalFile(palettes_.at(current_palette_)));
|
||||||
|
border_surface_->clear(border_color_);
|
||||||
|
|
||||||
// Establece la surface que actuará como renderer para recibir las llamadas a render()
|
// Establece la surface que actuará como renderer para recibir las llamadas a render()
|
||||||
renderer_surface_ = std::make_shared<std::shared_ptr<Surface>>(game_surface_);
|
renderer_surface_ = std::make_shared<std::shared_ptr<Surface>>(game_surface_);
|
||||||
@@ -127,10 +129,7 @@ void Screen::clear(Color color)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Limpia la pantalla
|
// Limpia la pantalla
|
||||||
void Screen::clearSurface(Uint8 index)
|
void Screen::clearSurface(Uint8 index) { game_surface_->clear(index); }
|
||||||
{
|
|
||||||
game_surface_->clear(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepara para empezar a dibujar en la textura de juego
|
// Prepara para empezar a dibujar en la textura de juego
|
||||||
void Screen::start()
|
void Screen::start()
|
||||||
|
|||||||
Reference in New Issue
Block a user