diff GUI/UI/UiGame.cpp @ 2573:0c67be4ec900

DrawTextureIndexed renamed to DrawTextureTransparentColorKey Changing more class Texture to class Image.
author a.parshin
date Sat, 05 Mar 2016 16:25:53 +0200
parents d87bfbd3bb3b
children dd36326a9994
line wrap: on
line diff
--- a/GUI/UI/UiGame.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UiGame.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -109,7 +109,7 @@
 {
 // -----------------------------------
 // 004156F0 GUI_UpdateWindows --- part
-    pRenderer->DrawTextureIndexed(
+    pRenderer->DrawTextureTransparentColorKey(
         pViewport->uViewportTL_Y,
         pViewport->uViewportTL_X,
         pIcons_LOD->GetTexture(uTextureID_Options)
@@ -221,10 +221,10 @@
         uGameMenuUI_CurentlySelectedKeyIdx = -1;
         pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
     }
-    pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Optkb[0]));//draw base texture
+    pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_Optkb[0]));//draw base texture
     if (KeyboardPageNum == 1)
     {
-        pRenderer->DrawTextureIndexed(19, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[3]));
+        pRenderer->DrawTextureTransparentColorKey(19, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[3]));
 
         pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, ui_gamemenu_keys_action_name_color, "ÂÏÅШÄ", 0, 0, 0);
         pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, GameMenuUI_GetKeyBindingColor(0), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[0]), 0, 0, 0);
@@ -257,7 +257,7 @@
     }
     else
     {
-        pRenderer->DrawTextureIndexed(127, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[4]));
+        pRenderer->DrawTextureTransparentColorKey(127, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[4]));
 
         pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, ui_gamemenu_keys_action_name_color, "Á. ÑÏÐÀÂÊÀ", 0, 0, 0);
         pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, GameMenuUI_GetKeyBindingColor(14), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[14]), 0, 0, 0);
@@ -345,10 +345,10 @@
 // 004156F0 GUI_UpdateWindows --- part
     GUIWindow msg_window; // [sp+8h] [bp-54h]@3
 
-    pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(optvid_base_texture_id));//draw base texture
+    pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(optvid_base_texture_id));//draw base texture
     //if ( !pRenderer->bWindowMode && pRenderer->IsGammaSupported() )
     {
-        pRenderer->DrawTextureIndexed(17 * uGammaPos + 42, 162, pIcons_LOD->GetTexture(pTextureIDs_GammaPositions[uGammaPos]));
+        pRenderer->DrawTextureTransparentColorKey(17 * uGammaPos + 42, 162, pIcons_LOD->GetTexture(pTextureIDs_GammaPositions[uGammaPos]));
         pRenderer->DrawTextureNew(274/640.0f, 169/480.0f, gamma_preview_image);
         msg_window.uFrameX = 22;
         msg_window.uFrameY = 190;
@@ -361,18 +361,18 @@
 
     /*if (!pRenderer->pRenderD3D)
     {
-    pRenderer->DrawTextureIndexed(20, 281, pIcons_LOD->GetTexture(not_available_bloodsplats_texture_id));
-    pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(not_available_us_colored_lights_texture_id));
-    pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(not_available_tinting_texture_id));
+    pRenderer->DrawTextureTransparentColorKey(20, 281, pIcons_LOD->GetTexture(not_available_bloodsplats_texture_id));
+    pRenderer->DrawTextureTransparentColorKey(20, 303, pIcons_LOD->GetTexture(not_available_us_colored_lights_texture_id));
+    pRenderer->DrawTextureTransparentColorKey(20, 325, pIcons_LOD->GetTexture(not_available_tinting_texture_id));
     }
     else*/
   {
       if (pEngine->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS)
-          pRenderer->DrawTextureIndexed(20, 281, pIcons_LOD->GetTexture(bloodsplats_texture_id));
+          pRenderer->DrawTextureTransparentColorKey(20, 281, pIcons_LOD->GetTexture(bloodsplats_texture_id));
       if (pRenderer->bUseColoredLights)
-          pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(us_colored_lights_texture_id));
+          pRenderer->DrawTextureTransparentColorKey(20, 303, pIcons_LOD->GetTexture(us_colored_lights_texture_id));
       if (pRenderer->bTinting)
-          pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(tinting_texture_id));
+          pRenderer->DrawTextureTransparentColorKey(20, 325, pIcons_LOD->GetTexture(tinting_texture_id));
   }
 }
 
