changeset 765:777c42590ffc

Merge
author Gloval
date Sat, 23 Mar 2013 21:42:01 +0400
parents 90bcfb56c8f9 (current diff) a84db04439a4 (diff)
children 67b77b052ef3
files Outdoor.cpp Outdoor.h mm7_4.cpp
diffstat 22 files changed, 141 insertions(+), 85 deletions(-) [+]
line wrap: on
line diff
--- a/Events.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/Events.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -1,3 +1,4 @@
+#include <assert.h>
 #include <stdlib.h>
 
 #include "MapInfo.h"
@@ -87,7 +88,7 @@
 
 //----- (00443DA1) --------------------------------------------------------
 void __cdecl Initialize_GlobalEVT()
-	{
+{
 	struct raw_event_header
 		{ 
 		unsigned char evt_size;
@@ -116,7 +117,8 @@
 		}
 	uGlobalEVT_NumEvents = events_count;
 
-	}
+  assert(uGlobalEVT_NumEvents < 4400);
+}
 
 
 //----- (00443EF8) --------------------------------------------------------
--- a/GUIWindow.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/GUIWindow.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -1282,12 +1282,11 @@
 
 
 //----- (0044D406) --------------------------------------------------------
-char * GUIWindow::DrawTitleText( GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing )
-    {
+void GUIWindow::DrawTitleText( GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing )
+{
   GUIWindow *pWindow; // esi@1
   unsigned int v8; // ebx@1
   char *v9; // eax@1
-  char *result; // eax@1
   unsigned int v11; // edi@1
   signed int v12; // esi@1
   int v13; // eax@2
@@ -1299,22 +1298,20 @@
   v8 = this->uFrameWidth - uHorizontalMargin;
   ui_current_text_color = uDefaultColor;
   v9 = FitTextInAWindow(pInString, a2, this, uHorizontalMargin, 0);
-  result = strtok(v9, "\n");
+  Stra = strtok(v9, "\n");
   v11 = uHorizontalMargin + pWindow->uFrameX;
   v12 = uVerticalMargin + pWindow->uFrameY;
   while ( 1 )
   {
-    Stra = result;
-    if ( !result )
+    if ( !Stra )
       break;
-    v13 = (signed int)(v8 - pFont->GetLineWidth(result)) >> 1;
+    v13 = (signed int)(v8 - pFont->GetLineWidth(Stra)) >> 1;
     if ( v13 < 0 )
       v13 = 0;
     pFont->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, 640);
     v12 += pFont->uFontHeight - uLineSpacing;
-    result = strtok(0, "\n");
+    Stra = strtok(0, "\n");
   }
-  return result;
 }
 // 5C6DB4: using guessed type int ui_current_text_color;
 
--- a/GUIWindow.h	Sat Mar 23 21:39:21 2013 +0400
+++ b/GUIWindow.h	Sat Mar 23 21:42:01 2013 +0400
@@ -114,7 +114,7 @@
   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);
   char DrawText(GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, unsigned int uFontShadowColor);
-  char *DrawTitleText(GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing);
+  void DrawTitleText(GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing);
   void DrawCurrentTime(__int64 a2);
   void HouseDialogManager();
   void OpenSpellBook();
--- a/GameUIs.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/GameUIs.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -34,9 +34,8 @@
 
   uDialogueType_ = uDialogueType;
   dword_6BE138 = -1;
-  ++pIcons_LOD->uTexturePacksCount;
-  if ( !pIcons_LOD->uNumPrevLoadedFiles )
-    pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
+  pIcons_LOD->_inlined_sub2();
+
   memset(pSavegameUsedSlots, 0, sizeof(pSavegameUsedSlots));
   memset(pSavegameThumbnails, 0, 45 * sizeof(RGBTexture));
   uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE);
--- a/Items.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/Items.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -305,7 +305,6 @@
   pStdItemsTXT_Raw = NULL;
   pRndItemsTXT_Raw = NULL;
   pItemsTXT_Raw = NULL;
-
 }
 
 
--- a/LOD.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/LOD.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -28,6 +28,47 @@
 int _6A0CA8_lod_unused; // weak
 
 
