diff mm7_5.cpp @ 977:ac85898f5903

Слияние
author Ritor1
date Thu, 09 May 2013 01:33:54 +0600
parents e875f5ab0cfb ec7568e13b24
children 9334a8c59c8d
line wrap: on
line diff
--- a/mm7_5.cpp	Thu May 09 01:33:38 2013 +0600
+++ b/mm7_5.cpp	Thu May 09 01:33:54 2013 +0600
@@ -1501,7 +1501,7 @@
               pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, v0, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u,
                              pGlobalTXT_LocalizationStrings[619],// "Return to Game"
                              pIcons_LOD->GetTexture(uTextureID_Resume1), 0);
-              pGUIWindow_CurrentMenu->_41D08F(6, v0, 0, 0);
+              pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, v0, 0, 0);
               viewparams->field_48 = v0;
               stru_506E40.Release();
               uNumSeconds = (unsigned int)MakeScreenshot(155, 117);
@@ -2864,7 +2864,7 @@
           papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE);
           pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, v0, 0, UIMSG_Escape, 0, 0,
                          pGlobalTXT_LocalizationStrings[79],// "Exit"
-                         (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), 0); //, v179);
+                         pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179);
           continue;
         case UIMSG_GameMenuButton:
           if ( pCurrentScreen )
@@ -2909,8 +2909,8 @@
           pCharacterScreen_DollBtn->Release();
           if ( bRingsShownInCharScreen )
           {
-            v128 = (uTextureID_detaliz_close_button != -1 ? pIcons_LOD->pTextures[uTextureID_detaliz_close_button].uTextureHeight : 26);
-            v125 = (uTextureID_detaliz_close_button != -1 ? pIcons_LOD->pTextures[uTextureID_detaliz_close_button].uTextureWidth : 24);
+            v128 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureHeight;
+            v125 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureWidth;
             v123 = 445;
             v121 = 470;
           }
@@ -9450,7 +9450,8 @@
 //----- (0040F82D) --------------------------------------------------------
 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue)
 {
-  ZBuffer_DoFill(pZBuffer, (Texture *)(uTextureId != -1 ? (int)&pIcons_LOD->pTextures[uTextureId] : 0), iZValue);
+  assert(uTextureId != -1);
+  ZBuffer_DoFill(pZBuffer, pIcons_LOD->GetTexture(uTextureId), iZValue);
 }
 
 //----- (0040F845) --------------------------------------------------------
@@ -10201,17 +10202,18 @@
   int v39; // eax@129
   unsigned int pNumMessages; // eax@142
   GUIButton *pGUIButton; // ebp@146
-  unsigned int pX; // [sp-1Ch] [bp-124h]@17
-  unsigned int pY; // [sp-18h] [bp-120h]@17
-  Texture *pTexture; // [sp-14h] [bp-11Ch]@17
-  Texture *pTexture2; // [sp-14h] [bp-11Ch]@86
+  //unsigned int pX; // [sp-1Ch] [bp-124h]@17
+  //unsigned int pY; // [sp-18h] [bp-120h]@17
+  //Texture *pTexture; // [sp-14h] [bp-11Ch]@17
+  //Texture *pTexture2; // [sp-14h] [bp-11Ch]@86
   int i; // [sp+0h] [bp-108h]@3
   ItemGen pItemGen; // [sp+4h] [bp-104h]@98
   GUIButton GUIButton2; // [sp+28h] [bp-E0h]@133
   ItemGen ItemGen2; // [sp+E4h] [bp-24h]@129
 
   if (GetCurrentMenuID() != MENU_CREATEPARTY)
-    sub_41CD4F(34);
+    UI_OnKeyDown(VK_NEXT);
+
   for ( i = 1; i <= uNumVisibleWindows; ++i )
   {
     pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1];
@@ -10220,10 +10222,8 @@
     {
       case WINDOW_OptionsButtons:
       {
-        pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0);
-        pY = pViewport->uViewportTL_Y;
-        pX = pViewport->uViewportTL_X;
-        pRenderer->DrawTextureIndexed(pX, pY, pTexture);
+        pRenderer->DrawTextureIndexed(pViewport->uViewportTL_Y,
+                                      pViewport->uViewportTL_X, pIcons_LOD->GetTexture(uTextureID_Options));
         viewparams->bRedrawGameUI = 1;
         continue;
       }