@@ -509,24 +509,24 @@
 {
 // -----------------------------------
 // 004156F0 GUI_UpdateWindows --- part
-    pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Options));
-    pRenderer->DrawTextureIndexed(8, 132, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_Background));
+    pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_Options));
+    pRenderer->DrawTextureTransparentColorKey(8, 132, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_Background));
 
     switch (uTurnSpeed)
     {
-        case 64:   pRenderer->DrawTextureIndexed(BtnTurnCoord[1], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])); break;
-        case 128:  pRenderer->DrawTextureIndexed(BtnTurnCoord[2], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])); break;
-        default:   pRenderer->DrawTextureIndexed(BtnTurnCoord[0], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])); break;
+        case 64:   pRenderer->DrawTextureTransparentColorKey(BtnTurnCoord[1], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])); break;
+        case 128:  pRenderer->DrawTextureTransparentColorKey(BtnTurnCoord[2], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])); break;
+        default:   pRenderer->DrawTextureTransparentColorKey(BtnTurnCoord[0], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])); break;
     }
 
-    if (bWalkSound)  pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound));
-    if (bShowDamage) pRenderer->DrawTextureIndexed(128, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage));
-    if (bFlipOnExit) pRenderer->DrawTextureIndexed(128, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit));
-    if (bAlwaysRun)  pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun));
+    if (bWalkSound)  pRenderer->DrawTextureTransparentColorKey(20, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound));
+    if (bShowDamage) pRenderer->DrawTextureTransparentColorKey(128, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage));
+    if (bFlipOnExit) pRenderer->DrawTextureTransparentColorKey(128, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit));
+    if (bAlwaysRun)  pRenderer->DrawTextureTransparentColorKey(20, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun));
 
-    pRenderer->DrawTextureIndexed(265 + 17 * uSoundVolumeMultiplier, 162, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uSoundVolumeMultiplier]));
-    pRenderer->DrawTextureIndexed(265 + 17 * uMusicVolimeMultiplier, 216, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uMusicVolimeMultiplier]));
-    pRenderer->DrawTextureIndexed(265 + 17 * uVoicesVolumeMultiplier, 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uVoicesVolumeMultiplier]));
+    pRenderer->DrawTextureTransparentColorKey(265 + 17 * uSoundVolumeMultiplier, 162, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uSoundVolumeMultiplier]));
+    pRenderer->DrawTextureTransparentColorKey(265 + 17 * uMusicVolimeMultiplier, 216, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uMusicVolimeMultiplier]));
+    pRenderer->DrawTextureTransparentColorKey(265 + 17 * uVoicesVolumeMultiplier, 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uVoicesVolumeMultiplier]));
 }
 
 
@@ -718,7 +718,7 @@
         popup_window.uFrameZ = popup_window.uFrameX + 399;
         popup_window.DrawMessageBox(0);
         sprintfex(pTmpBuf2.data(), "NPC%03d", pNPC->uPortraitID);
-        pRenderer->DrawTextureIndexed(popup_window.uFrameX + 22, popup_window.uFrameY + 36,
+        pRenderer->DrawTextureTransparentColorKey(popup_window.uFrameX + 22, popup_window.uFrameY + 36,
             (Texture *)(pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE) != -1
             ? &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE)] : 0));
         if ( pNPC->uProfession )
@@ -774,7 +774,7 @@
   v9 = 0;
   pDialogueNPCPortraits[0] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
   dword_591084 = areWeLoadingTexture;
-  right_panel_loop = right_panel;
+
   if ( !pNPCInfo->Hired() && pNPCInfo->Location2D >= 0 )
   {
     if ( (signed int)pParty->GetPartyFame() <= pNPCInfo->fame
@@ -871,10 +871,10 @@
   pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID);
   window.uFrameWidth -= 10;
   window.uFrameZ -= 10;
-  pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureIndexedAlpha(468, 0, right_panel_loop);
-  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]);
+  pRenderer->DrawTextureTransparentColorKey(477, 0, pTexture_Dialogue_Background);
+  pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame);
+  pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0));
+  pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]);
 
   if (pNPC->uProfession)
   {
@@ -966,7 +966,7 @@
     }
     if (uTextureID_Leather != -1)
       pRenderer->GetLeather(8, 352 - pTextHeight, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - pTextHeight);
