diff GUI/UI/UiGame.cpp @ 2524:c7264ab7132f

Main menu rendered using d3d11
author a.parshin
date Fri, 10 Oct 2014 17:42:05 +0300
parents 56b6d74ce716
children a902abdfc7f2
line wrap: on
line diff
--- a/GUI/UI/UiGame.cpp	Thu Oct 09 23:33:36 2014 +0300
+++ b/GUI/UI/UiGame.cpp	Fri Oct 10 17:42:05 2014 +0300
@@ -382,7 +382,7 @@
   window.uFrameWidth -= 10;
   window.uFrameZ -= 10;
   pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_right_panel_loop != -1 ? &pIcons_LOD->pTextures[uTextureID_right_panel_loop] : 0));
+  pRenderer->DrawTextureIndexedAlpha(468, 0, (Texture *)(uTextureID_right_panel_loop != -1 ? &pIcons_LOD->pTextures[uTextureID_right_panel_loop] : 0));
   pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0));
   pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]);
 
@@ -799,7 +799,7 @@
       v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1];
   }
 
-  pRenderer->DrawTextureTransparent(window->uFrameX + 24, window->uFrameY + 24, v13);
+  pRenderer->DrawTextureIndexedAlpha(window->uFrameX + 24, window->uFrameY + 24, v13);
 
   sprintfex(pTmpBuf.data(), "\f%05d", ui_character_header_text_color);
   sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s"
@@ -976,9 +976,9 @@
     byte_50697C = !byte_50697C;
     if ( byte_50697C && pCurrentScreen != SCREEN_REST )
     {
-      if (bFlashQuestBook)     pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A));
-      if (bFlashAutonotesBook) pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A));
-      if (bFlashHistoryBook)   pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A));
+      if (bFlashQuestBook)     pRenderer->DrawTextureIndexedAlpha(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A));
+      if (bFlashAutonotesBook) pRenderer->DrawTextureIndexedAlpha(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A));
+      if (bFlashHistoryBook)   pRenderer->DrawTextureIndexedAlpha(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A));
     }
     else
     {
@@ -1032,10 +1032,10 @@
         pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarRed);
       if( v3 > 0.0 )
       {
-        pRenderer->SetTextureClipRect(v17 + pHealthBarPos[i], (signed __int64)((1.0 - v3) * pTextureHealth->uTextureHeight) + 402,
+        pRenderer->SetUIClipRect(v17 + pHealthBarPos[i], (signed __int64)((1.0 - v3) * pTextureHealth->uTextureHeight) + 402,
                                           v17 + pHealthBarPos[i] + pTextureHealth->uTextureWidth, pTextureHealth->uTextureHeight + 402);
         pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[i], 402, pTextureHealth);
-        pRenderer->ResetTextureClipRect();
+        pRenderer->ResetUIClipRect();
       }
     }
     if (pParty->pPlayers[i].sMana > 0)
@@ -1046,10 +1046,10 @@
       int v17 = 0;
       if (i == 2)
         v17 = 1;
-      pRenderer->SetTextureClipRect(v17 + pManaBarPos[i], (signed __int64)((1.0 - v7) * pTextureMana->uTextureHeight) + 402,
+      pRenderer->SetUIClipRect(v17 + pManaBarPos[i], (signed __int64)((1.0 - v7) * pTextureMana->uTextureHeight) + 402,
                                     v17 + pManaBarPos[i] + pTextureMana->uTextureWidth, pTextureMana->uTextureHeight + 402);
       pRenderer->DrawTextureIndexed(v17 + pManaBarPos[i], 402, pTextureMana);
-      pRenderer->ResetTextureClipRect();
+      pRenderer->ResetUIClipRect();
     }
   }
 }
@@ -1057,7 +1057,7 @@
 //----- (0041B3B6) --------------------------------------------------------
 void GameUI_DrawRightPanel()
 {
-  pRenderer->DrawTextureTransparent(pViewport->uViewportBR_X, 0, pIcons_LOD->GetTexture(uTextureID_right_panel));
+  pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportBR_X, 0, pIcons_LOD->GetTexture(uTextureID_right_panel));
 }
 
 //----- (0041B3E2) --------------------------------------------------------
