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