File size: 2,073 Bytes
7e9dc27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
--[[
	Project: SA Memory (Available from https://blast.hk/)
	Developers: LUCHARE, FYP

	Special thanks:
		plugin-sdk (https://github.com/DK22Pac/plugin-sdk) for the structures and addresses.

	Copyright (c) 2018 BlastHack.
]]

local shared = require 'SAMemory.shared'

shared.require 'CPlaceable'
shared.require 'RenderWare'
shared.require 'CReference'

shared.ffi.cdef[[
	typedef struct CEntity CEntity;

	struct CEntity : CPlaceable
	{
		union
		{
			RwObject *pRwObject;
			RpClump  *pRwClump;
			RpAtomic *pRwAtomic;
		};
		unsigned int bUsesCollision : 1;
		unsigned int bCollisionProcessed : 1;
		unsigned int bIsStatic : 1;
		unsigned int bHasContacted : 1;
		unsigned int bIsStuck : 1;
		unsigned int bIsInSafePosition : 1;
		unsigned int bWasPostponed : 1;
		unsigned int bIsVisible : 1;

		unsigned int bIsBIGBuilding : 1;
		unsigned int bRenderDamaged : 1;
		unsigned int bStreamingDontDelete : 1;
		unsigned int bRemoveFromWorld : 1;
		unsigned int bHasHitWall : 1;
		unsigned int bImBeingRendered : 1;
		unsigned int bDrawLast :1;
		unsigned int bDistanceFade :1;

		unsigned int bDontCastShadowsOn : 1;
		unsigned int bOffscreen : 1;
		unsigned int bIsStaticWaitingForCollision : 1;
		unsigned int bDontStream : 1;
		unsigned int bUnderwater : 1;
		unsigned int bHasPreRenderEffects : 1;
		unsigned int bIsTempBuilding : 1;
		unsigned int bDontUpdateHierarchy : 1;
		unsigned int bHasRoadsignText : 1;
		unsigned int bDisplayedSuperLowLOD : 1;
		unsigned int bIsProcObject : 1;
		unsigned int bBackfaceCulled : 1;
		unsigned int bLightObject : 1;
		unsigned int bUnimportantStream : 1;
		unsigned int bTunnel : 1;
		unsigned int bTunnelTransition : 1;
		unsigned short nRandomSeed;
		unsigned short nModelIndex;
		CReference *pReferences;
		void *pStreamingLink;
		short nScanCode;
		char nIplIndex;
		unsigned char nAreaCode;
		union
		{
			int 		 nLodIndex;
			CEntity *pLod;
		};
		unsigned char nNumLodChildren;
		unsigned char nNumLodChildrenRendered;
		unsigned char nType : 3;
		unsigned char nStatus : 5;
	};
]]

shared.validate_size('CEntity', 0x38)