mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
- do not use the command line but the module filename to create the progdir path.
argv[0] is not guaranteed to contain anything usable and in cmd.exe it doesn't.
This commit is contained in:
parent
250fa0b847
commit
b179767d4a
4 changed files with 9 additions and 5 deletions
|
@ -562,7 +562,7 @@ void OSD_Init(void)
|
|||
OSD_RegisterFunction("unbindall", "unbindall: unbinds all keys", osdcmd_unbindall);
|
||||
OSD_RegisterFunction("quit", "quit: exits the game immediately", osdcmd_quit);
|
||||
OSD_RegisterFunction("exit", "exit: exits the game immediately", osdcmd_quit);
|
||||
OSD_RegisterFunction("changelevel", "changelevel <level>: warps to the given level", osdcmd_changelevel);
|
||||
//OSD_RegisterFunction("changelevel", "changelevel <level>: warps to the given level", osdcmd_changelevel);
|
||||
// atexit(OSD_Cleanup);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ static int osdcmd_changelevel(osdcmdptr_t parm)
|
|||
int32_t volume=0,level;
|
||||
char *p;
|
||||
|
||||
if ((g_gameType & GAMEFLAG_DUKE) && (g_gameType & GAMEFLAG_SHAREWARE))
|
||||
if (!VOLUMEONE)
|
||||
{
|
||||
if (parm->numparms != 2) return OSDCMD_SHOWHELP;
|
||||
|
||||
|
@ -1135,9 +1135,11 @@ int32_t registerosdcommands(void)
|
|||
OSD_RegisterFunction("playerinfo", "Prints information about the current player", osdcmd_playerinfo);
|
||||
#endif
|
||||
|
||||
if (!VOLUMEONE)
|
||||
if (VOLUMEONE)
|
||||
OSD_RegisterFunction("changelevel","changelevel <level>: warps to the given level", osdcmd_changelevel);
|
||||
else
|
||||
{
|
||||
OSD_RegisterFunction("changelevel","changelevel <volume> <level>: warps to the given level", osdcmd_changelevel);
|
||||
OSD_RegisterFunction("map","map <mapfile>: loads the given user map", osdcmd_map);
|
||||
OSD_RegisterFunction("demo","demo <demofile or demonum>: starts the given demo", osdcmd_demo);
|
||||
}
|
||||
|
|
|
@ -130,7 +130,10 @@ int32_t win_buildargs(char **argvbuf)
|
|||
}
|
||||
|
||||
// Figure out what directory the program resides in.
|
||||
progdir = argvbuf[0];
|
||||
|
||||
wchar_t buffer[256];
|
||||
GetModuleFileNameW(0, buffer, 256);
|
||||
progdir = buffer;
|
||||
progdir.Substitute("\\", "/");
|
||||
auto lastsep = progdir.LastIndexOf('/');
|
||||
if (lastsep != -1)
|
||||
|
|
|
@ -916,7 +916,6 @@ int32_t registerosdcommands(void)
|
|||
{
|
||||
|
||||
if (!VOLUMEONE)
|
||||
else
|
||||
{
|
||||
OSD_RegisterFunction("map","map <mapfile>: loads the given user map", osdcmd_map);
|
||||
OSD_RegisterFunction("demo","demo <demofile or demonum>: starts the given demo", osdcmd_demo);
|
||||
|
|
Loading…
Reference in a new issue