예제 #1
0
bool CMap::scrollUp(const bool force)
{
    if( !force && findHorizontalScrollBlocker((m_scrolly-1)<<STC) )
		return false;

    const int squareSize = gVideoDriver.getScrollSurface()->w;

	if( m_scrolly > 32 )
	{
		m_scrolly--;
        gVideoDriver.mpVideoEngine->UpdateScrollBufY(m_scrolly, squareSize-1);

		if (m_scrollpixy==0)
		{  // need to draw a new stripe
			if(m_mapy>0) m_mapy--;
			if (m_mapystripepos == 0)
			{
                m_mapystripepos = (squareSize - 16);
			}
			else
			{
				m_mapystripepos -= 16;
			}
			drawHstripe(m_mapystripepos, m_mapy);

			m_scrollpixy = 15;
		} else m_scrollpixy--;

        refreshVisibleArea();

		return true;
	}
	return false;
}
예제 #2
0
bool CMap::scrollUp(const bool force)
{
	if( !force && findScrollHorizontalScrollBlocker(m_scrolly<<STC) )
		return false;

	if( m_scrolly > 32 )
	{
		m_scrolly--;
		m_scrolly_buf = m_scrolly&511;

		if (m_scrollpixy==0)
		{  // need to draw a new stripe
			if(m_mapy>0) m_mapy--;
			if (m_mapystripepos == 0)
			{
				m_mapystripepos = (512 - 16);
			}
			else
			{
				m_mapystripepos -= 16;
			}
			drawHstripe(m_mapystripepos, m_mapy);

			m_scrollpixy = 15;
		} else m_scrollpixy--;
	}
	return true;
}
예제 #3
0
bool CMap::scrollDown(const bool force)
{
    const int res_height = gVideoDriver.getGameResolution().h;

    if( !force && findHorizontalScrollBlocker((m_scrolly+res_height)<<STC) )
		return false;

    const int squareSize = gVideoDriver.getScrollSurface()->w;

	if(m_scrolly < ((m_height-2)<<4) - res_height )
	{
		m_scrolly++;
        gVideoDriver.mpVideoEngine->UpdateScrollBufY(m_scrolly, squareSize-1);

		m_scrollpixy++;
		if (m_scrollpixy>=16)
		{  // need to draw a new stripe
            const int totalNumTiles = squareSize/16;
            drawHstripe(m_mapystripepos, m_mapy + totalNumTiles);
			m_mapy++;
			m_mapystripepos += 16;
            if (m_mapystripepos >= squareSize) m_mapystripepos = 0;
			m_scrollpixy = 0;
		}

        refreshVisibleArea();
		return true;
	}
	return false;
}
예제 #4
0
bool CMap::scrollDown(const bool force)
{
	const int res_height = g_pVideoDriver->getGameResolution().h;

	if( !force && findScrollHorizontalScrollBlocker((m_scrolly+res_height)<<STC) )
		return false;

	if(m_scrolly < ((m_height-2)<<4) - res_height )
	{
		m_scrolly++;
		m_scrolly_buf = m_scrolly&511;

		m_scrollpixy++;
		if (m_scrollpixy>=16)
		{  // need to draw a new stripe
			drawHstripe(m_mapystripepos, m_mapy + 32);
			m_mapy++;
			m_mapystripepos += 16;
			if (m_mapystripepos >= 512) m_mapystripepos = 0;
			m_scrollpixy = 0;
		}
	}
	return true;
}