source: Daodan/MSVC/Oni_Symbols.h@ 711

Last change on this file since 711 was 586, checked in by gumby, 14 years ago

stuff

File size: 10.7 KB
Line 
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!
12DefVar( onibool, ai2_deaf, 0x005ec0c1 );
13
14DefVar( HINSTANCE, g_Instance, 0x0061F9E4 );
15
16DefVar( gl_api_t*, gl_api, 0x00560604 );
17DefVar( gl_engine_t*, gl_eng, 0x00560600 );
18DefVar( WORD*, gl_gamma_ramp, 0x0055fdfc );
19DefVar( int, gl_gamma_ramp_valid, 0x005603fc );
20
21DefVar( char, opt_ignore_private_data,0x006370f0 );
22DefVar( char, opt_sound, 0x006370fc );
23
24DefVar( char, AKgDebug_DebugMaps, 0x002b2204 );
25
26DefVar( bool, BFgDebugFileEnable, 0x0055c8d0 );
27
28DefVar( uint32_t, COgConsoleLines, 0x005cb468 );
29DefVar( uint32_t, COgDefaultTextShade, 0x00533f70 );
30DefVar( uint32_t, COgDefaultTextShadow, 0x00533f74 );
31DefVar( uint32_t, COgFadeTimeValue, 0x00533f68 );
32
33DefVar( FILE*, ONgFileStartup, 0x005711b8 );
34DefVar( GameState*, ONgGameState, 0x005ece7c );
35DefVar( ONtPlatformData,ONgPlatformData, 0x0053100c );
36
37DefVar( char, M3gResolutionSwitch, 0x00531634 );
38
39DefVar( 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.
71typedef int64_t ( *_UUrMachineTime_High)();
72typedef double ( *_UUrMachineTime_High_Frequency)();
73typedef int64_t ( *_UUrMachineTime_Sixtieths)();
74typedef void ( *_UUrPlatform_Initialize)();
75typedef void ( *_UUrPlatform_Terminate)();
76
77typedef FILE* ( __cdecl *_oni_fopen)(const char*, const char*);
78typedef int ( __cdecl *_oni_fprintf)(FILE*, const char*, ...);
79typedef int ( __cdecl *_oni_fflush)(FILE*);
80
81typedef void ( __cdecl *_ONiMain)(int ArgCount, char *ArgList[]);
82typedef short ( *_ONrPlatform_Initialize)(ONtPlatformData *PlatformData);
83typedef LRESULT ( CALLBACK *_ONrPlatform_WindowProc)(HWND Window, UINT Message,
84 WPARAM WParam, LPARAM LParam);
85typedef unsigned int ( *_gl_enumerate_valid_display_modes)(M3tDisplayMode modes[16]);
86typedef int ( *_gl_platform_set_pixel_format)(HDC hdc);
87typedef int ( *_gl_platform_initialize)();
88
89typedef float ( *_ONrPersist_GetGamma)();
90typedef uint8_t ( *_ONrPersist_GetWonGame)();
91
92typedef void ( __cdecl *_UUrStartupMessage)(const char* fmt, ...);
93typedef int16_t ( *_ONrGameState_NewCharacter)(void* CHAR, void* AISA,
94 void* flag, uint32_t* list_location);
95typedef ActiveCharacter* ( *_ONrGetActiveCharacter)(void* CharacterPtr);
96typedef void ( *_ONrCharacter_NewAnimationHook)(Character *ioCharacter, ActiveCharacter *ioActiveCharacter);
97typedef void ( *_ONrCharacter_SetAnimationExternal)(Character *ioCharacter, short state, void* animation, int interpolation);
98
99typedef 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);
102typedef uint8_t ( *_ONrCheater)(uint32_t cheat);
103typedef int ( __cdecl *_AUrMessageBox)(int Buttons, char *Message, ...);
104typedef char* ( *_SSrMessage_Find)(char* message_key); //Returns a prompt message from a message key
105//typedef void ( *_ONiGameState_FindAutoPromptMessage)(char* Note, void* ptr);
106
107typedef uint16_t (ONICALL *sl_func)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
108typedef uint16_t (ONICALL *_SLrScript_Command_Register_ReturnType)(char* name, char* desc, char* argfmt, sl_type type, sl_func callback);
109typedef uint16_t (ONICALL *_SLrScript_Command_Register_Void)(char* name, char* desc, char* argfmt, sl_func callback);
110typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_Int32)(char* name, char* desc, int32_t* data);
111typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_Float)(char* name, char* desc, float* data);
112typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_String)(char* name, char* desc, char* data);
113
114typedef int ( *_COrMessage_Print)(char* Message, char* Key, void* noidea);
115//typedef void ( *_COrConsole_StatusLine_Display)();
116typedef int16_t ( *_TMrInstance_GetDataPtr)(int tag, char* name, void* pointer);
117typedef char* ( *_TMrInstance_GetInstanceName)(void* InstancePointer);
118
119typedef int16_t ( *_TSrContext_DrawText)(uint32_t TSrContext, char* Text, char alpha, uint32_t usuallyzero, void* pRect);
120//int16_t TSrContext_New ( TSFF*, size 7, ??? 1, ??? 1, ??? 0, TSrContext*);
121typedef int16_t ( *_TSrContext_New)( void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext);
122
123typedef int16_t ( *_TSrContext_SetShade)(
124 void *ioTextContext,
125 uint32_t inShade);
126typedef void (* _ONrGameState_Timer_Start)( char* function, int time );
127typedef uint16_t ( *_TRrAnimation_GetDuration)(void* Animation);
128typedef uint16_t ( *_TRrAnimation_GetTo)(void* Animation);
129typedef uint16_t ( *_TRrAnimation_GetFrom)(void* Animation);
130
131typedef void
132( *_ONrCharacter_SetHitPoints)(
133 Character *ioCharacter,
134 uint32_t inHitPoints);
135typedef void ( *_ONrCorpse_Create)(Character* Character);
136//yes im cheating so badly.
137typedef uint16_t ( *_iSetCharacterClass)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
138typedef uint16_t ( *_AI2iScript_Spawn)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
139typedef void * ( *_OBJrObjectType_GetObject_ByNumber)(int inObjectType, int inIndex);
140typedef int ( *_OBJiObjectGroup_GetNumObjects)(void *inObjectGroup);
141
142typedef void ( *_ONrGameState_DeleteCharacter)(Character *inCharacter);
143
144typedef char (*OBJtEnumCallback_Object)(
145 void *inObject,
146 int inUserData);
147
148typedef int ( *_OBJrObjectType_EnumerateObjects)(
149 int inObjectType,
150 OBJtEnumCallback_Object inEnumCallback,
151 int inUserData);
152
153typedef void ( *_OBJrDoor_Open)( DoorObject *inObject, Character *inCharacter );
154typedef void ( *_OBJrDoor_ForceOpen)(short id);
155typedef short ( *_OBJrConsole_OnActivate)( void *inObject, Character *inCharacter );
156//typedef void* ( *_OBJrConsole_GetByID)( short ID );
157#define ExtFunc(name) extern _##name name
158ExtFunc(SLrScript_Command_Register_ReturnType);
159ExtFunc(SLrScript_Command_Register_Void);
160ExtFunc(SLrGlobalVariable_Register_Int32);
161ExtFunc(SLrGlobalVariable_Register_Float);
162ExtFunc(SLrGlobalVariable_Register_String);
163//ExtFunc(COrConsole_StatusLine_Display);
164ExtFunc(OBJrObjectType_EnumerateObjects);
165//ExtFunc(OBJiObjectGroup_GetNumObjects);
166//ExtFunc(OBJrConsole_GetByID);
167ExtFunc(AI2iScript_Spawn);
168
169ExtFunc(TRrAnimation_GetDuration);
170ExtFunc(TRrAnimation_GetFrom);
171ExtFunc(TRrAnimation_GetTo);
172ExtFunc(ONrGameState_Timer_Start);
173extern _UUrMachineTime_High UUrMachineTime_High;
174extern _UUrMachineTime_High_Frequency UUrMachineTime_High_Frequency;
175extern _UUrMachineTime_Sixtieths UUrMachineTime_Sixtieths;
176extern _UUrPlatform_Initialize UUrPlatform_Initialize;
177extern _UUrPlatform_Terminate UUrPlatform_Terminate;
178
179extern _oni_fopen oni_fopen;
180extern _oni_fprintf oni_fprintf;
181extern _oni_fflush oni_fflush;
182
183extern _ONiMain ONiMain;
184extern _ONrPlatform_Initialize ONrPlatform_Initialize;
185extern _ONrPlatform_WindowProc ONrPlatform_WindowProc;
186
187ExtFunc(COrMessage_Print);
188
189ExtFunc(TMrInstance_GetDataPtr);
190ExtFunc(TMrInstance_GetInstanceName);
191
192ExtFunc(gl_enumerate_valid_display_modes);
193ExtFunc(gl_platform_set_pixel_format);
194ExtFunc(gl_platform_initialize);
195ExtFunc(ONrPersist_GetGamma);
196ExtFunc(ONrPersist_GetWonGame);
197ExtFunc(UUrStartupMessage);
198
199ExtFunc(ONrCharacter_SetAnimationExternal);
200
201ExtFunc(ONrCharacter_NewAnimationHook);
202ExtFunc(ONrCharacter_SetHitPoints);
203ExtFunc(ONrGameState_NewCharacter);
204ExtFunc(ONrGameState_DeleteCharacter);
205ExtFunc(ONrGetActiveCharacter);
206ExtFunc(ONrCorpse_Create);
207ExtFunc(iSetCharacterClass);
208
209ExtFunc(COrTextArea_Print);
210
211ExtFunc(ONrCheater);
212ExtFunc(AUrMessageBox);
213
214ExtFunc(SSrMessage_Find);
215//ExtFunc(ONiGameState_FindAutoPromptMessage);
216
217ExtFunc(TSrContext_DrawText);
218ExtFunc(TSrContext_New);
219ExtFunc(TSrContext_SetShade);
220ExtFunc(OBJrDoor_Open);
221ExtFunc(OBJrDoor_ForceOpen);
222
223ExtFunc(OBJrConsole_OnActivate);
224//static const void* ( *OBJrConsole_GetByID)( short ID ) = (const void*(*)(short))0x004C0950;
225#undef DefFunc
226#define DefFunc( type, name, args, address) static const type ( * name ) args = (const type (*) args )address;
227DefFunc( void*, OBJrConsole_GetByID, (short ID), 0x004C0950);
228DefFunc( void, COrConsole_StatusLine_Display, (), 0x00431E70 );
229//typedef void ( *_ONiGameState_FindAutoPromptMessage)(char* Note, void* ptr);
230DefFunc( void, ONiGameState_FindAutoPromptMessage, (char* Note, void* ptr), 0x004FDBE0 );
231DefFunc( void, ONrCharacter_SetCharacterClass, (Character* Char, ONCC* Class), 0x004D7C30 );
232DefFunc( short, TMrInstance_GetDataPtr_ByNumber, (int tag, int number, void** out), 0x00423680 );
233DefFunc( uint32_t, TMrInstance_GetTagCount, (int tag), 0x004236F0);
234//DefFunc( uint32_t, stdcall M3rTextureMap_New, (int tag), 0x041EB00);
235//(short width, short height, int type, int allocated, int flags, char* name, void** output)
236DefFunc( uint32_t, ONrCharacter_GetHealthShade, (uint32_t health, uint32_t maxhealth), 0x004EF450);
237//DefFunc( short, TSrContext_SetShade, (void* context, int shade ), 0x0042EE50);
238DefFunc( void, ONiDrawWeaponSight, (Character* Char), 0x004E1900 );
239DefFunc( void, AI2rDisplayDebuggingInfo, (Character* Char), 0x0048C5F0 );
240 static const uint32_t ( * M3rTextureMap_New)(short width, short height, int type, int allocated, int flags, char* name, void** output)
241 = (const uint32_t(*)(short width, short height, int type, int allocated, int flags, char* name, void** output))0x041EB00;
242#endif
Note: See TracBrowser for help on using the repository browser.