@@ -1514,7 +1514,7 @@
 void GameUI_DrawCharacterSelectionFrame()
 {
   if ( uActiveCharacter )
-    pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, 380,
+    pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, 380,
                                       pIcons_LOD->GetTexture(uTextureID_GameUI_CharSelectionFrame));
 }
 
@@ -1552,7 +1552,7 @@
       //if ( pRenderer->pRenderD3D )
         pRenderer->DrawTextureIndexed(8, 8, spell_texture);
       /*else
-        pRenderer->DrawTextureTransparent(8, 8, v7);*/
+        pRenderer->DrawTextureIndexedAlpha(8, 8, v7);*/
     }
     if ( pParty->WaterWalkActive() )
     {
@@ -1563,7 +1563,7 @@
       //if ( pRenderer->pRenderD3D )
         pRenderer->DrawTextureIndexed(396, 8, spell_texture);
       /*else
-        pRenderer->DrawTextureTransparent(396, 8, v9);*/
+        pRenderer->DrawTextureIndexedAlpha(396, 8, v9);*/
     }
   }
   for (uint i = 0; i < 4; ++i)
@@ -1607,7 +1607,7 @@
       if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
         pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
       else
-        pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
+        pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
       if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
          | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime
          | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime )
@@ -1620,7 +1620,7 @@
       if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
         pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
       else
-        pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
+        pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
       if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
          | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime
          | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime )
@@ -1647,7 +1647,7 @@
       if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
         pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
       else
-        pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
+        pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
       if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
          | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime
          | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime )
@@ -1675,7 +1675,7 @@
               if ( pParty->uFlags & 0x20 )
                 pTextureID = dword_5079C8;
             }
-            pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pTurnEngine->pQueue[i].uPackedID)] - 4, 385, pIcons_LOD->GetTexture(pTextureID));
+            pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pTurnEngine->pQueue[i].uPackedID)] - 4, 385, pIcons_LOD->GetTexture(pTextureID));
           }
         }
       }
@@ -1695,7 +1695,7 @@
           if ( pParty->uFlags & 0x20 )
             pTextureID = dword_5079C8;
         }
-        pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, 385, pIcons_LOD->GetTexture(pTextureID));
+        pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, 385, pIcons_LOD->GetTexture(pTextureID));
       }
     }
   }
@@ -1925,7 +1925,7 @@
     arrow_idx = 0;
   if ( (signed int)rotate < 128 || (signed int)rotate > 1920 )
     arrow_idx = 7;
-  pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx]));//стрелка
+  pRenderer->DrawTextureIndexedAlpha(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx]));//стрелка
 
   //draw objects on the minimap
   if ( bWizardEyeActive )
@@ -2014,10 +2014,10 @@
       }
     }
   }
-  pRenderer->DrawTextureTransparent(468, 0, pIcons_LOD->GetTexture(uTextureID_Minimap_Loop));//draw minimap_loop
-  pRenderer->SetTextureClipRect(541, 0, 567, 480);
+  pRenderer->DrawTextureIndexedAlpha(468, 0, pIcons_LOD->GetTexture(uTextureID_Minimap_Loop));//draw minimap_loop
+  pRenderer->SetUIClipRect(541, 0, 567, 480);
   pRenderer->DrawTextureIndexed(floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285, 136, pIcons_LOD->GetTexture(uTextureID_Compas));//draw compas
-  pRenderer->ResetTextureClipRect();
+  pRenderer->ResetUIClipRect();
 }
 
 //----- (00441498) --------------------------------------------------------
@@ -2038,12 +2038,12 @@
     if (pParty->TorchlightActive())
     {
       IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time());
-      pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID));
+      pRenderer->DrawTextureIndexedAlpha(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID));
     }
     if (pParty->WizardEyeActive())
     {
       IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time());
-      pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID));
+      pRenderer->DrawTextureIndexedAlpha(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID));
     }
   }
 }
@@ -2105,7 +2105,7 @@
                 break;
             }
           }
-          pRenderer->DrawTextureTransparent(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
+          pRenderer->DrawTextureIndexedAlpha(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
                         &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(v13, uFrameID)->uTextureID]);
         }
       }