comparison mm7_1.cpp @ 373:edd2d8b7e3c4

Interface reloading fix & party alignment enum
author Nomad
date Fri, 22 Feb 2013 18:40:38 +0200
parents 0f35f908547f
children 243418228760
comparison
equal deleted inserted replaced
372:6a2b4d1be013 373:edd2d8b7e3c4
3 3
4 Detected compiler: Visual C++ 4 Detected compiler: Visual C++
5 */ 5 */
6 6
7 //#include <defs.h> 7 //#include <defs.h>
8 #include <assert.h>
9
8 #include "MM7.h" 10 #include "MM7.h"
9 11
10 #include "MapInfo.h" 12 #include "MapInfo.h"
11 #include "Game.h" 13 #include "Game.h"
12 #include "GUIWindow.h" 14 #include "GUIWindow.h"
6113 return false; 6115 return false;
6114 } 6116 }
6115 // 4E28F8: using guessed type int pCurrentScreen; 6117 // 4E28F8: using guessed type int pCurrentScreen;
6116 6118
6117 //----- (004226EF) -------------------------------------------------------- 6119 //----- (004226EF) --------------------------------------------------------
6118 void __fastcall SetUserInterface(int a1, bool bReplace) 6120 void SetUserInterface(PartyAlignment align, bool bReplace)
6119 { 6121 {
6120 int v2; // ecx@2
6121 unsigned int v3; // eax@7 6122 unsigned int v3; // eax@7
6122 unsigned __int16 v4; // dx@7 6123 unsigned __int16 v4; // dx@7
6123 unsigned __int16 v5; // cx@7 6124 unsigned __int16 v5; // cx@7
6124 unsigned __int16 v6; // [sp-4h] [bp-14h]@7 6125 unsigned __int16 v6; // [sp-4h] [bp-14h]@7
6125 6126
6126 if ( a1 ) 6127
6127 { 6128 if (align == PartyAlignment_Evil)
6128 v2 = a1 - 1; 6129 {
6129 if ( v2 )
6130 {
6131 if ( v2 != 1 )
6132 return;
6133 if ( bReplace ) 6130 if ( bReplace )
6134 { 6131 {
6135 pTexture_RightFrame->Reload("ib-r-C.pcx"); 6132 pTexture_RightFrame->Reload("ib-r-C.pcx");
6136 pTexture_BottomFrame->Reload("ib-b-C.pcx"); 6133 pTexture_BottomFrame->Reload("ib-b-C.pcx");
6137 pTexture_TopFrame->Reload("ib-t-C.pcx"); 6134 pTexture_TopFrame->Reload("ib-t-C.pcx");
6211 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xC8u, 0, 0); 6208 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xC8u, 0, 0);
6212 v4 = 0; 6209 v4 = 0;
6213 v6 = 0; 6210 v6 = 0;
6214 v5 = 10; 6211 v5 = 10;
6215 } 6212 }
6216 else 6213 else if (align == PartyAlignment_Neutral)
6217 { 6214 {
6218 if ( bReplace ) 6215 if ( bReplace )
6219 { 6216 {
6220 pTexture_RightFrame->Reload("ib-r-a.pcx"); 6217 pTexture_RightFrame->Reload("ib-r-a.pcx");
6221 pTexture_BottomFrame->Reload("ib-b-a.pcx"); 6218 pTexture_BottomFrame->Reload("ib-b-a.pcx");
6307 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); 6304 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0);
6308 v4 = 214; 6305 v4 = 214;
6309 v5 = 230; 6306 v5 = 230;
6310 v6 = 193; 6307 v6 = 193;
6311 } 6308 }
6312 } 6309 else if (align == PartyAlignment_Good)
6313 else
6314 { 6310 {
6315 if ( bReplace ) 6311 if ( bReplace )
6316 { 6312 {
6317 pTexture_RightFrame->Reload("ib-r-B.pcx"); 6313 pTexture_RightFrame->Reload("ib-r-B.pcx");
6318 pTexture_BottomFrame->Reload("ib-b-B.pcx"); 6314 pTexture_BottomFrame->Reload("ib-b-B.pcx");
6359 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xC8u); 6355 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xC8u);
6360 v5 = 255; 6356 v5 = 255;
6361 v4 = 225; 6357 v4 = 225;
6362 v6 = 255; 6358 v6 = 255;
6363 } 6359 }
6360 else assert(false);
6361
6364 uGameUIFontMain = v3; 6362 uGameUIFontMain = v3;
6365 uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v5, v4, v6); 6363 uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v5, v4, v6);
6366 } 6364 }
6367 6365
6368 6366