Commit 59dd96e3 authored by Gerhard Stein's avatar Gerhard Stein

fixed Mask. Still don't like that new code so much...

parent c8b90258
...@@ -349,7 +349,8 @@ void CMap::drawAll() ...@@ -349,7 +349,8 @@ void CMap::drawAll()
if(has_background && c==0) if(has_background && c==0)
continue; continue;
Tilemap->drawTile(mp_scrollsurface, ((x<<4)+m_mapxstripepos)&511, ((y<<4)+m_mapystripepos)&511, c); Tilemap->drawTile(mp_scrollsurface, ((x<<4)+m_mapxstripepos)&511,
((y<<4)+m_mapystripepos)&511, c);
registerAnimation( ((x<<4)+m_mapxstripepos)&511, registerAnimation( ((x<<4)+m_mapxstripepos)&511,
((y<<4)+m_mapystripepos)&511, ((y<<4)+m_mapystripepos)&511,
plane, c ); plane, c );
...@@ -505,11 +506,24 @@ void CMap::animateAllTiles() ...@@ -505,11 +506,24 @@ void CMap::animateAllTiles()
{ {
if ( m_animtiles[plane][i].slotinuse ) if ( m_animtiles[plane][i].slotinuse )
{ {
CTileProperties &TileProperties = CTileProperties &TileProperties =
g_pBehaviorEngine->getTileProperties(plane).at(m_animtiles[plane][i].tile); g_pBehaviorEngine->getTileProperties(plane).at(m_animtiles[plane][i].tile);
if( (m_animtiletimer % TileProperties.animationtime) == 0) if( (m_animtiletimer % TileProperties.animationtime) == 0)
{ {
if(plane == 1 && has_background) // For masked tiles needed
{
size_t x = m_animtiles[plane][i].x+m_scrollx-m_scrollx_buf;
size_t y = m_animtiles[plane][i].y+m_scrolly-m_scrolly_buf;
size_t tile = m_Plane[0].getMapDataAt((x>>4), (y>>4));
(Tilemap-1)->drawTile( mp_scrollsurface,
m_animtiles[plane][i].x,
m_animtiles[plane][i].y,
tile);
}
Tilemap->drawTile( mp_scrollsurface, Tilemap->drawTile( mp_scrollsurface,
m_animtiles[plane][i].x, m_animtiles[plane][i].x,
m_animtiles[plane][i].y, m_animtiles[plane][i].y,
...@@ -520,6 +534,7 @@ void CMap::animateAllTiles() ...@@ -520,6 +534,7 @@ void CMap::animateAllTiles()
} }
} }
} }
else else
has_background = false; has_background = false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment