afegit gif.cpp i jail_shader.cpp desde coffee_crisis_arcade_edition
This commit is contained in:
@@ -1,27 +1,25 @@
|
||||
#include "scoreboard.h"
|
||||
#include <SDL2/SDL_error.h> // for SDL_GetError
|
||||
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_RGBA8888
|
||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||
#include <SDL2/SDL_timer.h> // for SDL_GetTicks
|
||||
#include <iostream> // for basic_ostream, operator<<, cout, endl
|
||||
#include "s_animated_sprite.h" // for SAnimatedSprite
|
||||
#include "defines.h" // for BLOCK
|
||||
#include "options.h" // for Options, options, OptionsVideo, Cheat
|
||||
#include "resource.h" // for Resource
|
||||
#include "screen.h" // for Screen
|
||||
#include "text.h" // for Text
|
||||
#include "surface.h" // for Texture
|
||||
#include <SDL2/SDL_rect.h> // Para SDL_Rect
|
||||
#include <SDL2/SDL_timer.h> // Para SDL_GetTicks
|
||||
#include "defines.h" // Para BLOCK
|
||||
#include "options.h" // Para Options, options, Cheat, OptionsGame
|
||||
#include "resource.h" // Para Resource
|
||||
#include "s_animated_sprite.h" // Para SAnimatedSprite
|
||||
#include "screen.h" // Para Screen
|
||||
#include "surface.h" // Para Surface
|
||||
#include "text.h" // Para Text
|
||||
#include "utils.h" // Para stringToColor
|
||||
|
||||
// Constructor
|
||||
Scoreboard::Scoreboard(std::shared_ptr<ScoreboardData> data)
|
||||
: data_(data),
|
||||
: item_surface_(Resource::get()->getSurface("items.gif")),
|
||||
data_(data),
|
||||
clock_(ClockData())
|
||||
{
|
||||
const int SURFACE_WIDTH_ = options.game.width;
|
||||
constexpr int SURFACE_HEIGHT_ = 6 * BLOCK;
|
||||
|
||||
// Reserva memoria para los objetos
|
||||
item_surface_ = Resource::get()->getSurface("items.gif");
|
||||
auto player_texture = Resource::get()->getSurface(options.cheats.alternate_skin == Cheat::CheatState::ENABLED ? "player2.gif" : "player.gif");
|
||||
auto player_animations = Resource::get()->getAnimations(options.cheats.alternate_skin == Cheat::CheatState::ENABLED ? "player2.ani" : "player.ani");
|
||||
player_sprite_ = std::make_shared<SAnimatedSprite>(player_texture, player_animations);
|
||||
@@ -136,7 +134,7 @@ int Scoreboard::getMinutes()
|
||||
void Scoreboard::fillTexture()
|
||||
{
|
||||
// Empieza a dibujar en la textura
|
||||
auto previuos_renderer = Screen::get()->getRendererSurface();
|
||||
auto previuos_renderer = Screen::get()->getRendererSurface();
|
||||
Screen::get()->setRendererSurface(surface_);
|
||||
|
||||
// Limpia la textura
|
||||
|
||||
Reference in New Issue
Block a user