mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 23:11:58 +00:00
- Added support for Eternity's JUMP table and PCD_GOTOSTACK (again, requires advanced compiler).
SVN r3990 (trunk)
This commit is contained in:
parent
86291fcd96
commit
e8731c7571
2 changed files with 16 additions and 0 deletions
|
@ -1144,6 +1144,14 @@ FBehavior::FBehavior (int lumpnum, FileReader * fr, int len)
|
||||||
Functions += 8;
|
Functions += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load JUMP points
|
||||||
|
chunk = (DWORD *)FindChunk (MAKE_ID('J','U','M','P'));
|
||||||
|
if (chunk != NULL)
|
||||||
|
{
|
||||||
|
for (i = 0;i < (int)LittleLong(chunk[1]);i += 4)
|
||||||
|
JumpPoints.Push(LittleLong(chunk[2 + i/4]));
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize this object's map variables
|
// Initialize this object's map variables
|
||||||
memset (MapVarStore, 0, sizeof(MapVarStore));
|
memset (MapVarStore, 0, sizeof(MapVarStore));
|
||||||
chunk = (DWORD *)FindChunk (MAKE_ID('M','I','N','I'));
|
chunk = (DWORD *)FindChunk (MAKE_ID('M','I','N','I'));
|
||||||
|
@ -5188,6 +5196,11 @@ int DLevelScript::RunScript ()
|
||||||
pc = activeBehavior->Ofs2PC (LittleLong(*pc));
|
pc = activeBehavior->Ofs2PC (LittleLong(*pc));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PCD_GOTOSTACK:
|
||||||
|
pc = activeBehavior->Jump2PC (STACK(1));
|
||||||
|
sp--;
|
||||||
|
break;
|
||||||
|
|
||||||
case PCD_IFGOTO:
|
case PCD_IFGOTO:
|
||||||
if (STACK(1))
|
if (STACK(1))
|
||||||
pc = activeBehavior->Ofs2PC (LittleLong(*pc));
|
pc = activeBehavior->Ofs2PC (LittleLong(*pc));
|
||||||
|
|
|
@ -165,6 +165,7 @@ public:
|
||||||
void StartTypedScripts (WORD type, AActor *activator, bool always, int arg1, bool runNow);
|
void StartTypedScripts (WORD type, AActor *activator, bool always, int arg1, bool runNow);
|
||||||
DWORD PC2Ofs (int *pc) const { return (DWORD)((BYTE *)pc - Data); }
|
DWORD PC2Ofs (int *pc) const { return (DWORD)((BYTE *)pc - Data); }
|
||||||
int *Ofs2PC (DWORD ofs) const { return (int *)(Data + ofs); }
|
int *Ofs2PC (DWORD ofs) const { return (int *)(Data + ofs); }
|
||||||
|
int *Jump2PC (DWORD jumpPoint) const { return Ofs2PC(JumpPoints[jumpPoint]); }
|
||||||
ACSFormat GetFormat() const { return Format; }
|
ACSFormat GetFormat() const { return Format; }
|
||||||
ScriptFunction *GetFunction (int funcnum, FBehavior *&module) const;
|
ScriptFunction *GetFunction (int funcnum, FBehavior *&module) const;
|
||||||
int GetArrayVal (int arraynum, int index) const;
|
int GetArrayVal (int arraynum, int index) const;
|
||||||
|
@ -213,6 +214,7 @@ private:
|
||||||
TArray<FBehavior *> Imports;
|
TArray<FBehavior *> Imports;
|
||||||
DWORD LibraryID;
|
DWORD LibraryID;
|
||||||
char ModuleName[9];
|
char ModuleName[9];
|
||||||
|
TArray<int> JumpPoints;
|
||||||
|
|
||||||
static TArray<FBehavior *> StaticModules;
|
static TArray<FBehavior *> StaticModules;
|
||||||
|
|
||||||
|
@ -602,6 +604,7 @@ public:
|
||||||
/*360*/ PCD_CALLSTACK, // from Eternity
|
/*360*/ PCD_CALLSTACK, // from Eternity
|
||||||
PCD_SCRIPTWAITNAMED,
|
PCD_SCRIPTWAITNAMED,
|
||||||
PCD_TRANSLATIONRANGE3,
|
PCD_TRANSLATIONRANGE3,
|
||||||
|
PCD_GOTOSTACK,
|
||||||
|
|
||||||
/*363*/ PCODE_COMMAND_COUNT
|
/*363*/ PCODE_COMMAND_COUNT
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue