| 5 |
|
#include "oni_gl.h" |
| 6 |
|
#include "Oni_Character.h" |
| 7 |
|
#include "BFW_ScriptLang.h" |
| 8 |
< |
#define DefVar(type, name, address) extern type* _##name |
| 8 |
> |
#define DefVar(type, name, address) static type* _##name = (type*)address |
| 9 |
|
//variables |
| 10 |
|
|
| 11 |
– |
///BADBAD DONT DO THIS |
| 12 |
– |
extern onibool* _ai2_deaf; |
| 13 |
– |
extern char* _AKgDebug_DebugMaps; |
| 14 |
– |
extern HINSTANCE* _g_Instance; |
| 15 |
– |
extern ONtPlatformData* _ONgPlatformData; |
| 16 |
– |
extern char* _opt_ignore_private_data; |
| 17 |
– |
extern char* _opt_sound; |
| 18 |
– |
|
| 11 |
|
//DO THIS INSTEAD! |
| 12 |
< |
DefVar( GameState* , ONgGameState , 0x005ece7c ); |
| 12 |
> |
DefVar( onibool, ai2_deaf, 0x005ec0c1 ); |
| 13 |
> |
|
| 14 |
> |
DefVar( HINSTANCE, g_Instance, 0x0061F9E4 ); |
| 15 |
|
|
| 22 |
– |
DefVar( bool, BFgDebugFileEnable, 0x0055c8d0 ); |
| 23 |
– |
DefVar( bool, SSgSearchOnDisk, 0x005eb758); |
| 24 |
– |
DefVar( char, M3gResolutionSwitch, 0x00531634); |
| 25 |
– |
DefVar( gl_engine_t*, gl_eng, 0x00560600 ); |
| 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 ); |
| 29 |
– |
DefVar( uint32_t, COgConsoleLines , 0x005cb468 ); |
| 30 |
– |
DefVar( uint32_t, COgFadeTimeValue , 0x00533f68 ); |
| 31 |
– |
DefVar( uint32_t, COgDefaultTextShade , 0x00533f70 ); |
| 32 |
– |
DefVar( uint32_t, COgDefaultTextShadow , 0x00533f74 ); |
| 33 |
– |
DefVar( FILE*, ONgFileStartup , 0x005711b8 ); |
| 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 |
| 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); |
| 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); |
| 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)(); |
| 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 |
|
|
| 152 |
|
|
| 153 |
|
typedef void ( *_OBJrDoor_Open)( DoorObject *inObject, Character *inCharacter ); |
| 154 |
|
typedef void ( *_OBJrDoor_ForceOpen)(short id); |
| 155 |
< |
|
| 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); |
| 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); |
| 210 |
|
ExtFunc(AUrMessageBox); |
| 211 |
|
|
| 212 |
|
ExtFunc(SSrMessage_Find); |
| 213 |
< |
ExtFunc(ONiGameState_FindAutoPromptMessage); |
| 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 |