Lunatic: compile out more code with LUNATIC_ONLY.

git-svn-id: https://svn.eduke32.com/eduke32@3354 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-01-01 15:24:18 +00:00
parent 37d8cda701
commit fd390efe2a
8 changed files with 66 additions and 28 deletions

View file

@ -3912,7 +3912,7 @@ static void G_DumpDebugInfo(void)
} }
OSD_Printf("\n"); OSD_Printf("\n");
} }
#endif
for (x=0; x<MAXSTATUS; x++) for (x=0; x<MAXSTATUS; x++)
{ {
j = headspritestat[x]; j = headspritestat[x];
@ -3947,6 +3947,7 @@ static void G_DumpDebugInfo(void)
} }
Gv_DumpValues(); Gv_DumpValues();
// fclose(fp); // fclose(fp);
#endif
saveboard("debug.map", &g_player[myconnectindex].ps->pos, g_player[myconnectindex].ps->ang, saveboard("debug.map", &g_player[myconnectindex].ps->pos, g_player[myconnectindex].ps->ang,
g_player[myconnectindex].ps->cursectnum); g_player[myconnectindex].ps->cursectnum);
} }
@ -4057,9 +4058,9 @@ 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(&spriteext[i], 0, sizeof(spriteext_t));
Bmemset(&spritesmooth[i], 0, sizeof(spritesmooth_t)); Bmemset(&spritesmooth[i], 0, sizeof(spritesmooth_t));
#if !defined LUNATIC_ONLY
A_ResetVars(i); A_ResetVars(i);
#endif
if (G_HaveEvent(EVENT_EGS)) if (G_HaveEvent(EVENT_EGS))
{ {
int32_t pl=A_FindPlayer(s, &p); int32_t pl=A_FindPlayer(s, &p);
@ -9544,7 +9545,9 @@ static void G_CompileScripts(void)
if (g_scriptNamePtr != NULL) if (g_scriptNamePtr != NULL)
Bcorrectfilename(g_scriptNamePtr,0); Bcorrectfilename(g_scriptNamePtr,0);
#if !defined LUNATIC_ONLY #if defined LUNATIC_ONLY
Gv_Init();
#else
// if we compile for a V7 engine wall[] should be used for label names since it's bigger // if we compile for a V7 engine wall[] should be used for label names since it's bigger
pathsearchmode = 1; pathsearchmode = 1;

View file

@ -178,6 +178,7 @@ enum
LABEL_MOVE = 32, LABEL_MOVE = 32,
}; };
#if !defined LUNATIC_ONLY
static const char *C_GetLabelType(int32_t type) static const char *C_GetLabelType(int32_t type)
{ {
int32_t i; int32_t i;
@ -572,6 +573,7 @@ const char *keyw[] =
"showviewunbiased", // 363 "showviewunbiased", // 363
"<null>" "<null>"
}; };
#endif
// KEEPINSYNC with enum GameEvent_t and lunatic/con_lang.lua // KEEPINSYNC with enum GameEvent_t and lunatic/con_lang.lua
const char *EventNames[MAXEVENTS] = const char *EventNames[MAXEVENTS] =
@ -673,6 +675,7 @@ const char *EventNames[MAXEVENTS] =
"EVENT_CHANGEMENU" "EVENT_CHANGEMENU"
}; };
#if !defined LUNATIC_ONLY
const memberlabel_t SectorLabels[]= const memberlabel_t SectorLabels[]=
{ {
{ "wallptr", SECTOR_WALLPTR, 0, 0 }, { "wallptr", SECTOR_WALLPTR, 0, 0 },
@ -1136,12 +1139,16 @@ const memberlabel_t InputLabels[]=
{ "", -1, 0, 0 } // END OF LIST { "", -1, 0, 0 } // END OF LIST
}; };
#endif
char *bitptr; // pointer to bitmap of which bytecode positions contain pointers char *bitptr; // pointer to bitmap of which bytecode positions contain pointers
#define BITPTR_POINTER 1 #define BITPTR_POINTER 1
hashtable_t h_gamevars = { MAXGAMEVARS>>1, NULL }; hashtable_t h_gamevars = { MAXGAMEVARS>>1, NULL };
hashtable_t h_arrays = { MAXGAMEARRAYS>>1, NULL }; hashtable_t h_arrays = { MAXGAMEARRAYS>>1, NULL };
hashtable_t h_labels = { 11264>>1, NULL }; hashtable_t h_labels = { 11264>>1, NULL };
#if !defined LUNATIC_ONLY
static hashtable_t h_keywords = { CON_END>>1, NULL }; static hashtable_t h_keywords = { CON_END>>1, NULL };
static hashtable_t sectorH = { SECTOR_END>>1, NULL }; static hashtable_t sectorH = { SECTOR_END>>1, NULL };
@ -2057,6 +2064,8 @@ static void check_filename_case(const char *fn)
static void check_filename_case(const char *fn) { UNREFERENCED_PARAMETER(fn); } static void check_filename_case(const char *fn) { UNREFERENCED_PARAMETER(fn); }
#endif #endif
#endif // !defined LUNATIC_ONLY
void G_DoGameStartup(const int32_t *params) void G_DoGameStartup(const int32_t *params)
{ {
int32_t j = 0; int32_t j = 0;
@ -2098,6 +2107,7 @@ void G_DoGameStartup(const int32_t *params)
} }
} }
#if !defined LUNATIC_ONLY
static int32_t C_ParseCommand(int32_t loop) static int32_t C_ParseCommand(int32_t loop)
{ {
int32_t i, j=0, k=0, tw, otw; int32_t i, j=0, k=0, tw, otw;
@ -5729,7 +5739,6 @@ repeatcase:
return 0; return 0;
} }
#if !defined LUNATIC_ONLY
/* Anything added with C_AddDefinition() cannot be overwritten in the CONs */ /* Anything added with C_AddDefinition() cannot be overwritten in the CONs */
static void C_AddDefinition(const char *lLabel,int32_t lValue,int32_t lType) static void C_AddDefinition(const char *lLabel,int32_t lValue,int32_t lType)
{ {
@ -5869,14 +5878,12 @@ static void C_InitProjectiles(void)
} }
} }
#pragma pack(pop) #pragma pack(pop)
#endif
extern int32_t g_numObituaries; extern int32_t g_numObituaries;
extern int32_t g_numSelfObituaries; extern int32_t g_numSelfObituaries;
void C_Compile(const char *filenam) void C_Compile(const char *filenam)
{ {
#if !defined LUNATIC_ONLY
char *mptr; char *mptr;
int32_t i; int32_t i;
int32_t fs,fp; int32_t fs,fp;
@ -5888,9 +5895,9 @@ void C_Compile(const char *filenam)
Bmemset(&g_tile[i], 0, sizeof(tiledata_t)); Bmemset(&g_tile[i], 0, sizeof(tiledata_t));
C_InitHashes(); C_InitHashes();
#endif
Gv_Init(); Gv_Init();
#if !defined LUNATIC_ONLY
C_InitProjectiles(); C_InitProjectiles();
fp = kopen4loadfrommod((char *)filenam,g_loadFromGroupOnly); fp = kopen4loadfrommod((char *)filenam,g_loadFromGroupOnly);
@ -6185,11 +6192,12 @@ void C_Compile(const char *filenam)
} }
} }
} }
#endif // !defined LUNATIC_ONLY
} }
#endif // !defined LUNATIC_ONLY
void C_ReportError(int32_t iError) void C_ReportError(int32_t iError)
{ {
#if !defined LUNATIC_ONLY
if (Bstrcmp(g_szCurrentBlockName,g_szLastBlockName)) if (Bstrcmp(g_szCurrentBlockName,g_szLastBlockName))
{ {
if (g_parsingEventPtr || g_processingState || g_parsingActorPtr) if (g_parsingEventPtr || g_processingState || g_parsingActorPtr)
@ -6278,4 +6286,5 @@ void C_ReportError(int32_t iError)
initprintf("%s:%d: warning: symbol `%s' already used for game variable.\n",g_szScriptFileName,g_lineNumber,label+(g_numLabels<<6)); initprintf("%s:%d: warning: symbol `%s' already used for game variable.\n",g_szScriptFileName,g_lineNumber,label+(g_numLabels<<6));
break; break;
} }
#endif
} }

