Moved more standard SDL_Color definitions to their appropriate file
This commit is contained in:
parent
1546472f94
commit
aeee65d6da
4 changed files with 55 additions and 35 deletions
|
@ -51,16 +51,6 @@ const std::string weapon = "<245,230,193>",
|
||||||
unit_type = "<245,230,193>",
|
unit_type = "<245,230,193>",
|
||||||
race = "<166,146,117>";
|
race = "<166,146,117>";
|
||||||
|
|
||||||
const SDL_Color
|
|
||||||
weapon_color = { 245, 230, 193, SDL_ALPHA_OPAQUE },
|
|
||||||
good_dmg_color = { 130, 240, 50, SDL_ALPHA_OPAQUE },
|
|
||||||
bad_dmg_color = { 250, 140, 80, SDL_ALPHA_OPAQUE },
|
|
||||||
weapon_details_color = { 166, 146, 117, SDL_ALPHA_OPAQUE },
|
|
||||||
inactive_details_color = { 146, 146, 146, SDL_ALPHA_OPAQUE },
|
|
||||||
inactive_ability_color = { 146, 146, 146, SDL_ALPHA_OPAQUE },
|
|
||||||
unit_type_color = { 245, 230, 193, SDL_ALPHA_OPAQUE },
|
|
||||||
race_color = { 166, 146, 117, SDL_ALPHA_OPAQUE };
|
|
||||||
|
|
||||||
std::string::const_iterator parse_markup(std::string::const_iterator i1,
|
std::string::const_iterator parse_markup(std::string::const_iterator i1,
|
||||||
std::string::const_iterator i2,
|
std::string::const_iterator i2,
|
||||||
int* font_size,
|
int* font_size,
|
||||||
|
|
|
@ -34,15 +34,6 @@ extern const char LARGE_TEXT, SMALL_TEXT, BOLD_TEXT, NORMAL_TEXT, NULL_MARKUP, B
|
||||||
// some colors often used in UI
|
// some colors often used in UI
|
||||||
extern const std::string weapon, weapon_details, unit_type, race;
|
extern const std::string weapon, weapon_details, unit_type, race;
|
||||||
|
|
||||||
extern const SDL_Color weapon_color,
|
|
||||||
good_dmg_color,
|
|
||||||
bad_dmg_color,
|
|
||||||
weapon_details_color,
|
|
||||||
inactive_details_color,
|
|
||||||
inactive_ability_color,
|
|
||||||
unit_type_color,
|
|
||||||
race_color;
|
|
||||||
|
|
||||||
/** Parses the markup-tags at the front of a string. */
|
/** Parses the markup-tags at the front of a string. */
|
||||||
std::string::const_iterator parse_markup(std::string::const_iterator i1,
|
std::string::const_iterator parse_markup(std::string::const_iterator i1,
|
||||||
std::string::const_iterator i2,
|
std::string::const_iterator i2,
|
||||||
|
|
|
@ -17,18 +17,30 @@
|
||||||
#include "sdl/utils.hpp"
|
#include "sdl/utils.hpp"
|
||||||
|
|
||||||
namespace font {
|
namespace font {
|
||||||
const SDL_Color NORMAL_COLOR = {0xDD,0xDD,0xDD,0},
|
|
||||||
GRAY_COLOR = {0x77,0x77,0x77,0},
|
|
||||||
LOBBY_COLOR = {0xBB,0xBB,0xBB,0},
|
|
||||||
GOOD_COLOR = {0x00,0xFF,0x00,0},
|
|
||||||
BAD_COLOR = {0xFF,0x00,0x00,0},
|
|
||||||
BLACK_COLOR = {0x00,0x00,0x00,0},
|
|
||||||
YELLOW_COLOR = {0xFF,0xFF,0x00,0},
|
|
||||||
BUTTON_COLOR = {0xBC,0xB0,0x88,0},
|
|
||||||
PETRIFIED_COLOR = {0xA0,0xA0,0xA0,0},
|
|
||||||
TITLE_COLOR = {0xBC,0xB0,0x88,0},
|
|
||||||
LABEL_COLOR = {0x6B,0x8C,0xFF,0},
|
|
||||||
BIGMAP_COLOR = {0xFF,0xFF,0xFF,0};
|
|
||||||
|
|
||||||
const SDL_Color DISABLED_COLOR = inverse(PETRIFIED_COLOR);
|
const SDL_Color
|
||||||
|
NORMAL_COLOR {0xDD,0xDD,0xDD,0},
|
||||||
|
GRAY_COLOR {0x77,0x77,0x77,0},
|
||||||
|
LOBBY_COLOR {0xBB,0xBB,0xBB,0},
|
||||||
|
GOOD_COLOR {0x00,0xFF,0x00,0},
|
||||||
|
BAD_COLOR {0xFF,0x00,0x00,0},
|
||||||
|
BLACK_COLOR {0x00,0x00,0x00,0},
|
||||||
|
YELLOW_COLOR {0xFF,0xFF,0x00,0},
|
||||||
|
BUTTON_COLOR {0xBC,0xB0,0x88,0},
|
||||||
|
PETRIFIED_COLOR {0xA0,0xA0,0xA0,0},
|
||||||
|
TITLE_COLOR {0xBC,0xB0,0x88,0},
|
||||||
|
LABEL_COLOR {0x6B,0x8C,0xFF,0},
|
||||||
|
BIGMAP_COLOR {0xFF,0xFF,0xFF,0};
|
||||||
|
|
||||||
|
const SDL_Color DISABLED_COLOR = inverse(PETRIFIED_COLOR);
|
||||||
|
|
||||||
|
const SDL_Color
|
||||||
|
weapon_color { 245, 230, 193, SDL_ALPHA_OPAQUE },
|
||||||
|
good_dmg_color { 130, 240, 50, SDL_ALPHA_OPAQUE },
|
||||||
|
bad_dmg_color { 250, 140, 80, SDL_ALPHA_OPAQUE },
|
||||||
|
weapon_details_color { 166, 146, 117, SDL_ALPHA_OPAQUE },
|
||||||
|
inactive_details_color { 146, 146, 146, SDL_ALPHA_OPAQUE },
|
||||||
|
inactive_ability_color { 146, 146, 146, SDL_ALPHA_OPAQUE },
|
||||||
|
unit_type_color { 245, 230, 193, SDL_ALPHA_OPAQUE },
|
||||||
|
race_color { 166, 146, 117, SDL_ALPHA_OPAQUE };
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,36 @@
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
namespace font {
|
namespace font {
|
||||||
extern const SDL_Color NORMAL_COLOR, GRAY_COLOR, LOBBY_COLOR, GOOD_COLOR, BAD_COLOR,
|
|
||||||
BLACK_COLOR, YELLOW_COLOR, BUTTON_COLOR, BIGMAP_COLOR,
|
//
|
||||||
PETRIFIED_COLOR, TITLE_COLOR, DISABLED_COLOR, LABEL_COLOR;
|
// TODO: these should probably all be constexpr
|
||||||
|
//
|
||||||
|
|
||||||
|
extern const SDL_Color
|
||||||
|
// These are GUI1 formatting colors and should be removed when GUI1 is
|
||||||
|
NORMAL_COLOR,
|
||||||
|
GRAY_COLOR,
|
||||||
|
LOBBY_COLOR,
|
||||||
|
GOOD_COLOR,
|
||||||
|
BAD_COLOR,
|
||||||
|
BLACK_COLOR,
|
||||||
|
YELLOW_COLOR,
|
||||||
|
BUTTON_COLOR,
|
||||||
|
BIGMAP_COLOR,
|
||||||
|
PETRIFIED_COLOR,
|
||||||
|
TITLE_COLOR,
|
||||||
|
DISABLED_COLOR,
|
||||||
|
LABEL_COLOR,
|
||||||
|
|
||||||
|
// General purpose color values
|
||||||
|
weapon_color,
|
||||||
|
good_dmg_color,
|
||||||
|
bad_dmg_color,
|
||||||
|
weapon_details_color,
|
||||||
|
inactive_details_color,
|
||||||
|
inactive_ability_color,
|
||||||
|
unit_type_color,
|
||||||
|
race_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue