1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Better implementation of the framerate manager, FPS timer added, minor improvements

This commit is contained in:
beegee1
2011-04-05 17:38:24 +00:00
parent 0aad12ae67
commit 157002fe68
10 changed files with 145 additions and 158 deletions

View File

@ -105,8 +105,6 @@ CPlayerInterface::CPlayerInterface(int Player)
makingTurn = false;
showingDialog = new CondSh<bool>(false);
sysOpts = GDefaultOptions;
//initializing framerate keeper
//framerate keeper initialized
cingconsole = new CInGameConsole;
terminate_cond.set(false);
firstCall = 1; //if loading will be overwritten in serialize
@ -283,7 +281,7 @@ void CPlayerInterface::heroMoved(const TryMoveHero & details)
initMovement(details, ho, hp);
//first initializing done
SDL_framerateDelay(GH.mainFPSmng); // after first move
GH.mainFPSmng->framerateDelay(); // after first move
//main moving
for(int i=1; i<32; i+=2*sysOpts.heroMoveSpeed)
@ -292,7 +290,7 @@ void CPlayerInterface::heroMoved(const TryMoveHero & details)
adventureInt->updateScreen = true;
adventureInt->show(screen);
CSDL_Ext::update(screen);
SDL_framerateDelay(GH.mainFPSmng); //for animation purposes
GH.mainFPSmng->framerateDelay(); //for animation purposes
} //for(int i=1; i<32; i+=4)
//main moving done
@ -1330,18 +1328,11 @@ void CPlayerInterface::update()
if(adventureInt && !adventureInt->selection && GH.topInt() == adventureInt)
return;
GH.updateTime();
GH.handleEvents();
if(adventureInt && !adventureInt->isActive() && adventureInt->scrollingDir) //player forces map scrolling though interface is disabled
GH.totalRedraw();
else
GH.simpleRedraw();
CCS->curh->draw1();
CSDL_Ext::update(screen);
CCS->curh->draw2();
pim->unlock();
}