diff GUIWindow.cpp @ 2215:e9625ad08541

fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
author Ritor1
date Fri, 14 Feb 2014 18:08:30 +0600
parents d28d3c006077
children 3f375342de12
line wrap: on
line diff
--- a/GUIWindow.cpp	Thu Feb 13 23:02:32 2014 +0600
+++ b/GUIWindow.cpp	Fri Feb 14 18:08:30 2014 +0600
@@ -186,7 +186,7 @@
 		return result;
 	  }
 	}
-	if ( !v4->uFrameX && !v4->uFrameY && (v4->uFrameWidth == 640 && v4->uFrameHeight == 480) )
+	if ( !v4->uFrameX && !v4->uFrameY && (v4->uFrameWidth == window->GetWidth() && v4->uFrameHeight == window->GetWidth()) )
 	  break;
   }
   return 0;
@@ -680,8 +680,8 @@
   else
   {
     v4 = 0;
-    v5 = 640;
-    v22 = 480;
+    v5 = window->GetWidth();
+    v22 = window->GetHeight();
   }
   v6 = this->uFrameX;
   if ( (signed int)this->uFrameX >= v4 )
@@ -1146,7 +1146,7 @@
     v13 = (signed int)(v8 - pFont->GetLineWidth(Stra)) >> 1;
     if ( v13 < 0 )
       v13 = 0;
-    pFont->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, 640);
+    pFont->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, window->GetWidth());
     v12 += pFont->uFontHeight - uLineSpacing;
     Stra = strtok(0, "\n");
   }
@@ -1789,7 +1789,7 @@
   current_npc_text = (char *)pNPCTopics[pEventCode + 99].pText;
   ContractSelectText(pEventCode);
   pDialogueWindow->Release();
-  pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventCode, 0);
+  pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), 350, WINDOW_MainMenu, pEventCode, 0);
   pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape,                    0, 0, pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); // Cancel
                     pDialogueWindow->CreateButton(  0,   0,   0,  0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0);
                     pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_ClickNPCTopic,             0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0);
@@ -2029,9 +2029,9 @@
         if ( pWindow->Hint != (char *)1 )
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
         pButton = (GUIButton *)pWindow->ptr_1C;
-        if ( pButton->uX >= 0 && pButton->uX <= 640 )
+        if ( pButton->uX >= 0 && pButton->uX <= window->GetWidth() )
         {
-          if ( pButton->uY >= 0 && pButton->uY <= 480 )
+          if ( pButton->uY >= 0 && pButton->uY <= window->GetHeight() )
           {
             pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]);
             viewparams->bRedrawGameUI = 1;
@@ -2264,7 +2264,7 @@
 {
   pEventTimer->Pause();
   modal_window_prev_screen = pCurrentScreen;
-  pModalWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ModalWindow, OnRelease_message, pStrHint);
+  pModalWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_ModalWindow, OnRelease_message, pStrHint);
   pCurrentScreen = SCREEN_MODAL_WINDOW;
 }
 
@@ -2352,7 +2352,7 @@
     if ( mscroll_id <= 782 )
     {
       uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE);
-      pGUIWindow_ScrollWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Scroll, v1 - 700, 0);
+      pGUIWindow_ScrollWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Scroll, v1 - 700, 0);
     }
   }
 }