2035: Fix rotating rotatable tiles in switch layer r=def- a=12pm



Co-authored-by: 12pm <30786226+12pm@users.noreply.github.com>
This commit is contained in:
bors[bot] 2020-01-17 18:21:10 +00:00 committed by GitHub
commit 77a4cd5b01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -508,10 +508,10 @@ void CLayerTiles::BrushFlipX()
m_pTiles[y*m_Width+m_Width-1-x] = Tmp;
}
if(m_Tele || m_Switch || m_Speedup || m_Tune)
if(m_Tele || m_Speedup || m_Tune)
return;
bool Rotate = !(m_Game || m_Front) || m_pEditor->m_AllowPlaceUnusedTiles;
bool Rotate = !(m_Game || m_Front || m_Switch) || m_pEditor->m_AllowPlaceUnusedTiles;
for(int y = 0; y < m_Height; y++)
for(int x = 0; x < m_Width; x++)
if(!Rotate && !IsRotatableTile(m_pTiles[y*m_Width+x].m_Index))
@ -530,10 +530,10 @@ void CLayerTiles::BrushFlipY()
m_pTiles[(m_Height-1-y)*m_Width+x] = Tmp;
}
if(m_Tele || m_Switch || m_Speedup || m_Tune)
if(m_Tele || m_Speedup || m_Tune)
return;
bool Rotate = !(m_Game || m_Front) || m_pEditor->m_AllowPlaceUnusedTiles;
bool Rotate = !(m_Game || m_Front || m_Switch) || m_pEditor->m_AllowPlaceUnusedTiles;
for(int y = 0; y < m_Height; y++)
for(int x = 0; x < m_Width; x++)
if(!Rotate && !IsRotatableTile(m_pTiles[y*m_Width+x].m_Index))
@ -1731,6 +1731,7 @@ void CLayerSwitch::BrushDraw(CLayer *pBrush, float wx, float wy)
m_pSwitchTile[fy*m_Width+fx].m_Type = l->m_pTiles[y*l->m_Width+x].m_Index;
m_pSwitchTile[fy*m_Width+fx].m_Flags = l->m_pTiles[y*l->m_Width+x].m_Flags;
m_pTiles[fy*m_Width+fx].m_Index = l->m_pTiles[y*l->m_Width+x].m_Index;
m_pTiles[fy*m_Width+fx].m_Flags = l->m_pTiles[y*l->m_Width+x].m_Flags;
}
else
{
@ -1800,6 +1801,12 @@ void CLayerSwitch::BrushRotate(float Amount)
{
*pDst1 = pTempData1[y*m_Width+x];
*pDst2 = pTempData2[y*m_Width+x];
if(IsRotatableTile(pDst2->m_Index))
{
if(pDst2->m_Flags&TILEFLAG_ROTATE)
pDst2->m_Flags ^= (TILEFLAG_HFLIP|TILEFLAG_VFLIP);
pDst2->m_Flags ^= TILEFLAG_ROTATE;
}
}
int Temp = m_Width;