+// inlined
+//----- (mm6c::00408860) --------------------------------------------------
+void LODFile_IconsBitmaps::_inlined_sub2()
+{
+  ++uTexturePacksCount;
+  if (!uNumPrevLoadedFiles)
+    uNumPrevLoadedFiles = uNumLoadedFiles;
+}
+
+// inlined
+//----- (mm6c::0045BE60) --------------------------------------------------
+void LODFile_IconsBitmaps::_inlined_sub1()
+{
+  dword_11B84 = uNumLoadedFiles;
+}
+
+// inlined
+//----- (mm6c::0045C310) --------------------------------------------------
+void LODFile_Sprites::_inlined_sub1()
+{
+  field_ECA0 = uNumLoadedSprites;
+}
+
+// inlined
+//----- (mm6c::0045C5B0) --------------------------------------------------
+void LODFile_IconsBitmaps::_inlined_sub0()
+{
+  dword_11B80 = uNumLoadedFiles;
+  if (dword_11B84 < uNumLoadedFiles)
+    dword_11B84 = uNumLoadedFiles;
+}
+
+
+// inlined
+//----- (mm6c::0045C660) --------------------------------------------------
+void LODFile_Sprites::_inlined_sub0()
+{
+  field_ECA4 = uNumLoadedSprites;
+  if (field_ECA0 < uNumLoadedSprites)
+    field_ECA0 = uNumLoadedSprites;
+}
 
 
 
--- a/LOD.h	Sat Mar 23 21:39:21 2013 +0400
+++ b/LOD.h	Sat Mar 23 21:42:01 2013 +0400
@@ -158,6 +158,9 @@
   void ReleaseAll2();
   void _4114F2();
   void _4355F7();
