diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index 1056bfe74..1c27f8ca7 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -421,7 +421,7 @@ ifneq ($(LUNATIC),0) else BASECOMMONFLAGS+= -I/usr/local/include/luajit-2.0 endif - BASECOMMONFLAGS+= -I$(SRC)/lunatic -DLUNATIC -DLUNATIC_ONLY + BASECOMMONFLAGS+= -I$(SRC)/lunatic -DLUNATIC ifeq ($(PLATFORM),WINDOWS) BASELIBS+= -lluajit diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 9774e5e29..36994b9c8 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -156,7 +156,7 @@ static inline int32_t G_HaveActor(int32_t actortile) static inline int32_t G_InitialActorStrength(int32_t actortile) { -#ifdef LUNATIC_ONLY +#ifdef LUNATIC return g_elActors[actortile].strength; #else return g_tile[actortile].execPtr[0]; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index eb44353dc..0dc57fe64 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -4050,7 +4050,7 @@ int32_t A_InsertSprite(int32_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int3 Bmemset(&spriteext[i], 0, sizeof(spriteext_t)); Bmemset(&spritesmooth[i], 0, sizeof(spritesmooth_t)); -#if !defined LUNATIC_ONLY +#if !defined LUNATIC A_ResetVars(i); #endif if (G_HaveEvent(EVENT_EGS)) @@ -9485,7 +9485,7 @@ static void G_Cleanup(void) if (g_sounds[i].filename != NULL) Bfree(g_sounds[i].filename); if (g_sounds[i].filename1 != NULL) Bfree(g_sounds[i].filename1); } -#if !defined LUNATIC_ONLY +#if !defined LUNATIC if (label != NULL && label != (char *)&sprite[0]) Bfree(label); if (labelcode != NULL && labelcode != (int32_t *)§or[0]) Bfree(labelcode); if (script != NULL) Bfree(script); @@ -9530,7 +9530,7 @@ void G_Shutdown(void) static void G_CompileScripts(void) { -#if !defined LUNATIC_ONLY +#if !defined LUNATIC int32_t psm = pathsearchmode; label = (char *)&sprite[0]; // V8: 16384*44/64 = 11264 V7: 4096*44/64 = 2816 @@ -9541,7 +9541,7 @@ static void G_CompileScripts(void) if (g_scriptNamePtr != NULL) Bcorrectfilename(g_scriptNamePtr,0); -#if defined LUNATIC_ONLY +#if defined LUNATIC Gv_Init(); #else // if we compile for a V7 engine wall[] should be used for label names since it's bigger diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 8e3682194..adf6350cd 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -98,7 +98,7 @@ int32_t g_totalLines,g_lineNumber; static int32_t g_checkingIfElse, g_processingState, g_lastKeyword = -1; char g_szBuf[1024]; -#if !defined LUNATIC_ONLY +#if !defined LUNATIC // The pointer to the start of the case table in a switch statement. // First entry is 'default' code. static intptr_t *g_caseScriptPtr=NULL; @@ -179,7 +179,7 @@ enum LABEL_MOVE = 32, }; -#if !defined LUNATIC_ONLY +#if !defined LUNATIC static const char *C_GetLabelType(int32_t type) { int32_t i; @@ -676,7 +676,7 @@ const char *EventNames[MAXEVENTS] = "EVENT_CHANGEMENU" }; -#if !defined LUNATIC_ONLY +#if !defined LUNATIC const memberlabel_t SectorLabels[]= { { "wallptr", SECTOR_WALLPTR, 0, 0 }, @@ -1149,7 +1149,7 @@ hashtable_t h_gamevars = { MAXGAMEVARS>>1, NULL }; hashtable_t h_arrays = { MAXGAMEARRAYS>>1, NULL }; hashtable_t h_labels = { 11264>>1, NULL }; -#if !defined LUNATIC_ONLY +#if !defined LUNATIC static hashtable_t h_keywords = { CON_END>>1, NULL }; static hashtable_t sectorH = { SECTOR_END>>1, NULL }; @@ -2053,7 +2053,7 @@ static void C_Include(const char *confile) Bfree(mptr); } -#endif // !defined LUNATIC_ONLY +#endif // !defined LUNATIC #ifdef _WIN32 static void check_filename_case(const char *fn) @@ -2304,7 +2304,7 @@ void C_InitQuotes(void) } } -#if !defined LUNATIC_ONLY +#if !defined LUNATIC static int32_t C_ParseCommand(int32_t loop) { int32_t i, j=0, k=0, tw, otw; @@ -6288,11 +6288,11 @@ void C_Compile(const char *filenam) C_InitQuotes(); } } -#endif // !defined LUNATIC_ONLY +#endif // !defined LUNATIC void C_ReportError(int32_t iError) { -#if !defined LUNATIC_ONLY +#if !defined LUNATIC if (Bstrcmp(g_szCurrentBlockName,g_szLastBlockName)) { if (g_parsingEventPtr || g_processingState || g_parsingActorPtr) diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 013e0f361..ecb27a579 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -92,7 +92,7 @@ int32_t C_AllocQuote(int32_t qnum); void C_InitQuotes(void); void C_ReportError(int32_t iError); -#if !defined LUNATIC_ONLY +#if !defined LUNATIC void C_Compile(const char *filenam); #endif diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index d0d74f4c9..1d9809cf5 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -61,7 +61,7 @@ int32_t g_tw; int32_t g_currentEventExec = -1; -#if !defined LUNATIC_ONLY +#if !defined LUNATIC GAMEEXEC_STATIC void VM_Execute(int32_t loop); # include "gamestructures.c" @@ -72,7 +72,7 @@ GAMEEXEC_STATIC void VM_Execute(int32_t loop); void VM_ScriptInfo(void) { -#if !defined LUNATIC_ONLY +#if !defined LUNATIC intptr_t *p; if (!script) @@ -115,7 +115,7 @@ int32_t VM_OnEvent(int32_t iEventID, int32_t iActor, int32_t iPlayer, int32_t lD El_CallEvent(&g_ElState, iEventID, iActor, iPlayer, lDist); #endif -#if !defined LUNATIC_ONLY +#if !defined LUNATIC if (apScriptGameEvent[iEventID]) { intptr_t *oinsptr=insptr; @@ -780,7 +780,7 @@ void P_AddWeaponMaybeSwitch(DukePlayer_t *ps, int32_t weap) P_AddWeaponNoSwitch(ps, weap); } -#if !defined LUNATIC_ONLY +#if !defined LUNATIC static void P_AddWeaponAmmoCommon(DukePlayer_t *ps, int32_t weap, int32_t amount) { P_AddAmmo(weap, ps, amount); @@ -965,7 +965,7 @@ static void VM_ResetPlayer(void) //AddLog("EOF: resetplayer"); } -#if !defined LUNATIC_ONLY +#if !defined LUNATIC GAMEEXEC_STATIC void VM_Execute(int32_t loop) { register int32_t tw = *insptr; @@ -2013,7 +2013,7 @@ nullquote: actor[i].flags = 0; sprite[i].hitag = 0; -#if !defined LUNATIC_ONLY +#if !defined LUNATIC // TODO: Lunatic if (g_tile[sprite[i].picnum].execPtr) { @@ -5133,7 +5133,7 @@ nullquote: // NORECURSE void A_LoadActor(int32_t iActor) { -#if !defined LUNATIC_ONLY +#if !defined LUNATIC vm.g_i = iActor; // Sprite ID vm.g_p = -1; // iPlayer; // Player ID vm.g_x = -1; // lDist; // ? @@ -5237,7 +5237,7 @@ void A_Execute(int32_t iActor,int32_t iPlayer,int32_t lDist) { #endif -#if !defined LUNATIC_ONLY +#if !defined LUNATIC insptr = 4 + (g_tile[vm.g_sp->picnum].execPtr); VM_Execute(1); insptr = NULL; @@ -5486,7 +5486,7 @@ void G_RestoreMapState(mapstate_t *save) Bmemcpy(&lockclock,&save->lockclock,sizeof(lockclock)); Bmemcpy(&randomseed,&save->randomseed,sizeof(randomseed)); Bmemcpy(&g_globalRandom,&save->g_globalRandom,sizeof(g_globalRandom)); -#if !defined LUNATIC_ONLY +#if !defined LUNATIC for (i=g_gameVarCount-1; i>=0; i--) { if (aGameVars[i].dwFlags & GAMEVAR_NORESET) continue; diff --git a/polymer/eduke32/source/gamevars.c b/polymer/eduke32/source/gamevars.c index 3479078e5..49d9c825f 100644 --- a/polymer/eduke32/source/gamevars.c +++ b/polymer/eduke32/source/gamevars.c @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "savegame.h" #define _gamevars_c_ -#if !defined LUNATIC_ONLY +#if !defined LUNATIC # include "gamestructures.c" #endif @@ -37,7 +37,7 @@ extern int32_t OSD_errors; void Gv_RefreshPointers(void); extern void G_FreeMapState(int32_t mapnum); -#if !defined LUNATIC_ONLY +#if !defined LUNATIC static void Gv_Free(void) /* called from Gv_ReadSave() and Gv_ResetVars() */ { // call this function as many times as needed. @@ -112,7 +112,7 @@ static void Gv_Clear(void) int32_t Gv_ReadSave(int32_t fil, int32_t newbehav) { -#if !defined LUNATIC_ONLY +#if !defined LUNATIC int32_t i, j; char savedstate[MAXVOLUMES*MAXLEVELS]; char tbuf[12]; @@ -253,7 +253,7 @@ corrupt: void Gv_WriteSave(FILE *fil, int32_t newbehav) { -#if !defined LUNATIC_ONLY +#if !defined LUNATIC int32_t i, j; char savedstate[MAXVOLUMES*MAXLEVELS]; @@ -340,7 +340,7 @@ void Gv_WriteSave(FILE *fil, int32_t newbehav) #endif } -#if !defined LUNATIC_ONLY +#if !defined LUNATIC void Gv_DumpValues(void) { int32_t i; @@ -1070,7 +1070,7 @@ void Gv_ResetSystemDefaults(void) } } #endif -#if !defined LUNATIC_ONLY +#if !defined LUNATIC g_iReturnVarID=Gv_GetVarIndex("RETURN"); g_iWeaponVarID=Gv_GetVarIndex("WEAPON"); g_iWorksLikeVarID=Gv_GetVarIndex("WORKSLIKE"); @@ -1417,7 +1417,7 @@ void Gv_Init(void) // initprintf("Initializing game variables\n"); //AddLog("Gv_Init"); -#ifdef LUNATIC_ONLY +#ifdef LUNATIC Gv_AddSystemVars(); // set up weapon defaults, g_playerWeapon[][] Gv_ResetSystemDefaults(); #else diff --git a/polymer/eduke32/source/gamevars.h b/polymer/eduke32/source/gamevars.h index 140d49a5a..77217b527 100644 --- a/polymer/eduke32/source/gamevars.h +++ b/polymer/eduke32/source/gamevars.h @@ -94,7 +94,7 @@ extern gamearray_t aGameArrays[MAXGAMEARRAYS]; extern int32_t g_gameVarCount; extern int32_t g_gameArrayCount; -#if defined LUNATIC_ONLY +#if defined LUNATIC # define Gv_GetVar(id, iActor, iPlayer) 0 // (OSD_Printf("Gv_GetVar @ %s:%d\n", __FILE__, __LINE__), 0) # define Gv_SetVar(id, lValue, iActor, iPlayer) do{}while(0) //OSD_Printf("Gv_SetVar @ %s:%d\n", __FILE__, __LINE__) #else @@ -104,7 +104,7 @@ void __fastcall Gv_SetVar(register int32_t id,register int32_t lValue,register i int32_t __fastcall Gv_GetVarX(register int32_t id); void __fastcall Gv_SetVarX(register int32_t id,register int32_t lValue); -#ifdef LUNATIC_ONLY +#ifdef LUNATIC # define Gv_GetVarByLabel(szGameLabel, lDefault, iActor, iPlayer) (lDefault) #else int32_t Gv_GetVarByLabel(const char *szGameLabel,int32_t lDefault,int32_t iActor,int32_t iPlayer); diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index cd5ead341..4dc90ecf4 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1105,7 +1105,7 @@ static inline void prelevel(char g) while (i >= 0) { nexti = nextspritestat[i]; -#if !defined LUNATIC_ONLY +#if !defined LUNATIC A_ResetVars(i); #endif A_LoadActor(i); @@ -1443,7 +1443,7 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk) p->zoom = 768; p->gm = 0; -#if !defined LUNATIC_ONLY +#if !defined LUNATIC //AddLog("Newgame"); Gv_ResetVars();