Changeset 984
- Timestamp:
- Mar 17, 2014, 12:35:10 AM (11 years ago)
- Location:
- Daodan/src
- Files:
-
- 40 added
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/Daodan_Config.c
r983 r984 40 40 bool patch_safeprintf = true; 41 41 bool patch_showalllasersights = false; 42 bool patch_showtriggervolumes = true; 42 43 bool patch_throwtest = false; 43 44 bool patch_usedaodangl = true; … … 161 162 else if (!_stricmp(name, "showalllasersights")) 162 163 patch_showalllasersights = !_stricmp(inifile_cleanstr(value), "true"); 164 else if (!_stricmp(name, "showtriggervolumes")) 165 patch_showtriggervolumes = !_stricmp(inifile_cleanstr(value), "true"); 163 166 else if (!_stricmp(name, "throwtest")) 164 167 patch_throwtest = !_stricmp(inifile_cleanstr(value), "true"); -
Daodan/src/Daodan_Config.h
r983 r984 35 35 extern bool patch_safeprintf; 36 36 extern bool patch_showalllasersights; 37 extern bool patch_showtriggervolumes; 37 38 extern bool patch_throwtest; 38 39 extern bool patch_usedaodangl; -
Daodan/src/Oni.h
r983 r984 23 23 } UUtRect; 24 24 25 typedef struct OBJtMethods 26 { 27 void* rNew; 28 void* rSetDefaults; 29 void* rDelete; 30 void* rIsInvalid; 31 void* rLevelBegin; 32 void* rLevelEnd; 33 34 void* rDraw; 35 void* rEnumerate; 36 void* rGetBoundingSphere; 37 void* rOSDGetName; 38 void* rOSDSetName; 39 void* rIntersectsLine; 40 void* rUpdatePosition; 41 42 void* rGetOSD; 43 void* rGetOSDWriteSize; 44 void* rSetOSD; 45 46 void* rWrite; 47 void* rRead; 48 49 void* rSearch; 50 51 void* rGetClassVisible; 52 void* rSetClassVisible; 53 54 void* rGetUniqueOSD; 55 } OBJtMethods; 56 25 57 void ONICALL TMrInstance_GetDataPtr_List( 26 58 char Tag[4], //as in 'ONWC' -
Daodan/src/Oni_Symbols.h
r983 r984 8 8 #include "BFW_ScriptLang.h" 9 9 10 #include "patches/objt.h" 10 11 11 12 //Define variables of Oni: #define VARNAME (*((TYPE*)ADDRESS)) … … 165 166 DefFunc(uint8_t, ONrCheater, ONICALL, (uint32_t cheat), 0x004f5c30); 166 167 168 DefFunc(int16_t, ONrMechanics_Register, ONICALL, (uint32_t inObjectType, uint32_t inObjectTypeIndex, char* inGroupName, 169 uint32_t inSizeInMemory, OBJtMethods* inObjectMethods, uint32_t inFlags, void* inMechanicsMethods), 0x00507450); 170 DefFunc(int16_t, OBJrTriggerVolume_IntersectsCharacter, ONICALL, (const OBJtObject* inObject, uint32_t inMask, const void* inCharacter), 0x004cc680); 171 172 167 173 // ? 168 174 DefFunc(int, AUrMessageBox, __cdecl, (int Buttons, char *Message, ...), 0x004378c0); … … 227 233 DefFunc(void, M3rDraw_BigBitmap, ONICALL, (M3tTextureMap_Big* inBigBitmap, const M3tPointScreen *inDestPoint, UUtUns16 inWidth, UUtUns16 inHeight, UUtUns32 inShade, UUtUns16 inAlpha), 0x0041f6e0); 228 234 DefFunc(void, M3rDraw_Bitmap, ONICALL, (void* inBitmap, const M3tPointScreen* inDestPoint, UUtUns16 inWidth, UUtUns16 inHeight, UUtUns32 inShade, UUtUns16 inAlpha), 0x0041f4a0); 235 236 DefFunc(void, M3rGeom_Line_Light, ONICALL, (const M3tPoint3D *point1, const M3tPoint3D *point2, uint32_t shade), 0x0041f440); 229 237 /* 230 238 DefFunc(void, M3rGeom_Line_Light, ONICALL, (), 0x0041f440); -
Daodan/src/patches/Patches.c
r983 r984 13 13 #include "../flatline/Flatline_Hooks.h" 14 14 #include "../Oni.h" 15 //#include "Objt.h"15 #include "objt.h" 16 16 17 17 typedef int (__cdecl *CHINESEPROC)(DWORD ThreadId); … … 128 128 } 129 129 130 #define IMcShade_Red (0xFFFF0000) 131 #define IMcShade_Green (0xFF00FF00) 132 #define IMcShade_Blue (0xFF0000FF) 133 void ONICALL DD_OBJiTriggerVolume_Draw(OBJtObject* inObject, uint32_t inDrawFlags) 134 { 135 UUtUns32 itr; 136 OBJtOSD_All *inOSD = (OBJtOSD_All *) inObject->object_data; 137 OBJtOSD_TriggerVolume *trigger_osd = &inOSD->osd.trigger_volume_osd; 138 M3tPoint3D *points = trigger_osd->volume.worldPoints; 139 M3tPoint3D trigger_center = {0, 0, 0}; 140 UUtUns32 shade = 0xFFFFFF; 141 142 if (!OBJgTriggerVolume_Visible) { 143 return; 144 } 145 146 if (OBJrTriggerVolume_IntersectsCharacter(inObject, trigger_osd->team_mask, ONgGameState->PlayerCharacter)) { 147 shade = IMcShade_Red; 148 } 149 else 150 { 151 shade = IMcShade_Blue; 152 } 153 154 M3rGeom_Line_Light(points + 0, points + 1, shade); 155 M3rGeom_Line_Light(points + 1, points + 3, shade); 156 M3rGeom_Line_Light(points + 3, points + 2, shade); 157 M3rGeom_Line_Light(points + 2, points + 0, shade); 158 159 M3rGeom_Line_Light(points + 4, points + 5, shade); 160 M3rGeom_Line_Light(points + 5, points + 7, shade); 161 M3rGeom_Line_Light(points + 7, points + 6, shade); 162 M3rGeom_Line_Light(points + 6, points + 4, shade); 163 164 M3rGeom_Line_Light(points + 0, points + 4, shade); 165 M3rGeom_Line_Light(points + 1, points + 5, shade); 166 M3rGeom_Line_Light(points + 3, points + 7, shade); 167 M3rGeom_Line_Light(points + 2, points + 6, shade); 168 169 for(itr = 0; itr < M3cNumBoundingPoints; itr++) 170 { 171 MUmVector_Add(trigger_center, trigger_center, points[itr]); 172 } 173 174 MUmVector_Scale(trigger_center, (1.0f / ((float) M3cNumBoundingPoints))); 175 } 176 177 _ONrMechanics_Register Oni_ONrMechanics_Register = (_ONrMechanics_Register)0; 178 int16_t ONICALL DD_ONrMechanics_Register(uint32_t inObjectType, uint32_t inObjectTypeIndex, char* inGroupName, 179 uint32_t inSizeInMemory, OBJtMethods* inObjectMethods, uint32_t inFlags, void* inMechanicsMethods) 180 { 181 if (strcmp("Trigger Volume", inGroupName) == 0) { 182 inObjectMethods->rDraw = DD_OBJiTriggerVolume_Draw; 183 } 184 return Oni_ONrMechanics_Register(inObjectType, inObjectTypeIndex, inGroupName, inSizeInMemory, inObjectMethods, inFlags, inMechanicsMethods); 185 } 186 187 188 130 189 int DD_Patch_DebugNameTextureInit(short width, short height, int type, int allocated, int flags, char* name, void** output) 131 190 { … … 441 500 } 442 501 502 void DD_Patch_ShowTriggerVolumes() 503 { 504 Oni_ONrMechanics_Register = DDrPatch_MakeDetour((void*)ONrMechanics_Register, (void*)DD_ONrMechanics_Register); 505 } 506 443 507 // Experiment with allowing enemies to be thrown over railings 444 508 void DD_Patch_Throwtest() … … 643 707 if (patch_showalllasersights) 644 708 DD_Patch_ShowAllLasersights(); 709 710 if (patch_showtriggervolumes) 711 DD_Patch_ShowTriggerVolumes(); 645 712 646 713 if (patch_throwtest)
Note:
See TracChangeset
for help on using the changeset viewer.