100 {185, 185, 255, 255},
105 {160, 160, 160, 255},
106 {105, 105, 105, 255},
107 {255, 255, 255 ,255},
108 {160, 144, 160, 255},
109 {192, 104, 192, 255},
113 {185, 150, 150, 255},
114 {230, 190, 190, 255},
115 {255, 255, 122, 255},
117 {161, 184, 161, 255},
118 {190, 228, 190, 255},
119 {184, 161, 161, 255},
155 #define DEFAULT_TAGS 20
250 mprintf((
"TABLES => Starting parse of 'colors.tbl' (checking '#Start Colors' section only)...\n"));
262 Color_Tags.push_back(DEFAULT_TAG_LIST[i]);
266 mprintf((
"TABLES => Starting parse of 'colors.tbl' (skipping '#Start Colors' section)...\n"));
274 Assertion(filename != NULL,
"parse_colors() called on NULL; get a coder!\n");
286 int rgba[4] = { 0, 0, 0, 0 };
318 mprintf((
"'%s' has been redefined.\n", color_names[i]));
321 for (j = 0; j < 4; j++) {
323 Warning(
LOCATION,
"RGBA value for '%s' in %s too low (%d), capping to 0.\n", color_names[i], filename, rgba[j]);
326 else if (rgba[j] > 255) {
327 Warning(
LOCATION,
"RGBA value for '%s' in %s too high (%d), capping to 255.\n", color_names[i], filename, rgba[j]);
342 mprintf((
"TABLES: Unable to parse '%s'! Error message = %s.\n", filename, e.what()));
349 Assertion(filename != NULL,
"parse_everything_else() called on NULL; get a coder!\n");
356 int rgba[4] = { 0, 0, 0, 0 };
379 Warning(
LOCATION,
"Team color in '%s' defined with a name of '%s'; this won't be usable due to 'None' being used for a lack of a team color by the engine.\n", filename, temp2);
385 for (i = 0; i < 3; i++) {
386 CLAMP(rgb[i], 0, 255);
389 temp_color.
stripe.
r = rgb[0] / 255.0f;
390 temp_color.
stripe.
g = rgb[1] / 255.0f;
391 temp_color.
stripe.
b = rgb[2] / 255.0f;
397 for (i = 0; i < 3; i++) {
398 CLAMP(rgb[i], 0, 255);
401 temp_color.
base.
r = rgb[0] / 255.0f;
402 temp_color.
base.
g = rgb[1] / 255.0f;
403 temp_color.
base.
b = rgb[2] / 255.0f;
406 if (Team_Colors.find(temp) == Team_Colors.end()) {
407 Team_Names.push_back(temp);
409 Team_Colors[
temp] = temp_color;
418 "$Text Subselected:",
421 "$Text Error Highlighted:",
423 "$Text Active Highlighted:",
426 "$Bright More Indicator:",
436 mprintf((
"'%s' has been redefined.\n", color_names[i]));
440 for (j = 0; j < 4; j++) {
443 Warning(
LOCATION,
"RGBA value for '%s' in %s too low (%d), capping to 0.\n", color_names[i], filename, rgba[j]);
446 else if (rgba[j] > 255)
448 Warning(
LOCATION,
"RGBA value for '%s' in %s too high (%d), capping to 255.\n", color_names[i], filename, rgba[j]);
465 if (j == TOTAL_COLORS) {
469 Assertion(j >= 0 && j < TOTAL_COLORS,
"Attempting to copy nonexistant color (%d out of 0-%d)!\n", j, TOTAL_COLORS - 1);
470 memcpy(interface_colors[i], COLOR_LIST[j],
sizeof(
color));
486 if (temp[0] ==
'$') {
487 if (temp[1] ==
'\0') {
488 Error(
LOCATION,
"%s - found a '$Tag:' entry with a solitary '$'.\n", filename);
491 if (temp[2] !=
'\0') {
492 Warning(
LOCATION,
"%s - tag '$%c' has extra text in its definition.\n", filename, tag);
495 else if (temp[0] ==
'\0') {
496 Error(
LOCATION,
"%s - found a '$Tag:' entry with no tag.\n", filename);
500 if (temp[1] !=
'\0') {
501 Warning(
LOCATION,
"%s - tag '$%c' has extra text in its definition.\n", filename, tag);
505 if (Tagged_Colors.find(tag) == Tagged_Colors.end()) {
506 Color_Tags.push_back(tag);
513 rgba[0] = rgba[1] = rgba[2] = 0;
518 for (j = 0; j < 4; j++) {
521 Warning(
LOCATION,
"RGBA value for '$%c' in %s too low (%d), capping to 0.\n", tag, filename, rgba[j]);
524 else if (rgba[j] > 255)
526 Warning(
LOCATION,
"RGBA value for '$%c' in %s too high (%d), capping to 255.\n", tag, filename, rgba[j]);
531 Custom_Colors[tag] = temp_color;
532 Tagged_Colors[tag] = &Custom_Colors[tag];
547 if (j == TOTAL_COLORS) {
548 Error(
LOCATION,
"Unknown color '%s' in %s, for definition of tag '$%c'.\n", temp.c_str(),
filename, tag);
550 Tagged_Colors[tag] = COLOR_LIST[j];
567 if (Tagged_Colors.find(tag) == Tagged_Colors.end()) {
568 Color_Tags.pop_back();
572 Assertion(
false,
"MageKing17 made a coding error somewhere, and you should laugh at him (and report this error).\n");
579 Assertion(Color_Tags.size() == Tagged_Colors.size(),
"Color_Tags and Tagged_Colors size mismatch; get a coder!\n");
585 "$Command Briefing:",
587 "$Redalert Briefing:",
606 if (temp[0] ==
'$') {
607 if (temp[1] ==
'\0') {
608 Error(
LOCATION,
"%s - default text color '%s' entry with a solitary '$'.\n", filename, color_names[i]);
610 *color_value[
i] = temp[1];
611 if (temp[2] !=
'\0') {
612 Warning(
LOCATION,
"%s - default text color '%s' has extra text after the tag '$%c'.\n", filename, color_names[i], *color_value[i]);
615 else if (temp[0] ==
'\0') {
616 Error(
LOCATION,
"%s - default text color '%s' entry with no tag.\n", filename, color_names[i]);
619 *color_value[
i] = temp[0];
620 if (temp[1] !=
'\0') {
621 Warning(
LOCATION,
"%s - default text color '%s' has extra text after the tag '$%c'.\n", filename, color_names[i], *color_value[i]);
624 if (Tagged_Colors.find(*color_value[i]) == Tagged_Colors.end()) {
626 mprintf((
"%s - default text color '%s' set to non-existant tag '$%c'.\n", filename, color_names[i], *color_value[i]));
635 mprintf((
"TABLES: Unable to parse '%s'! Error message = %s.\n", filename, e.what()));
struct team_color::@238 stripe
const char * COLOR_NAMES[TOTAL_COLORS]
int check_for_string(const char *pstr)
color Color_more_indicator
int required_string_one_of(int arg_count,...)
Checks for one of any of the given required strings.
void _cdecl void void _cdecl void _cdecl Warning(char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
void gr_init_alphacolor(color *clr, int r, int g, int b, int alpha, int type)
color Brief_color_legacy_neutral
char default_briefing_color
char default_loop_briefing_color
#define Assertion(expr, msg,...)
color Color_text_active_hi
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
int required_string_either(char *str1, char *str2)
Checks for one of two required strings.
color Color_ui_light_green
#define CLAMP(x, min, max)
int cf_exists_full(const char *filename, int dir_type)
void stuff_string(char *outstr, int type, int len, char *terminators)
char default_fiction_viewer_color
int required_string(const char *pstr)
int optional_string(const char *pstr)
void read_file_text(const char *filename, int mode, char *processed_text, char *raw_text)
color * Color_netplayer[NETPLAYER_COLORS]
color Color_bright_yellow
color * interface_colors[INTERFACE_COLORS]
void _cdecl void void _cdecl Error(const char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
color Color_text_error_hi
const int rgba_defaults[TOTAL_COLORS][4]
#define MAX_DEFAULT_TEXT_COLORS
char default_debriefing_color
void reset_parse(char *text)
char default_recommendation_color
color Color_text_subselected
int stuff_int_list(int *ilp, int max_ints, int lookup_type)
color Color_text_selected
const int interface_defaults[INTERFACE_COLORS]
struct team_color::@237 base
SCP_vector< char > Color_Tags
SCP_vector< SCP_string > Team_Names
color Color_briefing_grid
void parse_colors(const char *filename)
SCP_map< char, color > Custom_Colors
color * COLOR_LIST[TOTAL_COLORS]
char default_redalert_briefing_color
char default_command_briefing_color
int parse_modular_table(const char *name_check, void(*parse_callback)(const char *filename), int path_type, int sort_type)
SCP_map< SCP_string, team_color > Team_Colors
color Color_ui_light_pink
color * DEFAULT_TAG_COLORS[DEFAULT_TAGS]
void parse_everything_else(const char *filename)
const char DEFAULT_TAG_LIST[DEFAULT_TAGS]
SCP_map< char, color * > Tagged_Colors
int skip_to_string(char *pstr, char *end)