diff UIBooks.cpp @ 949:c0d0656aa662

Awards
author Nomad
date Wed, 01 May 2013 20:04:24 +0200
parents 5a2dbb00c399
children 9a5db2cf999a
line wrap: on
line diff
--- a/UIBooks.cpp	Wed May 01 17:31:10 2013 +0200
+++ b/UIBooks.cpp	Wed May 01 20:04:24 2013 +0200
@@ -409,7 +409,7 @@
     v0 = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(v0, v11, v13);
-  if ( dword_506544 || dword_506528 + awards_count >= awards_count2 )
+  if ( dword_506544 || dword_506528 + num_achieved_awards >= num_achieved_awards_2 )
   {
     v14 = pTex_tab_an_7a__zoot_off;
     v12 = pViewport->uViewportTL_Y + 38;
@@ -424,7 +424,7 @@
   pRenderer->DrawTextureTransparent(v1, v12, v14);
   if ( !byte_5C6D50[dword_506528] )
   {
-    v2 = achievedAwardsIndex[dword_506528];
+    v2 = achieved_awards[dword_506528];
     a1.uFrameWidth = game_viewport_width;
     a1.uFrameX = game_viewport_x;
     a1.uFrameY = game_viewport_y;
@@ -443,12 +443,12 @@
   a1.uFrameZ = 407;
   a1.uFrameHeight = v4 * 264 / v4;
   a1.uFrameW = a1.uFrameHeight + 69;
-  if ( dword_506544 && dword_506528 + awards_count < awards_count2 )
+  if ( dword_506544 && dword_506528 + num_achieved_awards < num_achieved_awards_2 )
   {
     pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
     v5 = dword_50651C++;
-    dword_506528 += awards_count;
-    byte_506130[v5] = awards_count;
+    dword_506528 += num_achieved_awards;
+    byte_506130[v5] = num_achieved_awards;
   }
   if ( dword_506548 && dword_50651C )
   {
@@ -456,15 +456,15 @@
     --dword_50651C;
     dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
   }
-  if ( !awards_count || dword_506528 < 1 )
+  if ( !num_achieved_awards || dword_506528 < 1 )
   {
     dword_506528 = 0;
     dword_50651C = 0;
   }
   dword_506544 = 0;
-  v6 = achievedAwardsIndex[dword_506528];
+  v6 = achieved_awards[dword_506528];
   dword_506548 = 0;
-  awards_count = 0;
+  num_achieved_awards = 0;
   //v7 = *pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6);
   v7 = (int)pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6);
   v8 = BuilDialogueString(
@@ -478,7 +478,7 @@
   {
     v9 = pAutonoteFont->_44C6C2(v8, &a1, 1u, (unsigned __int8)byte_5C6D50[dword_506528]);
     LOBYTE(v8) = a1.DrawText(pAutonoteFont, 1, 0, 0, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, 0);
-    ++awards_count;
+    ++num_achieved_awards;
   }
   return (char)v8;
 }
@@ -515,7 +515,7 @@
     v0 = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(v0, v8, v10);
-  if ( dword_506544 || dword_506528 + awards_count >= awards_count2 )
+  if ( dword_506544 || dword_506528 + num_achieved_awards >= num_achieved_awards_2 )
   {
     v11 = pTex_tab_an_7a__zoot_off;
     v9 = pViewport->uViewportTL_Y + 38;
@@ -541,12 +541,12 @@
   a1.uFrameHeight = 264;
   a1.uFrameZ = 407;
   a1.uFrameW = 333;
-  if ( dword_506544 && dword_506528 + awards_count < awards_count2 )
+  if ( dword_506544 && dword_506528 + num_achieved_awards < num_achieved_awards_2 )
   {
     pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
     v2 = dword_50651C++;
-    dword_506528 += awards_count;
-    byte_506130[v2] = awards_count;
+    dword_506528 += num_achieved_awards;
+    byte_506130[v2] = num_achieved_awards;
   }
   if ( dword_506548 && dword_50651C )
   {
@@ -554,7 +554,7 @@
     --dword_50651C;
     dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
   }
-  if ( !awards_count || (v3 = dword_506528, dword_506528 < 1) )
+  if ( !num_achieved_awards || (v3 = dword_506528, dword_506528 < 1) )
   {
     v3 = 0;
     dword_50651C = 0;
@@ -562,11 +562,11 @@
   }
   dword_506544 = 0;
   dword_506548 = 0;
-  awards_count = 0;
-  while ( v3 < awards_count2 )
+  num_achieved_awards = 0;
+  while ( v3 < num_achieved_awards_2 )
   {
-    v4 = achievedAwardsIndex[v3];
-    ++awards_count;
+    v4 = achieved_awards[v3];
+    ++num_achieved_awards;
     v5 = pQuestTable[v4-1];//(&dword_722F10)[4 * v4];
     a1.DrawText(pAutonoteFont, 1, 0, 0, pQuestTable[v4-1], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0);
     v6 = pAutonoteFont->CalcTextHeight(v5, &a1, 1, 0);
@@ -633,7 +633,7 @@
     v0 = pViewport->uViewportTL_X + 398;
   }
   pRenderer->DrawTextureTransparent(v0, v17, v24);
-  if ( dword_506544 || dword_506528 + awards_count >= awards_count2 )
+  if ( dword_506544 || dword_506528 + num_achieved_awards >= num_achieved_awards_2 )
   {
     v25 = pTex_tab_an_7a__zoot_off;
     v18 = pViewport->uViewportTL_Y + 38;
@@ -807,10 +807,10 @@
   a1.uFrameW = 333;
   if ( v31 )
   {
-    awards_count2 = 0;
+    num_achieved_awards_2 = 0;
     dword_506528 = 0;
     dword_50651C = 0;
-    awards_count = 0;
+    num_achieved_awards = 0;
     v8 = 0;
     do
     {
@@ -823,25 +823,25 @@
         {
           if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v8) && v32 )
           {
-            v9 = awards_count++;
-            achievedAwardsIndex[v9] = (signed __int16)v8;
+            v9 = num_achieved_awards++;
+            achieved_awards[v9] = (AwardType)v8;
           }
         }
       }
       ++v8;
     }
     while ( v8 < 196 );
-    awards_count2 = awards_count;
+    num_achieved_awards_2 = num_achieved_awards;
   }
   else
   {
     if ( dword_506544 )
     {
-      v10 = awards_count + dword_506528;
-      if ( awards_count + dword_506528 < awards_count2 )
+      v10 = num_achieved_awards + dword_506528;
+      if ( num_achieved_awards + dword_506528 < num_achieved_awards_2 )
       {
         v11 = dword_50651C++;
-        byte_506130[v11] = awards_count;
+        byte_506130[v11] = num_achieved_awards;
         dword_506528 = v10;
         pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
       }
@@ -852,7 +852,7 @@
       dword_506528 -= (unsigned __int8)byte_506130[dword_50651C];
       pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
     }
-    if ( !awards_count || dword_506528 < 1 )
+    if ( !num_achieved_awards || dword_506528 < 1 )
     {
       dword_506528 = 0;
       dword_50651C = 0;
@@ -862,16 +862,16 @@
   dword_50652C = 0;
   dword_506544 = 0;
   dword_506548 = 0;
-  awards_count = 0;
+  num_achieved_awards = 0;
   dword_506530 = 0;
   dword_506534 = 0;
   dword_506538 = 0;
   dword_50653C = 0;
   dword_506540 = 0;
-  while ( v12 < awards_count2 )
+  while ( v12 < num_achieved_awards_2 )
   {
-    v13 = achievedAwardsIndex[v12];
-    ++awards_count;
+    v13 = achieved_awards[v12];
+    ++num_achieved_awards;
     //v14 = (&dword_723718_autonote_related)[8 * v13];
 	v14 = pAutonoteTxt[v13-1].pText;
     //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0);
@@ -1199,8 +1199,8 @@
         }
     else
         {
-        black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
-        teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
+        black = TargetColor(0, 0, 0);
+        teal = TargetColor(0, 0xFFu, 0xFFu);
         v7 = pIndoor->pMapOutlines;
         uNumBlueFacesInBLVMinimap = 0;
         v8 = pIndoor->pMapOutlines->uNumOutlines == 0;
@@ -1381,7 +1381,7 @@
             }
         pRenderer->DrawTransparentRedShade(v47, v49, (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0));
         }
-    result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
+    result = TargetColor(0xFFu, 0xFFu, 0xFFu);
     v95 = 0;
     v86 = result;
     if ( (signed int)uNumLevelDecorations > 0 )
@@ -1448,7 +1448,7 @@
         teal = v60 >> 16;
         v63 = (signed __int16)v61;
         a4a = map_texture_16;
-        result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xCu, 0xCu, 0xCu);
+        result = TargetColor(0xCu, 0xCu, 0xCu);
         screenCenter_X = 0;
         for ( i = result; screenCenter_X < (signed int)v95; result = screenCenter_X )
             {