From c0fd65345e03900146a52d508332d4c3aff9ef18 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 23 Nov 2010 22:30:27 +0000 Subject: [PATCH] remove obsolete CON compile warnings about affecting multiplayer sync, add -nodinput compatibility parameter to work around DirectInput crash issues on certain systems, fix http://forums.duke4.net/index.php?s=&showtopic=2961&view=findpost&p=60752 git-svn-id: https://svn.eduke32.com/eduke32@1729 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 2 + polymer/eduke32/build/include/editor.h | 2 + polymer/eduke32/build/include/winlayer.h | 2 + polymer/eduke32/build/src/engine.c | 18 ++++---- polymer/eduke32/build/src/winlayer.c | 19 ++++---- polymer/eduke32/source/enet/src/list.c | 2 +- polymer/eduke32/source/game.c | 54 ++++++++++------------- polymer/eduke32/source/gamedef.c | 56 ++++++++++++++++++++++++ polymer/eduke32/source/gameexec.c | 1 + polymer/eduke32/source/osdcmds.c | 4 -- polymer/eduke32/source/savegame.c | 3 +- polymer/eduke32/source/sdlmusic.c | 2 +- polymer/eduke32/source/startwin.game.c | 5 ++- 13 files changed, 114 insertions(+), 56 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 917f76427..0b483fafb 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -658,6 +658,7 @@ int32_t md_loadmodel(const char *fn); int32_t md_setmisc(int32_t modelid, float scale, int32_t shadeoff, float zadd, int32_t flags); // int32_t md_tilehasmodel(int32_t tilenume, int32_t pal); +#if defined(POLYMOST) && defined(USE_OPENGL) typedef struct { // maps build tiles to particular animation frames of a model @@ -679,6 +680,7 @@ static inline int32_t md_tilehasmodel(int32_t tilenume,int32_t pal) if (!mdinited) return -1; return tile2model[Ptile2tile(tilenume,pal)].modelid; } +#endif int32_t md_defineframe(int32_t modelid, const char *framename, int32_t tilenume, int32_t skinnum, float smoothduration, int32_t pal); int32_t md_defineanimation(int32_t modelid, const char *framestart, const char *frameend, int32_t fps, int32_t flags); diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index 8685fc4bd..4d1db0089 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -5,6 +5,8 @@ #ifndef __editor_h__ #define __editor_h__ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/polymer/eduke32/build/include/winlayer.h b/polymer/eduke32/build/include/winlayer.h index a93610fff..ce0937db8 100644 --- a/polymer/eduke32/build/include/winlayer.h +++ b/polymer/eduke32/build/include/winlayer.h @@ -10,6 +10,8 @@ extern uint32_t maxrefreshfreq; extern int32_t glusecds; +extern char di_disabled; + int32_t win_gethwnd(void); int32_t win_gethinstance(void); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index dc370439c..dc0c036f8 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -56,15 +56,15 @@ void drawpixel_safe(void* s, char a) else { static const char *const c = &editorcolors[15]; - drawpixel((void*)frameplace, *c); - drawpixel((void*)frameplace+1, *c); - drawpixel((void*)frameplace+2, *c); - drawpixel((void*)frameplace+bytesperline, *c); - drawpixel((void*)frameplace+bytesperline+1, *c); - drawpixel((void*)frameplace+bytesperline+2, *c); - drawpixel((void*)frameplace+2*bytesperline, *c); - drawpixel((void*)frameplace+2*bytesperline+1, *c); - drawpixel((void*)frameplace+2*bytesperline+2, *c); + drawpixel((intptr_t*)frameplace, *c); + drawpixel((intptr_t*)frameplace+1, *c); + drawpixel((intptr_t*)frameplace+2, *c); + drawpixel((intptr_t*)frameplace+bytesperline, *c); + drawpixel((intptr_t*)frameplace+bytesperline+1, *c); + drawpixel((intptr_t*)frameplace+bytesperline+2, *c); + drawpixel((intptr_t*)frameplace+2*bytesperline, *c); + drawpixel((intptr_t*)frameplace+2*bytesperline+1, *c); + drawpixel((intptr_t*)frameplace+2*bytesperline+2, *c); } #endif } diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index 08f534736..0ee3d451e 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -153,8 +153,9 @@ static LPDIRECTINPUTDEVICE7A lpDID = NULL; #define INPUT_BUFFER_SIZE 32 static GUID guidDevs; +char di_disabled = 0; static char di_devacquired; -static HANDLE di_inputevt; +static HANDLE di_inputevt = 0; static int32_t joyblast=0; volatile uint8_t moustat = 0, mousegrab = 0; @@ -1053,7 +1054,7 @@ static BOOL InitDirectInput(void) LPDIRECTINPUTDEVICE7A dev2; DIDEVCAPS didc; - if (hDInputDLL) return FALSE; + if (hDInputDLL || di_disabled) return FALSE; initprintf("Initializing DirectInput...\n"); @@ -1077,7 +1078,7 @@ static BOOL InitDirectInput(void) initprintf(" - Enumerating attached game controllers\n"); inputdevices = 1|2; - result = IDirectInput7_EnumDevices(lpDI, 0, InitDirectInput_enum, NULL, DIEDFL_ATTACHEDONLY); + result = IDirectInput7_EnumDevices(lpDI, DIDEVTYPE_JOYSTICK, InitDirectInput_enum, NULL, DIEDFL_ATTACHEDONLY); if (FAILED(result)) { HorribleDInputDeath("Failed enumerating attached game controllers", result); } else if (result != DI_OK) initprintf(" Enumerated game controllers with warning: %s\n",GetDInputError(result)); @@ -1105,6 +1106,7 @@ static BOOL InitDirectInput(void) else if (result != DI_OK) initprintf(" Set data format with warning: %s\n",GetDInputError(result)); di_inputevt = CreateEvent(NULL, FALSE, FALSE, NULL); + if (di_inputevt == NULL) { IDirectInputDevice7_Release(dev2); @@ -1192,17 +1194,18 @@ static void UninitDirectInput(void) Bfree(hatdefs); hatdefs = NULL; } - if (*devicedef.did) - { - IDirectInputDevice7_Release(*devicedef.did); - *devicedef.did = NULL; - } if (di_inputevt) { CloseHandle(di_inputevt); di_inputevt = NULL; } + if (*devicedef.did) + { + IDirectInputDevice7_Release(*devicedef.did); + *devicedef.did = NULL; + } + if (lpDI) { IDirectInput7_Release(lpDI); diff --git a/polymer/eduke32/source/enet/src/list.c b/polymer/eduke32/source/enet/src/list.c index 8487200ff..1c1a8dfaa 100644 --- a/polymer/eduke32/source/enet/src/list.c +++ b/polymer/eduke32/source/enet/src/list.c @@ -3,7 +3,7 @@ @brief ENet linked list functions */ #define ENET_BUILDING_LIB 1 -#include "enet/list.h" +#include "enet/enet.h" /** @defgroup list ENet linked list utility functions diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index fc2a36435..f790de91f 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -6787,6 +6787,7 @@ FOUNDCHEAT: sprite[g_player[myconnectindex].ps->i].extra = g_player[myconnectindex].ps->max_player_health; actor[g_player[myconnectindex].ps->i].extra = 0; g_player[myconnectindex].ps->cheat_phase = 0; + g_player[myconnectindex].ps->dead_flag = 0; KB_FlushKeyBoardQueue(); return; @@ -7756,6 +7757,7 @@ static void G_ShowDebugHelp(void) "-name [name]\tPlayer name in multiplay\n" "-nD\t\tDump default gamevars to gamevars.txt\n" "-noautoload\tDisable loading content from autoload dir\n" + "-nodinput\tDisable DirectInput (joystick) support\n" "-nologo\t\tSkip the logo anim\n" "-ns/-nm\t\tDisable sound or music\n" "-q#\t\tFake multiplayer with # (2-8) players\n" @@ -8273,6 +8275,15 @@ static void G_CheckCommandLine(int32_t argc, const char **argv) i++; continue; } +#ifdef _WIN32 + if (!Bstrcasecmp(c+1,"nodinput")) + { + initprintf("DirectInput (joystick) support disabled\n"); + di_disabled = 1; + i++; + continue; + } +#endif if (!Bstrcasecmp(c+1,"noautoload")) { initprintf("Autoload disabled\n"); @@ -8950,13 +8961,10 @@ static void G_CompileScripts(void) static inline void G_CheckGametype(void) { - // initprintf("ud.m_coop=%i before sanitization\n",ud.m_coop); ud.m_coop = clamp(ud.m_coop, 0, g_numGametypes-1); - Bsprintf(tempbuf,"%s\n",GametypeNames[ud.m_coop]); - initprintf(tempbuf); + initprintf("%s\n",GametypeNames[ud.m_coop]); if (GametypeFlags[ud.m_coop] & GAMETYPE_ITEMRESPAWN) ud.m_respawn_items = ud.m_respawn_inventory = 1; - // initprintf("ud.m_coop=%i after sanitisation\n",ud.m_coop); } static void G_LoadExtraPalettes(void) @@ -9140,9 +9148,9 @@ static void G_Startup(void) initprintf("Multiplayer initialized.\n"); { - char cwd[BMAX_PATH]; + char *cwd; - if (getcwd(cwd,BMAX_PATH) && g_modDir[0] != '/') + if (g_modDir[0] != '/' && (cwd = (char *)getcwd(NULL, 0))) { chdir(g_modDir); // initprintf("g_rootDir '%s'\nmod '%s'\ncwd '%s'\n",g_rootDir,mod_dir,cwd); @@ -9153,6 +9161,7 @@ static void G_Startup(void) G_GameExit("Failed loading art."); } chdir(cwd); + Bfree(cwd); } else if (loadpics("tiles000.art",MAXCACHE1DSIZE) < 0) G_GameExit("Failed loading art."); @@ -9168,13 +9177,6 @@ static void G_Startup(void) screenpeek = myconnectindex; } -void sendscore(const char *s) -{ - UNREFERENCED_PARAMETER(s); -// if (numplayers > 1) -// genericmultifunction(-1,(char *)s,strlen(s)+1,5); -} - void G_UpdatePlayerFromMenu(void) { if (ud.recstat != 0) @@ -10751,12 +10753,6 @@ FRAGBONUS: minitext(92+(y*23),90+t,tempbuf,0,2+8+16+128); xfragtotal += g_player[i].frags[y]; } - - if (g_netServer) - { - Bsprintf(tempbuf,"stats %d killed %d %d\n",i+1,y+1,g_player[i].frags[y]); - sendscore(tempbuf); - } } Bsprintf(tempbuf,"%-4d",xfragtotal); @@ -10834,11 +10830,7 @@ FRAGBONUS: playerbest = CONFIG_GetMapBestTime(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].filename); if (g_player[myconnectindex].ps->player_par < playerbest || playerbest < 0) - { CONFIG_SetMapBestTime(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].filename, g_player[myconnectindex].ps->player_par); - // if(playerbest != -1) - // playerbest = g_player[myconnectindex].ps->player_par; - } { int32_t ii, ij; @@ -10859,7 +10851,7 @@ FRAGBONUS: clockpad = max(clockpad,ij); } - while (1) + do { int32_t yy = 0, zz; @@ -11089,10 +11081,13 @@ FRAGBONUS: totalclock = (1000000000L); } } - else break; + else + break; + VM_OnEvent(EVENT_DISPLAYBONUSSCREEN, g_player[screenpeek].ps->i, screenpeek, -1); nextpage(); } + while (1); } static void G_DrawCameraText(int16_t i) @@ -11184,13 +11179,10 @@ void A_SpawnWallGlass(int32_t i,int32_t wallnum,int32_t n) void A_SpawnGlass(int32_t i,int32_t n) { - int32_t j, k, a, z; - - for (j=n; j>0; j--) + for (; n>0; n--) { - a = krand()&2047; - z = SZ-((krand()&16)<<8); - k = A_InsertSprite(SECT,SX,SY,z,GLASSPIECES+(j%3),krand()&15,36,36,a,32+(krand()&63),-512-(krand()&2047),i,5); + int32_t k = A_InsertSprite(SECT,SX,SY,SZ-((krand()&16)<<8),GLASSPIECES+(n%3), + krand()&15,36,36,krand()&2047,32+(krand()&63),-512-(krand()&2047),i,5); sprite[k].pal = sprite[i].pal; } } diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 78e00b1a8..002d30538 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -1446,6 +1446,7 @@ static void C_SetProjectile(int32_t lVar1, int32_t lLabelID, int32_t lVar2) return; } +/* static int32_t C_CheckEventSync(int32_t iEventID) { if (g_parsingEventPtr || g_parsingActorPtr) @@ -1484,6 +1485,7 @@ static int32_t C_CheckEventSync(int32_t iEventID) } return 1; } +*/ #define GetDefID(szGameLabel) hash_find(&h_gamevars,szGameLabel) #define GetADefID(szGameLabel) hash_find(&h_arrays,szGameLabel) @@ -1829,6 +1831,7 @@ static void C_GetNextVarType(int32_t type) C_ReportError(ERROR_VARTYPEMISMATCH); return; } +/* if ((aGameVars[i].dwFlags & GAMEVAR_SYNCCHECK) && g_parsingActorPtr && C_CheckEventSync(g_currentEvent)) { C_ReportError(-1); @@ -1837,6 +1840,7 @@ static void C_GetNextVarType(int32_t type) g_lineNumber,label+(g_numLabels<<6),g_parsingEventPtr?"a synced event":"an actor"); g_numCompilerWarnings++; } +*/ if (!(g_numCompilerErrors || g_numCompilerWarnings) && g_scriptDebug > 1) initprintf("%s:%d: debug: accepted gamevar `%s'.\n",g_szScriptFileName,g_lineNumber,label+(g_numLabels<<6)); @@ -2197,8 +2201,10 @@ static int32_t C_ParseCommand(void) case CON_SETTHISPROJECTILE: case CON_SETPROJECTILE: +/* if (!C_CheckEventSync(g_currentEvent)) C_ReportError(WARNING_EVENTSYNC); +*/ case CON_GETTHISPROJECTILE: case CON_GETPROJECTILE: { @@ -2426,11 +2432,13 @@ static int32_t C_ParseCommand(void) case CON_MOVE: if (g_parsingActorPtr || g_processingState) { +/* if (!C_CheckEventSync(g_currentEvent)) { g_numCompilerWarnings++; C_ReportError(WARNING_EVENTSYNC); } +*/ if ((C_GetNextValue(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(g_scriptPtr-1) != 0) && (*(g_scriptPtr-1) != 1)) { @@ -2640,11 +2648,13 @@ static int32_t C_ParseCommand(void) case CON_AI: if (g_parsingActorPtr || g_processingState) { +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ C_GetNextValue(LABEL_AI); } else @@ -2720,11 +2730,13 @@ static int32_t C_ParseCommand(void) case CON_ACTION: if (g_parsingActorPtr || g_processingState) { +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ C_GetNextValue(LABEL_ACTION); } else @@ -3023,11 +3035,13 @@ static int32_t C_ParseCommand(void) return 0; case CON_INSERTSPRITEQ: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ return 0; case CON_QSPRINTF: @@ -3066,11 +3080,13 @@ static int32_t C_ParseCommand(void) case CON_LOTSOFGLASS: case CON_SAVENN: case CON_SAVE: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_ANGOFF: case CON_QUOTE: case CON_SOUND: @@ -3099,11 +3115,13 @@ static int32_t C_ParseCommand(void) return 0; case CON_HITRADIUSVAR: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ C_GetManyVars(5); break; case CON_HITRADIUS: @@ -3117,11 +3135,13 @@ static int32_t C_ParseCommand(void) case CON_DEBRIS: case CON_ADDINVENTORY: case CON_GUTS: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ C_GetNextValue(LABEL_DEFINE); C_GetNextValue(LABEL_DEFINE); break; @@ -3175,11 +3195,13 @@ static int32_t C_ParseCommand(void) return 0; case CON_SETSECTOR: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_GETSECTOR: { int32_t lLabelID; @@ -3310,11 +3332,13 @@ static int32_t C_ParseCommand(void) } case CON_SETWALL: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_GETWALL: { int32_t lLabelID; @@ -3377,11 +3401,13 @@ static int32_t C_ParseCommand(void) } case CON_SETPLAYER: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_GETPLAYER: { int32_t lLabelID; @@ -3458,11 +3484,13 @@ static int32_t C_ParseCommand(void) } case CON_SETINPUT: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_GETINPUT: { int32_t lLabelID; @@ -3577,11 +3605,13 @@ static int32_t C_ParseCommand(void) case CON_SETACTORVAR: case CON_SETPLAYERVAR: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_GETACTORVAR: case CON_GETPLAYERVAR: { @@ -3711,11 +3741,13 @@ static int32_t C_ParseCommand(void) } case CON_SETACTOR: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_GETACTOR: { int32_t lLabelID; @@ -3871,11 +3903,13 @@ static int32_t C_ParseCommand(void) return 0; case CON_GETTICKS: +/* if (C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_REVEVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_GETCURRADDRESS: C_GetNextVarType(GAMEVAR_READONLY); return 0; @@ -3892,11 +3926,13 @@ static int32_t C_ParseCommand(void) case CON_LOCKPLAYER: case CON_SHOOTVAR: case CON_QUAKE: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_JUMP: case CON_CMENU: case CON_SOUNDVAR: @@ -3947,11 +3983,13 @@ static int32_t C_ParseCommand(void) case CON_RANDVAR: case CON_ZSHOOT: case CON_EZSHOOT: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_SETVAR: case CON_ADDVAR: case CON_SUBVAR: @@ -4113,11 +4151,13 @@ static int32_t C_ParseCommand(void) return 0; case CON_RANDVARVAR: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_SETVARVAR: case CON_ADDVARVAR: case CON_SUBVARVAR: @@ -4140,11 +4180,13 @@ static int32_t C_ParseCommand(void) case CON_OPERATESECTORS: case CON_OPERATEACTIVATORS: case CON_SSP: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_GMAXAMMO: case CON_DIST: case CON_LDIST: @@ -4255,11 +4297,13 @@ static int32_t C_ParseCommand(void) return 0; } +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ C_GetNextVar(); return 0; } @@ -4526,11 +4570,13 @@ static int32_t C_ParseCommand(void) case CON_MOVESPRITE: case CON_SETSPRITE: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ C_GetManyVars(4); if (tw == CON_MOVESPRITE) { @@ -4857,11 +4903,13 @@ repeatcase: case CON_CHANGESPRITESECT: case CON_ZSHOOTVAR: case CON_EZSHOOTVAR: +/* if (!C_CheckEventSync(g_currentEvent)) { g_numCompilerWarnings++; C_ReportError(WARNING_EVENTSYNC); } +*/ case CON_GETPNAME: case CON_STARTLEVEL: case CON_QSTRCAT: @@ -4881,11 +4929,13 @@ repeatcase: return 0; case CON_SETACTORANGLE: case CON_SETPLAYERANGLE: +/* if (!C_CheckEventSync(g_currentEvent)) { g_numCompilerWarnings++; C_ReportError(WARNING_EVENTSYNC); } +*/ case CON_GETANGLETOTARGET: case CON_GETACTORANGLE: case CON_GETPLAYERANGLE: @@ -4904,11 +4954,13 @@ repeatcase: return 0; case CON_IFRND: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_IFPDISTL: case CON_IFPDISTG: case CON_IFWASWEAPON: @@ -4973,11 +5025,13 @@ repeatcase: break; case CON_IFSOUND: case CON_IFACTORSOUND: +/* if (C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_REVEVENTSYNC); g_numCompilerWarnings++; } +*/ default: C_GetNextValue(LABEL_DEFINE); break; @@ -5790,11 +5844,13 @@ repeatcase: case CON_PKICK: case CON_MIKESND: case CON_TOSSWEAPON: +/* if (!C_CheckEventSync(g_currentEvent)) { C_ReportError(WARNING_EVENTSYNC); g_numCompilerWarnings++; } +*/ case CON_NULLOP: if (tw == CON_NULLOP) { diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 0a55020a7..dfc8f3ead 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include +#include #include "duke3d.h" #include "gamedef.h" diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index 0f04de6d7..ccab6120b 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -306,13 +306,9 @@ static int32_t osdcmd_god(const osdfuncparm_t *parm) { UNREFERENCED_PARAMETER(parm); if (numplayers == 1 && g_player[myconnectindex].ps->gm & MODE_GAME) - { osdcmd_cheatsinfo_stat.cheatnum = 0; - } else - { OSD_Printf("god: Not in a single-player game.\n"); - } return OSDCMD_OK; } diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index 58c3fd81b..626a85af5 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -495,7 +495,8 @@ int32_t G_LoadPlayer(int32_t spot) Bstrcpy(MapInfo[ud.level_number].musicfn,levname); } - if (MapInfo[(uint8_t)g_musicIndex].musicfn != NULL && (i != g_musicIndex || MapInfo[MAXVOLUMES*MAXLEVELS+2].alt_musicfn)) + if (ud.config.MusicToggle && MapInfo[(uint8_t)g_musicIndex].musicfn != NULL && + (i != g_musicIndex || MapInfo[MAXVOLUMES*MAXLEVELS+2].alt_musicfn)) { S_StopMusic(); S_PlayMusic(&MapInfo[(uint8_t)g_musicIndex].musicfn[0],g_musicIndex); diff --git a/polymer/eduke32/source/sdlmusic.c b/polymer/eduke32/source/sdlmusic.c index 0228caed9..c28435551 100644 --- a/polymer/eduke32/source/sdlmusic.c +++ b/polymer/eduke32/source/sdlmusic.c @@ -173,7 +173,7 @@ int32_t MUSIC_Init(int32_t SoundCard, int32_t Address) sz = (numargs+2)*sizeof(char *) + (c-command+1); sz = ((sz+pagesize-1)/pagesize)*pagesize; # ifdef NEDMALLOC - external_midi_argv = Bmemalign(pagesize, sz); + external_midi_argv = Bmalloc(sz); if (!external_midi_argv) goto fallback; # else diff --git a/polymer/eduke32/source/startwin.game.c b/polymer/eduke32/source/startwin.game.c index c59acd2ba..16c83627e 100644 --- a/polymer/eduke32/source/startwin.game.c +++ b/polymer/eduke32/source/startwin.game.c @@ -221,7 +221,10 @@ static void PopulateForm(int32_t pgs) (void)ComboBox_ResetContent(hwnd); (void)ComboBox_SetCurSel(hwnd, 0); - for (i=0; i<4; i++) + if (di_disabled) j = 2; + else j = 4; + + for (i=0; i