Mercurial > mm7
changeset 522:61343380715b
Origianl structures integrity test added
author | Nomad |
---|---|
date | Sat, 02 Mar 2013 01:30:24 +0200 |
parents | 35f28d4c0ff9 |
children | 8f7f651311bc |
files | DecalBuilder.h Game.h IndoorCameraD3D.h LightmapBuilder.h Lights.h Vis.h mm7_2.cpp |
diffstat | 7 files changed, 129 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/DecalBuilder.h Fri Mar 01 23:43:21 2013 +0400 +++ b/DecalBuilder.h Sat Mar 02 01:30:24 2013 +0200 @@ -40,7 +40,7 @@ { } - void (__thiscall ***vdestructor_ptr)(Decal *, bool); + //void (__thiscall ***vdestructor_ptr)(Decal *, bool); int uNumVertices; RenderVertexSoft pVertices[64]; __int16 field_C08; @@ -103,7 +103,7 @@ - void (__thiscall ***vdestructor_ptr)(DecalBuilder *, bool); + //void (__thiscall ***vdestructor_ptr)(DecalBuilder *, bool); Decal std__vector_pDecals[1024]; unsigned int std__vector_pDecals_size; int field_308008; @@ -150,7 +150,7 @@ { } - void (__thiscall ***vdestructor_ptr)(Bloodsplat *, bool); + //void (__thiscall ***vdestructor_ptr)(Bloodsplat *, bool); float x; float y; float z; @@ -194,7 +194,7 @@ bool AddBloodsplat(float x, float y, float z, float radius, char r, char g, char b); - void (__thiscall ***vdestructor_ptr)(BloodsplatContainer *, bool); + //void (__thiscall ***vdestructor_ptr)(BloodsplatContainer *, bool); Bloodsplat std__vector_pBloodsplats[64]; unsigned int std__vector_pBloodsplats_size; int uNumBloodsplats;
--- a/Game.h Fri Mar 01 23:43:21 2013 +0400 +++ b/Game.h Sat Mar 02 01:30:24 2013 +0200 @@ -82,7 +82,7 @@ static void Destroy(); protected: Game(); -protected: ~Game(); +protected: virtual ~Game(); public: void _44E904(); @@ -113,7 +113,7 @@ struct IndoorCameraD3D *GetIndoorCamera() {return this->pIndoorCameraD3D;} - void (__thiscall ***vdestructor_ptr)(Game *, bool); + //void (__thiscall ***vdestructor_ptr)(Game *, bool); Game__StationaryLight pStationaryLights[25]; char field_2C0[1092]; unsigned int uNumStationaryLights;
--- a/IndoorCameraD3D.h Fri Mar 01 23:43:21 2013 +0400 +++ b/IndoorCameraD3D.h Sat Mar 02 01:30:24 2013 +0200 @@ -14,7 +14,7 @@ //----- (004C039C) -------------------------------------------------------- //void ~IndoorCameraD3D_Vec3() {} - void (__thiscall ***vdestructor_ptr)(IndoorCameraD3D_Vec3 *, bool); + //void (__thiscall ***vdestructor_ptr)(IndoorCameraD3D_Vec3 *, bool); union { @@ -43,6 +43,7 @@ {} float dot; + int _wtf; // sizeof vec4 is 18 and first member is vdtor, but vdtor is already included in vec3 so very weird }; #pragma pack(pop) @@ -157,7 +158,7 @@ void ViewTransfrom_OffsetUV(struct RenderVertexSoft *pVertices, unsigned int uNumVertices, struct RenderVertexSoft *pOutVertices, struct stru320 *a5); char ApplyViewTransform_TrueIfStillVisible(int x, int y, int z, signed int *pOutX, int *pOutZ, int *pOutY, char bDoNotShow); - void (__thiscall ***vdestructor_ptr)(IndoorCameraD3D *, bool); + //void (__thiscall ***vdestructor_ptr)(IndoorCameraD3D *, bool); IndoorCameraD3D_Vec3 field_4[3]; //IndoorCameraD3D_Vec3 field_14; //IndoorCameraD3D_Vec3 field_24;
--- a/LightmapBuilder.h Fri Mar 01 23:43:21 2013 +0400 +++ b/LightmapBuilder.h Sat Mar 02 01:30:24 2013 +0200 @@ -9,8 +9,9 @@ struct Lightmap { Lightmap(); + virtual ~Lightmap() {} - void (__thiscall ***vdestructor_ptr)(Lightmap *, bool); + //void (__thiscall ***vdestructor_ptr)(Lightmap *, bool); unsigned int uNumVertices; RenderVertexSoft pVertices[64]; __int16 field_C08; @@ -29,7 +30,7 @@ struct LightmapBuilder { LightmapBuilder(); - inline ~LightmapBuilder() //----- (0045BBAA) + virtual ~LightmapBuilder() //----- (0045BBAA) {} void DoDrawLightmaps(); @@ -57,7 +58,7 @@ bool ApplyLights(struct stru320 *a2, struct stru154 *a3, unsigned int uNumVertices, struct RenderVertexSoft *a5, struct IndoorCameraD3D_Vec4 *, char uClipFlag); - void (__thiscall ***vdestructor_ptr)(LightmapBuilder *, bool); + //void (__thiscall ***vdestructor_ptr)(LightmapBuilder *, bool); //std::vector<Lightmap> std__vector_000004; //std::vector<Lightmap> std__vector_183808; Lightmap std__vector_000004[512];
--- a/Lights.h Fri Mar 01 23:43:21 2013 +0400 +++ b/Lights.h Sat Mar 02 01:30:24 2013 +0200 @@ -98,7 +98,7 @@ - void (__thiscall ***vdestructor_ptr)(LightsStack_StationaryLight_ *, bool); + //void (__thiscall ***vdestructor_ptr)(LightsStack_StationaryLight_ *, bool); StationaryLight pLights[400]; unsigned int uNumLightsActive; }; @@ -127,7 +127,7 @@ - void (__thiscall ***vdestructor_ptr)(LightsStack_MobileLight_ *, bool); + //void (__thiscall ***vdestructor_ptr)(LightsStack_MobileLight_ *, bool); MobileLight pLights[400]; unsigned int uNumLightsActive; };
--- a/Vis.h Fri Mar 01 23:43:21 2013 +0400 +++ b/Vis.h Sat Mar 02 01:30:24 2013 +0200 @@ -87,7 +87,7 @@ //----- (004C05A2) -------------------------------------------------------- //virtual ~Vis() {} //----- (004C05BE) -------------------------------------------------------- - ~Vis() {} + virtual ~Vis() {} bool PickKeyboard(Vis_SelectionList *list, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter); void PickBillboards_Keyboard(float pick_depth, Vis_SelectionList *list, Vis_SelectionFilter *filter); void PickIndoorFaces_Keyboard(float pick_depth, Vis_SelectionList *list, Vis_SelectionFilter *filter); @@ -121,7 +121,7 @@ bool SortByScreenSpaceX(struct RenderVertexSoft *pArray, int sLeft, int sRight); bool SortByScreenSpaceY(struct RenderVertexSoft *pArray, int sLeft, int sRight); - void (__thiscall ***vdestructor_ptr)(Vis *, bool); + //void (__thiscall ***vdestructor_ptr)(Vis *, bool); Vis_SelectionList default_list; RenderVertexSoft stru_200C; RenderVertexSoft stru_203C;
--- a/mm7_2.cpp Fri Mar 01 23:43:21 2013 +0400 +++ b/mm7_2.cpp Sat Mar 02 01:30:24 2013 +0200 @@ -29,6 +29,7 @@ #include "SaveLoad.h" #include "stru123.h" #include "stru287.h" +#include "stru176.h" #include "Time.h" #include "IconFrameTable.h" #include "GUIProgressBar.h" @@ -53,6 +54,7 @@ #include "texts.h" #include "mm7_data.h" +#include "MM7.h" //----- (004B4F4F) -------------------------------------------------------- @@ -13128,6 +13130,112 @@ +void IntegrityTest() +{ + assert(sizeof(RenderVertexSoft) == 0x30); + assert(sizeof(RenderBillboard) == 0x34); + assert(sizeof(Texture) == 0x48); + assert(sizeof(RGBTexture) == 0x28); + assert(sizeof(LODFile_IconsBitmaps) == 0x11BB8 + 4); // + virtual dtor ptr + assert(sizeof(AudioPlayer) == 0xC84); + assert(sizeof(SoundDesc) == 0x78); + assert(sizeof(stru339_spell_sound) == 0xAFD8); + assert(sizeof(VideoPlayer) == 0x108 + 4); + assert(sizeof(MovieHeader) == 0x2C); + assert(sizeof(DecorationDesc) == 0x54); + assert(sizeof(ObjectDesc) == 0x38); + assert(sizeof(OverlayDesc) == 0x8); + assert(sizeof(ChestDesc) == 0x24); + assert(sizeof(TileDesc) == 0x1A); + assert(sizeof(MonsterDesc) == 0x98); + assert(sizeof(Timer) == 0x28); + assert(sizeof(OtherOverlay) == 0x14); + assert(sizeof(ItemGen) == 0x24); + assert(sizeof(SpriteObject) == 0x70); + assert(sizeof(ItemDesc) == 0x30); + assert(sizeof(ItemsTable) == 0x117A0); + assert(sizeof(Chest) == 0x14CC); + assert(sizeof(MapInfo) == 0x44); + assert(sizeof(SpellInfo) == 0x24); + assert(sizeof(SpellData) == 0x14); + assert(sizeof(SpellBuff) == 0x10); + assert(sizeof(AIDirection) == 0x1C); + assert(sizeof(ActorJob) == 0xC); + assert(sizeof(Actor) == 0x344); + assert(sizeof(LevelDecoration) == 0x20); + assert(sizeof(KeyboardActionMapping) == 0x20C); + assert(sizeof(UIAnimation) == 0xD); + assert(sizeof(SpawnPointMM7) == 0x18); + assert(sizeof(ODMFace) == 0x134); + assert(sizeof(BSPNode) == 0x8); + assert(sizeof(BSPModel) == 0xBC); + assert(sizeof(OutdoorLocation) == 0x1C28C); + assert(sizeof(BLVFace) == 0x60); + assert(sizeof(BLVFaceExtra) == 0x24); + assert(sizeof(BLVSector) == 0x74); + assert(sizeof(BLVLightMM7) == 0x10); + assert(sizeof(BLVDoor) == 0x50); + assert(sizeof(IndoorLocation) == 0x690); + assert(sizeof(OutdoorCamera) == 0x74); + assert(sizeof(Mouse) == 0x114); + assert(sizeof(Particle_) == 0x68); + assert(sizeof(Particle) == 0x68); + assert(sizeof(ParticleEngine) == 0xE430); + assert(sizeof(Lightmap) == 0xC1C); + assert(sizeof(LightmapBuilder) == 0x3CBC38); + assert(sizeof(Vis_SelectionList) == 0x2008); + assert(sizeof(Vis) == 0x20D0); + assert(sizeof(PlayerBuffAnim) == 0x10); + assert(sizeof(ProjectileAnim) == 0x1C); + assert(sizeof(stru6) == 0x5F8); + assert(sizeof(IndoorCameraD3D_Vec3) == 0x10); + assert(sizeof(IndoorCameraD3D_Vec4) == 0x18); //should be 14 (10 vec3 + 4 vdtor) but 18 coz of his +4 from own vdtor, but it is odd since vdtor already present from vec3 + assert(sizeof(IndoorCameraD3D) == 0x1A1384); + assert(sizeof(StationaryLight) == 0xC); + assert(sizeof(LightsStack_StationaryLight_) == 0x12C8); + assert(sizeof(MobileLight) == 0x12); + assert(sizeof(LightsStack_MobileLight_) == 0x1C28); + assert(sizeof(Game) == 0xE78); + assert(sizeof(stru141) == 0xA8); + assert(sizeof(ActionQueue) == 0x7C); + assert(sizeof(NPCData) == 0x4C); + assert(sizeof(NPCStats) == 0x17FFC); + assert(sizeof(BspRenderer) == 0x53740); + assert(sizeof(PaletteManager) == 0x267AF0); + assert(sizeof(ViewingParams) == 0x26C); + assert(sizeof(IndoorCamera) == 0x50); + assert(sizeof(Bloodsplat) == 0x28); + assert(sizeof(BloodsplatContainer) == 0xA0C); + assert(sizeof(stru167) == 0x18); + assert(sizeof(EventIndex) == 0xC); + assert(sizeof(_2devent) == 0x34); + assert(sizeof(stru176) == 0x20); + assert(sizeof(SavegameHeader) == 0x64); + assert(sizeof(SavegameList) == 0x3138); + assert(sizeof(StorylineText) == 0x168); + assert(sizeof(FactionTable) == 0x1EF1); + assert(sizeof(Decal) == 0xC20); + assert(sizeof(DecalBuilder) == 0x30C038); + assert(sizeof(MonsterInfo) == 0x58); + assert(sizeof(MonsterStats) == 0x5BA0); + assert(sizeof(RenderD3D) == 0x148); + assert(sizeof(Render) == 0x129844); + assert(sizeof(Player) == 0x1B3C); + assert(sizeof(Party_stru0) == 0x678); + assert(sizeof(Party) == 0x16238); + assert(sizeof(GUIButton) == 0xBC); + assert(sizeof(GUIWindow) == 0x54); + assert(sizeof(GUIProgressBar) == 0x1B8); + assert(sizeof(GUIFont) == 0x1020); + assert(sizeof(stru262_TurnBased) == 0x40); + assert(sizeof(ArcomageGame) == 0xFA); + assert(sizeof(stru277) == 0x14); + assert(sizeof(ArcomageCard) == 0x6C); + assert(sizeof(stru320) == 0x3FC); + assert(sizeof(TravelInfo) == 0x20); + assert(sizeof(stru336) == 0x798); +} + bool new_sky = false; //----- (00462C94) -------------------------------------------------------- @@ -13145,9 +13253,11 @@ unsigned int startms; // [sp+8h] [bp-24h]@55 RECT Rect; // [sp+Ch] [bp-20h]@15 int a2[4]; // [sp+1Ch] [bp-10h]@15 - + + IntegrityTest(); char test[1024]; - //sprintfex(test, "^Pi[%s]: знахар^R[ь;ка;]", "Золтан"); + sprintfex(test, "^Pi[%s]: знахар^R[ь;ка;]", "Золтан"); + if (pCmdLine && *pCmdLine) {