mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add devmode music
Song: <NOTHING>
Song: DEMOZ
Format: OGG
Volume: 50/100
Loop A: 00:00.65
Loop B: 01:06.00
Elapsed: 01:09.00
This commit is contained in:
parent
49c5c785bf
commit
4e51ad6c78
5 changed files with 63 additions and 4 deletions
|
|
@ -564,7 +564,7 @@ typedef enum
|
||||||
DBG_DETAILED = 0x00000002,
|
DBG_DETAILED = 0x00000002,
|
||||||
DBG_PLAYER = 0x00000004,
|
DBG_PLAYER = 0x00000004,
|
||||||
DBG_RENDER = 0x00000008,
|
DBG_RENDER = 0x00000008,
|
||||||
//DBG_NIGHTSBASIC = 0x00000010, // free
|
DBG_MUSIC = 0x00000010,
|
||||||
//DBG_NIGHTS = 0x00000020, // free
|
//DBG_NIGHTS = 0x00000020, // free
|
||||||
DBG_POLYOBJ = 0x00000040,
|
DBG_POLYOBJ = 0x00000040,
|
||||||
DBG_GAMELOGIC = 0x00000080,
|
DBG_GAMELOGIC = 0x00000080,
|
||||||
|
|
|
||||||
|
|
@ -690,6 +690,7 @@ struct debugFlagNames_s const debug_flag_names[] =
|
||||||
{"Lua", DBG_LUA},
|
{"Lua", DBG_LUA},
|
||||||
{"RNG", DBG_RNG},
|
{"RNG", DBG_RNG},
|
||||||
{"Randomizer", DBG_RNG}, // alt name
|
{"Randomizer", DBG_RNG}, // alt name
|
||||||
|
{"Music", DBG_MUSIC},
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1364,7 +1364,7 @@ int musicdef_volume;
|
||||||
//
|
//
|
||||||
// Find music def by 6 char name
|
// Find music def by 6 char name
|
||||||
//
|
//
|
||||||
static musicdef_t *S_FindMusicDef(const char *name)
|
musicdef_t *S_FindMusicDef(const char *name)
|
||||||
{
|
{
|
||||||
musicdef_t *def = musicdefstart;
|
musicdef_t *def = musicdefstart;
|
||||||
|
|
||||||
|
|
@ -2461,8 +2461,6 @@ static inline void PrintMusicDefField(const char *label, const char *field)
|
||||||
|
|
||||||
static void PrintSongAuthors(const musicdef_t *def)
|
static void PrintSongAuthors(const musicdef_t *def)
|
||||||
{
|
{
|
||||||
CONS_Printf("Volume: %d/100\n\n", def->volume);
|
|
||||||
|
|
||||||
PrintMusicDefField("Title: ", def->title);
|
PrintMusicDefField("Title: ", def->title);
|
||||||
PrintMusicDefField("Author: ", def->author);
|
PrintMusicDefField("Author: ", def->author);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,7 @@ extern int musicdef_volume;
|
||||||
|
|
||||||
void S_LoadMusicDefs(UINT16 wadnum);
|
void S_LoadMusicDefs(UINT16 wadnum);
|
||||||
void S_InitMusicDefs(void);
|
void S_InitMusicDefs(void);
|
||||||
|
musicdef_t *S_FindMusicDef(const char *name);
|
||||||
void S_ShowMusicCredit(void);
|
void S_ShowMusicCredit(void);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -357,6 +357,60 @@ static INT32 SCR(INT32 r)
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
// Devmode information
|
// Devmode information
|
||||||
|
|
||||||
|
static void ST_pushDebugString(INT32 *height, const char *string)
|
||||||
|
{
|
||||||
|
V_DrawRightAlignedString(320, *height, V_MONOSPACE, string);
|
||||||
|
*height -= 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ST_pushDebugTimeMS(INT32 *height, const char *label, UINT32 ms)
|
||||||
|
{
|
||||||
|
ST_pushDebugString(height, va("%s%02d:%05.2f", label,
|
||||||
|
ms / 60000, ms % 60000 / 1000.f));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ST_drawMusicDebug(INT32 *height)
|
||||||
|
{
|
||||||
|
char mname[7];
|
||||||
|
UINT16 mflags; // unused
|
||||||
|
boolean looping;
|
||||||
|
|
||||||
|
const musicdef_t *def;
|
||||||
|
const char *format;
|
||||||
|
|
||||||
|
if (!S_MusicInfo(mname, &mflags, &looping))
|
||||||
|
{
|
||||||
|
ST_pushDebugString(height, "Song: <NOTHING>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
def = S_FindMusicDef(mname);
|
||||||
|
format = S_MusicType();
|
||||||
|
|
||||||
|
ST_pushDebugTimeMS(height, " Elapsed: ", S_GetMusicPosition());
|
||||||
|
ST_pushDebugTimeMS(height, looping
|
||||||
|
? " Loop B: "
|
||||||
|
: "Duration: ", S_GetMusicLength());
|
||||||
|
|
||||||
|
if (looping)
|
||||||
|
{
|
||||||
|
ST_pushDebugTimeMS(height, " Loop A: ", S_GetMusicLoopPoint());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (def)
|
||||||
|
{
|
||||||
|
ST_pushDebugString(height, va(" Volume: %4d/100", def->volume));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (format)
|
||||||
|
{
|
||||||
|
ST_pushDebugString(height, va(" Format: %8s", S_MusicType()));
|
||||||
|
}
|
||||||
|
|
||||||
|
ST_pushDebugString(height, va(" Song: %8s", mname));
|
||||||
|
}
|
||||||
|
|
||||||
static void ST_drawDebugInfo(void)
|
static void ST_drawDebugInfo(void)
|
||||||
{
|
{
|
||||||
INT32 height = 192;
|
INT32 height = 192;
|
||||||
|
|
@ -419,6 +473,11 @@ static void ST_drawDebugInfo(void)
|
||||||
height -= 32;
|
height -= 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cht_debug & DBG_MUSIC)
|
||||||
|
{
|
||||||
|
ST_drawMusicDebug(&height);
|
||||||
|
}
|
||||||
|
|
||||||
if (cht_debug & DBG_MEMORY)
|
if (cht_debug & DBG_MEMORY)
|
||||||
V_DrawRightAlignedString(320, height, V_MONOSPACE, va("Heap used: %7sKB", sizeu1(Z_TagsUsage(0, INT32_MAX)>>10)));
|
V_DrawRightAlignedString(320, height, V_MONOSPACE, va("Heap used: %7sKB", sizeu1(Z_TagsUsage(0, INT32_MAX)>>10)));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue