1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Add command-line options to force-enable/disable color

`-forcecolor` will force color to be on. `-nocolor` will force color to
be off.

And just because I'm a nice person, I've also added British versions of
those flags. As a treat.
This commit is contained in:
Misa 2021-09-01 13:28:51 -07:00 committed by Misa Elizabeth Kai
parent ac85f57441
commit c68a274c4f
3 changed files with 15 additions and 0 deletions

View file

@ -47,6 +47,11 @@ void vlog_init(void)
} }
} }
void vlog_toggle_color(const int enable_color)
{
color_enabled = enable_color;
}
int vlog_info(const char* text, ...) int vlog_info(const char* text, ...)
{ {
va_list list; va_list list;

View file

@ -8,6 +8,8 @@ extern "C"
void vlog_init(void); void vlog_init(void);
void vlog_toggle_color(int enable_color);
int vlog_info(const char* text, ...); int vlog_info(const char* text, ...);
int vlog_warn(const char* text, ...); int vlog_warn(const char* text, ...);

View file

@ -432,6 +432,14 @@ int main(int argc, char *argv[])
playassets = "levels/" + std::string(argv[i]) + ".vvvvvv"; playassets = "levels/" + std::string(argv[i]) + ".vvvvvv";
}) })
} }
else if (ARG("-forcecolor") || ARG("-forcecolour"))
{
vlog_toggle_color(1);
}
else if (ARG("-nocolor") || ARG("-nocolour"))
{
vlog_toggle_color(0);
}
#undef ARG_INNER #undef ARG_INNER
#undef ARG #undef ARG
else else