+  void _inlined_sub0();
+  void _inlined_sub1();
+  void _inlined_sub2();
 
   inline Texture *GetTexture(int idx)
   {
@@ -255,6 +258,8 @@
   void ReleaseLostHardwareSprites();
   void ReleaseAll();
   void MoveSpritesToVideoMemory();
+  void _inlined_sub0();
+  void _inlined_sub1();
 
 
   /*FILE *pFile;
--- a/Mouse.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/Mouse.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -284,11 +284,18 @@
   SetCursorBitmap("MICON1");
 }
 
+// inlined
+//----- (0045FE00) mm6 chinese --------------------------------------------
+void Mouse::SetActive(bool active)
+{
+  bActive = active;
+}
+
 //----- (00469CC2) --------------------------------------------------------
 void Mouse::Deactivate()
 {
   if (bInitialized)
-    bActive = false;
+    SetActive(false);
 }
 
 //----- (00469CCD) --------------------------------------------------------
--- a/Mouse.h	Sat Mar 23 21:39:21 2013 +0400
+++ b/Mouse.h	Sat Mar 23 21:42:01 2013 +0400
@@ -68,6 +68,7 @@
   void *DoAllocCursorMem();
   POINT *GetCursorPos(POINT *p);
   void Initialize(HWND hWnd);
+  void SetActive(bool active);
   void Deactivate();
   void DrawCursor();
   void _469E1C();
--- a/Outdoor.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/Outdoor.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -64,8 +64,8 @@
 
   pIndoorCamera->sRotationX = pParty->sRotationX;
   pIndoorCamera->sRotationY = pParty->sRotationY;
-  pIndoorCamera->pos.x = pParty->vPosition.x - ((stru_5C6E00->Cos(pParty->sRotationY) * (signed __int64)pParty->y_rotation_granularity) >> 16);
-  pIndoorCamera->pos.y = pParty->vPosition.y - pParty->y_rotation_granularity * (stru_5C6E00->Sin(pParty->sRotationY) >> 16);
+  pIndoorCamera->pos.x = pParty->vPosition.x - fixpoint_mul(stru_5C6E00->Cos(pParty->sRotationY), pParty->y_rotation_granularity);
+  pIndoorCamera->pos.y = pParty->vPosition.y - fixpoint_mul(stru_5C6E00->Sin(pParty->sRotationY), pParty->y_rotation_granularity);
   pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel;
   if (bRedraw || pRenderer->pRenderD3D)
   {
@@ -73,8 +73,11 @@
     pOutdoorCamera->RotationToInts();
     sub_481ED9_MessWithOutdoorCamera();
   }
+
   pIndoorCamera->uMapGridCellX = WorldPosToGridCellX(pParty->vPosition.x);
   pIndoorCamera->uMapGridCellZ = WorldPosToGridCellZ(pParty->vPosition.y);
+  assert(pIndoorCamera->uMapGridCellX <= 127 && pIndoorCamera->uMapGridCellZ <= 127);
+
   if (bRedraw)
   {
     Software_ResetNewEdges();
@@ -458,9 +461,9 @@
 }
 
 //----- (004892E6) --------------------------------------------------------
-unsigned int OutdoorLocation::UpdateSunlightVectors()
+void OutdoorLocation::UpdateSunlightVectors()
 {
-  unsigned int result; // eax@1
+  //unsigned int result; // eax@1
   OutdoorLocation *v2; // esi@1
   unsigned int v3; // edi@3
   //int v4; // ebx@3
@@ -469,7 +472,6 @@
   //int v7; // ecx@3
   double v8; // st7@4
 
-  result = pParty->uCurrentHour;
   v2 = this;
   if ( pParty->uCurrentHour >= 5 && pParty->uCurrentHour < 21 )
   {
@@ -489,10 +491,8 @@
     else
       v8 = (double)(signed int)v3;
     v2->max_terrain_dimming_level = (signed __int64)(20.0 - v8 / 480.0 * 20.0);
-    result = pParty->uCurrentMinute;
     v2->uLastSunlightUpdateMinute = pParty->uCurrentMinute;
   }
-  return result;
 }
 
 //----- (004893C1) --------------------------------------------------------
@@ -1341,9 +1341,7 @@
     pPaletteManager->pPalette_tintColor[0] = 0x10;
     pPaletteManager->pPalette_tintColor[1] = 0xC2;
     pPaletteManager->pPalette_tintColor[2] = 0x99;
-    pPaletteManager->pPalette_mistColor[0] = 0x25;
-    pPaletteManager->pPalette_mistColor[1] = 0x8F;
-    pPaletteManager->pPalette_mistColor[2] = 0x5C;
+    pPaletteManager->SetMistColor(37, 143, 92);
   }
   else
   {
@@ -1354,9 +1352,7 @@
         pPaletteManager->pPalette_mistColor[1] != 0x80 ||
         pPaletteManager->pPalette_mistColor[2] != 0x80)
     {
-      pPaletteManager->pPalette_mistColor[0] = 0x80;
-      pPaletteManager->pPalette_mistColor[1] = 0x80;
-      pPaletteManager->pPalette_mistColor[2] = 0x80;
+      pPaletteManager->SetMistColor(128, 128, 128);
       pPaletteManager->RecalculateAll();
     }
   }
--- a/Outdoor.h	Sat Mar 23 21:39:21 2013 +0400
+++ b/Outdoor.h	Sat Mar 23 21:42:01 2013 +0400
@@ -176,7 +176,7 @@
   bool Release2();
   bool GetTravelDestination(signed int sPartyX, signed int sPartyZ, char *pOut, signed int a5);
   void MessWithLUN();
-  unsigned int UpdateSunlightVectors();
+  void UpdateSunlightVectors();
   void UpdateFog();
   int GetNumFoodRequiredToRestInCurrentPos(int x, signed int y, int z);
   int SetFog();
--- a/PaletteManager.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/PaletteManager.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -865,6 +865,15 @@
 
 }
 
+// inlined
+//----- (mm6c::0045C610) ---------------------------------------------------
+void PaletteManager::SetMistColor(unsigned char r, unsigned char g, unsigned char b)
+{
+  pPalette_mistColor[0] = r;
+  pPalette_mistColor[1] = g;
+  pPalette_mistColor[2] = b;
+}
+
 //----- (0048A614) --------------------------------------------------------
 void PaletteManager::RecalculateAll()
 {
--- a/PaletteManager.h	Sat Mar 23 21:39:21 2013 +0400
+++ b/PaletteManager.h	Sat Mar 23 21:42:01 2013 +0400
@@ -6,7 +6,8 @@
 struct PaletteManager
 {
   PaletteManager();
-
+  
+  void SetMistColor(unsigned char r, unsigned char g, unsigned char b);
   int ResetNonTestLocked();
   void CalcPalettes_LUT(int a2);
   int ResetNonLocked();
--- a/UIHouses.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/UIHouses.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -528,8 +528,8 @@
         806, 0, -1, 0, 0, 0, 0);
 }
 
-    //----- (004B4F4F) --------------------------------------------------------
-char *__cdecl JailDialog()
+//----- (004B4F4F) --------------------------------------------------------
+void JailDialog()
 {
   const char *v0; // esi@1
   const char *v1; // ST10_4@1
@@ -545,7 +545,7 @@
   v5.uFrameZ = 334;
   v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
   v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0);
-  return v5.DrawTitleText(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u);
+  v5.DrawTitleText(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u);
 }
 
 
@@ -3650,7 +3650,7 @@
                                 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
                                 v22 = WORD2(v59);
                                 v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v57, 0, 0);
-                                result = (int)v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u);
+                                v57.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u);
                                 }
                         }
                     }
@@ -4047,7 +4047,7 @@
               strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
               v29 = color2;
               v30 = pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0);
-              (int)v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf, 3u);
+              v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf, 3u);
             }
           }
         }
--- a/UIHouses.h	Sat Mar 23 21:39:21 2013 +0400
+++ b/UIHouses.h	Sat Mar 23 21:42:01 2013 +0400
@@ -96,7 +96,7 @@
 };
 
 void TrainingDialog();
-char *__cdecl JailDialog();
+void JailDialog();
 void  MagicShopDialog();
 void  GuildDialog();
 void  sub_4B6478();
--- a/VideoPlayer.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/VideoPlayer.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -316,8 +316,9 @@
   pRenderer->DrawTextureRGB(0, 0, &tex);
   free(tex.pPixels);
   tex.pPixels = 0;
-  MainMenuUI_LoadFontsAndSomeStuff();
-  DrawCopyrightWindow();
+
+  LoadFonts_and_DrawCopyrightWindow();
+
   pRenderer->EndScene();
   pRenderer->Present();
   if (!bNoSound && pAudioPlayer->hAILRedbook )
--- a/Viewport.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/Viewport.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -37,7 +37,7 @@
     this->uScreenHeight = br_y - tl_y + 1;
     this->uScreenCenterX = (signed int)(br_x + tl_x) /2;
     if ( pRenderer->pRenderD3D == 0 )
-        this->uScreenCenterY = this->uScreen_BR_Y - ((unsigned __int64)(this->field_30 * (signed __int64)(uScreenHeight)) >> 16);
+        this->uScreenCenterY = this->uScreen_BR_Y - fixpoint_mul(field_30, uScreenHeight);
     else
         this->uScreenCenterY = uScreenHeight/2;
     SetViewport(this->uScreen_TL_X, this->uScreen_TL_Y, this->uScreen_BR_X, this->uScreen_BR_Y);
--- a/mm7_1.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/mm7_1.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -70,6 +70,13 @@
 
 
 
+//----- (004453C0) mm6-----------------------------------------------------
+//----- (004A1760) mm6_chinese---------------------------------------------
+int fixpoint_mul(int a1, int a2)
+{
+  return ((__int64)a1 * a2) >> 16;
+}
+
 //----- (004196A0) --------------------------------------------------------
 void __cdecl sub_4196A0()
 {
--- a/mm7_2.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/mm7_2.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -8049,7 +8049,7 @@
 }
 
 //----- (004627B7) --------------------------------------------------------
-void __cdecl MainMenu_Loop()
+void MainMenu_Loop()
 {
   GUIButton *pButton; // eax@27
   unsigned int pControlParam; // ecx@35
@@ -8068,9 +8068,9 @@
   pGUIWindow2 = 0;
   pAudioPlayer->StopChannels(-1, -1);
   pMouse->RemoveHoldingItem();
-  ++pIcons_LOD->uTexturePacksCount;
-  if ( !pIcons_LOD->uNumPrevLoadedFiles )
-    pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
+
+  pIcons_LOD->_inlined_sub2();
+
   pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
   auto pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE);
   pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172, pNew->uTextureWidth, pNew->uTextureHeight, 1, 0, 
@@ -8921,21 +8921,19 @@
 }
 
 //----- (004647AB) --------------------------------------------------------
-void __cdecl FinalInitialization()
+void FinalInitialization()
 {
   pViewport->SetScreen(viewparams->uSomeX, viewparams->uSomeY, viewparams->uSomeZ, viewparams->uSomeW);
   pViewport->_4C02F8((signed __int64)(flt_6BE3A0 * 65536.0));
 
   pIndoorCamera = new IndoorCamera;
-  pIndoorCamera->Initialize(
-    65,
-    viewparams->uScreen_BttmR_X - viewparams->uScreen_topL_X + 1,
-    viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y + 1);
+  pIndoorCamera->Initialize(65, viewparams->uScreen_BttmR_X - viewparams->uScreen_topL_X + 1,
+                                viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y + 1);
 
   InitializeTurnBasedAnimations(&stru_50C198);
-  pBitmaps_LOD->dword_11B84 = pBitmaps_LOD->uNumLoadedFiles;
-  pSprites_LOD->field_ECA0 = pSprites_LOD->uNumLoadedSprites;
-  pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
+  pBitmaps_LOD->_inlined_sub1();
+  pSprites_LOD->_inlined_sub1();
+  pIcons_LOD->_inlined_sub1();
 }
 // 6BE3A0: using guessed type float flt_6BE3A0;
 
@@ -9947,9 +9945,8 @@
   pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
   pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
   pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
-  pPaletteManager->pPalette_mistColor[0] = 128;
-  pPaletteManager->pPalette_mistColor[1] = 128;
-  pPaletteManager->pPalette_mistColor[2] = 128;
+
+  pPaletteManager->SetMistColor(128, 128, 128);
   pPaletteManager->RecalculateAll();
   pSprites_LOD->field_ECAC = 1;
   pObjectList->InitializeSprites();
@@ -10013,12 +10010,8 @@
   pNPCStats->Initialize();
 
   Initialize_GlobalEVT();
-  pBitmaps_LOD->dword_11B80 = pBitmaps_LOD->uNumLoadedFiles;
-  if ( pBitmaps_LOD->dword_11B84 < (signed int)pBitmaps_LOD->uNumLoadedFiles )
-    pBitmaps_LOD->dword_11B84 = pBitmaps_LOD->uNumLoadedFiles;
-  pSprites_LOD->field_ECA4 = pSprites_LOD->uNumLoadedSprites;
-  if ( pSprites_LOD->field_ECA0 < (signed int)pSprites_LOD->uNumLoadedSprites )
-    pSprites_LOD->field_ECA0 = pSprites_LOD->uNumLoadedSprites;
+  pBitmaps_LOD->_inlined_sub0();
+  pSprites_LOD->_inlined_sub0();
   pPaletteManager->LockAll();
 
   _mkdir("Saves");
--- a/mm7_4.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/mm7_4.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -6255,7 +6255,7 @@
 }
 
 //----- (004B1523) --------------------------------------------------------
-char *__thiscall sub_4B1523(int *_this)
+void __thiscall sub_4B1523(int *_this)
 {
   int v1; // esi@1
   int v2; // edx@1
@@ -6321,7 +6321,7 @@
   a1.uFrameWidth = 108;
   a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v11 / 4 + 12], 3u);
   sprintf(pTmpBuf, "%s\n%d", pGlobalTXT_LocalizationStrings[522], *(&pSpellDatas[0].uNormalLevelMana + 10 * v1));
-  return a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3);
+  a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3);
 }
 
 
@@ -7310,7 +7310,7 @@
 
 
 //----- (004B2A74) --------------------------------------------------------
-char __cdecl SimpleHouseAndBoatsDialog()
+void SimpleHouseAndBoatsDialog()
 {
   char *v0; // esi@3
   char *v1; // ST1C_4@3
@@ -7391,8 +7391,8 @@
     }
     v3 = v2;
     v4 = pFontCreate->CalcTextHeight(v2, &a1, 0, 0);
-    LOBYTE(i) = (unsigned int)a1.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u);
-    return i;
+    a1.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u);
+    return;
   }
   a1.uFrameWidth -= 10;
   a1.uFrameZ -= 10;
@@ -7631,9 +7631,8 @@
       (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v48);
     pRenderer->DrawTextureIndexed(8u, 347 - v48, pTexture_591428);
     v49 = FitTextInAWindow(ptr_F8B1E8, v47, &w, 0xDu, 0);
-    LOBYTE(i) = a1.DrawText(v47, 13, 354 - v48, 0, v49, 0, 0, 0);
-  }
-  return i;
+    a1.DrawText(v47, 13, 354 - v48, 0, v49, 0, 0, 0);
+  }
 }
 
 
--- a/mm7_5.cpp	Sat Mar 23 21:39:21 2013 +0400
+++ b/mm7_5.cpp	Sat Mar 23 21:42:01 2013 +0400
@@ -10618,20 +10618,12 @@
 
 
 //----- (004141CA) --------------------------------------------------------
-GUIWindow *__fastcall ModalWindow(const char *pStr, int a4)
-{
-  const char *v2; // edi@1
-  int v3; // esi@1
-  GUIWindow *result; // eax@1
-
-  v2 = pStr;
-  v3 = a4;
+void ModalWindow(const char *pStr, int a4)
+{
   pEventTimer->Pause();
   dword_506F0C[0] = pCurrentScreen;
-  result = GUIWindow::Create(0, 0, 640, 480, WINDOW_FinalWindow, v3, (int)v2);
-  ptr_507BDC = result;
+  ptr_507BDC = GUIWindow::Create(0, 0, 640, 480, WINDOW_FinalWindow, a4, (int)pStr);
   pCurrentScreen = SCREEN_PRESS_ESCAPE_MESSAGE;
-  return result;
 }
 // 4E28F8: using guessed type int pCurrentScreen;
 
@@ -10674,7 +10666,11 @@
 
 
 
-
+void LoadFonts_and_DrawCopyrightWindow()
+{
+  MainMenuUI_LoadFontsAndSomeStuff();
+  DrawCopyrightWindow();
+}
 
 //----- (00415485) --------------------------------------------------------
 void DrawCopyrightWindow()
--- a/mm7_data.h	Sat Mar 23 21:39:21 2013 +0400
+++ b/mm7_data.h	Sat Mar 23 21:42:01 2013 +0400
@@ -1793,7 +1793,7 @@
 int __fastcall am_40D2B4(struct Vec2_int_ *, int); // weak
 int __fastcall am_40D402(int, int); // weak
 int __cdecl am_40D444();
-struct GUIWindow *__fastcall ModalWindow(const char *pStr, int a4);
+void ModalWindow(const char *pStr, int a4);
 char __fastcall pPrimaryWindow_draws_text(int a1, const char *pText, int *pXY);
 void __thiscall am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3); // idb
 void __fastcall Blt_Chroma(struct ArcomageRect *pSrcXYZW, int *pTargetXY, int a3, int a4);
@@ -1847,6 +1847,7 @@
 void __cdecl DrawGameOptions();
 void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight); // idb
 void DrawCopyrightWindow();
+void LoadFonts_and_DrawCopyrightWindow();
 void __cdecl GUI_UpdateWindows();
 void __cdecl identify_item();
 void __thiscall sub_416B01(void *_this);
@@ -2280,7 +2281,7 @@
 void __cdecl nullsub_20(); // idb
 void __cdecl nullsub_21(); // idb
 struct Player *__fastcall sub_4B1447_party_fine(int a1, int a2, int a3);
-char *__thiscall sub_4B1523(int *_this);
+void __thiscall sub_4B1523(int *_this);
 bool __cdecl sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
 void __cdecl sub_4B1A2D();
 void __stdcall RestAndHeal(__int64 uNumMinutes); // idb
@@ -2290,7 +2291,7 @@
 void __fastcall ClickNPCTopic(signed int uMessageParam);
 char *__thiscall _4B254D_SkillMasteryTeacher(int _this);
 const char * ContractSelectText(int pEventCode);
-char __cdecl SimpleHouseAndBoatsDialog();
+void SimpleHouseAndBoatsDialog();
 void  CreateButtonInColumn(int a1, unsigned int a2);
 void FillAviableSkillsToTeach(int _this);
 void  sub_4B3A72(int a1); // idb
@@ -2341,6 +2342,8 @@
 signed int __fastcall SpawnRandomTreasure(struct MapInfo *a1, struct SpawnPointMM7 *a2);
 void DamageMonsterFromParty(signed int a1, unsigned int uActorID_Monster, struct Vec3_int_ *pVelocity);
 
+int fixpoint_mul(int, int);
+
 
 #define ErrD3D(hr) do {extern void ErrHR(HRESULT, const char *, const char *, const char *, int); ErrHR(hr, "Direct3D", __FUNCTION__, __FILE__, __LINE__);} while(0)