Mercurial > mm7
changeset 1262:0aeac0b9ca30
included header cleanup
author | Grumpy7 |
---|---|
date | Wed, 12 Jun 2013 21:07:34 +0200 |
parents | cdee1d692a4a |
children | 6bc88137a019 2b4c8cdd8db0 |
files | Allocator.cpp Arcomage.cpp AudioPlayer.cpp CShow.cpp Events.cpp GUIButton.cpp GUIProgressBar.h GUIWindow.h Game.cpp Indoor.cpp Indoor.h Indoor_stuff.h Keyboard.cpp LOD.h LightmapBuilder.cpp LightmapBuilder.h LightsStack.cpp Math.h Mouse.cpp Outdoor.cpp Outdoor.h Outdoor_stuff.h Party.h Player.cpp Random.cpp Render.cpp Render.h Texture.cpp Texture.h Time.cpp UIHouses.cpp UITransition.cpp UiGame.cpp VideoPlayer.cpp VideoPlayer.h Vis.cpp Weather.cpp mm7_1.cpp mm7_2.cpp mm7_3.cpp mm7_4.cpp mm7_5.cpp mm7_data.cpp mm7_data.h stru11.h stru6.cpp |
diffstat | 46 files changed, 214 insertions(+), 192 deletions(-) [+] |
line wrap: on
line diff
--- a/Allocator.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Allocator.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -4,7 +4,6 @@ #include <string.h> #include <stdio.h> -#include "OSAPI.h" #include "Allocator.h"
--- a/Arcomage.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Arcomage.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -20,6 +20,7 @@ #include "VectorTypes.h" #include "texts.h" #include <windef.h> +#include "mm7_data.h"
--- a/AudioPlayer.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/AudioPlayer.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -7,6 +7,7 @@ #include "stru11.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "AudioPlayer.h" #include "Allocator.h"
--- a/CShow.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/CShow.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -2,6 +2,7 @@ #include "CShow.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "Mouse.h"
--- a/Events.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Events.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -5,6 +5,8 @@ #include <assert.h> #include <stdlib.h> +#include "Texture.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "Mouse.h"
--- a/GUIButton.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/GUIButton.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -1,7 +1,6 @@ #include "GUIWindow.h" #include "GUIFont.h" -#include "mm7_data.h"
--- a/GUIProgressBar.h Wed Jun 12 15:13:45 2013 +0200 +++ b/GUIProgressBar.h Wed Jun 12 21:07:34 2013 +0200 @@ -41,9 +41,9 @@ RGBTexture field_68; RGBTexture field_90; RGBTexture field_B8; - Texture field_E0; - Texture pBardata; - Texture pLoadingProgress; + struct Texture field_E0; + struct Texture pBardata; + struct Texture pLoadingProgress; }; #pragma pack(pop)
--- a/GUIWindow.h Wed Jun 12 15:13:45 2013 +0200 +++ b/GUIWindow.h Wed Jun 12 21:07:34 2013 +0200 @@ -325,7 +325,7 @@ } GUIButton *CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, int a6, int a7, - UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...); + UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, struct Texture *pTextures, ...); void DrawFlashingInputCursor(signed int a3, int a4, struct GUIFont *a2); int DrawTextInRect(GUIFont *a2, unsigned int uX, unsigned int uY, unsigned int uColor, const char *Str1, int Source, int a8); void DrawText(GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, unsigned int uFontShadowColor);
--- a/Game.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Game.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -38,6 +38,8 @@ #include "texts.h" #include "GUIFont.h" #include "Log.h" +#include "Lights.h" +#include "mm7_data.h" //#include "MM7.h"
--- a/Indoor.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Indoor.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -33,6 +33,7 @@ #include "PaletteManager.h" #include "MapInfo.h" #include "IndoorCamera.h" +#include "Lights.h" #include "mm7_data.h" #include "MM7.h"
--- a/Indoor.h Wed Jun 12 15:13:45 2013 +0200 +++ b/Indoor.h Wed Jun 12 21:07:34 2013 +0200 @@ -1,6 +1,7 @@ #pragma once #include "VectorTypes.h" #include "Weather.h" +#include "Indoor_stuff.h" @@ -128,17 +129,6 @@ -/* 291 */ -enum PolygonType : __int8 -{ - POLYGON_Invalid = 0x0, - POLYGON_VerticalWall = 0x1, - POLYGON_unk = 0x2, - POLYGON_Floor = 0x3, - POLYGON_InBetweenFloorAndWall = 0x4, - POLYGON_Ceiling = 0x5, - POLYGON_InBetweenCeilingAndWall = 0x6, -}; /* 90 */ #pragma pack(push, 1) @@ -576,5 +566,3 @@ - -#include "Indoor_stuff.h" \ No newline at end of file
--- a/Indoor_stuff.h Wed Jun 12 15:13:45 2013 +0200 +++ b/Indoor_stuff.h Wed Jun 12 21:07:34 2013 +0200 @@ -370,6 +370,17 @@ extern stru337 stru_F81018; +/* 291 */ +enum PolygonType : __int8 +{ + POLYGON_Invalid = 0x0, + POLYGON_VerticalWall = 0x1, + POLYGON_unk = 0x2, + POLYGON_Floor = 0x3, + POLYGON_InBetweenFloorAndWall = 0x4, + POLYGON_Ceiling = 0x5, + POLYGON_InBetweenCeilingAndWall = 0x6, +}; /* 147 */
--- a/Keyboard.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Keyboard.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -2,7 +2,6 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "OSAPI.h" #include "Keyboard.h" #include "GUIWindow.h"
--- a/LOD.h Wed Jun 12 15:13:45 2013 +0200 +++ b/LOD.h Wed Jun 12 21:07:34 2013 +0200 @@ -150,13 +150,13 @@ bool LoadIconsOrEvents(const char *pLODFilename); void ReleaseAll(); unsigned int LoadTexture(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT); - Texture *LoadTexturePtr(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT); - int LoadTextureFromLOD(Texture *pOutTex, const char *pContainer, enum TEXTURE_TYPE eTextureType); - int ReloadTexture(Texture *pDst, const char *pContainer, int mode); + struct Texture *LoadTexturePtr(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT); + int LoadTextureFromLOD(struct Texture *pOutTex, const char *pContainer, enum TEXTURE_TYPE eTextureType); + int ReloadTexture(struct Texture *pDst, const char *pContainer, int mode); void ReleaseHardwareTextures(); void ReleaseLostHardwareTextures(); void _410423_move_textures_to_device(); - int _410522(Texture *pDst, const char *pContainer, unsigned int uTextureType); + int _410522(struct Texture *pDst, const char *pContainer, unsigned int uTextureType); void SetupPalettes(unsigned int uTargetRBits, unsigned int uTargetGBits, unsigned int uTargetBBits); void ReleaseAll2(); void _4114F2(); @@ -165,7 +165,7 @@ void _inlined_sub1(); void _inlined_sub2(); - inline Texture *GetTexture(int idx) + inline struct Texture *GetTexture(int idx) { assert(idx < 1000); if (idx == -1) return nullptr; // we need to return dummy texture here
--- a/LightmapBuilder.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/LightmapBuilder.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -5,6 +5,7 @@ #include "Log.h" #include "OutdoorCamera.h" +#include "Lights.h" #include "mm7_data.h"
--- a/LightmapBuilder.h Wed Jun 12 15:13:45 2013 +0200 +++ b/LightmapBuilder.h Wed Jun 12 21:07:34 2013 +0200 @@ -1,8 +1,9 @@ #pragma once #include <vector> #include "Render.h" -#include "Lights.h" +struct LightsStack_StationaryLight_; +struct LightsStack_MobileLight_; /* 115 */ #pragma pack(push, 1)
--- a/LightsStack.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/LightsStack.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -1,7 +1,6 @@ #include <string> #include "Lights.h" -#include "mm7_data.h" //----- (00467D88) -------------------------------------------------------- bool LightsStack_MobileLight_::AddLight(__int16 x, __int16 y, __int16 z, __int16 uSectorID, int uRadius, unsigned __int8 r, unsigned __int8 g, unsigned __int8 b, char uLightType)
--- a/Math.h Wed Jun 12 15:13:45 2013 +0200 +++ b/Math.h Wed Jun 12 21:07:34 2013 +0200 @@ -2,6 +2,9 @@ #include <cassert> #include <limits> #include <float.h> +#include <cmath> +#include <cstdlib> +#include <ciso646> /* 186 */ @@ -35,9 +38,6 @@ #define ROUNDING_EPSILON 0.0000001 #endif -#include <cmath> -#include <cstdlib> -#include <ciso646> template <typename FloatType> int bankersRounding(
--- a/Mouse.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Mouse.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -2,9 +2,9 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "OSAPI.h" -#include "VideoPlayer.h" +#include "Texture.h" +#include "mm7_data.h" #include "Render.h" #include "Mouse.h" #include "Items.h"
--- a/Outdoor.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Outdoor.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -30,6 +30,7 @@ #include "mm7_data.h" #include "MM7.h" +#include "Lights.h" #include "MapInfo.h"
--- a/Outdoor.h Wed Jun 12 15:13:45 2013 +0200 +++ b/Outdoor.h Wed Jun 12 21:07:34 2013 +0200 @@ -2,8 +2,7 @@ #include "Indoor.h" #include "TileFrameTable.h" -#include "Weather.h" -#include "BSPModel.h" +#include "Outdoor_stuff.h" #define DAY_ATTRIB_FOG 1 @@ -273,5 +272,3 @@ - -#include "Outdoor_stuff.h" \ No newline at end of file
--- a/Outdoor_stuff.h Wed Jun 12 15:13:45 2013 +0200 +++ b/Outdoor_stuff.h Wed Jun 12 21:07:34 2013 +0200 @@ -32,7 +32,7 @@ __int16 field_32; int field_34; struct stru149 *ptr_38; - Texture *pTexture; + struct Texture *pTexture; struct Span *prolly_head; struct Span *prolly_tail; int **ptr_48;
--- a/Party.h Wed Jun 12 15:13:45 2013 +0200 +++ b/Party.h Wed Jun 12 21:07:34 2013 +0200 @@ -1,7 +1,6 @@ #pragma once #include "Player.h" #include "NPC.h" -#include "Spells.h" #include "VectorTypes.h"
--- a/Player.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Player.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -7,7 +7,6 @@ #include "stru6.h" -#include "OSAPI.h" #include "Player.h" #include "PlayerFrameTable.h" #include "AudioPlayer.h"
--- a/Random.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Random.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -1,8 +1,7 @@ #include <math.h> #include "Random.h" - -#include "mm7_data.h" +#include "Math.h" @@ -50,13 +49,11 @@ double v3; // ST04_8@1 int floored_random; // ecx@1 - v1 = this; v2 = GetRandom() * (double)this->range; - v3 = v2 + 6.7553994e15; - floored_random = LODWORD(v3); - if ( SLODWORD(v3) >= v1->range ) - floored_random = v1->range; - return floored_random + v1->min; + floored_random = bankersRounding(v2); + if ( floored_random >= this->range ) + floored_random = this->range; + return floored_random + this->min; } //----- (004BE65D) --------------------------------------------------------
--- a/Render.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Render.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -36,6 +36,7 @@ #include "texts.h" #include "mm7_data.h" #include "MM7.h" +#include "Lights.h" #pragma comment(lib, "lib\\legacy_dx\\lib\\ddraw.lib") #pragma comment(lib, "lib\\legacy_dx\\lib\\dxguid.lib")
--- a/Render.h Wed Jun 12 15:13:45 2013 +0200 +++ b/Render.h Wed Jun 12 21:07:34 2013 +0200 @@ -323,7 +323,7 @@ void DrawTerrainPolygon(unsigned int uNumVertices, stru148 *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders); void DrawSkyPolygon(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *pTexture); void _4A2ED5(signed int a2, stru148 *a3, IDirect3DTexture2 *pHwTex); - void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, Texture *pTex, int uPackedID, unsigned int uColor, int a8); + void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture *pTex, int uPackedID, unsigned int uColor, int a8); void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle); void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle); void TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int dimming_level, RenderBillboard *pBillboard); @@ -340,20 +340,20 @@ void ResetTextureClipRect(); void DrawTextureRGB(unsigned int uOutX, unsigned int uOutY, RGBTexture *a4); void _4A5D33(unsigned int a2, unsigned int a3, int a4, int a5, RGBTexture *pTexture); - void DrawTextureIndexed(unsigned int uX, unsigned int uY, Texture *a4); - void ZBuffer_Fill_2(signed int a2, signed int a3, Texture *pTexture, int a5); - void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, Texture *pTexture, int zVal); - void DrawTextureTransparent(unsigned int uX, unsigned int uY, Texture *pTexture); - void _4A63E6(unsigned int a2, unsigned int a3, Texture *a4, Texture *a5, int a6, int a7, int a8); - void _4A65CC(unsigned int x, unsigned int y, Texture *a4, Texture *a5, int a6, int a7, int a8); - void DrawTransparentRedShade(unsigned int a2, unsigned int a3, Texture *a4); - void DrawTransparentGreenShade(signed int a2, signed int a3, Texture *pTexture); - void _4A6A68(unsigned int a2, unsigned int a3, Texture *a4, __int16 height); + void DrawTextureIndexed(unsigned int uX, unsigned int uY, struct Texture *a4); + void ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5); + void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal); + void DrawTextureTransparent(unsigned int uX, unsigned int uY, struct Texture *pTexture); + void _4A63E6(unsigned int a2, unsigned int a3, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8); + void _4A65CC(unsigned int x, unsigned int y, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8); + void DrawTransparentRedShade(unsigned int a2, unsigned int a3, struct Texture *a4); + void DrawTransparentGreenShade(signed int a2, signed int a3, struct Texture *pTexture); + void _4A6A68(unsigned int a2, unsigned int a3, struct Texture *a4, __int16 height); void DrawTextPalette(int x, int y, int a4, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8); void DrawText(signed int uOutX, signed int uOutY, unsigned __int8 *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, unsigned __int16 *pFontPalette, unsigned __int16 uFaceColor, unsigned __int16 uShadowColor); void FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16); int _4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, struct Vec2_int_ *pBitmapXY, unsigned __int16 *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7); - void _4A6E7E(unsigned int a2, unsigned int a3, Texture *a4); + void _4A6E7E(unsigned int a2, unsigned int a3, struct Texture *a4); char DrawBuildingsD3D(); struct BSPModel *DrawBuildingsSW(); int OnOutdoorRedrawSW();
--- a/Texture.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Texture.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -192,6 +192,8 @@ unsigned int uTextureID_BACKDOLL; // weak unsigned int uTextureID_BACKHAND; // weak +stru355 stru_4E82A4 = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; +stru355 stru_4EFCBC = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; Texture pTex_F7CE30;
--- a/Texture.h Wed Jun 12 15:13:45 2013 +0200 +++ b/Texture.h Wed Jun 12 21:07:34 2013 +0200 @@ -125,51 +125,49 @@ - - extern std::array<struct RGBTexture, 45> pSavegameThumbnails; -extern std::array<Texture *, 2> pTexture_LloydBeacons; -extern Texture *pTexture_50635C; -extern Texture *pTexture_506368; -extern Texture *pTexture_50636C; -extern Texture *pTexture_506370; -extern Texture *pTexture_506374; -extern Texture *pTexture_506378; -extern Texture *pTexture_50637C; -extern Texture *pTexture_506380; -extern Texture *pTexture_506384; -extern Texture *pTexture_506388; -extern Texture *pTexture_50638C; -extern Texture *pTexture_506390; -extern Texture *pTexture_506394; -extern Texture *pTex_tab_an_7a__zoot_off; -extern Texture *pTex_tab_an_6a__zoom_off; -extern Texture *pTex_tab_an_7b__zoot_on; -extern Texture *pTex_tab_an_6b__zoom_on; -extern std::array<Texture *, 6> pTexture_TownPortalIcons; // [0]Harmonale, [1]Pierpont, [2]Nighon, [3]Evenmorn Island, [4]Celestia, [5]The Pit +extern std::array<struct Texture *, 2> pTexture_LloydBeacons; +extern struct Texture *pTexture_50635C; +extern struct Texture *pTexture_506368; +extern struct Texture *pTexture_50636C; +extern struct Texture *pTexture_506370; +extern struct Texture *pTexture_506374; +extern struct Texture *pTexture_506378; +extern struct Texture *pTexture_50637C; +extern struct Texture *pTexture_506380; +extern struct Texture *pTexture_506384; +extern struct Texture *pTexture_506388; +extern struct Texture *pTexture_50638C; +extern struct Texture *pTexture_506390; +extern struct Texture *pTexture_506394; +extern struct Texture *pTex_tab_an_7a__zoot_off; +extern struct Texture *pTex_tab_an_6a__zoom_off; +extern struct Texture *pTex_tab_an_7b__zoot_on; +extern struct Texture *pTex_tab_an_6b__zoom_on; +extern std::array<struct Texture *, 6> pTexture_TownPortalIcons; // [0]Harmonale, [1]Pierpont, [2]Nighon, [3]Evenmorn Island, [4]Celestia, [5]The Pit -extern std::array<Texture *, 12> dword_5063D8; -extern std::array<Texture *, 12> dword_506408; -extern Texture *pTexture_50643C; // idb -extern Texture *ptr_506440; -extern Texture *pTexture_506444; -extern Texture *pTexture_506448; // idb -extern std::array<std::array<Texture *, 2>, 9> pTextures_tabs; -extern Texture *pTexture_mapbordr; // idb -extern Texture *pTexture_pagemask; // idb -extern std::array<Texture *, 9> pSpellBookPagesTextr; -extern Texture *pSpellBookPagesTextr_9; -extern Texture *pSpellBookPagesTextr_10; -extern Texture *pSpellBookPagesTextr_11; -extern Texture *pSpellBookPagesTextr_12; -extern Texture *pSpellBookPagesTextr_13; -extern Texture *pTexture_AutonotesBook; -extern Texture *pTexture_CurrentBook; -extern Texture *pTex_moon_new; -extern Texture *pTex_moon_4; -extern Texture *pTex_moon_2; -extern Texture *pTex_moon_2_2; -extern Texture *pTex_moon_ful; +extern std::array<struct Texture *, 12> dword_5063D8; +extern std::array<struct Texture *, 12> dword_506408; +extern struct Texture *pTexture_50643C; // idb +extern struct Texture *ptr_506440; +extern struct Texture *pTexture_506444; +extern struct Texture *pTexture_506448; // idb +extern std::array<std::array<struct Texture *, 2>, 9> pTextures_tabs; +extern struct Texture *pTexture_mapbordr; // idb +extern struct Texture *pTexture_pagemask; // idb +extern std::array<struct Texture *, 9> pSpellBookPagesTextr; +extern struct Texture *pSpellBookPagesTextr_9; +extern struct Texture *pSpellBookPagesTextr_10; +extern struct Texture *pSpellBookPagesTextr_11; +extern struct Texture *pSpellBookPagesTextr_12; +extern struct Texture *pSpellBookPagesTextr_13; +extern struct Texture *pTexture_AutonotesBook; +extern struct Texture *pTexture_CurrentBook; +extern struct Texture *pTex_moon_new; +extern struct Texture *pTex_moon_4; +extern struct Texture *pTex_moon_2; +extern struct Texture *pTex_moon_2_2; +extern struct Texture *pTex_moon_ful; @@ -211,16 +209,16 @@ extern unsigned int uTextureID_BUTTMAKE; extern unsigned int uTextureID_BUTTYES2; extern unsigned int uTextureID_x_ok_u; -extern std::array<Texture *, 22> pPlayerPortraits; -extern std::array<Texture *, 9> pTexture_IC_KNIGHT; -extern Texture *pTexture_MAKESKY; -extern Texture *pTexture_MAKETOP; -extern std::array<Texture *, 20> pTextures_arrowr; -extern std::array<Texture *, 20> pTextures_arrowl; -extern Texture *pTexture_presleft; -extern Texture *pTexture_pressrigh; -extern Texture *pTexture_buttminu; -extern Texture *pTexture_buttplus; +extern std::array<struct Texture *, 22> pPlayerPortraits; +extern std::array<struct Texture *, 9> pTexture_IC_KNIGHT; +extern struct Texture *pTexture_MAKESKY; +extern struct Texture *pTexture_MAKETOP; +extern std::array<struct Texture *, 20> pTextures_arrowr; +extern std::array<struct Texture *, 20> pTextures_arrowl; +extern struct Texture *pTexture_presleft; +extern struct Texture *pTexture_pressrigh; +extern struct Texture *pTexture_buttminu; +extern struct Texture *pTexture_buttplus; extern unsigned int uTextureID_Quit1; extern unsigned int uTextureID_Resume1; extern unsigned int uTextureID_Controls1; @@ -269,9 +267,9 @@ extern unsigned int uTextureID_right_panel_loop; // weak -extern Texture *pTexture_Leather; -extern Texture *pTexture_RestUI_CurrentSkyFrame; // idb -extern Texture *pTexture_RestUI_CurrentHourglassFrame; // idb +extern struct Texture *pTexture_Leather; +extern struct Texture *pTexture_RestUI_CurrentSkyFrame; // idb +extern struct Texture *pTexture_RestUI_CurrentHourglassFrame; // idb extern std::array<unsigned int, 5> uTextureID_Optkb; @@ -315,12 +313,13 @@ extern unsigned int uTextureID_BACKHAND; // weak -extern Texture pTex_F7CE30; +extern struct Texture pTex_F7CE30; extern RGBTexture stru_5773C4; // idb - +extern struct stru355 stru_4E82A4;// = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; moved to texture.h +extern struct stru355 stru_4EFCBC;// = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; moved to texture.h @@ -347,15 +346,15 @@ struct stru350 { stru350 *_450DDE(); - bool _450DF1(const stru355 *p1, const stru355 *p2); + bool _450DF1(const struct stru355 *p1, const struct stru355 *p2); unsigned int _450F55(int a2); int _450FB1(int a2); int sub_451007_scale_image_bicubic(unsigned short *pSrc, int srcWidth, int srcHeight, int srcPitch, unsigned short *pDst, int dstWidth, int dstHeight, int dstPitch, int a9, int a10); - stru355 field_0; - stru355 field_20; + struct stru355 field_0; + struct stru355 field_20; int field_40; int field_44; int field_48;
--- a/Time.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Time.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -1,10 +1,9 @@ -#include "OSAPI.h" #include "Time.h" #include "Keyboard.h" #include "Log.h" -#include "mm7_data.h" +#include "OSAPI.h"
--- a/UIHouses.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/UIHouses.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -2,6 +2,8 @@ #define _CRT_SECURE_NO_WARNINGS #endif +#include "Texture.h" +#include "mm7_data.h" #include "UIHouses.h" #include "Party.h" #include "texts.h"
--- a/UITransition.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/UITransition.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -5,6 +5,7 @@ #include <assert.h> #include <io.h> +#include "mm7_data.h" #include "VideoPlayer.h" #include "MapInfo.h" #include "GUIWindow.h"
--- a/UiGame.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/UiGame.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -4,6 +4,7 @@ #include <assert.h> +#include "Texture.h" #include "MM7.h" #include "Mouse.h" @@ -31,6 +32,7 @@ #include "TurnEngine.h" #include "texts.h" #include "UIHouses.h" +#include "BSPModel.h"
--- a/VideoPlayer.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/VideoPlayer.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -2,10 +2,10 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "OSAPI.h" #include "Bink_Smacker.h" +#include "mm7_data.h" #include "CShow.h" #include "Mouse.h" @@ -1171,4 +1171,17 @@ bStopBeforeSchedule = 0; pResetflag = 0; pGame->pCShow->PlayMovie(MOVIE_Death, 1); -} \ No newline at end of file +} + +//----- (004BE6F5) -------------------------------------------------------- +VideoPlayer::VideoPlayer() : + field_54(0), + pBinkMovie(nullptr), pBinkBuffer(nullptr), + pSmackerMovie(nullptr), pSmackerBuffer(nullptr), pSmackMovieBlit(nullptr) +{ + //RGBTexture::RGBTexture(&pVideoPlayer->pVideoFrame); + bStopBeforeSchedule = false; + pResetflag = 0; + byte_F8BC0C = 0; + //pBinkMovie = nullptr; +}
--- a/VideoPlayer.h Wed Jun 12 15:13:45 2013 +0200 +++ b/VideoPlayer.h Wed Jun 12 21:07:34 2013 +0200 @@ -1,7 +1,7 @@ #pragma once #include "OSAPI.h" +#include "Texture.h" -#include "mm7_data.h" @@ -112,18 +112,7 @@ #pragma pack(push, 1) struct VideoPlayer { - //----- (004BE6F5) -------------------------------------------------------- - inline VideoPlayer(): - field_54(0), - pBinkMovie(nullptr), pBinkBuffer(nullptr), - pSmackerMovie(nullptr), pSmackerBuffer(nullptr), pSmackMovieBlit(nullptr) - { - //RGBTexture::RGBTexture(&pVideoPlayer->pVideoFrame); - bStopBeforeSchedule = false; - pResetflag = 0; - byte_F8BC0C = 0; - //pBinkMovie = nullptr; - } + VideoPlayer(); //----- (004BECBD) -------------------------------------------------------- virtual ~VideoPlayer() {
--- a/Vis.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Vis.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -2,6 +2,7 @@ #include "Vis.h" #include "Outdoor.h" +#include "BSPModel.h" #include "Game.h" #include "Actor.h" #include "IndoorCamera.h"
--- a/Weather.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/Weather.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -4,7 +4,7 @@ #include "Viewport.h" #include "Render.h" -#include "mm7_data.h" +#include "mm7_data.h" ////TODO: remove this once LOWORD/HIWRD stuff is refactored
--- a/mm7_1.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/mm7_1.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -11,6 +11,8 @@ //#include <defs.h> #include <assert.h> +#include "Texture.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "BSPModel.h" #include "Mouse.h"
--- a/mm7_2.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/mm7_2.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -8,6 +8,8 @@ #include <windows.h> +#include "Texture.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "Sprites.h" #include "BSPModel.h" @@ -64,6 +66,7 @@ #include "UIHouses.h" #include "texts.h" #include "MM7.h" +#include "Lights.h" //----- (004BB756) -------------------------------------------------------- signed int __fastcall sub_4BB756(signed int a1) @@ -7259,7 +7262,7 @@ if (!bNoSound) pAudioPlayer->Initialize(hWnd); - pVideoPlayer = new VideoPlayer; + pVideoPlayer = new VideoPlayer(); pVideoPlayer->Initialize(); dword_6BE364_game_settings_1 |= 0x4000;
--- a/mm7_3.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/mm7_3.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -5,7 +5,8 @@ #include <assert.h> -#include "VideoPlayer.h" +#include "Texture.h" +#include "mm7_data.h" #include "Sprites.h" #include "BSPModel.h" #include "OutdoorCamera.h" @@ -46,6 +47,7 @@ #include "stru298.h" #include "texts.h" #include "Log.h" +#include "Lights.h" #include "MM7.h"
--- a/mm7_4.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/mm7_4.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -4,6 +4,8 @@ #include <assert.h> +#include "Texture.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "Sprites.h" #include "BSPModel.h" @@ -43,6 +45,7 @@ #include "texts.h" #include "Log.h" #include "UIHouses.h" +#include "Lights.h" //----- (0046CC4B) -------------------------------------------------------- void __cdecl check_event_triggers()
--- a/mm7_5.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/mm7_5.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -4,6 +4,8 @@ #include <assert.h> +#include "Texture.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "Sprites.h" #include "MapInfo.h" @@ -45,6 +47,8 @@ #include "texts.h" #include "Log.h" #include "UIHouses.h" +#include "Lights.h" +#include "Lights.h" //----- (004304E7) -------------------------------------------------------- void __cdecl GameUI_MsgProc() @@ -3624,6 +3628,50 @@ this->z = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->z; } +//----- (00438526) -------------------------------------------------------- +stru11::stru11() +{ + stru11 *v1; // esi@1 + signed int v2; // eax@1 + char *v3; // edx@1 + + v1 = this; + v2 = 0; + this->cpuid_00000000_eax_numops = 0; + this->cpuid_00000001_eax = 0; + this->cpuid_00000001_edx = 0; + this->field_38 = 0; + this->field_3C = 0; + this->cpuid_80000000_edx = 0; + this->cpuid_80000001_eax = 0; + this->cpuid_80000001_edx = 0; + this->cpuid_80000005_ebx = 0; + this->cpuid_80000005_ecx = 0; + this->cpuid_80000005_edx = 0; + this->cpuid_80000006_ecx = 0; + this->field_AC = 0; + this->uProcessorManufacturer = 0; + LOBYTE(this->cpuid_80000002_registers2[0]) = 0; + v3 = (char *)&this->cpuid_00000002_eax; + do + { + if ( v2 < 3 ) + *((int *)v3 - 9) = 0; + if ( v2 < 4 ) + *(int *)v3 = 0; + if ( v2 < 12 ) + *((int *)v3 + 17) = 0; + if ( v2 < 13 ) + this->pCPUString[v2] = 0; + if ( v2 < 30 ) + *((char *)this->field_40 + v2) = 0; + *((char *)&this->cpuid_80000002_registers2[0] + v2++ + 1) = 0; + v3 += 4; + } + while ( v2 < 48 ); + CheckCPU(); +} + //----- (004385B5) -------------------------------------------------------- void stru11::CheckCPU() {
--- a/mm7_data.cpp Wed Jun 12 15:13:45 2013 +0200 +++ b/mm7_data.cpp Wed Jun 12 21:07:34 2013 +0200 @@ -570,8 +570,6 @@ int bWinNT4_0; // weak std::array<__int16, 11> word_4E8152 = {0, 0, 0, 90, 8, 2, 70, 20, 10, 50, 30}; -stru355 stru_4E82A4 = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; -stru355 stru_4EFCBC = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; char byte_4E94D0 = 5; // weak char byte_4E94D1 = 9; // weak char _4E94D2_light_type = 6; // weak @@ -912,8 +910,8 @@ __int64 qword_506350; // weak char byte_506360; // weak int dword_506364; // weak -Texture *dword_506404[12]; // weak -Texture *dword_50640C[12]; // weak +//Texture *dword_506404[12]; // weak +//Texture *dword_50640C[12]; // weak unsigned int uExitCancelTextureId; int dword_50651C; // weak int dword_506528; // weak
--- a/mm7_data.h Wed Jun 12 15:13:45 2013 +0200 +++ b/mm7_data.h Wed Jun 12 21:07:34 2013 +0200 @@ -3,9 +3,11 @@ #include "VectorTypes.h" #include "OSAPI.h" #include <array> +#include "Items.h" //TODO: remove this once sub_467E7F_EquipBody if moved to a class or something typedef char _UNKNOWN; + typedef unsigned int uint; @@ -463,9 +465,8 @@ extern int bWinNT4_0; // weak extern std::array<__int16, 11> word_4E8152; extern std::array< std::array<char, 14>, 7> byte_4E8168; -#include "Texture.h" -extern stru355 stru_4E82A4;// = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; -extern stru355 stru_4EFCBC;// = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; +//extern stru355 stru_4E82A4;// = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; moved to texture.h +//extern stru355 stru_4EFCBC;// = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; moved to texture.h extern char byte_4E94D0; // weak extern char _4E94D2_light_type; // weak extern char byte_4E94D3; // weak @@ -549,7 +550,7 @@ extern __int64 qword_506350; // weak extern char byte_506360; // weak extern int dword_506364; // weak -extern Texture *dword_50640C[]; // weak +//extern Texture *dword_50640C[]; // weak extern unsigned int uExitCancelTextureId; extern int dword_50651C; // weak extern int dword_506528; // weak @@ -1108,7 +1109,7 @@ int loc_40E4FC(); // weak void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue); -void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture *pTex, int uZValue); +void __fastcall ZBuffer_DoFill(int *pZBuffer, struct Texture *pTex, int uZValue); void __fastcall sub_40F92A(int *pZBuffer, struct Texture *a2, int a3); // idb void __cdecl SetMoonPhaseNames(); signed int __fastcall sub_410D99_get_map_index(int a1); @@ -1343,7 +1344,6 @@ enum MENU_STATE GetCurrentMenuID(); void *__thiscall output_debug_string(void *_this, std::string a2, const char *a3, int a4); std::string *__fastcall _4678E2_make_error_string(std::string *a1, int line, std::string file); -#include "Items.h" void sub_467E7F_EquipBody(ITEM_EQUIP_TYPE uEquipType); // idb void CreateMsgScrollWindow(signed int mscroll_id); void __cdecl free_book_subwindow();
--- a/stru11.h Wed Jun 12 15:13:45 2013 +0200 +++ b/stru11.h Wed Jun 12 21:07:34 2013 +0200 @@ -1,54 +1,12 @@ #pragma once -#include "mm7_data.h" /* 128 */ #pragma pack(push, 1) struct stru11 { - //----- (00438526) -------------------------------------------------------- - stru11() - { - stru11 *v1; // esi@1 - signed int v2; // eax@1 - char *v3; // edx@1 - v1 = this; - v2 = 0; - this->cpuid_00000000_eax_numops = 0; - this->cpuid_00000001_eax = 0; - this->cpuid_00000001_edx = 0; - this->field_38 = 0; - this->field_3C = 0; - this->cpuid_80000000_edx = 0; - this->cpuid_80000001_eax = 0; - this->cpuid_80000001_edx = 0; - this->cpuid_80000005_ebx = 0; - this->cpuid_80000005_ecx = 0; - this->cpuid_80000005_edx = 0; - this->cpuid_80000006_ecx = 0; - this->field_AC = 0; - this->uProcessorManufacturer = 0; - LOBYTE(this->cpuid_80000002_registers2[0]) = 0; - v3 = (char *)&this->cpuid_00000002_eax; - do - { - if ( v2 < 3 ) - *((int *)v3 - 9) = 0; - if ( v2 < 4 ) - *(int *)v3 = 0; - if ( v2 < 12 ) - *((int *)v3 + 17) = 0; - if ( v2 < 13 ) - this->pCPUString[v2] = 0; - if ( v2 < 30 ) - *((char *)this->field_40 + v2) = 0; - *((char *)&this->cpuid_80000002_registers2[0] + v2++ + 1) = 0; - v3 += 4; - } - while ( v2 < 48 ); - CheckCPU(); - } + stru11(); void CheckCPU(); void RunCPUID();