diff --git a/src/Hook.cpp b/src/Hook.cpp index 327f725..4003ed8 100644 --- a/src/Hook.cpp +++ b/src/Hook.cpp @@ -138,12 +138,12 @@ void Hook::RegisterModules() RegisterModule(); RegisterModule(); RegisterModule(); + RegisterModule(); #ifndef TR8 RegisterModule(); RegisterModule(); RegisterModule(); - RegisterModule(); RegisterModule(); #else RegisterModule(); diff --git a/src/level/Level.h b/src/level/Level.h index 8c452aa..7ff6622 100644 --- a/src/level/Level.h +++ b/src/level/Level.h @@ -91,6 +91,7 @@ struct TerrainGroup char pad1[116]; }; +#ifndef TR8 struct StreamUnitPortal { char tolevelname[30]; @@ -126,6 +127,35 @@ struct Terrain TerrainGroup* signalTerrainGroup; Signal* signals; }; +#else +struct StreamUnitPortal +{ + char tolevelname[128]; + + __int16 field_80; + __int16 field_82; + + __int16 streamID; + + __int16 field_86; + __int16 field_88; + __int16 field_8A; + __int16 field_8C; + __int16 field_8E; + + cdc::Vector3 min; + cdc::Vector3 max; + cdc::Vector3 quad[4]; + cdc::Vector3 normal; +}; + +struct Terrain +{ + __int16 field_0; + __int16 numStreamUnitPortals; + StreamUnitPortal* streamUnitPortals; +}; +#endif struct Level { diff --git a/src/modules/Draw.cpp b/src/modules/Draw.cpp index 64014e9..5a70f84 100644 --- a/src/modules/Draw.cpp +++ b/src/modules/Draw.cpp @@ -1,5 +1,3 @@ -#ifndef TR8 - #include #include #include @@ -148,6 +146,7 @@ void Draw::DrawInstances() void Draw::DrawInstance(Instance* instance) { +#ifndef TR8 auto name = instance->object->name; auto data = (ObjectData*)instance->data; @@ -225,10 +224,12 @@ void Draw::DrawInstance(Instance* instance) } } } +#endif } void Draw::DrawEnemyRoute(Instance* instance) { +#ifndef TR8 auto data = (ObjectData*)instance->data; // Check if the instance is an enemy @@ -251,6 +252,7 @@ void Draw::DrawEnemyRoute(Instance* instance) x = y; } +#endif } void Draw::DrawMarkUp() @@ -317,6 +319,7 @@ void Draw::DrawMarkUp() void Draw::DrawCollision(Level* level) { +#ifndef TR8 auto terrain = level->terrain; // Draw the collision mesh for all terrain groups @@ -339,6 +342,7 @@ void Draw::DrawCollision(Level* level) DrawCollision(terrainGroup); } } +#endif } void Draw::DrawCollision(TerrainGroup* terrainGroup) @@ -379,6 +383,7 @@ void Draw::DrawPortals(Level* level) position += &portal->max; position /= 2; +#ifndef TR8 TRANS_RotTransPersVectorf(&position, &position); // Check if the portal is on screen @@ -387,15 +392,17 @@ void Draw::DrawPortals(Level* level) // Draw the portal destination font->SetCursor(position.x, position.y); font->PrintCentered("Portal to %s", portal->tolevelname); - - // Draw the portal bounds - DrawPlane(&portal->min, &portal->max, RGBA(0, 0, 255, 10)); } +#endif + + // Draw the portal bounds + DrawPlane(&portal->min, &portal->max, RGBA(0, 0, 255, 10)); } } void Draw::DrawSignals(Level* level) { +#ifndef TR8 auto terrain = level->terrain; auto terrainGroup = terrain->signalTerrainGroup; @@ -420,6 +427,7 @@ void Draw::DrawSignals(Level* level) // Draw the face DrawTriangle(&x, &y, &z, RGBA(255, 0, 0, 10)); } +#endif } std::string Draw::FlagsToString(unsigned int flags) @@ -441,6 +449,4 @@ std::string Draw::FlagsToString(unsigned int flags) result.erase(result.end() - 3, result.end()); return result; -} - -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/modules/Draw.h b/src/modules/Draw.h index 35c1024..e5d29c8 100644 --- a/src/modules/Draw.h +++ b/src/modules/Draw.h @@ -1,5 +1,4 @@ #pragma once -#ifndef TR8 #include "Module.h" @@ -46,6 +45,4 @@ class Draw : public Module void OnMenu(); void OnDraw(); void OnFrame(); -}; - -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp index bd149d9..5ff33ac 100644 --- a/src/render/Draw.cpp +++ b/src/render/Draw.cpp @@ -10,7 +10,7 @@ void TRANS_TransToDrawVertexV4f(DRAWVERTEX* v, cdc::Vector3* vec) void TRANS_RotTransPersVectorf(cdc::Vector3* srcvector, cdc::Vector3* dstvector) { - auto addr = GET_ADDRESS(0x402B20, 0x402B50, 0x000000); + auto addr = GET_ADDRESS(0x402B20, 0x402B50, 0x49F630); Hooking::Call(addr, srcvector, dstvector); }