1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-16 09:38:29 +02: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, ...)
{
va_list list;

View File

@ -8,6 +8,8 @@ extern "C"
void vlog_init(void);
void vlog_toggle_color(int enable_color);
int vlog_info(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";
})
}
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
else