1 | #ifndef ONI_SYMBOLS_H
|
---|
2 | #define ONI_SYMBOLS_H
|
---|
3 | #include "bool.h"
|
---|
4 | #include <stdio.h>
|
---|
5 | #include "oni_gl.h"
|
---|
6 | #include "Oni_Character.h"
|
---|
7 | #include "BFW_ScriptLang.h"
|
---|
8 | #define DefVar(type, name, address) static type* _##name = (type*)address
|
---|
9 | //variables
|
---|
10 |
|
---|
11 | //DO THIS INSTEAD!
|
---|
12 | DefVar( onibool, ai2_deaf, 0x005ec0c1 );
|
---|
13 |
|
---|
14 | DefVar( HINSTANCE, g_Instance, 0x0061F9E4 );
|
---|
15 |
|
---|
16 | DefVar( gl_api_t*, gl_api, 0x00560604 );
|
---|
17 | DefVar( gl_engine_t*, gl_eng, 0x00560600 );
|
---|
18 | DefVar( WORD*, gl_gamma_ramp, 0x0055fdfc );
|
---|
19 | DefVar( int, gl_gamma_ramp_valid, 0x005603fc );
|
---|
20 |
|
---|
21 | DefVar( char, opt_ignore_private_data,0x006370f0 );
|
---|
22 | DefVar( char, opt_sound, 0x006370fc );
|
---|
23 |
|
---|
24 | DefVar( char, AKgDebug_DebugMaps, 0x002b2204 );
|
---|
25 |
|
---|
26 | DefVar( bool, BFgDebugFileEnable, 0x0055c8d0 );
|
---|
27 |
|
---|
28 | DefVar( uint32_t, COgConsoleLines, 0x005cb468 );
|
---|
29 | DefVar( uint32_t, COgDefaultTextShade, 0x00533f70 );
|
---|
30 | DefVar( uint32_t, COgDefaultTextShadow, 0x00533f74 );
|
---|
31 | DefVar( uint32_t, COgFadeTimeValue, 0x00533f68 );
|
---|
32 |
|
---|
33 | DefVar( FILE*, ONgFileStartup, 0x005711b8 );
|
---|
34 | DefVar( GameState*, ONgGameState, 0x005ece7c );
|
---|
35 | DefVar( ONtPlatformData,ONgPlatformData, 0x0053100c );
|
---|
36 |
|
---|
37 | DefVar( char, M3gResolutionSwitch, 0x00531634 );
|
---|
38 |
|
---|
39 | DefVar( bool, SSgSearchOnDisk, 0x005eb758 );
|
---|
40 | #undef DefVar
|
---|
41 | //Yes, I'm aware that there are a few ways this could go wrong
|
---|
42 | //but in the interests of neatness and not having to go through and rename all the variables
|
---|
43 | //and use annoying dereferencing, this will do.
|
---|
44 |
|
---|
45 | //...too bad there is no way to nest #defines...
|
---|
46 | #define AKgDebug_DebugMaps (*_AKgDebug_DebugMaps)
|
---|
47 | #define ai2_deaf (*_ai2_deaf)
|
---|
48 | #define g_Instance (*_g_Instance)
|
---|
49 | #define M3gResolutionSwitch (*_M3gResolutionSwitch)
|
---|
50 | #define ONgGameState (*_ONgGameState)
|
---|
51 | #define ONgPlatformData (*_ONgPlatformData)
|
---|
52 | #define opt_ignore_private_data (*_opt_ignore_private_data)
|
---|
53 | #define opt_sound (*_opt_sound)
|
---|
54 | #define BFgDebugFileEnable (*_BFgDebugFileEnable)
|
---|
55 | #define SSgSearchOnDisk (*_SSgSearchOnDisk)
|
---|
56 | #define gl_gamma_ramp (*_gl_gamma_ramp)
|
---|
57 | #define gl_gamma_ramp_valid (*_gl_gamma_ramp_valid)
|
---|
58 | #define gl_api (*_gl_api)
|
---|
59 | #define gl_eng (*_gl_eng)
|
---|
60 | #define COgConsoleLines (*_COgConsoleLines)
|
---|
61 | #define COgFadeTimeValue (*_COgFadeTimeValue)
|
---|
62 | #define COgDefaultTextShade (*_COgDefaultTextShade)
|
---|
63 | #define COgDefaultTextShadow (*_COgDefaultTextShadow)
|
---|
64 | #define ONgFileStartup (*_ONgFileStartup)
|
---|
65 |
|
---|
66 |
|
---|
67 | #undef $
|
---|
68 |
|
---|
69 | //functions
|
---|
70 | //__fastcall isn't neccessary if you specify the correct calling convention.
|
---|
71 | typedef int64_t ( *_UUrMachineTime_High)();
|
---|
72 | typedef double ( *_UUrMachineTime_High_Frequency)();
|
---|
73 | typedef int64_t ( *_UUrMachineTime_Sixtieths)();
|
---|
74 | typedef void ( *_UUrPlatform_Initialize)();
|
---|
75 | typedef void ( *_UUrPlatform_Terminate)();
|
---|
76 |
|
---|
77 | typedef FILE* ( __cdecl *_oni_fopen)(const char*, const char*);
|
---|
78 | typedef int ( __cdecl *_oni_fprintf)(FILE*, const char*, ...);
|
---|
79 | typedef int ( __cdecl *_oni_fflush)(FILE*);
|
---|
80 |
|
---|
81 | typedef void ( __cdecl *_ONiMain)(int ArgCount, char *ArgList[]);
|
---|
82 | typedef short ( *_ONrPlatform_Initialize)(ONtPlatformData *PlatformData);
|
---|
83 | typedef LRESULT ( CALLBACK *_ONrPlatform_WindowProc)(HWND Window, UINT Message,
|
---|
84 | WPARAM WParam, LPARAM LParam);
|
---|
85 | typedef unsigned int ( *_gl_enumerate_valid_display_modes)(M3tDisplayMode modes[16]);
|
---|
86 | typedef int ( *_gl_platform_set_pixel_format)(HDC hdc);
|
---|
87 | typedef int ( *_gl_platform_initialize)();
|
---|
88 |
|
---|
89 | typedef float ( *_ONrPersist_GetGamma)();
|
---|
90 | typedef uint8_t ( *_ONrPersist_GetWonGame)();
|
---|
91 |
|
---|
92 | typedef void ( __cdecl *_UUrStartupMessage)(const char* fmt, ...);
|
---|
93 | typedef int16_t ( *_ONrGameState_NewCharacter)(void* CHAR, void* AISA,
|
---|
94 | void* flag, uint32_t* list_location);
|
---|
95 | typedef ActiveCharacter* ( *_ONrGetActiveCharacter)(void* CharacterPtr);
|
---|
96 | typedef void ( *_ONrCharacter_NewAnimationHook)(Character *ioCharacter, ActiveCharacter *ioActiveCharacter);
|
---|
97 | //int16_t ONICALL ONrGameState_GetPlayerCharacter();
|
---|
98 |
|
---|
99 | typedef void ( *_COrTextArea_Print)(uint32_t area, uint32_t priority,
|
---|
100 | uint32_t textshade, uint32_t textshadowshade,
|
---|
101 | const char* text, uint32_t unk_alwaws_0, uint32_t fadetime);
|
---|
102 | typedef uint8_t ( *_ONrCheater)(uint32_t cheat);
|
---|
103 | typedef int ( __cdecl *_AUrMessageBox)(int Buttons, char *Message, ...);
|
---|
104 | typedef char* ( *_SSrMessage_Find)(char* message_key); //Returns a prompt message from a message key
|
---|
105 | //typedef void ( *_ONiGameState_FindAutoPromptMessage)(char* Note, void* ptr);
|
---|
106 |
|
---|
107 | typedef uint16_t (ONICALL *sl_func)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
|
---|
108 | typedef uint16_t (ONICALL *_SLrScript_Command_Register_ReturnType)(char* name, char* desc, char* argfmt, sl_type type, sl_func callback);
|
---|
109 | typedef uint16_t (ONICALL *_SLrScript_Command_Register_Void)(char* name, char* desc, char* argfmt, sl_func callback);
|
---|
110 | typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_Int32)(char* name, char* desc, int32_t* data);
|
---|
111 | typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_Float)(char* name, char* desc, float* data);
|
---|
112 | typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_String)(char* name, char* desc, char* data);
|
---|
113 |
|
---|
114 | typedef int ( *_COrMessage_Print)(char* Message, char* Key, void* noidea);
|
---|
115 | //typedef void ( *_COrConsole_StatusLine_Display)();
|
---|
116 | typedef int16_t ( *_TMrInstance_GetDataPtr)(int tag, char* name, void* pointer);
|
---|
117 | typedef char* ( *_TMrInstance_GetInstanceName)(void* InstancePointer);
|
---|
118 |
|
---|
119 | typedef int16_t ( *_TSrContext_DrawText)(uint32_t TSrContext, char* Text, int alpha, uint32_t usuallyzero, void* pRect);
|
---|
120 | //int16_t TSrContext_New ( TSFF*, size 7, ??? 1, ??? 1, ??? 0, TSrContext*);
|
---|
121 | typedef int16_t ( *_TSrContext_New)( void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext);
|
---|
122 |
|
---|
123 | typedef int16_t ( *_TSrContext_SetShade)(
|
---|
124 | void *ioTextContext,
|
---|
125 | uint32_t inShade);
|
---|
126 |
|
---|
127 | typedef uint16_t ( *_TRrAnimation_GetDuration)(int Animation);
|
---|
128 | typedef uint16_t ( *_TRrAnimation_GetTo)(int Animation);
|
---|
129 | typedef uint16_t ( *_TRrAnimation_GetFrom)(int Animation);
|
---|
130 |
|
---|
131 | typedef void
|
---|
132 | ( *_ONrCharacter_SetHitPoints)(
|
---|
133 | Character *ioCharacter,
|
---|
134 | uint32_t inHitPoints);
|
---|
135 | typedef void ( *_ONrCorpse_Create)(Character* Character);
|
---|
136 | //yes im cheating so badly.
|
---|
137 | typedef uint16_t ( *_iSetCharacterClass)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
|
---|
138 | typedef uint16_t ( *_AI2iScript_Spawn)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
|
---|
139 | typedef void * ( *_OBJrObjectType_GetObject_ByNumber)(int inObjectType, int inIndex);
|
---|
140 | typedef int ( *_OBJiObjectGroup_GetNumObjects)(void *inObjectGroup);
|
---|
141 |
|
---|
142 | typedef void ( *_ONrGameState_DeleteCharacter)(Character *inCharacter);
|
---|
143 |
|
---|
144 | typedef char (*OBJtEnumCallback_Object)(
|
---|
145 | void *inObject,
|
---|
146 | int inUserData);
|
---|
147 |
|
---|
148 | typedef int ( *_OBJrObjectType_EnumerateObjects)(
|
---|
149 | int inObjectType,
|
---|
150 | OBJtEnumCallback_Object inEnumCallback,
|
---|
151 | int inUserData);
|
---|
152 |
|
---|
153 | typedef void ( *_OBJrDoor_Open)( DoorObject *inObject, Character *inCharacter );
|
---|
154 | typedef void ( *_OBJrDoor_ForceOpen)(short id);
|
---|
155 | typedef short ( *_OBJrConsole_OnActivate)( void *inObject, Character *inCharacter );
|
---|
156 | //typedef void* ( *_OBJrConsole_GetByID)( short ID );
|
---|
157 | #define ExtFunc(name) extern _##name name
|
---|
158 | ExtFunc(SLrScript_Command_Register_ReturnType);
|
---|
159 | ExtFunc(SLrScript_Command_Register_Void);
|
---|
160 | ExtFunc(SLrGlobalVariable_Register_Int32);
|
---|
161 | ExtFunc(SLrGlobalVariable_Register_Float);
|
---|
162 | ExtFunc(SLrGlobalVariable_Register_String);
|
---|
163 | //ExtFunc(COrConsole_StatusLine_Display);
|
---|
164 | ExtFunc(OBJrObjectType_EnumerateObjects);
|
---|
165 | //ExtFunc(OBJiObjectGroup_GetNumObjects);
|
---|
166 | //ExtFunc(OBJrConsole_GetByID);
|
---|
167 | ExtFunc(AI2iScript_Spawn);
|
---|
168 |
|
---|
169 | ExtFunc(TRrAnimation_GetDuration);
|
---|
170 | ExtFunc(TRrAnimation_GetFrom);
|
---|
171 | ExtFunc(TRrAnimation_GetTo);
|
---|
172 |
|
---|
173 | extern _UUrMachineTime_High UUrMachineTime_High;
|
---|
174 | extern _UUrMachineTime_High_Frequency UUrMachineTime_High_Frequency;
|
---|
175 | extern _UUrMachineTime_Sixtieths UUrMachineTime_Sixtieths;
|
---|
176 | extern _UUrPlatform_Initialize UUrPlatform_Initialize;
|
---|
177 | extern _UUrPlatform_Terminate UUrPlatform_Terminate;
|
---|
178 |
|
---|
179 | extern _oni_fopen oni_fopen;
|
---|
180 | extern _oni_fprintf oni_fprintf;
|
---|
181 | extern _oni_fflush oni_fflush;
|
---|
182 |
|
---|
183 | extern _ONiMain ONiMain;
|
---|
184 | extern _ONrPlatform_Initialize ONrPlatform_Initialize;
|
---|
185 | extern _ONrPlatform_WindowProc ONrPlatform_WindowProc;
|
---|
186 |
|
---|
187 | ExtFunc(COrMessage_Print);
|
---|
188 |
|
---|
189 | ExtFunc(TMrInstance_GetDataPtr);
|
---|
190 | ExtFunc(TMrInstance_GetInstanceName);
|
---|
191 |
|
---|
192 | ExtFunc(gl_enumerate_valid_display_modes);
|
---|
193 | ExtFunc(gl_platform_set_pixel_format);
|
---|
194 | ExtFunc(gl_platform_initialize);
|
---|
195 | ExtFunc(ONrPersist_GetGamma);
|
---|
196 | ExtFunc(ONrPersist_GetWonGame);
|
---|
197 | ExtFunc(UUrStartupMessage);
|
---|
198 |
|
---|
199 | ExtFunc(ONrCharacter_NewAnimationHook);
|
---|
200 | ExtFunc(ONrCharacter_SetHitPoints);
|
---|
201 | ExtFunc(ONrGameState_NewCharacter);
|
---|
202 | ExtFunc(ONrGameState_DeleteCharacter);
|
---|
203 | ExtFunc(ONrGetActiveCharacter);
|
---|
204 | ExtFunc(ONrCorpse_Create);
|
---|
205 | ExtFunc(iSetCharacterClass);
|
---|
206 |
|
---|
207 | ExtFunc(COrTextArea_Print);
|
---|
208 |
|
---|
209 | ExtFunc(ONrCheater);
|
---|
210 | ExtFunc(AUrMessageBox);
|
---|
211 |
|
---|
212 | ExtFunc(SSrMessage_Find);
|
---|
213 | //ExtFunc(ONiGameState_FindAutoPromptMessage);
|
---|
214 |
|
---|
215 | ExtFunc(TSrContext_DrawText);
|
---|
216 | ExtFunc(TSrContext_New);
|
---|
217 | ExtFunc(TSrContext_SetShade);
|
---|
218 | ExtFunc(OBJrDoor_Open);
|
---|
219 | ExtFunc(OBJrDoor_ForceOpen);
|
---|
220 |
|
---|
221 | ExtFunc(OBJrConsole_OnActivate);
|
---|
222 | //static const void* ( *OBJrConsole_GetByID)( short ID ) = (const void*(*)(short))0x004C0950;
|
---|
223 | #undef DefFunc
|
---|
224 | #define DefFunc( type, name, args, address) static const type ( * name ) args = (const type (*) args )address;
|
---|
225 | DefFunc( void*, OBJrConsole_GetByID, (short ID), 0x004C0950);
|
---|
226 | DefFunc( void, COrConsole_StatusLine_Display, (), 0x00431E70 );
|
---|
227 | //typedef void ( *_ONiGameState_FindAutoPromptMessage)(char* Note, void* ptr);
|
---|
228 | DefFunc( void, ONiGameState_FindAutoPromptMessage, (char* Note, void* ptr), 0x004FDBE0 );
|
---|
229 | #endif
|
---|