Skip to content

Commit c540c65

Browse files
committed
Fix #4442: Revert unintended change from b162464
1 parent 36b85b2 commit c540c65

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Client/core/Graphics/CGraphics.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,6 @@ void CGraphics::DrawMaterialPrimitive3DQueued(std::vector<PrimitiveMaterialVerti
993993
m_pMaterialPrimitive3DBatcherPreGUI->AddPrimitive(eType, pMaterial, pVecVertices);
994994
else
995995
m_pMaterialPrimitive3DBatcherPostFX->AddPrimitive(eType, pMaterial, pVecVertices);
996-
997996
}
998997

999998
void CGraphics::DrawMaterialPrimitiveQueued(std::vector<PrimitiveMaterialVertice>* pVecVertices, D3DPRIMITIVETYPE eType, CMaterialItem* pMaterial,
@@ -1515,11 +1514,10 @@ void CGraphics::DrawTexture(CTextureItem* pTexture, float fX, float fY, float fS
15151514
D3DXVECTOR2 scaling(fScaleX * fFileWidth / fCutWidth, fScaleY * fFileHeight / fCutHeight);
15161515
D3DXVECTOR2 rotationCenter(fFileWidth * fScaleX * fCenterX, fFileHeight * fScaleX * fCenterY);
15171516
D3DXVECTOR2 position(fX - fFileWidth * fScaleX * fCenterX, fY - fFileHeight * fScaleY * fCenterY);
1518-
const D3DXVECTOR2* pRotationCenter = fRotation != 0.0f ? &rotationCenter : NULL;
1519-
D3DXMatrixTransformation2D(&matrix, NULL, NULL, &scaling, pRotationCenter, DegreesToRadians(fRotation), &position);
1517+
D3DXMatrixTransformation2D(&matrix, NULL, NULL, &scaling, &rotationCenter, DegreesToRadians(fRotation), &position);
15201518
CheckModes(EDrawMode::DX_SPRITE, m_ActiveBlendMode);
15211519
m_pDXSprite->SetTransform(&matrix);
1522-
m_pDXSprite->Draw((IDirect3DTexture9*)pTexture->m_pD3DTexture, &cutImagePos, NULL, NULL, dwColor);
1520+
m_pDXSprite->Draw((IDirect3DTexture9*)pTexture->m_pD3DTexture, &cutImagePos, NULL, NULL, /*ModifyColorForBlendMode (*/ dwColor /*, blendMode )*/);
15231521
EndDrawBatch();
15241522
}
15251523

@@ -1764,7 +1762,7 @@ void CGraphics::DrawQueueItem(const sDrawQueueItem& Item)
17641762
D3DXVECTOR2 scaling(Item.Text.fScaleX, Item.Text.fScaleY);
17651763
D3DXVECTOR2 translation(fPosFracX * Item.Text.fScaleX, fPosFracY * Item.Text.fScaleY); // Sub-pixel positioning
17661764
D3DXVECTOR2 rotcenter(Item.Text.fRotationCenterX, Item.Text.fRotationCenterY);
1767-
const D3DXVECTOR2* pRotcenter = Item.Text.fRotation != 0.0f ? &rotcenter : NULL;
1765+
D3DXVECTOR2* pRotcenter = Item.Text.fRotation ? &rotcenter : NULL;
17681766
D3DXMatrixTransformation2D(&matrix, NULL, 0.0f, &scaling, pRotcenter, DegreesToRadians(Item.Text.fRotation), &translation);
17691767
CheckModes(EDrawMode::DX_SPRITE, Item.blendMode);
17701768
m_pDXSprite->SetTransform(&matrix);
@@ -1790,7 +1788,7 @@ void CGraphics::DrawQueueItem(const sDrawQueueItem& Item)
17901788
const float fCutWidth = cutImagePos.right - cutImagePos.left;
17911789
const float fCutHeight = cutImagePos.bottom - cutImagePos.top;
17921790
const D3DXVECTOR2 scaling(Item.Texture.fWidth / fCutWidth, Item.Texture.fHeight / fCutHeight);
1793-
const D3DXVECTOR2 rotationCenter(fFileWidth * 0.5f + Item.Texture.fRotCenOffX, fFileHeight * 0.5f + Item.Texture.fRotCenOffY);
1791+
const D3DXVECTOR2 rotationCenter(Item.Texture.fWidth * 0.5f + Item.Texture.fRotCenOffX, Item.Texture.fHeight * 0.5f + Item.Texture.fRotCenOffY);
17941792
const D3DXVECTOR2 position(Item.Texture.fX, Item.Texture.fY);
17951793
const D3DXVECTOR2* pRotationCenter = Item.Texture.fRotation ? &rotationCenter : NULL;
17961794
D3DXMATRIX matrix;
@@ -2012,7 +2010,7 @@ void CGraphics::SaveGTARenderStates()
20122010
}
20132011

20142012
SAFE_RELEASE(m_pSavedStateBlock);
2015-
2013+
20162014
// Add error handling for state block creation
20172015
HRESULT hr = m_pDevice->CreateStateBlock(D3DSBT_ALL, &m_pSavedStateBlock);
20182016
if (FAILED(hr))
@@ -2489,7 +2487,7 @@ namespace
24892487

24902488
// Initial octahedron
24912489
static SFixedArray<CVector, 6> vecPoints = {CVector(0, 0, 1), CVector(0, 0, -1), CVector(-1, -1, 0),
2492-
CVector(1, -1, 0), CVector(1, 1, 0), CVector(-1, 1, 0)};
2490+
CVector(1, -1, 0), CVector(1, 1, 0), CVector(-1, 1, 0)};
24932491
static const SFixedArray<WORD, 24> indices = {0, 3, 4, 0, 4, 5, 0, 5, 2, 0, 2, 3, 1, 4, 3, 1, 5, 4, 1, 2, 5, 1, 3, 2};
24942492

24952493
for (uint i = 0; i < NUMELMS(vecPoints); i++)

0 commit comments

Comments
 (0)