mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
minigen command: Support -m(ultiplier) parameter
Supports values between 1 and 10, with 1 being the default. If a multiplier greater than 1 is provided, the filename will take the form "MINIMAP-%d.png", where %d is the multiplier.
This commit is contained in:
parent
d7d1fdded3
commit
16d6837112
1 changed files with 37 additions and 1 deletions
38
src/m_misc.c
38
src/m_misc.c
|
|
@ -1752,10 +1752,12 @@ boolean M_ScreenshotResponder(event_t *ev)
|
||||||
void M_MinimapGenerate(void)
|
void M_MinimapGenerate(void)
|
||||||
{
|
{
|
||||||
#ifdef USE_PNG
|
#ifdef USE_PNG
|
||||||
char *filepath = va(pandf, srb2home, "MINIMAP.png");
|
char *filepath;
|
||||||
boolean ret = false;
|
boolean ret = false;
|
||||||
minigen_t *minigen = NULL;
|
minigen_t *minigen = NULL;
|
||||||
INT32 wh = 100;
|
INT32 wh = 100;
|
||||||
|
size_t option_scale;
|
||||||
|
INT32 mul = 1;
|
||||||
|
|
||||||
if (gamestate != GS_LEVEL)
|
if (gamestate != GS_LEVEL)
|
||||||
{
|
{
|
||||||
|
|
@ -1769,6 +1771,36 @@ void M_MinimapGenerate(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
option_scale = COM_CheckPartialParm("-m");
|
||||||
|
|
||||||
|
if (option_scale)
|
||||||
|
{
|
||||||
|
if (COM_Argc() < option_scale + 2)/* no argument after? */
|
||||||
|
{
|
||||||
|
CONS_Alert(CONS_ERROR,
|
||||||
|
"No multiplier follows parameter '%s'.\n",
|
||||||
|
COM_Argv(option_scale));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mul = atoi(COM_Argv(option_scale + 1));
|
||||||
|
|
||||||
|
if (mul < 1 || mul > 10)
|
||||||
|
{
|
||||||
|
CONS_Alert(CONS_ERROR,
|
||||||
|
"Multiplier %d must be within range 1-10.\n",
|
||||||
|
mul);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
wh *= mul;
|
||||||
|
filepath = va("%s" PATHSEP "MINIMAP-%d.png", srb2home, mul);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filepath = va("%s" PATHSEP "MINIMAP.png", srb2home);
|
||||||
|
}
|
||||||
|
|
||||||
minigen = AM_MinimapGenerate(wh);
|
minigen = AM_MinimapGenerate(wh);
|
||||||
|
|
||||||
if (minigen == NULL || minigen->buf == NULL)
|
if (minigen == NULL || minigen->buf == NULL)
|
||||||
|
|
@ -1784,6 +1816,10 @@ failure:
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("%s saved.\nRemember that this is not a complete minimap,\nand must be edited before putting in-game.\n"), filepath);
|
CONS_Printf(M_GetText("%s saved.\nRemember that this is not a complete minimap,\nand must be edited before putting in-game.\n"), filepath);
|
||||||
|
if (mul != 1)
|
||||||
|
{
|
||||||
|
CONS_Printf("You should divide its size by %d!\n", mul);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue