diff Arcomage.cpp @ 2209:3664342f5d93

DrawCardsRectangles continue
author Ritor1
date Wed, 12 Feb 2014 17:32:47 +0600
parents 9bd7522cdbbb
children 05e74b19991d
line wrap: on
line diff
--- a/Arcomage.cpp	Wed Feb 12 16:33:12 2014 +0600
+++ b/Arcomage.cpp	Wed Feb 12 17:32:47 2014 +0600
@@ -2693,135 +2693,94 @@
 //----- (0040BB67) --------------------------------------------------------
 signed int DrawCardsRectangles( int player_num )
 {
-//int v1; // esi@1
 signed int result; // eax@1
-int v3; // ebx@1
-char v4; // zf@1
 int v5; // eax@3
-int v6; // eax@4
 int v7; // ecx@6
-char *v8; // eax@6
-int v9; // eax@10
 int v10; // ecx@10
 int v11; // eax@10
-char v12; // ch@2@11
-int v13; // ST00_4@12
-unsigned __int16 v14; // ax@12
-int v15; // eax@13
 int v16; // ecx@13
 int v17; // eax@13
-char v18; // al@16
-char v19; // ch@2@16
 int v20; // ST00_4@19
-unsigned __int16 v21; // ax@19
 RECT pXYZW; // [sp+Ch] [bp-3Ch]@3
 stru273 v26; // [sp+1Ch] [bp-2Ch]@2
-int v25; // [sp+2Ch] [bp-1Ch]@3
 __int32 var18; // [sp+30h] [bp-18h]@3
-int i; // [sp+34h] [bp-14h]@4
 int v28; // [sp+38h] [bp-10h]@1
 int hand_index; // [sp+3Ch] [bp-Ch]@3
-int v30; // [sp+40h] [bp-8h]@1
-char v31; // [sp+44h] [bp-4h]@12
-char v32; // [sp+45h] [bp-3h]@12
-char v33; // [sp+46h] [bp-2h]@12
-
-__debugbreak(); // need do fix rectangle not fit to card
-
-v30 = 0;
-result = -1;
-//v3 = 188 * a1;
-
-//v4 = LOBYTE(am_Players[a1].field_20) == 0;
-v28 = -1;
-if ( am_Players[player_num].IsHisTurn )
+
+//__debugbreak(); // need do fix rectangle not fit to card
+
+  //v30 = 0;
+  result = -1;
+  //v3 = 188 * a1;
+
+  //v4 = LOBYTE(am_Players[a1].field_20) == 0;
+  v28 = -1;
+  if ( am_Players[player_num].IsHisTurn )
+  {
+    if ( v26._40DD2F() )
     {
-    if ( v26._40DD2F() )
+      v5 = GetPlayerHandCardCount(player_num);
+      pXYZW.top = 327;
+      pXYZW.bottom = 455;
+      pXYZW.left = (640 - 96 * v5) / (v5 + 1);
+      var18 = pXYZW.left + 96;
+      pXYZW.right = pXYZW.left + 96;
+      if ( v5 > 0 )
+      {
+        // v6 = 47 * v1;
+        // for ( i = player_num; ; v6 = i )
+        for( hand_index = 0; hand_index < v5; hand_index++)
         {
-        v5 = GetPlayerHandCardCount(player_num);
-        hand_index = 0;
-        v25 = v5;
-        pXYZW.top = 327;
-        pXYZW.bottom = 455;
-        pXYZW.left = (640 - 96 * v5) / (v5 + 1);
-        var18 = pXYZW.left + 96;
-        pXYZW.right = pXYZW.left + 96;
-        if ( v5 > 0 )
-            {
-           // v6 = 47 * v1;
-           // for ( i = player_num; ; v6 = i )
-            for(;;)
-                {
-                v7 = v30;
-              //  v8 = &am_Players[0].cards_at_hand[v30 + v6];
-
-                for (v7=0; v7<10; ++v7)
-                    {
-                    if (am_Players[player_num].cards_at_hand[v7]!= -1 )
-                        break;
-                    }
-                //if ( *v8 )
-                //    {
-                //    do
-                //        {
-                //        //v8 += 4;
-                //        ++v7;
-                //        }
-                //        while ( *v8 == -1 );
-                        v30 = v7;
-                  //  }
-                if ( am_byte_4E185D )
-                    {
-                 //   v9 = v3 + 8 * v7;
-                    v10 = am_Players[player_num].card_shift[v7].x;//*(am_player[0].arr_6C[0] + v9);
-                    v11 = am_Players[player_num].card_shift[v7].y;//*(&am_player[0].arr_6C[0][1] + v9);
-                    pXYZW.left += v10;
-                    pXYZW.right += v10;
-                    pXYZW.top += v11;
-                    pXYZW.bottom += v11;
-                    }
-                if (v26.Inside(&pXYZW) )
-                    break;
-           
-                v13=0;
-                v14 = R8G8B8_to_TargetFormat(v13);
-                DrawRect(&pXYZW, v14, 0);
-                pXYZW.left += var18;
-                pXYZW.right += var18;
-                if ( am_byte_4E185D )
-                    {
-                    v16 = am_Players[player_num].card_shift[v30].x;//*(am_player[0].arr_6C[0] + v15);
-                    v17 = am_Players[player_num].card_shift[v30].y;//*(&am_player[0].arr_6C[0][1] + v15);
-                    pXYZW.left -= v16;
-                    pXYZW.right -= v16;
-                    pXYZW.top -= v17;
-                    pXYZW.bottom -= v17;
-                    }
-                ++v30;
-                ++hand_index;
-                if ( hand_index >= v25 )
-                    return v28;
-                }
-            v28 = hand_index;
-            v18 = CanCardBePlayed(player_num, hand_index);
-            if ( v18 )
-                {
-                 v20=0x00FFFFFF;
-                }
+          //  v8 = &am_Players[0].cards_at_hand[v30 + v6];
+          for ( v7 = 0; v7 < 10; ++v7 )
+          {
+            if (am_Players[player_num].cards_at_hand[v7]!= -1 )
+              break;
+          }
+          //if ( *v8 )
+          //    {
+          //    do
+          //        {
+          //        //v8 += 4;
+          //        ++v7;
+          //        }
+          //        while ( *v8 == -1 );
+          //v30 = v7;
+          //  }
+          if ( am_byte_4E185D )
+          {
+            pXYZW.left += am_Players[player_num].card_shift[v7].x;
+            pXYZW.right += am_Players[player_num].card_shift[v7].x;
+            pXYZW.top += am_Players[player_num].card_shift[v7].y;
+            pXYZW.bottom += am_Players[player_num].card_shift[v7].y;
+          }
+          if (v26.Inside(&pXYZW) )
+          {
+            if ( CanCardBePlayed(player_num, hand_index) )
+              v20 = 0x00FFFFFF;//белый цвет
             else
-                {
-                v20=0x000000FF;
-                }
-           
-            v21 = R8G8B8_to_TargetFormat(v20);
-            DrawRect(&pXYZW, v21, 0);
-            }
+              v20 = 0x000000FF;//красный цвет
+            DrawRect(&pXYZW, R8G8B8_to_TargetFormat(v20), 0);
+            return hand_index;
+          }
+          DrawRect(&pXYZW, R8G8B8_to_TargetFormat(0), 0);//рамка чёрного цвета
+          pXYZW.left += var18;
+          pXYZW.right += var18;
+          if ( am_byte_4E185D )
+          {
+            v16 = am_Players[player_num].card_shift[v7].x;//*(am_player[0].arr_6C[0] + v15);
+            v17 = am_Players[player_num].card_shift[v7].y;//*(&am_player[0].arr_6C[0][1] + v15);
+            pXYZW.left -= v16;
+            pXYZW.right -= v16;
+            pXYZW.top -= v17;
+            pXYZW.bottom -= v17;
+          }
         }
-    result = v28;
+      }
     }
-return result;
-
-
+    result = v28;
+  }
+  return result;
 }
 // 4E185D: using guessed type char am_byte_4E185D;