diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 493caa41a..eabb72f80 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -157,7 +157,11 @@ alldarwin: cd osx && xcodebuild -target All -buildstyle $(style) endif +ifeq ($(PLATFORM),WINDOWS) +all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) duke3d_w32$(EXESUFFIX) +else all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) +endif eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)$(ENGINELIB) $(CC) -o $@ $^ $(JFAUDLIBS) $(LIBS) $(STDCPPLIB) -Wl,-Map=$@.map diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 14e368910..16d46dc03 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -567,6 +567,9 @@ void CONFIG_ReadSetup( void ) SCRIPT_GetString( scripthandle, "Comm Setup","PlayerName",&myname[0]); + if(Bstrlen(myname) > 9) + myname[10] = 0; + SCRIPT_GetString( scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]); SCRIPT_GetNumber( scripthandle, "Screen Setup", "Shadows",&ud.shadows); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index e5103c87d..c0804f4de 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -8261,7 +8261,13 @@ void Startup(void) if (CommandSoundToggleOff) SoundToggle = 0; if (CommandMusicToggleOff) MusicToggle = 0; - if (CommandName) strcpy(myname,CommandName); + + if (CommandName) + { + Bstrncpy(myname, CommandName, 10); + myname[10] = 0; + } + if (CommandMap) { if (VOLUMEONE) { initprintf("The -map option is available in the registered version only!\n"); diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 053fd6dc2..fe03d2eb2 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -701,7 +701,7 @@ void menus(void) break; } } else { - x = strget(200,50-9,buf,12,0); + x = strget(200,50-9,buf,10,0); if (x) { if (x == 1) { if(buf[0]) { @@ -3476,9 +3476,7 @@ cheat_for_port_credits: } break; case 1: - - if(numplayers < 2) - if(MusicDevice >= 0) + if(MusicDevice >= 0 && (numplayers < 2 || MusicToggle)) { MusicToggle = 1-MusicToggle; if( MusicToggle == 0 ) MUSIC_Pause(); @@ -3517,7 +3515,7 @@ cheat_for_port_credits: menutext(c+160+40,50,MENUHIGHLIGHT(0),(FXDevice<0),SoundToggle && FXDevice >= 0?"ON":"OFF"); - menutext(c+160+40,50+16,MENUHIGHLIGHT(1),(MusicDevice < 0),MusicToggle && (MusicDevice >= 0) && (numplayers<2)?"ON":"OFF"); + menutext(c+160+40,50+16,MENUHIGHLIGHT(1),(MusicDevice<0||(numplayers > 1 && !MusicToggle)),(MusicToggle && (MusicDevice >= 0))?"ON":"OFF"); menutext(c,50,MENUHIGHLIGHT(0),(FXDevice<0),"SOUND"); menutext(c,50+16+16,MENUHIGHLIGHT(2),(FXDevice<0)||SoundToggle==0,"SOUND VOLUME"); @@ -3530,7 +3528,7 @@ cheat_for_port_credits: if(l != FXVolume) FX_SetVolume( (short) FXVolume ); } - menutext(c,50+16,MENUHIGHLIGHT(1),(MusicDevice<0),"MUSIC"); + menutext(c,50+16,MENUHIGHLIGHT(1),(MusicDevice<0||(numplayers > 1 && !MusicToggle)),"MUSIC"); menutext(c,50+16+16+16,MENUHIGHLIGHT(3),(MusicDevice<0)||MusicToggle==0,"MUSIC VOLUME"); { l = MusicVolume; diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index 4acfd7105..bbc11b386 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -442,7 +442,7 @@ struct cvarmappings { { "cl_weaponswitch", "cl_weaponswitch: enable/disable auto weapon switching", (void*)&ud.weaponswitch, CVAR_INT|256, 0, 0, 3 }, { "cl_autoaim", "cl_autoaim: enable/disable weapon autoaim", (void*)&AutoAim, CVAR_INT|256, 0, 0, 2 }, { "cl_messagetime", "cl_messagetime: length of time to display multiplayer chat messages\n", (void*)&ud.msgdisptime, CVAR_INT, 0, 0, 3600 }, - { "name", "name: change your multiplayer nickname", (void*)&myname[0], CVAR_STRING|256, sizeof(myname), 0, 0 } + { "name", "name: change your multiplayer nickname", (void*)&myname[0], CVAR_STRING|256, 11, 0, 0 } }; int osdcmd_cvar_set(const osdfuncparm_t *parm) diff --git a/polymer/eduke32/source/wrapper.c b/polymer/eduke32/source/wrapper.c index 3d270e775..a63cdb72d 100755 --- a/polymer/eduke32/source/wrapper.c +++ b/polymer/eduke32/source/wrapper.c @@ -9,7 +9,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow) { - int i,j; + int i=0,j=0; char CmdLine[1024], sCmdLine[1024], szFileName[255]; LPTSTR szCmdLine; @@ -19,14 +19,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, in strcpy(sCmdLine,lpCmdLine); - i = 0; - + while(sCmdLine[i] == ' ') i++; while(i < (signed)strlen(sCmdLine)) { if(sCmdLine[i] == '-' && sCmdLine[i+1] == 'n' && sCmdLine[i+2] == 'e' && sCmdLine[i+3] == 't') { CmdLine[i-1] = '\0'; - j = 0,i += 5; + i += 5; while(sCmdLine[i] != ' ' && i < (signed)strlen(sCmdLine)) { szFileName[j] = sCmdLine[i]; @@ -39,9 +38,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, in i++; } - if(szFileName[0]) - sprintf(sCmdLine,"eduke32.exe %s -rmnet %s",CmdLine,szFileName); - else sprintf(sCmdLine,"eduke32.exe %s",CmdLine); + if(szFileName[0] && CmdLine[0]) sprintf(sCmdLine,"eduke32.exe %s -rmnet %s",CmdLine,szFileName); + else if(CmdLine[0]) sprintf(sCmdLine,"eduke32.exe %s",CmdLine); + else sprintf(sCmdLine,"eduke32.exe"); szCmdLine = sCmdLine;