-    pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
+    pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap);
     pDialogueWindow->DrawText(font, 13, 354 - pTextHeight, 0, FitTextInAWindow(pInString, font,  &window, 13, 0), 0, 0, 0);
   }
   // Right panel(Ïðàâàÿ ïàíåëü)------- 
@@ -1126,7 +1126,7 @@
       window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pButton->pButtonName, 3);
     }
   }
-  pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
+  pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
 }
 
 //----- (00444FBE) --------------------------------------------------------
@@ -1149,7 +1149,7 @@
     pTextHeight = pFontCreate->CalcTextHeight(byte_5B0938.data(), &BranchlessDlg_window, 12, 0) + 7;
   }
   pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight);
-  pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
+  pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap);
   pGUIWindow2->DrawText(pFont, 12, 354 - pTextHeight, 0, FitTextInAWindow(byte_5B0938.data(), pFont, &BranchlessDlg_window, 12, 0), 0, 0, 0);
   pRenderer->DrawTextureNew(0, 352/480.0f, game_ui_statusbar);
   if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
@@ -1411,7 +1411,7 @@
       {
         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->DrawTextureTransparentColorKey(v17 + pHealthBarPos[i], 402, pTextureHealth);
         pRenderer->ResetUIClipRect();
       }
     }
@@ -1425,7 +1425,7 @@
         v17 = 1;
       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->DrawTextureTransparentColorKey(v17 + pManaBarPos[i], 402, pTextureMana);
       pRenderer->ResetUIClipRect();
     }
   }
@@ -1434,7 +1434,7 @@
 //----- (0041B3B6) --------------------------------------------------------
 void GameUI_DrawRightPanel()
 {
-  pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportBR_X, 0, right_panel);
+  pRenderer->DrawTextureAlphaNew(pViewport->uViewportBR_X/640.0f, 0, game_ui_right_panel_frame);
 }
 
 //----- (0041B3E2) --------------------------------------------------------
@@ -1930,7 +1930,7 @@
       else
         spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID);
       //if ( pRenderer->pRenderD3D )
-        pRenderer->DrawTextureIndexed(8, 8, spell_texture);
+        pRenderer->DrawTextureTransparentColorKey(8, 8, spell_texture);
       /*else
         pRenderer->DrawTextureIndexedAlpha(8, 8, v7);*/
     }
@@ -1941,7 +1941,7 @@
       else
         spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID);
       //if ( pRenderer->pRenderD3D )
-        pRenderer->DrawTextureIndexed(396, 8, spell_texture);
+        pRenderer->DrawTextureTransparentColorKey(396, 8, spell_texture);
       /*else
         pRenderer->DrawTextureIndexedAlpha(396, 8, v9);*/
     }
@@ -1949,13 +1949,13 @@
   for (uint i = 0; i < 4; ++i)
   {
     if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime )
-      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands));
+      pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands));
     if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime )
-      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless));
+      pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless));
     if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime )
-      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation));
+      pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation));
     if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime )
-      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection));
+      pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection));
   }
 }
 
@@ -2400,7 +2400,7 @@
   }
   pRenderer->DrawTextureIndexedAlpha(468, 0, minimap_loop);
   pRenderer->SetUIClipRect(541, 0, 567, 480);
-  pRenderer->DrawTextureIndexed(floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285, 136, _5079B4_compass);
+  pRenderer->DrawTextureTransparentColorKey(floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285, 136, _5079B4_compass);
   pRenderer->ResetUIClipRect();
 }
 
@@ -2469,13 +2469,13 @@
       if ( (unsigned __int8)pTmpBuf[i] >= 2 )
       {
         sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[i] + 499].uPortraitID);
-        pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
+        pRenderer->DrawTextureTransparentColorKey(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
                       pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)));
       }
       else
       {
         sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].uPortraitID);
-        pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
+        pRenderer->DrawTextureTransparentColorKey(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
                    pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)));
         if ( pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_A == 1 )
         {