View file

@ -97,7 +97,9 @@ extern const memberlabel_t InputLabels[];
extern const memberlabel_t TsprLabels[]; extern const memberlabel_t TsprLabels[];
void C_ReportError(int32_t iError); void C_ReportError(int32_t iError);
#if !defined LUNATIC_ONLY
void C_Compile(const char *filenam); void C_Compile(const char *filenam);
#endif
/* /*
extern void VM_AccessUserdef(int32_t iSet, int32_t lLabelID, int32_t lVar2); extern void VM_AccessUserdef(int32_t iSet, int32_t lLabelID, int32_t lVar2);

View file

@ -61,15 +61,18 @@ int32_t g_tw;
int32_t g_currentEventExec = -1; int32_t g_currentEventExec = -1;
#if !defined LUNATIC_ONLY
GAMEEXEC_STATIC void VM_Execute(int32_t loop); GAMEEXEC_STATIC void VM_Execute(int32_t loop);
#include "gamestructures.c" # include "gamestructures.c"
#endif
#define VM_CONDITIONAL(xxx) { if ((xxx) || ((insptr = (intptr_t *)*(insptr+1)) && (((*insptr) & 0xfff) == CON_ELSE))) \ #define VM_CONDITIONAL(xxx) { if ((xxx) || ((insptr = (intptr_t *)*(insptr+1)) && (((*insptr) & 0xfff) == CON_ELSE))) \
{ insptr += 2; VM_Execute(0); } } { insptr += 2; VM_Execute(0); } }
void VM_ScriptInfo(void) void VM_ScriptInfo(void)
{ {
#if !defined LUNATIC_ONLY
intptr_t *p; intptr_t *p;
if (!script) if (!script)
@ -98,6 +101,7 @@ void VM_ScriptInfo(void)
initprintf_nowarn("current actor: %d (%d)\n",vm.g_i,TrackerCast(vm.g_sp->picnum)); initprintf_nowarn("current actor: %d (%d)\n",vm.g_i,TrackerCast(vm.g_sp->picnum));
initprintf("g_errorLineNum: %d, g_tw: %d\n",g_errorLineNum,g_tw); initprintf("g_errorLineNum: %d, g_tw: %d\n",g_errorLineNum,g_tw);
#endif
} }
// May recurse, e.g. through EVENT_XXX -> ... -> EVENT_KILLIT // May recurse, e.g. through EVENT_XXX -> ... -> EVENT_KILLIT
@ -110,6 +114,8 @@ int32_t VM_OnEvent(int32_t iEventID, int32_t iActor, int32_t iPlayer, int32_t lD
if (L_IsInitialized(&g_ElState) && El_HaveEvent(iEventID)) if (L_IsInitialized(&g_ElState) && El_HaveEvent(iEventID))
El_CallEvent(&g_ElState, iEventID, iActor, iPlayer, lDist); El_CallEvent(&g_ElState, iEventID, iActor, iPlayer, lDist);
#endif #endif
#if !defined LUNATIC_ONLY
if (apScriptGameEvent[iEventID]) if (apScriptGameEvent[iEventID])
{ {
intptr_t *oinsptr=insptr; intptr_t *oinsptr=insptr;
@ -148,6 +154,7 @@ int32_t VM_OnEvent(int32_t iEventID, int32_t iActor, int32_t iPlayer, int32_t lD
iReturn = aGameVars[g_iReturnVarID].val.lValue; iReturn = aGameVars[g_iReturnVarID].val.lValue;
aGameVars[g_iReturnVarID].val.lValue = backupReturnVar; aGameVars[g_iReturnVarID].val.lValue = backupReturnVar;
} }
#endif
#ifdef LUNATIC #ifdef LUNATIC
g_eventTotalMs[iEventID] += gethitickms()-t; g_eventTotalMs[iEventID] += gethitickms()-t;
@ -773,6 +780,7 @@ void P_AddWeaponMaybeSwitch(DukePlayer_t *ps, int32_t weap)
P_AddWeaponNoSwitch(ps, weap); P_AddWeaponNoSwitch(ps, weap);
} }
#if !defined LUNATIC_ONLY
static void P_AddWeaponAmmoCommon(DukePlayer_t *ps, int32_t weap, int32_t amount) static void P_AddWeaponAmmoCommon(DukePlayer_t *ps, int32_t weap, int32_t amount)
{ {
P_AddAmmo(weap, ps, amount); P_AddAmmo(weap, ps, amount);
@ -803,6 +811,7 @@ static int32_t VM_AddWeapon(int32_t weap, int32_t amount, DukePlayer_t *ps)
return 0; return 0;
} }
#endif
static void VM_Fall(void) static void VM_Fall(void)
{ {
@ -956,6 +965,7 @@ static void VM_ResetPlayer(void)
//AddLog("EOF: resetplayer"); //AddLog("EOF: resetplayer");
} }
#if !defined LUNATIC_ONLY
GAMEEXEC_STATIC void VM_Execute(int32_t loop) GAMEEXEC_STATIC void VM_Execute(int32_t loop)
{ {
register int32_t tw = *insptr; register int32_t tw = *insptr;
@ -5132,10 +5142,12 @@ nullquote:
} }
} }
} }
#endif
// NORECURSE // NORECURSE
void A_LoadActor(int32_t iActor) void A_LoadActor(int32_t iActor)
{ {
#if !defined LUNATIC_ONLY
vm.g_i = iActor; // Sprite ID vm.g_i = iActor; // Sprite ID
vm.g_p = -1; // iPlayer; // Player ID vm.g_p = -1; // iPlayer; // Player ID
vm.g_x = -1; // lDist; // ? vm.g_x = -1; // lDist; // ?
@ -5161,6 +5173,7 @@ void A_LoadActor(int32_t iActor)
if (vm.g_flags & VM_KILL) if (vm.g_flags & VM_KILL)
A_DeleteSprite(vm.g_i); A_DeleteSprite(vm.g_i);
#endif
} }
// NORECURSE // NORECURSE
@ -5487,7 +5500,7 @@ void G_RestoreMapState(mapstate_t *save)
Bmemcpy(&lockclock,&save->lockclock,sizeof(lockclock)); Bmemcpy(&lockclock,&save->lockclock,sizeof(lockclock));
Bmemcpy(&randomseed,&save->randomseed,sizeof(randomseed)); Bmemcpy(&randomseed,&save->randomseed,sizeof(randomseed));
Bmemcpy(&g_globalRandom,&save->g_globalRandom,sizeof(g_globalRandom)); Bmemcpy(&g_globalRandom,&save->g_globalRandom,sizeof(g_globalRandom));
#if !defined LUNATIC_ONLY
for (i=g_gameVarCount-1; i>=0; i--) for (i=g_gameVarCount-1; i>=0; i--)
{ {
if (aGameVars[i].dwFlags & GAMEVAR_NORESET) continue; if (aGameVars[i].dwFlags & GAMEVAR_NORESET) continue;
@ -5505,7 +5518,7 @@ void G_RestoreMapState(mapstate_t *save)
} }
Gv_RefreshPointers(); Gv_RefreshPointers();
#endif
for (i=0; i<playerswhenstarted; i++) for (i=0; i<playerswhenstarted; i++)
sprite[g_player[i].ps->i].extra = phealth[i]; sprite[g_player[i].ps->i].extra = phealth[i];

View file

@ -146,7 +146,7 @@ void G_RestoreMapState(mapstate_t *save);
void G_RestoreMapState(mapstate_t *save); void G_RestoreMapState(mapstate_t *save);
void G_SaveMapState(mapstate_t *save); void G_SaveMapState(mapstate_t *save);
void G_SaveMapState(mapstate_t *save); void G_SaveMapState(mapstate_t *save);
void Gv_RefreshPointers(void); //void Gv_RefreshPointers(void);
int32_t VM_OnEvent(int32_t iEventID,int32_t iActor,int32_t iPlayer,int32_t lDist, int32_t iReturn); int32_t VM_OnEvent(int32_t iEventID,int32_t iActor,int32_t iPlayer,int32_t lDist, int32_t iReturn);
void VM_ScriptInfo(void); void VM_ScriptInfo(void);

View file

@ -28,7 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "savegame.h" #include "savegame.h"
#define _gamevars_c_ #define _gamevars_c_
#include "gamestructures.c" #if !defined LUNATIC_ONLY
# include "gamestructures.c"
#endif
extern int32_t OSD_errors; extern int32_t OSD_errors;
@ -109,6 +111,7 @@ static void Gv_Clear(void)
int32_t Gv_ReadSave(int32_t fil, int32_t newbehav) int32_t Gv_ReadSave(int32_t fil, int32_t newbehav)
{ {
#if !defined LUNATIC_ONLY
int32_t i, j; int32_t i, j;
char savedstate[MAXVOLUMES*MAXLEVELS]; char savedstate[MAXVOLUMES*MAXLEVELS];
char tbuf[12]; char tbuf[12];
@ -243,11 +246,13 @@ int32_t Gv_ReadSave(int32_t fil, int32_t newbehav)
#endif #endif
return(0); return(0);
corrupt: corrupt:
#endif
return(1); return(1);
} }
void Gv_WriteSave(FILE *fil, int32_t newbehav) void Gv_WriteSave(FILE *fil, int32_t newbehav)
{ {
#if !defined LUNATIC_ONLY
int32_t i, j; int32_t i, j;
char savedstate[MAXVOLUMES*MAXLEVELS]; char savedstate[MAXVOLUMES*MAXLEVELS];
@ -331,8 +336,10 @@ void Gv_WriteSave(FILE *fil, int32_t newbehav)
} }
else else
fwrite("EOF: EDuke32", 12, 1, fil); fwrite("EOF: EDuke32", 12, 1, fil);
#endif
} }
#if !defined LUNATIC_ONLY
void Gv_DumpValues(void) void Gv_DumpValues(void)
{ {
int32_t i; int32_t i;
@ -453,6 +460,7 @@ int32_t Gv_NewArray(const char *pszLabel, void *arrayptr, intptr_t asize, uint32
g_gameArrayCount++; g_gameArrayCount++;
hash_add(&h_arrays, aGameArrays[i].szLabel, i, 1); hash_add(&h_arrays, aGameArrays[i].szLabel, i, 1);
return 1; return 1;
} }
@ -560,7 +568,6 @@ void __fastcall A_ResetVars(register int32_t iActor)
while (i--); while (i--);
} }
#if !defined LUNATIC_ONLY
static int32_t Gv_GetVarIndex(const char *szGameLabel) static int32_t Gv_GetVarIndex(const char *szGameLabel)
{ {
int32_t i = hash_find(&h_gamevars,szGameLabel); int32_t i = hash_find(&h_gamevars,szGameLabel);
@ -765,7 +772,6 @@ badindex:
aGameVars[id].szLabel,vm.g_i,vm.g_p); aGameVars[id].szLabel,vm.g_i,vm.g_p);
return; return;
} }
#endif
int32_t __fastcall Gv_GetVarX(register int32_t id) int32_t __fastcall Gv_GetVarX(register int32_t id)
{ {
@ -977,6 +983,7 @@ int32_t Gv_GetVarByLabel(const char *szGameLabel, int32_t lDefault, int32_t iAct
return Gv_GetVar(i, iActor, iPlayer); return Gv_GetVar(i, iActor, iPlayer);
} }
#endif
#if !defined LUNATIC #if !defined LUNATIC
static intptr_t *Gv_GetVarDataPtr(const char *szGameLabel) static intptr_t *Gv_GetVarDataPtr(const char *szGameLabel)
@ -1407,9 +1414,9 @@ void Gv_Init(void)
#endif #endif
} }
#if !defined LUNATIC
void Gv_InitWeaponPointers(void) void Gv_InitWeaponPointers(void)
{ {
#if !defined LUNATIC
int32_t i; int32_t i;
char aszBuf[64]; char aszBuf[64];
// called from game Init AND when level is loaded... // called from game Init AND when level is loaded...
@ -1463,12 +1470,10 @@ void Gv_InitWeaponPointers(void)
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",i); Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",i);
aplWeaponFlashColor[i]=Gv_GetVarDataPtr(aszBuf); aplWeaponFlashColor[i]=Gv_GetVarDataPtr(aszBuf);
} }
#endif
} }
void Gv_RefreshPointers(void) void Gv_RefreshPointers(void)
{ {
#if !defined LUNATIC_ONLY
aGameVars[Gv_GetVarIndex("RESPAWN_MONSTERS")].val.lValue = (intptr_t)&ud.respawn_monsters; aGameVars[Gv_GetVarIndex("RESPAWN_MONSTERS")].val.lValue = (intptr_t)&ud.respawn_monsters;
aGameVars[Gv_GetVarIndex("RESPAWN_ITEMS")].val.lValue = (intptr_t)&ud.respawn_items; aGameVars[Gv_GetVarIndex("RESPAWN_ITEMS")].val.lValue = (intptr_t)&ud.respawn_items;
aGameVars[Gv_GetVarIndex("RESPAWN_INVENTORY")].val.lValue = (intptr_t)&ud.respawn_inventory; aGameVars[Gv_GetVarIndex("RESPAWN_INVENTORY")].val.lValue = (intptr_t)&ud.respawn_inventory;
@ -1551,5 +1556,5 @@ void Gv_RefreshPointers(void)
# ifdef USE_OPENGL # ifdef USE_OPENGL
aGameVars[Gv_GetVarIndex("rendmode")].val.lValue = (intptr_t)&rendmode; aGameVars[Gv_GetVarIndex("rendmode")].val.lValue = (intptr_t)&rendmode;
# endif # endif
#endif
} }
#endif

View file

@ -95,8 +95,8 @@ extern int32_t g_gameVarCount;
extern int32_t g_gameArrayCount; extern int32_t g_gameArrayCount;
#if defined LUNATIC_ONLY #if defined LUNATIC_ONLY
# define Gv_GetVar(id, iActor, iPlayer) (OSD_Printf("Gv_GetVar @ %s:%d\n", __FILE__, __LINE__), 0) # define Gv_GetVar(id, iActor, iPlayer) 0 // (OSD_Printf("Gv_GetVar @ %s:%d\n", __FILE__, __LINE__), 0)
# define Gv_SetVar(id, lValue, iActor, iPlayer) OSD_Printf("Gv_SetVar @ %s:%d\n", __FILE__, __LINE__) # define Gv_SetVar(id, lValue, iActor, iPlayer) do{}while(0) //OSD_Printf("Gv_SetVar @ %s:%d\n", __FILE__, __LINE__)
#else #else
int32_t __fastcall Gv_GetVar(register int32_t id,register int32_t iActor,register int32_t iPlayer); int32_t __fastcall Gv_GetVar(register int32_t id,register int32_t iActor,register int32_t iPlayer);
void __fastcall Gv_SetVar(register int32_t id,register int32_t lValue,register int32_t iActor,register int32_t iPlayer); void __fastcall Gv_SetVar(register int32_t id,register int32_t lValue,register int32_t iActor,register int32_t iPlayer);
@ -104,19 +104,22 @@ void __fastcall Gv_SetVar(register int32_t id,register int32_t lValue,register i
int32_t __fastcall Gv_GetVarX(register int32_t id); int32_t __fastcall Gv_GetVarX(register int32_t id);
void __fastcall Gv_SetVarX(register int32_t id,register int32_t lValue); void __fastcall Gv_SetVarX(register int32_t id,register int32_t lValue);
#ifdef LUNATIC_ONLY
# define Gv_GetVarByLabel(szGameLabel, lDefault, iActor, iPlayer) (-1)
#else
int32_t Gv_GetVarByLabel(const char *szGameLabel,int32_t lDefault,int32_t iActor,int32_t iPlayer); int32_t Gv_GetVarByLabel(const char *szGameLabel,int32_t lDefault,int32_t iActor,int32_t iPlayer);
int32_t Gv_NewArray(const char *pszLabel,void *arrayptr,intptr_t asize,uint32_t dwFlags); int32_t Gv_NewArray(const char *pszLabel,void *arrayptr,intptr_t asize,uint32_t dwFlags);
int32_t Gv_NewVar(const char *pszLabel,intptr_t lValue,uint32_t dwFlags); int32_t Gv_NewVar(const char *pszLabel,intptr_t lValue,uint32_t dwFlags);
int32_t Gv_ReadSave(int32_t fil,int32_t newbehav);
void __fastcall A_ResetVars(register int32_t iActor); void __fastcall A_ResetVars(register int32_t iActor);
void G_FreeMapState(int32_t mapnum); void G_FreeMapState(int32_t mapnum);
void Gv_DumpValues(void); void Gv_DumpValues(void);
void Gv_Init(void);
void Gv_InitWeaponPointers(void); void Gv_InitWeaponPointers(void);
void Gv_RefreshPointers(void); void Gv_RefreshPointers(void);
void Gv_RefreshPointers(void);
void Gv_ResetSystemDefaults(void); void Gv_ResetSystemDefaults(void);
void Gv_ResetVars(void); void Gv_ResetVars(void);
#endif
int32_t Gv_ReadSave(int32_t fil,int32_t newbehav);
void Gv_Init(void);
void Gv_WriteSave(FILE *fil,int32_t newbehav); void Gv_WriteSave(FILE *fil,int32_t newbehav);
#define GV_VAROP(func, operator) static inline void __fastcall func(register int32_t id, register int32_t lValue) \ #define GV_VAROP(func, operator) static inline void __fastcall func(register int32_t id, register int32_t lValue) \

View file

@ -1101,7 +1101,9 @@ static inline void prelevel(char g)
while (i >= 0) while (i >= 0)
{ {
nexti = nextspritestat[i]; nexti = nextspritestat[i];
#if !defined LUNATIC_ONLY
A_ResetVars(i); A_ResetVars(i);
#endif
A_LoadActor(i); A_LoadActor(i);
VM_OnEvent(EVENT_LOADACTOR, i, -1, -1, 0); VM_OnEvent(EVENT_LOADACTOR, i, -1, -1, 0);
if (sprite[i].lotag == UINT16_MAX && (sprite[i].cstat&16)) if (sprite[i].lotag == UINT16_MAX && (sprite[i].cstat&16))
@ -1367,7 +1369,7 @@ static inline void prelevel(char g)
} }
} }
#ifdef LUNATIC #if 0 //def LUNATIC
if (L_IsInitialized(&g_ElState)) if (L_IsInitialized(&g_ElState))
{ {
i = L_RunOnce(&g_ElState, "test.elua"); i = L_RunOnce(&g_ElState, "test.elua");
@ -1437,6 +1439,7 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk)
p->zoom = 768; p->zoom = 768;
p->gm = 0; p->gm = 0;
#if !defined LUNATIC_ONLY
//AddLog("Newgame"); //AddLog("Newgame");
Gv_ResetVars(); Gv_ResetVars();
@ -1447,7 +1450,7 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk)
Gv_RefreshPointers(); Gv_RefreshPointers();
Gv_ResetSystemDefaults(); Gv_ResetSystemDefaults();
#endif
for (i=0; i<(MAXVOLUMES*MAXLEVELS); i++) for (i=0; i<(MAXVOLUMES*MAXLEVELS); i++)
if (MapInfo[i].savedstate) if (MapInfo[i].savedstate)
{ {