do not rotate/flip gamelayer tiles. Closes #155

This commit is contained in:
oy 2010-09-16 13:13:53 +02:00
parent 7714454829
commit 9727cd25ec

View file

@ -132,6 +132,7 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
pGrabbed->m_pEditor = m_pEditor;
pGrabbed->m_TexId = m_TexId;
pGrabbed->m_Image = m_Image;
pGrabbed->m_Game = m_Game;
pBrush->AddLayer(pGrabbed);
// copy the tiles
@ -204,6 +205,7 @@ void CLayerTiles::BrushFlipX()
m_pTiles[y*m_Width+m_Width-1-x] = Tmp;
}
if(!m_Game)
for(int y = 0; y < m_Height; y++)
for(int x = 0; x < m_Width; x++)
m_pTiles[y*m_Width+x].m_Flags ^= m_pTiles[y*m_Width+x].m_Flags&TILEFLAG_ROTATE ? TILEFLAG_HFLIP : TILEFLAG_VFLIP;
@ -219,6 +221,7 @@ void CLayerTiles::BrushFlipY()
m_pTiles[(m_Height-1-y)*m_Width+x] = Tmp;
}
if(!m_Game)
for(int y = 0; y < m_Height; y++)
for(int x = 0; x < m_Width; x++)
m_pTiles[y*m_Width+x].m_Flags ^= m_pTiles[y*m_Width+x].m_Flags&TILEFLAG_ROTATE ? TILEFLAG_VFLIP : TILEFLAG_HFLIP;
@ -240,10 +243,13 @@ void CLayerTiles::BrushRotate(float Amount)
for(int y = m_Height-1; y >= 0; --y, ++pDst)
{
*pDst = pTempData[y*m_Width+x];
if(!m_Game)
{
if(pDst->m_Flags&TILEFLAG_ROTATE)
pDst->m_Flags ^= (TILEFLAG_HFLIP|TILEFLAG_VFLIP);
pDst->m_Flags ^= TILEFLAG_ROTATE;
}
}
int Temp = m_Width;
m_Width = m_Height;