Commit 941a863c authored by Gerhard Stein's avatar Gerhard Stein

added dummy sprite to the map. However it is a camera sprite that will be used...

added dummy sprite to the map. However it is a camera sprite that will be used for testing the scroll behaviour...
parent cce9e179
......@@ -23,6 +23,8 @@ CObject(pmap, x, y, OBJ_NONE),
mp_AttachedObject(NULL)
{
g_pLogFile->ftextOut("Starting the camera system...<br>");
sprite = 138;
solid = false;
}
/**
......@@ -56,48 +58,58 @@ void CCamera::process()
{
if(mp_AttachedObject == NULL)
{ // This means, that there is no attached object. Let the camera scroll freely!
if(g_pInput->getHoldedCommand(IC_LEFT))
moveLeft();
if(g_pInput->getHoldedKey(KA))
moveLeft(10);
else if(g_pInput->getHoldedKey(KD))
moveRight(10);
if(g_pInput->getHoldedKey(KW))
moveUp(10);
else if(g_pInput->getHoldedKey(KS))
moveDown(10);
/*if(g_pInput->getHoldedCommand(IC_LEFT))
moveLeft(10);
else if(g_pInput->getHoldedCommand(IC_RIGHT))
moveRight();
moveRight(10);
if(g_pInput->getHoldedCommand(IC_UP))
moveUp();
moveUp(10);
else if(g_pInput->getHoldedCommand(IC_DOWN))
moveDown();
moveDown(10);*/
}
}
/**
* Move the camera left also checking the bounds
*/
void CCamera::moveLeft()
/*void CCamera::moveLeft()
{
mp_Map->scrollLeft();
}
}*/
/**
* Move the camera right also checking the bounds
*/
void CCamera::moveRight()
/*void CCamera::moveRight()
{
mp_Map->scrollRight();
}
}*/
/**
* Move the camera up also checking the bounds
*/
void CCamera::moveUp()
/*void CCamera::moveUp()
{
mp_Map->scrollUp();
}
}*/
/**
* Move the camera down also checking the bounds
*/
void CCamera::moveDown()
/*void CCamera::moveDown()
{
mp_Map->scrollDown();
}
}*/
CCamera::~CCamera()
{
......
......@@ -27,10 +27,10 @@ public:
void process();
void moveLeft();
/*void moveLeft();
void moveRight();
void moveUp();
void moveDown();
void moveDown();*/
virtual ~CCamera();
......
......@@ -76,11 +76,12 @@ void CPlayGameGalaxy::processInput()
}
/*
* This processes the rendering over all the other stuff. THis is used for extra messages normally
* blit scrollsurface happens with m_WorldMap or m_LevelPlay
*/
void CPlayGameGalaxy::processRendering()
{
// Blit the background
g_pVideoDriver->blitScrollSurface();
g_pGfxEngine->getFont(0).drawFont(g_pVideoDriver->BlitSurface, "Press the arrows to scroll", 10, 10);
}
......
......@@ -40,11 +40,21 @@ void CWorldMap::process()
// Animate the tiles of the map
m_Map.animateAllTiles();
std::vector<CObject*>::iterator obj=m_ObjectPtr.begin();
for( ; obj!=m_ObjectPtr.end() ; obj++ )
for( std::vector<CObject*>::iterator obj=m_ObjectPtr.begin() ;
obj!=m_ObjectPtr.end() ; obj++ )
{
(*obj)->process();
}
g_pVideoDriver->blitScrollSurface();
for( std::vector<CObject*>::iterator obj=m_ObjectPtr.begin() ;
obj!=m_ObjectPtr.end() ; obj++ )
{
(*obj)->draw();
}
}
void CWorldMap::processInput()
......@@ -58,22 +68,18 @@ void CWorldMap::processInput()
if(g_pInput->getHoldedCommand(IC_LEFT))
{
m_Map.scrollLeft();
m_Map.scrollLeft();
}
else if(g_pInput->getHoldedCommand(IC_RIGHT))
{
m_Map.scrollRight();
m_Map.scrollRight();
}
if(g_pInput->getHoldedCommand(IC_UP))
{
m_Map.scrollUp();
m_Map.scrollUp();
}
else if(g_pInput->getHoldedCommand(IC_DOWN))
{
m_Map.scrollDown();
m_Map.scrollDown();
}
}
......
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