Mercurial > mm7
comparison UI/UiGame.cpp @ 2155:0a1438c16c2b
Render decoupling.
author | Nomad |
---|---|
date | Thu, 09 Jan 2014 17:29:17 +0200 |
parents | d28d3c006077 |
children | 00bd098f6435 |
comparison
equal
deleted
inserted
replaced
2154:9bd7522cdbbb | 2155:0a1438c16c2b |
---|---|
1137 pPrimaryWindow->DrawText(pFontLucida, pFontLucida->AlignText_Center(450, v1) + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); | 1137 pPrimaryWindow->DrawText(pFontLucida, pFontLucida->AlignText_Center(450, v1) + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); |
1138 } | 1138 } |
1139 } | 1139 } |
1140 // 5C35BC: using guessed type int bForceDrawFooter; | 1140 // 5C35BC: using guessed type int bForceDrawFooter; |
1141 //----- (00420EFF) -------------------------------------------------------- | 1141 //----- (00420EFF) -------------------------------------------------------- |
1142 void GameUI_WritePointedObjectStatusString() | 1142 void GameUI_WritePointedObjectStatusString() |
1143 { | 1143 { |
1144 int v1; // ebx@6 | 1144 int v1; // ebx@6 |
1145 GUIWindow *pWindow; // edi@7 | 1145 GUIWindow *pWindow; // edi@7 |
1146 GUIButton *pButton; // ecx@11 | 1146 GUIButton *pButton; // ecx@11 |
1147 int v7; // ecx@19 | 1147 int v7; // ecx@19 |
1171 if ( pX <= 467 && pY <= 351 )//пределы основной области | 1171 if ( pX <= 467 && pY <= 351 )//пределы основной области |
1172 { | 1172 { |
1173 //окно(область) игры---------------------------------- | 1173 //окно(область) игры---------------------------------- |
1174 if ( pCurrentScreen == SCREEN_GAME ) | 1174 if ( pCurrentScreen == SCREEN_GAME ) |
1175 { | 1175 { |
1176 if ( pRenderer->pRenderD3D ) // inlined mm8::4C1E01 | 1176 //if ( pRenderer->pRenderD3D ) // inlined mm8::4C1E01 |
1177 { | 1177 { |
1178 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); | 1178 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); |
1179 if ( pX < (unsigned int)pViewport->uScreen_TL_X || pX > (unsigned int)pViewport->uScreen_BR_X | 1179 if ( pX < (unsigned int)pViewport->uScreen_TL_X || pX > (unsigned int)pViewport->uScreen_BR_X |
1180 || pY < (unsigned int)pViewport->uScreen_TL_Y || pY > (unsigned int)pViewport->uScreen_BR_Y ) | 1180 || pY < (unsigned int)pViewport->uScreen_TL_Y || pY > (unsigned int)pViewport->uScreen_BR_Y ) |
1181 v18 = -1; | 1181 v18 = -1; |
1192 } | 1192 } |
1193 uLastPointedObjectID = pMouse->uPointingObjectID; | 1193 uLastPointedObjectID = pMouse->uPointingObjectID; |
1194 return; | 1194 return; |
1195 } | 1195 } |
1196 } | 1196 } |
1197 else | 1197 /*else |
1198 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | 1198 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];*/ |
1199 pMouse->uPointingObjectID = (unsigned __int16)v18; | 1199 pMouse->uPointingObjectID = (unsigned __int16)v18; |
1200 v19 = (signed)PID_ID(v18); | 1200 v19 = (signed)PID_ID(v18); |
1201 //For Items------------------------------------ | 1201 //For Items------------------------------------ |
1202 if (PID_TYPE(v18) == OBJECT_Item) | 1202 if (PID_TYPE(v18) == OBJECT_Item) |
1203 { | 1203 { |
1661 { | 1661 { |
1662 if ( pParty->bFlying ) | 1662 if ( pParty->bFlying ) |
1663 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID); | 1663 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID); |
1664 else | 1664 else |
1665 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID); | 1665 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID); |
1666 if ( pRenderer->pRenderD3D ) | 1666 //if ( pRenderer->pRenderD3D ) |
1667 pRenderer->DrawTextureIndexed(8, 8, v7); | 1667 pRenderer->DrawTextureIndexed(8, 8, v7); |
1668 else | 1668 /*else |
1669 pRenderer->DrawTextureTransparent(8, 8, v7); | 1669 pRenderer->DrawTextureTransparent(8, 8, v7);*/ |
1670 } | 1670 } |
1671 if ( pParty->WaterWalkActive() ) | 1671 if ( pParty->WaterWalkActive() ) |
1672 { | 1672 { |
1673 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER ) | 1673 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER ) |
1674 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID); | 1674 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID); |
1675 else | 1675 else |
1676 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID); | 1676 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID); |
1677 if ( pRenderer->pRenderD3D ) | 1677 //if ( pRenderer->pRenderD3D ) |
1678 pRenderer->DrawTextureIndexed(396, 8, v9); | 1678 pRenderer->DrawTextureIndexed(396, 8, v9); |
1679 else | 1679 /*else |
1680 pRenderer->DrawTextureTransparent(396, 8, v9); | 1680 pRenderer->DrawTextureTransparent(396, 8, v9);*/ |
1681 } | 1681 } |
1682 } | 1682 } |
1683 for (uint i = 0; i < 4; ++i) | 1683 for (uint i = 0; i < 4; ++i) |
1684 { | 1684 { |
1685 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime ) | 1685 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime ) |
1717 Player* pPlayer = &pParty->pPlayers[i]; | 1717 Player* pPlayer = &pParty->pPlayers[i]; |
1718 if ( pPlayer->IsEradicated() ) | 1718 if ( pPlayer->IsEradicated() ) |
1719 { | 1719 { |
1720 pPortrait = pTexture_PlayerFaceEradicated; | 1720 pPortrait = pTexture_PlayerFaceEradicated; |
1721 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | 1721 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) |
1722 pRenderer->_4A6E7E(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | 1722 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); |
1723 else | 1723 else |
1724 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); | 1724 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); |
1725 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime | 1725 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
1726 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime | 1726 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime |
1727 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) | 1727 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) |
1730 } | 1730 } |
1731 if (pPlayer->IsDead()) | 1731 if (pPlayer->IsDead()) |
1732 { | 1732 { |
1733 pPortrait = pTexture_PlayerFaceDead; | 1733 pPortrait = pTexture_PlayerFaceDead; |
1734 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | 1734 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) |
1735 pRenderer->_4A6E7E(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | 1735 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); |
1736 else | 1736 else |
1737 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); | 1737 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); |
1738 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime | 1738 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
1739 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime | 1739 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime |
1740 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) | 1740 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) |
1757 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this ) | 1757 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this ) |
1758 { | 1758 { |
1759 pPlayer->field_1AA2 = pFrame->uTextureID - 1; | 1759 pPlayer->field_1AA2 = pFrame->uTextureID - 1; |
1760 pPortrait = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; | 1760 pPortrait = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; |
1761 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | 1761 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) |
1762 pRenderer->_4A6E7E(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | 1762 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); |
1763 else | 1763 else |
1764 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); | 1764 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); |
1765 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime | 1765 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
1766 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime | 1766 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime |
1767 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) | 1767 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) |
2040 if ( !pSpriteObjects[i].uType || !pSpriteObjects[i].uObjectDescID ) | 2040 if ( !pSpriteObjects[i].uType || !pSpriteObjects[i].uObjectDescID ) |
2041 continue; | 2041 continue; |
2042 //if (uWizardEyeSkillLevel == 1 | 2042 //if (uWizardEyeSkillLevel == 1 |
2043 pPoint_X = uCenterX + ((unsigned __int64)((pSpriteObjects[i].vPosition.x - pParty->vPosition.x) * (signed __int64)uZoom) >> 16); | 2043 pPoint_X = uCenterX + ((unsigned __int64)((pSpriteObjects[i].vPosition.x - pParty->vPosition.x) * (signed __int64)uZoom) >> 16); |
2044 pPoint_Y = uCenterY - ((signed __int64)((pSpriteObjects[i].vPosition.y - pParty->vPosition.y) * (signed __int64)uZoom) >> 16); | 2044 pPoint_Y = uCenterY - ((signed __int64)((pSpriteObjects[i].vPosition.y - pParty->vPosition.y) * (signed __int64)uZoom) >> 16); |
2045 if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z && | 2045 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z && |
2046 pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w) | 2046 // pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w) |
2047 { | 2047 { |
2048 if (pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE) | 2048 if (pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE) |
2049 { | 2049 { |
2050 pRenderer->RasterLine2D(pPoint_X, pPoint_Y, pPoint_X, pPoint_Y, ui_game_minimap_projectile_color); | 2050 pRenderer->RasterLine2D(pPoint_X, pPoint_Y, pPoint_X, pPoint_Y, ui_game_minimap_projectile_color); |
2051 } | 2051 } |
2070 if ( pActors[i].uAIState != Removed && pActors[i].uAIState != Disabled | 2070 if ( pActors[i].uAIState != Removed && pActors[i].uAIState != Disabled |
2071 && (pActors[i].uAIState == Dead || BYTE1(pActors[i].uAttributes) & 0x80) ) | 2071 && (pActors[i].uAIState == Dead || BYTE1(pActors[i].uAttributes) & 0x80) ) |
2072 { | 2072 { |
2073 pPoint_X = uCenterX + ((unsigned __int64)(( pActors[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16); | 2073 pPoint_X = uCenterX + ((unsigned __int64)(( pActors[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16); |
2074 pPoint_Y = uCenterY - ((unsigned __int64)(( pActors[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16); | 2074 pPoint_Y = uCenterY - ((unsigned __int64)(( pActors[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16); |
2075 if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z | 2075 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z |
2076 && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w ) | 2076 // && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w ) |
2077 { | 2077 { |
2078 pColor = ui_game_minimap_actor_friendly_color; | 2078 pColor = ui_game_minimap_actor_friendly_color; |
2079 if ( BYTE3(pActors[i].uAttributes) & 1 ) | 2079 if ( BYTE3(pActors[i].uAttributes) & 1 ) |
2080 pColor = ui_game_minimap_actor_hostile_color; | 2080 pColor = ui_game_minimap_actor_hostile_color; |
2081 if ( pActors[i].uAIState == Dead) | 2081 if ( pActors[i].uAIState == Dead) |
2100 { | 2100 { |
2101 if ( pLevelDecorations[i].uFlags & 8 ) | 2101 if ( pLevelDecorations[i].uFlags & 8 ) |
2102 { | 2102 { |
2103 pPoint_X = uCenterX + ((unsigned __int64)((pLevelDecorations[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16); | 2103 pPoint_X = uCenterX + ((unsigned __int64)((pLevelDecorations[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16); |
2104 pPoint_Y = uCenterY - ((unsigned __int64)((pLevelDecorations[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16); | 2104 pPoint_Y = uCenterY - ((unsigned __int64)((pLevelDecorations[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16); |
2105 if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z | 2105 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z |
2106 && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w ) | 2106 // && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w ) |
2107 { | 2107 { |
2108 if ( (signed int)uZoom > 512 ) | 2108 if ( (signed int)uZoom > 512 ) |
2109 { | 2109 { |
2110 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y + 1, ui_game_minimap_decoration_color_1); | 2110 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y + 1, ui_game_minimap_decoration_color_1); |
2111 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y + 1, ui_game_minimap_decoration_color_1); | 2111 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y + 1, ui_game_minimap_decoration_color_1); |