diff mm7_1.cpp @ 2:2ca04ccb612a

NoCD, main menu, various
author Nomad
date Wed, 10 Oct 2012 14:21:15 +0200
parents ac0fb48cd27a
children 540178ef9b18
line wrap: on
line diff
--- a/mm7_1.cpp	Tue Oct 09 13:09:08 2012 +0200
+++ b/mm7_1.cpp	Wed Oct 10 14:21:15 2012 +0200
@@ -1569,7 +1569,7 @@
   {
     while ( 2 )
     {
-      v4 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[v2]];
+      v4 = &pWindowList[pVisibleWindowsIdxs[v2] - 1];
       for ( result = v4->pControlsHead; result; result = result->pNext )
       {
         if ( result->uHotkey == v3 )
@@ -1619,14 +1619,16 @@
     for ( i = uNumVisibleWindows; i >= 0; --i )
     {
       result = 84 * pVisibleWindowsIdxs[i];
-      for ( j = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); j; j = j->pNext )
+      //for ( j = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); j; j = j->pNext )
+      for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext )
         j->field_28 = 0;
     }
   }
   for ( k = uNumVisibleWindows; k >= 0; --k )
   {
     result = 84 * pVisibleWindowsIdxs[k];
-    for ( l = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); l; l = l->pNext )
+    //for ( l = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); l; l = l->pNext )
+    for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext )
     {
       LOBYTE(result) = v10;
       if ( l->uHotkey == v10 )
@@ -1671,7 +1673,7 @@
   pFontCreate->field_3 = 0;
 
   for (uint i = 0; i < 20; ++i)
-    pWindowList[i].uWindowType = 0;
+    pWindowList[i].eWindowType = WINDOW_null;
 
   uNumVisibleWindows = -1;
   memset(pVisibleWindowsIdxs, 0, sizeof(pVisibleWindowsIdxs));
@@ -1753,7 +1755,8 @@
   uTextureID_BUTTYES2 = pIcons_LOD->LoadTexture("BUTTYES2", TEXTURE_16BIT_PALETTE);
   uTextureID_BUTTMAKE = pIcons_LOD->LoadTexture("BUTTMAKE", TEXTURE_16BIT_PALETTE);
   uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE);
-  pGUIWindow0 = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Credits, 0, 0);
+
+  pGUIWindow0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
   pGUIWindow0->CreateButton(7u, 8u, 0x1CCu, 0x157u, 1, 0, 0xAu, 0, 0, nullstring, 0);
   pGUIWindow0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, nullstring, 0);
   pGUIWindow0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, nullstring, 0);
@@ -3922,7 +3925,7 @@
   char v4; // al@17
   bool v5; // eax@21
   GUIButton Dst; // [sp+8h] [bp-DCh]@19
-  double v7; // [sp+C4h] [bp-20h]@17
+  //double v7; // [sp+C4h] [bp-20h]@17
   float v8; // [sp+CCh] [bp-18h]@17
   __int64 v9; // [sp+D0h] [bp-14h]@17
   unsigned int v10; // [sp+D8h] [bp-Ch]@9
@@ -3973,11 +3976,11 @@
     }
     v9 = v3;
     v8 = (double)v3 * 0.001953125 * 120.0;
-    v7 = v8 + 6.7553994e15;
-    HIDWORD(v9) = LODWORD(v7);
-    v4 = LOBYTE(v7) + 1;
-    byte_4E2BC8 = LOBYTE(v7) + 1;
-    if ( (unsigned __int8)(LOBYTE(v7) + 1) >= 0x78u )
+    //v7 = v8 + 6.7553994e15;
+    HIDWORD(v9) = floorf(v8);//LODWORD(v7);
+    v4 = (int)floorf(v8) % 256 + 1;//LOBYTE(v7) + 1;
+    byte_4E2BC8 = v4;
+    if ( (unsigned __int8)(v4) >= 0x78u )
     {
       v4 = 1;
       byte_4E2BC8 = 1;
@@ -5077,7 +5080,7 @@
           if ( !v25 )
           {
             if ( v23->IsInteractive() )
-              v26 = (const char *)dword_722240[2 * stru_5E4C90.field_0[v24->field_1C]];
+              v26 = pNPCTopics[stru_5E4C90.field_0[v24->field_1C] + 379].pTopic;
             else
               v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20;
             goto LABEL_87;
@@ -5365,7 +5368,7 @@
   bRingsShownInCharScreen = 0;
   CharacterUI_LoadPaperdollTextures();
   uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = v1;
-  v2 = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_CharacterRecord, uActiveCharacter, 0);
+  v2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_CharacterRecord, uActiveCharacter, 0);
   pCharacterScreen_StatsBtn = v2->CreateButton(
                                 pViewport->uViewportX + 12,
                                 pViewport->uViewportY + 308,
@@ -5474,7 +5477,7 @@
   bRingsShownInCharScreen = 0;
   CharacterUI_LoadPaperdollTextures();
   uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 23;
-  v2 = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_HouseInterior|WINDOW_Options, v1, 0);
+  v2 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|WINDOW_Options), v1, 0);
   ptr_50767C = v2->CreateButton(
                  394u,
                  318u,