game/tetris/global_vars.cpp
2020-09-13 14:14:39 +02:00

53 lines
1.9 KiB
C++

#include "global_vars.hpp"
#include "config.hpp"
#include "functions.hpp"
int g_ticks_till_fall = TICKS_TILL_FALL;
int g_ticks_till_descend = TICKS_TILL_DESCEND;
int g_ticks_till_movement = TICKS_TILL_MOVE;
int g_menu_select = 0;
int g_menu_max = 3;
int g_game_over_select = 0;
int g_game_over_max = 1;
int g_options_select = 0;
int g_options_max = 2;
std::vector< std::shared_ptr< SDLPP::RectangleRender > > g_menu_options{};
std::vector< std::shared_ptr< SDLPP::RectangleRender > > g_game_over_options{};
std::vector< std::shared_ptr< SDLPP::RectangleRender > > g_options_options{};
std::shared_ptr< SDLPP::TextRenderer > g_score_texture{};
std::shared_ptr< SDLPP::Renderer > g_active_renderer{};
int g_score = 0;
bool g_update_score = false;
bool g_update_colors = false;
bool g_checked_line = false;
bool g_wait_for_anim = false;
std::vector< int > g_bag = { 28, 28, 28, 28, 28, 28, 28 };
std::shared_ptr< SDLPP::Scene > g_main_scene{};
std::shared_ptr< SDLPP::Scene > g_menu_scene{};
std::shared_ptr< SDLPP::Scene > g_game_over_scene{};
std::shared_ptr< SDLPP::Scene > g_options_scene{};
std::shared_ptr< TetrisPiece > g_cur_object{};
bool g_object_falling = false;
std::shared_ptr< TetrisPiece > g_next_object{};
std::shared_ptr< TetrisPiece > g_cur_shadow{};
std::shared_ptr< SDLPP::RectangleRender > g_shadow_colider{};
std::mutex g_movement_mutex{};
bool g_quit = false;
std::vector<std::function<void(std::shared_ptr<SDLPP::Scene>, int, std::vector<std::shared_ptr<SDLPP::RenderObject>>&)>>g_input_functions{};
std::vector<std::shared_ptr< SDLPP::Scene >> g_active_scenes{};
std::vector< std::shared_ptr< TetrisPiece > ( * )(
std::shared_ptr< SDLPP::Renderer >, std::shared_ptr< SDLPP::Scene > ) >
g_tetrisFunctions = {
tetrisBrick, tetrisT, tetrisLRight, tetrisZRight,
tetrisLine, tetrisLLeft, tetrisZLeft,
};
std::shared_ptr<SDLPP::Font> g_font{};