source: Daodan/MSVC/Oni_Symbols.h@ 573

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