source: Daodan/MSVC/Oni_Symbols.h@ 569

Last change on this file since 569 was 568, checked in by gumby, 14 years ago

Updates

File size: 7.0 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) 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)
60#undef $
61
62//functions
63//__fastcall isn't neccessary if you specify the correct calling convention.
64typedef int64_t ( *_UUrMachineTime_High)();
65typedef double ( *_UUrMachineTime_High_Frequency)();
66typedef int64_t ( *_UUrMachineTime_Sixtieths)();
67typedef void ( *_UUrPlatform_Initialize)();
68typedef void ( *_UUrPlatform_Terminate)();
69
70typedef FILE* ( __cdecl *_oni_fopen)(const char*, const char*);
71typedef int ( __cdecl *_oni_fprintf)(FILE*, const char*, ...);
72typedef int ( __cdecl *_oni_fflush)(FILE*);
73
74typedef void ( __cdecl *_ONiMain)(int ArgCount, char *ArgList[]);
75typedef short ( *_ONrPlatform_Initialize)(ONtPlatformData *PlatformData);
76typedef LRESULT ( CALLBACK *_ONrPlatform_WindowProc)(HWND Window, UINT Message,
77 WPARAM WParam, LPARAM LParam);
78typedef unsigned int ( *_gl_enumerate_valid_display_modes)(M3tDisplayMode modes[16]);
79typedef int ( *_gl_platform_set_pixel_format)(HDC hdc);
80typedef int ( *_gl_platform_initialize)();
81
82typedef float ( *_ONrPersist_GetGamma)();
83typedef uint8_t ( *_ONrPersist_GetWonGame)();
84
85typedef void ( __cdecl *_UUrStartupMessage)(const char* fmt, ...);
86typedef int16_t ( *_ONrGameState_NewCharacter)(void* CHAR, void* AISA,
87 void* flag, uint32_t* list_location);
88typedef ActiveCharacter* ( *_ONrGetActiveCharacter)(void* CharacterPtr);
89//int16_t ONICALL ONrGameState_GetPlayerCharacter();
90
91typedef void ( *_COrTextArea_Print)(uint32_t area, uint32_t priority,
92 uint32_t textshade, uint32_t textshadowshade,
93 const char* text, uint32_t unk_alwaws_0, uint32_t fadetime);
94typedef uint8_t ( *_ONrCheater)(uint32_t cheat);
95typedef int ( __cdecl *_AUrMessageBox)(int Buttons, char *Message, ...);
96typedef char* ( *_SSrMessage_Find)(char* message_key); //Returns a prompt message from a message key
97typedef void ( *_ONiGameState_FindAutoPromptMessage)(char* Note, void* ptr);
98
99typedef uint16_t (ONICALL *sl_func)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
100typedef uint16_t (ONICALL *_SLrScript_Command_Register_ReturnType)(char* name, char* desc, char* argfmt, sl_type type, sl_func callback);
101typedef uint16_t (ONICALL *_SLrScript_Command_Register_Void)(char* name, char* desc, char* argfmt, sl_func callback);
102typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_Int32)(char* name, char* desc, int32_t* data);
103typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_Float)(char* name, char* desc, float* data);
104typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_String)(char* name, char* desc, char* data);
105
106typedef int ( *_COrMessage_Print)(char* Message, char* Key, void* noidea);
107
108typedef int16_t ( *_TMrInstance_GetDataPtr)(int tag, char* name, void* pointer);
109typedef char* ( *_TMrInstance_GetInstanceName)(void* InstancePointer);
110
111typedef int16_t ( *_TSrContext_DrawText)(uint32_t TSrContext, char* Text, int alpha, uint32_t usuallyzero, void* pRect);
112//int16_t TSrContext_New ( TSFF*, size 7, ??? 1, ??? 1, ??? 0, TSrContext*);
113typedef int16_t ( *_TSrContext_New)( void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext);
114
115//yes im cheating so badly.
116typedef uint16_t ( *_iSetCharacterClass)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
117
118#define ExtFunc(name) extern _##name name
119ExtFunc(SLrScript_Command_Register_ReturnType);
120ExtFunc(SLrScript_Command_Register_Void);
121ExtFunc(SLrGlobalVariable_Register_Int32);
122ExtFunc(SLrGlobalVariable_Register_Float);
123ExtFunc(SLrGlobalVariable_Register_String);
124
125
126extern _UUrMachineTime_High UUrMachineTime_High;
127extern _UUrMachineTime_High_Frequency UUrMachineTime_High_Frequency;
128extern _UUrMachineTime_Sixtieths UUrMachineTime_Sixtieths;
129extern _UUrPlatform_Initialize UUrPlatform_Initialize;
130extern _UUrPlatform_Terminate UUrPlatform_Terminate;
131
132extern _oni_fopen oni_fopen;
133extern _oni_fprintf oni_fprintf;
134extern _oni_fflush oni_fflush;
135
136extern _ONiMain ONiMain;
137extern _ONrPlatform_Initialize ONrPlatform_Initialize;
138extern _ONrPlatform_WindowProc ONrPlatform_WindowProc;
139
140ExtFunc(COrMessage_Print);
141
142ExtFunc(TMrInstance_GetDataPtr);
143ExtFunc(TMrInstance_GetInstanceName);
144
145ExtFunc(gl_enumerate_valid_display_modes);
146ExtFunc(gl_platform_set_pixel_format);
147ExtFunc(gl_platform_initialize);
148ExtFunc(ONrPersist_GetGamma);
149ExtFunc(ONrPersist_GetWonGame);
150ExtFunc(UUrStartupMessage);
151
152ExtFunc(ONrGameState_NewCharacter);
153ExtFunc(ONrGetActiveCharacter);
154
155ExtFunc(iSetCharacterClass);
156
157ExtFunc(COrTextArea_Print);
158
159ExtFunc(ONrCheater);
160ExtFunc(AUrMessageBox);
161
162ExtFunc(SSrMessage_Find);
163ExtFunc(ONiGameState_FindAutoPromptMessage);
164
165ExtFunc(TSrContext_DrawText);
166ExtFunc(TSrContext_New);
167#endif
Note: See TracBrowser for help on using the repository browser.