mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
* choosing adventure map scroll speed
This commit is contained in:
parent
c6bcd61aba
commit
00899402cc
@ -1206,13 +1206,13 @@ void CAdvMapInt::update()
|
|||||||
++animValHitCount; //for animations
|
++animValHitCount; //for animations
|
||||||
if(animValHitCount == 8)
|
if(animValHitCount == 8)
|
||||||
{
|
{
|
||||||
|
CGI->mh->updateWater();
|
||||||
animValHitCount = 0;
|
animValHitCount = 0;
|
||||||
++anim;
|
++anim;
|
||||||
updateScreen = true;
|
updateScreen = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
++heroAnim;
|
++heroAnim;
|
||||||
if((animValHitCount % 4) && !LOCPLINT->showingDialog->get())
|
if((animValHitCount % (4/LOCPLINT->mapScrollingSpeed)) == 0 && !LOCPLINT->showingDialog->get())
|
||||||
{
|
{
|
||||||
if(scrollingLeft)
|
if(scrollingLeft)
|
||||||
{
|
{
|
||||||
@ -1252,8 +1252,7 @@ void CAdvMapInt::update()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(updateScreen)
|
if(updateScreen)
|
||||||
{
|
{
|
||||||
CGI->mh->updateWater();
|
|
||||||
terrain.show();
|
terrain.show();
|
||||||
for(int i=0;i<4;i++)
|
for(int i=0;i<4;i++)
|
||||||
blitAt(gems[i]->ourImages[LOCPLINT->playerID].bitmap,ADVOPT.gemX[i],ADVOPT.gemY[i]);
|
blitAt(gems[i]->ourImages[LOCPLINT->playerID].bitmap,ADVOPT.gemX[i],ADVOPT.gemY[i]);
|
||||||
|
@ -1001,6 +1001,7 @@ CPlayerInterface::CPlayerInterface(int Player, int serial)
|
|||||||
pim = new boost::recursive_mutex;
|
pim = new boost::recursive_mutex;
|
||||||
showingDialog = new CondSh<bool>(false);
|
showingDialog = new CondSh<bool>(false);
|
||||||
heroMoveSpeed = 2;
|
heroMoveSpeed = 2;
|
||||||
|
mapScrollingSpeed = 2;
|
||||||
//initializing framerate keeper
|
//initializing framerate keeper
|
||||||
mainFPSmng = new FPSmanager;
|
mainFPSmng = new FPSmanager;
|
||||||
SDL_initFramerate(mainFPSmng);
|
SDL_initFramerate(mainFPSmng);
|
||||||
@ -1529,16 +1530,6 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
|||||||
adventureInt->updateScreen = true;
|
adventureInt->updateScreen = true;
|
||||||
LOCPLINT->adventureInt->update(); //updating screen
|
LOCPLINT->adventureInt->update(); //updating screen
|
||||||
CSDL_Ext::update(screen);
|
CSDL_Ext::update(screen);
|
||||||
//CGI->screenh->updateScreen();
|
|
||||||
|
|
||||||
++LOCPLINT->adventureInt->animValHitCount; //for animations
|
|
||||||
if(LOCPLINT->adventureInt->animValHitCount == 8)
|
|
||||||
{
|
|
||||||
LOCPLINT->adventureInt->animValHitCount = 0;
|
|
||||||
++LOCPLINT->adventureInt->anim;
|
|
||||||
LOCPLINT->adventureInt->updateScreen = true;
|
|
||||||
}
|
|
||||||
++LOCPLINT->adventureInt->heroAnim;
|
|
||||||
|
|
||||||
SDL_Delay(5);
|
SDL_Delay(5);
|
||||||
SDL_framerateDelay(mainFPSmng); //for animation purposes
|
SDL_framerateDelay(mainFPSmng); //for animation purposes
|
||||||
@ -3825,6 +3816,13 @@ CSystemOptionsWindow::CSystemOptionsWindow(const SDL_Rect &pos, CPlayerInterface
|
|||||||
heroMoveSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[352].first),CGI->generaltexth->zelp[352].second, "sysopb4.def", 331, 134, 8);
|
heroMoveSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[352].first),CGI->generaltexth->zelp[352].second, "sysopb4.def", 331, 134, 8);
|
||||||
heroMoveSpeed->select(owner->heroMoveSpeed, 1);
|
heroMoveSpeed->select(owner->heroMoveSpeed, 1);
|
||||||
heroMoveSpeed->onChange = boost::bind(&CPlayerInterface::setHeroMoveSpeed, owner, _1);
|
heroMoveSpeed->onChange = boost::bind(&CPlayerInterface::setHeroMoveSpeed, owner, _1);
|
||||||
|
|
||||||
|
mapScrollSpeed = new CHighlightableButtonsGroup(0);
|
||||||
|
mapScrollSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[357].first),CGI->generaltexth->zelp[357].second, "sysopb9.def", 187, 267, 1);
|
||||||
|
mapScrollSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[358].first),CGI->generaltexth->zelp[358].second, "sysob10.def", 251, 267, 2);
|
||||||
|
mapScrollSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[359].first),CGI->generaltexth->zelp[359].second, "sysob11.def", 315, 267, 4);
|
||||||
|
mapScrollSpeed->select(owner->mapScrollingSpeed, 1);
|
||||||
|
mapScrollSpeed->onChange = boost::bind(&CPlayerInterface::setMapScrollingSpeed, owner, _1);
|
||||||
}
|
}
|
||||||
|
|
||||||
CSystemOptionsWindow::~CSystemOptionsWindow()
|
CSystemOptionsWindow::~CSystemOptionsWindow()
|
||||||
@ -3834,6 +3832,7 @@ CSystemOptionsWindow::~CSystemOptionsWindow()
|
|||||||
delete quitGame;
|
delete quitGame;
|
||||||
delete backToMap;
|
delete backToMap;
|
||||||
delete heroMoveSpeed;
|
delete heroMoveSpeed;
|
||||||
|
delete mapScrollSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSystemOptionsWindow::bquitf()
|
void CSystemOptionsWindow::bquitf()
|
||||||
@ -3864,6 +3863,7 @@ void CSystemOptionsWindow::activate()
|
|||||||
quitGame->activate();
|
quitGame->activate();
|
||||||
backToMap->activate();
|
backToMap->activate();
|
||||||
heroMoveSpeed->activate();
|
heroMoveSpeed->activate();
|
||||||
|
mapScrollSpeed->activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSystemOptionsWindow::deactivate()
|
void CSystemOptionsWindow::deactivate()
|
||||||
@ -3871,6 +3871,7 @@ void CSystemOptionsWindow::deactivate()
|
|||||||
quitGame->deactivate();
|
quitGame->deactivate();
|
||||||
backToMap->deactivate();
|
backToMap->deactivate();
|
||||||
heroMoveSpeed->deactivate();
|
heroMoveSpeed->deactivate();
|
||||||
|
mapScrollSpeed->deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSystemOptionsWindow::show(SDL_Surface *to)
|
void CSystemOptionsWindow::show(SDL_Surface *to)
|
||||||
@ -3884,6 +3885,7 @@ void CSystemOptionsWindow::show(SDL_Surface *to)
|
|||||||
quitGame->show(to);
|
quitGame->show(to);
|
||||||
backToMap->show(to);
|
backToMap->show(to);
|
||||||
heroMoveSpeed->show(to);
|
heroMoveSpeed->show(to);
|
||||||
|
mapScrollSpeed->show(to);
|
||||||
}
|
}
|
||||||
|
|
||||||
CTavernWindow::CTavernWindow(const CGHeroInstance *H1, const CGHeroInstance *H2, const std::string &gossip)
|
CTavernWindow::CTavernWindow(const CGHeroInstance *H1, const CGHeroInstance *H2, const std::string &gossip)
|
||||||
|
@ -336,7 +336,9 @@ public:
|
|||||||
boost::recursive_mutex *pim;
|
boost::recursive_mutex *pim;
|
||||||
bool makingTurn;
|
bool makingTurn;
|
||||||
int heroMoveSpeed;
|
int heroMoveSpeed;
|
||||||
void setHeroMoveSpeed(int newSpeed) {heroMoveSpeed = newSpeed;}; //set for the member above
|
void setHeroMoveSpeed(int newSpeed) {heroMoveSpeed = newSpeed;} //set for the member above
|
||||||
|
int mapScrollingSpeed;
|
||||||
|
void setMapScrollingSpeed(int newSpeed) {mapScrollingSpeed = newSpeed;} //set the member above
|
||||||
SDL_Event * current;
|
SDL_Event * current;
|
||||||
CMainInterface *curint;
|
CMainInterface *curint;
|
||||||
CAdvMapInt * adventureInt;
|
CAdvMapInt * adventureInt;
|
||||||
@ -664,6 +666,7 @@ private:
|
|||||||
SDL_Surface * background; //background of window
|
SDL_Surface * background; //background of window
|
||||||
AdventureMapButton * quitGame, * backToMap;
|
AdventureMapButton * quitGame, * backToMap;
|
||||||
CHighlightableButtonsGroup * heroMoveSpeed;
|
CHighlightableButtonsGroup * heroMoveSpeed;
|
||||||
|
CHighlightableButtonsGroup * mapScrollSpeed;
|
||||||
public:
|
public:
|
||||||
CSystemOptionsWindow(const SDL_Rect & pos, CPlayerInterface * owner); //c-tor
|
CSystemOptionsWindow(const SDL_Rect & pos, CPlayerInterface * owner); //c-tor
|
||||||
~CSystemOptionsWindow(); //d-tor
|
~CSystemOptionsWindow(); //d-tor
|
||||||
|
@ -746,7 +746,7 @@ SDL_Surface * CMapHandler::terrainRect(int x, int y, int dx, int dy, int level,
|
|||||||
//borders printed
|
//borders printed
|
||||||
return su;
|
return su;
|
||||||
}
|
}
|
||||||
SDL_Surface * CMapHandler::getVisBitmap(int x, int y, std::vector< std::vector< std::vector<unsigned char> > > & visibilityMap, int lvl)
|
SDL_Surface * CMapHandler::getVisBitmap(int x, int y, const std::vector< std::vector< std::vector<unsigned char> > > & visibilityMap, int lvl)
|
||||||
{
|
{
|
||||||
int size = visibilityMap.size()-1; //is tile visible. arrangement: (like num keyboard)
|
int size = visibilityMap.size()-1; //is tile visible. arrangement: (like num keyboard)
|
||||||
bool d7 = (x>0 && y>0) ? visibilityMap[x-1][y-1][lvl] : 0, //789
|
bool d7 = (x>0 && y>0) ? visibilityMap[x-1][y-1][lvl] : 0, //789
|
||||||
|
@ -86,7 +86,7 @@ public:
|
|||||||
std::vector<std::vector<std::vector<unsigned char> > > hideBitmap; //specifies number of graphic that should be used to fully hide a tile
|
std::vector<std::vector<std::vector<unsigned char> > > hideBitmap; //specifies number of graphic that should be used to fully hide a tile
|
||||||
|
|
||||||
void loadDefs();
|
void loadDefs();
|
||||||
SDL_Surface * getVisBitmap(int x, int y, std::vector< std::vector< std::vector<unsigned char> > > & visibilityMap, int lvl);
|
SDL_Surface * getVisBitmap(int x, int y, const std::vector< std::vector< std::vector<unsigned char> > > & visibilityMap, int lvl);
|
||||||
|
|
||||||
int getCost(int3 & a, int3 & b, const CGHeroInstance * hero);
|
int getCost(int3 & a, int3 & b, const CGHeroInstance * hero);
|
||||||
std::vector< std::string > getObjDescriptions(int3 pos); //returns desriptions of objects blocking given position
|
std::vector< std::string > getObjDescriptions(int3 pos); //returns desriptions of objects blocking given position
|
||||||
|
Loading…
Reference in New Issue
Block a user