diff UI/UiGame.cpp @ 2155:0a1438c16c2b

Render decoupling.
author Nomad
date Thu, 09 Jan 2014 17:29:17 +0200
parents d28d3c006077
children 00bd098f6435
line wrap: on
line diff
--- a/UI/UiGame.cpp	Thu Jan 09 14:36:48 2014 +0200
+++ b/UI/UiGame.cpp	Thu Jan 09 17:29:17 2014 +0200
@@ -1139,7 +1139,7 @@
 }
 // 5C35BC: using guessed type int bForceDrawFooter;
 //----- (00420EFF) --------------------------------------------------------
-void  GameUI_WritePointedObjectStatusString()
+void GameUI_WritePointedObjectStatusString()
 {
   int v1; // ebx@6
   GUIWindow *pWindow; // edi@7
@@ -1173,7 +1173,7 @@
     //окно(область) игры----------------------------------
     if ( pCurrentScreen == SCREEN_GAME )
     {
-      if ( pRenderer->pRenderD3D )  // inlined mm8::4C1E01
+      //if ( pRenderer->pRenderD3D )  // inlined mm8::4C1E01
       {
         v18 = pGame->pVisInstance->get_picked_object_zbuf_val();
         if ( pX < (unsigned int)pViewport->uScreen_TL_X || pX > (unsigned int)pViewport->uScreen_BR_X
@@ -1194,8 +1194,8 @@
           return;
         }
       }
-      else
-        v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
+      /*else
+        v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];*/
       pMouse->uPointingObjectID = (unsigned __int16)v18;
       v19 = (signed)PID_ID(v18);
       //For Items------------------------------------
@@ -1663,10 +1663,10 @@
         v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID);
       else
         v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID);
-      if ( pRenderer->pRenderD3D )
+      //if ( pRenderer->pRenderD3D )
         pRenderer->DrawTextureIndexed(8, 8, v7);
-      else
-        pRenderer->DrawTextureTransparent(8, 8, v7);
+      /*else
+        pRenderer->DrawTextureTransparent(8, 8, v7);*/
     }
     if ( pParty->WaterWalkActive() )
     {
@@ -1674,10 +1674,10 @@
         v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID);
       else
         v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID);
-      if ( pRenderer->pRenderD3D )
+      //if ( pRenderer->pRenderD3D )
         pRenderer->DrawTextureIndexed(396, 8, v9);
-      else
-        pRenderer->DrawTextureTransparent(396, 8, v9);
+      /*else
+        pRenderer->DrawTextureTransparent(396, 8, v9);*/
     }
   }
   for (uint i = 0; i < 4; ++i)
@@ -1719,7 +1719,7 @@
     {
       pPortrait = pTexture_PlayerFaceEradicated;
       if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
-        pRenderer->_4A6E7E(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
+        pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
       else
         pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
       if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
@@ -1732,7 +1732,7 @@
     {
       pPortrait = pTexture_PlayerFaceDead;
       if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
-        pRenderer->_4A6E7E(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
+        pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
       else
         pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
       if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
@@ -1759,7 +1759,7 @@
       pPlayer->field_1AA2 = pFrame->uTextureID - 1;
       pPortrait = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID];
       if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
-        pRenderer->_4A6E7E(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
+        pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
       else
         pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
       if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
@@ -2042,8 +2042,8 @@
         //if (uWizardEyeSkillLevel == 1
         pPoint_X = uCenterX + ((unsigned __int64)((pSpriteObjects[i].vPosition.x - pParty->vPosition.x) * (signed __int64)uZoom) >> 16);
         pPoint_Y = uCenterY - ((signed __int64)((pSpriteObjects[i].vPosition.y - pParty->vPosition.y) * (signed __int64)uZoom) >> 16);
-        if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z &&
-             pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w)
+        //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z &&
+        //     pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w)
         {
           if (pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE)
           {
@@ -2072,8 +2072,8 @@
       {
         pPoint_X = uCenterX + ((unsigned __int64)(( pActors[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16);
         pPoint_Y = uCenterY - ((unsigned __int64)(( pActors[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16);
-        if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z
-          && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w )
+        //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z
+        //  && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w )
         {
           pColor = ui_game_minimap_actor_friendly_color;
           if ( BYTE3(pActors[i].uAttributes) & 1 )
@@ -2102,8 +2102,8 @@
       {
         pPoint_X = uCenterX + ((unsigned __int64)((pLevelDecorations[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16);
         pPoint_Y = uCenterY - ((unsigned __int64)((pLevelDecorations[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16);
-        if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z
-          && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w )
+        //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z
+        //  && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w )
         {
           if ( (signed int)uZoom > 512 )
           {