@@ -10283,8 +10283,7 @@
           pRenderer->ClearZBuffer(0, 479);
           draw_leather();
           CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
-          pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
-             (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0));
+          pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId));
         }
         continue;
       }
@@ -10333,8 +10332,7 @@
         draw_leather();
         CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
         CharacterUI_DrawPaperdoll(uActiveCharacter);
-        pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
-            (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
+        pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u));
         continue;
       }
       case WINDOW_FinalWindow:
@@ -10557,9 +10555,8 @@
       case WINDOW_BooksWindow:
       {
         pButton = (GUIButton *)pWindow->ptr_1C;
-        pY = pWindow->uFrameY;
-        pX = pWindow->uFrameX;
-        pRenderer->DrawTextureIndexed(pX, pY, pButton->pTextures[0]);
+        pRenderer->DrawTextureIndexed(pWindow->uFrameY,
+                                      pWindow->uFrameX, pButton->pTextures[0]);
         viewparams->bRedrawGameUI = 1;
         continue;
       }
@@ -11529,14 +11526,18 @@
         i->uX = 0;
       }
     }
-    pBtn_Up = pGUIWindow_CurrentMenu->CreateButton(438, 46, (uTextureID_ar_up_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_up_up].uTextureWidth : 24),
-                   (uTextureID_ar_up_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_up_up].uTextureHeight : 26),
-                   1, 0, UIMSG_ClickAwardsUpBtn, 0, 0, "", (Texture *)(uTextureID_ar_up_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_up_up] : 0),
-                   uTextureID_ar_up_dn != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_up_dn] : 0, 0);
-    pBtn_Down = pGUIWindow_CurrentMenu->CreateButton(438, 292, (uTextureID_ar_dn_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_dn_up].uTextureWidth : 24),
-                   (uTextureID_ar_dn_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_dn_up].uTextureHeight : 26),
-                   1, 0, UIMSG_ClickAwardsDownBtn, 0, 0, "", (Texture *)(uTextureID_ar_dn_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_dn_up] : 0),
-                   uTextureID_ar_dn_dn != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_dn_dn] : 0, 0);
+    pBtn_Up = pGUIWindow_CurrentMenu->CreateButton(438, 46,
+                   pIcons_LOD->GetTexture(uTextureID_ar_up_up)->uTextureWidth,
+                   pIcons_LOD->GetTexture(uTextureID_ar_up_up)->uTextureHeight,
+                   1, 0, UIMSG_ClickAwardsUpBtn, 0, 0, "",
+                   pIcons_LOD->GetTexture(uTextureID_ar_up_up),
+                   pIcons_LOD->GetTexture(uTextureID_ar_up_dn), 0);
+    pBtn_Down = pGUIWindow_CurrentMenu->CreateButton(438, 292,
+                   pIcons_LOD->GetTexture(uTextureID_ar_dn_up)->uTextureWidth,
+                   pIcons_LOD->GetTexture(uTextureID_ar_dn_up)->uTextureHeight,
+                   1, 0, UIMSG_ClickAwardsDownBtn, 0, 0, "",
+                   pIcons_LOD->GetTexture(uTextureID_ar_dn_up),
+                   pIcons_LOD->GetTexture(uTextureID_ar_dn_dn), 0);
     ptr_507BA4 = pGUIWindow_CurrentMenu->CreateButton(440, 62, 16, 232, 1, 0, UIMSG_C0, 0, 0, "", 0);
   }
 }
@@ -11564,10 +11565,10 @@
         pButton->uY = dword_506988;
         pButton->uZ = dword_506984;
         pButton->uW = dword_506980;
-        pGUIWindow_CurrentMenu->_41D08F(1, 0, 0, 0);
-      }
-    }
-  }
-}
-
-
+        pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(1, 0, 0, 0);
+      }
+    }
+  }
+}
+
+