diff 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
line wrap: on
line diff
--- a/mm7_1.cpp	Fri Feb 22 17:56:00 2013 +0200
+++ b/mm7_1.cpp	Fri Feb 22 18:40:38 2013 +0200
@@ -5,6 +5,8 @@
 */
 
 //#include <defs.h>
+#include <assert.h>
+
 #include "MM7.h"
 
 #include "MapInfo.h"
@@ -6115,21 +6117,16 @@
 // 4E28F8: using guessed type int pCurrentScreen;
 
 //----- (004226EF) --------------------------------------------------------
-void __fastcall SetUserInterface(int a1, bool bReplace)
+void SetUserInterface(PartyAlignment align, bool bReplace)
 {
-  int v2; // ecx@2
   unsigned int v3; // eax@7
   unsigned __int16 v4; // dx@7
   unsigned __int16 v5; // cx@7
   unsigned __int16 v6; // [sp-4h] [bp-14h]@7
 
-  if ( a1 )
-  {
-    v2 = a1 - 1;
-    if ( v2 )
-    {
-      if ( v2 != 1 )
-        return;
+
+    if (align == PartyAlignment_Evil)
+    {
       if ( bReplace )
       {
         pTexture_RightFrame->Reload("ib-r-C.pcx");
@@ -6213,7 +6210,7 @@
       v6 = 0;
       v5 = 10;
     }
-    else
+    else if (align == PartyAlignment_Neutral)
     {
       if ( bReplace )
       {
@@ -6309,8 +6306,7 @@
       v5 = 230;
       v6 = 193;
     }
-  }
-  else
+  else if (align == PartyAlignment_Good)
   {
     if ( bReplace )
     {
@@ -6361,6 +6357,8 @@
     v4 = 225;
     v6 = 255;
   }
+  else assert(false);
+
   uGameUIFontMain = v3;
   uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v5, v4, v6);
 }