2020-09-11 19:34:43 +00:00
|
|
|
#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_game_over_select = 0;
|
|
|
|
int g_options_select = 0;
|
|
|
|
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;
|
2021-01-30 20:35:25 +00:00
|
|
|
bool g_update_3d = false;
|
2020-09-11 19:34:43 +00:00
|
|
|
bool g_checked_line = false;
|
|
|
|
bool g_wait_for_anim = false;
|
2020-12-18 14:14:08 +00:00
|
|
|
bool g_update_size = false;
|
2020-09-11 19:34:43 +00:00
|
|
|
|
|
|
|
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{};
|
2021-03-14 16:02:41 +00:00
|
|
|
std::mutex g_render_mutex{};
|
2020-09-11 19:34:43 +00:00
|
|
|
|
|
|
|
bool g_quit = false;
|
2020-11-21 19:58:52 +00:00
|
|
|
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{};
|
2020-09-11 19:34:43 +00:00
|
|
|
|
|
|
|
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,
|
|
|
|
};
|
|
|
|
|
2020-11-21 19:58:52 +00:00
|
|
|
std::shared_ptr< SDLPP::Font > g_font{};
|
2021-01-30 20:35:25 +00:00
|
|
|
std::shared_ptr< SDLPP::FontConfiguration > g_font_config{};
|
2021-01-30 22:01:36 +00:00
|
|
|
|
2021-03-13 17:37:23 +00:00
|
|
|
std::vector< std::shared_ptr< SDLPP::Scene > > g_update_scenes{};
|
|
|
|
std::vector< std::shared_ptr< SDLPP::RenderObject > > g_update_objects{};
|