TETRIS: separate into multiple files, add options
This commit is contained in:
+58
-74
@@ -1,78 +1,62 @@
|
||||
#ifndef TETRIS_CONFIG_H
|
||||
#define TETRIS_CONFIG_H
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
std::map<std::string, std::map<std::string, std::string>> color_schemes = {
|
||||
{ "default", {
|
||||
{"piece_brick", "#FF0000"},
|
||||
{"piece_brick_out", "#AA0000"},
|
||||
{"piece_T", "#00FF00"},
|
||||
{"piece_T_out", "#00AA00"},
|
||||
{"piece_L_right", "#0000FF"},
|
||||
{"piece_L_right_out", "#0000AA"},
|
||||
{"piece_Z_right", "#FF00FF"},
|
||||
{"piece_Z_right_out", "#AA00AA"},
|
||||
{"piece_line", "#FFFF00"},
|
||||
{"piece_line_out", "#AAAA00"},
|
||||
{"piece_L_left", "#00FFFF"},
|
||||
{"piece_L_left_out", "#00AAAA"},
|
||||
{"piece_Z_left", "#FFFFFF"},
|
||||
{"piece_Z_left_out", "#AAAAAA"},
|
||||
{"shadow", "#AAAAAAAA"},
|
||||
{"background", "#222222"},
|
||||
{"line", "#888888"},
|
||||
{"barrier", "#AA0000"},
|
||||
{"text", "#FFFFFF"},
|
||||
{"text_out", "#000000"},
|
||||
{"menu_background", "#00000080"},
|
||||
{"menu_item_background", "#FFFFFF40"},
|
||||
}},
|
||||
{ "gruvbox_dark", {
|
||||
{"piece_brick", "#cc241d"},
|
||||
{"piece_brick_out", "#fb4934"},
|
||||
{"piece_T", "#98971a"},
|
||||
{"piece_T_out", "#b8bb26"},
|
||||
{"piece_L_right", "#458588"},
|
||||
{"piece_L_right_out", "#83a598"},
|
||||
{"piece_Z_right", "#b16286"},
|
||||
{"piece_Z_right_out", "#d3869b"},
|
||||
{"piece_line", "#d79921"},
|
||||
{"piece_line_out", "#fabd2f"},
|
||||
{"piece_L_left", "#689d6a"},
|
||||
{"piece_L_left_out", "#8ec07c"},
|
||||
{"piece_Z_left", "#a89984"},
|
||||
{"piece_Z_left_out", "#ebdbb2"},
|
||||
{"shadow", "#bdae9380"},
|
||||
{"background", "#282828"},
|
||||
{"line", "#fbf1c7"},
|
||||
{"barrier", "#d65d0e"},
|
||||
{"text", "#ebdbb2"},
|
||||
{"text_out", "#1d2021"},
|
||||
{"menu_background", "#28282880"},
|
||||
{"menu_item_background", "#d5c4a180"},
|
||||
}},
|
||||
{ "blackandwhite", {
|
||||
{"piece_brick", "#FFFFFF"},
|
||||
{"piece_brick_out", "#000000"},
|
||||
{"piece_T", "#FFFFFF"},
|
||||
{"piece_T_out", "#000000"},
|
||||
{"piece_L_right", "#FFFFFF"},
|
||||
{"piece_L_right_out", "#000000"},
|
||||
{"piece_Z_right", "#FFFFFF"},
|
||||
{"piece_Z_right_out", "#000000"},
|
||||
{"piece_line", "#FFFFFF"},
|
||||
{"piece_line_out", "#000000"},
|
||||
{"piece_L_left", "#FFFFFF"},
|
||||
{"piece_L_left_out", "#000000"},
|
||||
{"piece_Z_left", "#FFFFFF"},
|
||||
{"piece_Z_left_out", "#000000"},
|
||||
{"shadow", "#FFFFFF80"},
|
||||
{"background", "#000000"},
|
||||
{"line", "#FFFFFF"},
|
||||
{"barrier", "#FFFFFF"},
|
||||
{"text", "#FFFFFF"},
|
||||
{"text_out", "#000000"},
|
||||
{"menu_background", "#00000080"},
|
||||
{"menu_item_background", "#FFFFFF40"},
|
||||
}},
|
||||
};
|
||||
#define COLIDER_ID 0x00000001
|
||||
#define BRICK_ID 0x00000002
|
||||
#define GAME_OVER 0x00000003
|
||||
#define SHADOW_ID 0x00000004
|
||||
#define BORDER_LEFT_ID 0x00000005
|
||||
#define BORDER_RIGHT_ID 0x00000006
|
||||
#define FLOOR_ID 0x00000007
|
||||
#define SCORE_TEXTURE_ID 0x00000008
|
||||
#define BACKGROUND_ID 0x00000009
|
||||
#define LINE_ID 0x0000000A
|
||||
#define BARRIER_ID 0x0000000B
|
||||
#define TEXT_ID 0x0000000C
|
||||
|
||||
#define MENU_ITEM_ID 0x00000001
|
||||
#define MENU_BACKGROUND_ID 0x00000002
|
||||
#define MENU_TEXT_ID 0x00000003
|
||||
|
||||
#define LEFT_BORDER 0.3
|
||||
#define RIGHT_BORDER 0.7
|
||||
#define BOTTOM_BORDER 1
|
||||
#define TOP_BORDER 0.16
|
||||
#define BLOCK_SIZE 0.04
|
||||
|
||||
#define PIECE_BRICK 0
|
||||
#define PIECE_T 1
|
||||
#define PIECE_L_RIGHT 2
|
||||
#define PIECE_Z_RIGHT 3
|
||||
#define PIECE_LINE 4
|
||||
#define PIECE_L_LEFT 5
|
||||
#define PIECE_Z_LEFT 6
|
||||
|
||||
#define TICKS_TILL_FALL 500
|
||||
#define TICKS_TILL_DESCEND 50
|
||||
#define TICKS_TILL_MOVE 100
|
||||
|
||||
#define PAUSE_PAUSE 1
|
||||
#define PAUSE_GAME_OVER 2
|
||||
|
||||
#define TETRIS_BRICK 0
|
||||
#define TETRIS_T 1
|
||||
#define TETRIS_L_RIGHT 2
|
||||
#define TETRIS_Z_RIGHT 3
|
||||
#define TETRIS_LINE 4
|
||||
#define TETRIS_L_LEFT 5
|
||||
#define TETRIS_Z_LEFT 6
|
||||
|
||||
#define PIECE_ACTION_UPDATE_COLOR 0
|
||||
|
||||
#define colors color_schemes[color_schemes_names[selected_color_scheme]]
|
||||
|
||||
extern std::map<std::string, std::map<std::string, std::string>> color_schemes;
|
||||
extern std::vector<std::string> color_schemes_names;
|
||||
extern long unsigned int selected_color_scheme;
|
||||
extern bool g_show_shadow;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user