mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
This patch removes a lot of old code. Context is now exclusively grabbed from the CSquirrelVM instance. This patch also comes with a few new types: SQArray and SQTable! The implementation also allows pushing Vector3D's on the stack, but these are handled slightly differently.. The largest field in tagSQObjectValue is 8 bytes, Vector3D is 12 bytes unaligned, but the tagSQObjectValue field in the tagSQObject struct is aligned to a 8 byte boundary while the field prior is only 4 bytes, Vector3D starts right after the type field in the tagSQObject (at the padding) to keep the whole structure the same size, therefore a new field has been added in between the padding (_pad) with a simple Vector3D accessor. Also added a hook to allow registering proper script enums.
25 lines
446 B
C
25 lines
446 B
C
#ifndef SQFUNCSTATE_H
|
|
#define SQFUNCSTATE_H
|
|
|
|
#include "squirrel.h"
|
|
#include "sqopcodes.h"
|
|
#include "sqobject.h"
|
|
|
|
struct SQFuncState
|
|
{
|
|
_BYTE gap0[17400];
|
|
sqvector<SQInstruction> _instructions;
|
|
_BYTE gap4418[88];
|
|
SQObjectPtr _sourcename;
|
|
SQObjectPtr _wuh;
|
|
_BYTE gap4478[120];
|
|
int _lastline;
|
|
char gap4504[4];
|
|
bool _optimization;
|
|
char gap4510[80];
|
|
};
|
|
|
|
|
|
static_assert(offsetof(SQFuncState, _optimization) == 0x4508);
|
|
|
|
#endif // SQFUNCSTATE_H
|