1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +02:00

* next ubuntux's patch

This commit is contained in:
mateuszb
2009-04-15 10:20:47 +00:00
parent 38b680ed30
commit aa87e1ff16
9 changed files with 34 additions and 33 deletions

View File

@ -231,14 +231,14 @@ ui8 side; //who made this action: false - left, true - right player
CBattleHelper::CBattleHelper(): CBattleHelper::CBattleHelper():
InfiniteDistance(0xffff), InfiniteDistance(0xffff),
BattlefieldHeight(11),
BattlefieldWidth(15), BattlefieldWidth(15),
BattlefieldHeight(11),
m_voteForMaxDamage(10),
m_voteForMinDamage(10),
m_voteForMaxSpeed(10),
m_voteForDistance(10), m_voteForDistance(10),
m_voteForDistanceFromShooters(20), m_voteForDistanceFromShooters(20),
m_voteForHitPoints(10), m_voteForHitPoints(10)
m_voteForMaxDamage(10),
m_voteForMaxSpeed(10),
m_voteForMinDamage(10)
{ {
// loads votes // loads votes
std::fstream f; std::fstream f;
@ -373,9 +373,9 @@ int CBattleHelper::GetDistanceWithObstacles(int pointA, int pointB)
* Implementation of CBattleLogic class. * Implementation of CBattleLogic class.
*/ */
CBattleLogic::CBattleLogic(ICallback *cb, CCreatureSet *army1, CCreatureSet *army2, int3 tile, CGHeroInstance *hero1, CGHeroInstance *hero2, bool side) : CBattleLogic::CBattleLogic(ICallback *cb, CCreatureSet *army1, CCreatureSet *army2, int3 tile, CGHeroInstance *hero1, CGHeroInstance *hero2, bool side) :
m_cb(cb),
m_iCurrentTurn(-2), m_iCurrentTurn(-2),
m_bIsAttacker(false), m_bIsAttacker(false),
m_cb(cb),
m_army1(army1), m_army1(army1),
m_army2(army2), m_army2(army2),
m_tile(tile), m_tile(tile),

View File

@ -44,9 +44,10 @@ struct CMP_stack2
} cmpst2 ; } cmpst2 ;
CBattleInterface::CBattleInterface(CCreatureSet * army1, CCreatureSet * army2, CGHeroInstance *hero1, CGHeroInstance *hero2, const SDL_Rect & myRect) CBattleInterface::CBattleInterface(CCreatureSet * army1, CCreatureSet * army2, CGHeroInstance *hero1, CGHeroInstance *hero2, const SDL_Rect & myRect)
: attackingHeroInstance(hero1), defendingHeroInstance(hero2), animCount(0), activeStack(-1), givenCommand(NULL), : attackingHeroInstance(hero1), defendingHeroInstance(hero2), animCount(0), activeStack(-1),
attackingInfo(NULL), myTurn(false), resWindow(NULL), showStackQueue(false), mouseHoveredStack(-1), previouslyHoveredHex(-1), spellDestSelectMode(false), spellToCast(NULL),
spellDestSelectMode(false), spellToCast(NULL), previouslyHoveredHex(-1), moveStarted(false), mouseHoveredStack(-1) attackingInfo(NULL), givenCommand(NULL), myTurn(false), resWindow(NULL),
showStackQueue(false), moveStarted(false)
{ {
pos = myRect; pos = myRect;
strongInterest = true; strongInterest = true;
@ -2336,7 +2337,7 @@ void CBattleHero::clickLeft(boost::logic::tribool down)
} }
} }
CBattleHero::CBattleHero(const std::string & defName, int phaseG, int imageG, bool flipG, unsigned char player, const CGHeroInstance * hero, const CBattleInterface * owner): phase(phaseG), image(imageG), flip(flipG), flagAnim(0), myHero(hero), myOwner(owner), nextPhase(-1) CBattleHero::CBattleHero(const std::string & defName, int phaseG, int imageG, bool flipG, unsigned char player, const CGHeroInstance * hero, const CBattleInterface * owner): flip(flipG), myHero(hero), myOwner(owner), phase(phaseG), nextPhase(-1), image(imageG), flagAnim(0)
{ {
dh = CDefHandler::giveDef( defName ); dh = CDefHandler::giveDef( defName );
for(int i=0; i<dh->ourImages.size(); ++i) //transforming images for(int i=0; i<dh->ourImages.size(); ++i) //transforming images
@ -2425,7 +2426,7 @@ void CBattleHex::hover(bool on)
} }
} }
CBattleHex::CBattleHex() : myNumber(-1), accesible(true), hovered(false), strictHovered(false), myInterface(NULL), setAlterText(false) CBattleHex::CBattleHex() : setAlterText(false), myNumber(-1), accesible(true), hovered(false), strictHovered(false), myInterface(NULL)
{ {
} }

View File

@ -435,8 +435,8 @@ std::pair< std::vector<int>, int > BattleInfo::getPath(int start, int dest, bool
} }
CStack::CStack(CCreature * C, int A, int O, int I, bool AO, int S) CStack::CStack(CCreature * C, int A, int O, int I, bool AO, int S)
:creature(C),amount(A), baseAmount(A), owner(O), position(-1), ID(I), attackerOwned(AO), firstHPleft(C->hitPoints), :ID(I), creature(C), amount(A), baseAmount(A), firstHPleft(C->hitPoints), owner(O), slot(S), attackerOwned(AO), position(-1),
shots(C->shots), slot(S), counterAttacks(1), effects(), state() counterAttacks(1), shots(C->shots), state(), effects()
{ {
speed = creature->speed; speed = creature->speed;
abilities = C->abilities; abilities = C->abilities;

View File

@ -159,7 +159,7 @@ public:
std::vector<StackEffect> effects; std::vector<StackEffect> effects;
CStack(CCreature * C, int A, int O, int I, bool AO, int S); CStack(CCreature * C, int A, int O, int I, bool AO, int S);
CStack() : creature(NULL),amount(-1),owner(255), position(-1), ID(-1), attackerOwned(true), firstHPleft(-1), slot(255), baseAmount(-1), counterAttacks(1), effects(), state(), abilities(){} CStack() : ID(-1), creature(NULL), amount(-1), baseAmount(-1), firstHPleft(-1), owner(255), slot(255), attackerOwned(true), position(-1), counterAttacks(1), abilities(), state(), effects() {}
const StackEffect * getEffect(ui16 id) const; //effect id (SP) const StackEffect * getEffect(ui16 id) const; //effect id (SP)
bool willMove(); //if stack has remaining move this turn bool willMove(); //if stack has remaining move this turn
ui32 Speed() const; ui32 Speed() const;

View File

@ -522,8 +522,8 @@ void CGarrisonInt::splitStacks(int am2)
} }
CGarrisonInt::CGarrisonInt(int x, int y, int inx, int iny, SDL_Surface *&pomsur, int OX, int OY, const CArmedInstance *s1, CGarrisonInt::CGarrisonInt(int x, int y, int inx, int iny, SDL_Surface *&pomsur, int OX, int OY, const CArmedInstance *s1,
const CArmedInstance *s2) const CArmedInstance *s2)
:interx(inx),intery(iny),sur(pomsur),highlighted(NULL),sup(NULL),sdown(NULL),oup(s1),odown(s2), :interx(inx),intery(iny),highlighted(NULL),sur(pomsur),offx(OX),offy(OY),sup(NULL),
offx(OX),offy(OY) sdown(NULL),oup(s1),odown(s2)
{ {
active = false; active = false;
splitting = false; splitting = false;
@ -641,7 +641,7 @@ void CRClickPopup::close()
} }
CInfoPopup::CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free) CInfoPopup::CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free)
:bitmap(Bitmap),free(Free) :free(Free),bitmap(Bitmap)
{ {
pos.x = x; pos.x = x;
pos.y = y; pos.y = y;
@ -3589,7 +3589,7 @@ void CCreInfoWindow::show(SDL_Surface * to)
} }
CCreInfoWindow::CCreInfoWindow(int Cid, int Type, int creatureCount, StackState *State, boost::function<void()> Upg, boost::function<void()> Dsm, UpgradeInfo *ui) CCreInfoWindow::CCreInfoWindow(int Cid, int Type, int creatureCount, StackState *State, boost::function<void()> Upg, boost::function<void()> Dsm, UpgradeInfo *ui)
:ok(0),dismiss(0),upgrade(0),type(Type),dsm(Dsm) :type(Type),dsm(Dsm),dismiss(0),upgrade(0),ok(0)
{ {
//active = false; //active = false;
anf = 0; anf = 0;
@ -4724,7 +4724,7 @@ void CInGameConsole::refreshEnteredText()
} }
} }
CInGameConsole::CInGameConsole() : defaultTimeout(10000), maxDisplayedTexts(10), prevEntDisp(-1) CInGameConsole::CInGameConsole() : prevEntDisp(-1), defaultTimeout(10000), maxDisplayedTexts(10)
{ {
} }

View File

@ -444,13 +444,13 @@ PreGameTab::PreGameTab()
} }
/********************************************************************************************/ /********************************************************************************************/
Options::PlayerOptions::PlayerOptions(int serial, int player) Options::PlayerOptions::PlayerOptions(int serial, int player)
:Cleft(genRect(24,11,164,133+serial*50),CPG->ourOptions->left,true,-1), //left castle arrow :flag(genRect(50,42,14,130+serial*50),CPG->ourOptions->flags[player],player),
Cleft(genRect(24,11,164,133+serial*50),CPG->ourOptions->left,true,-1), //left castle arrow
Cright(genRect(24,11,225,133+serial*50),CPG->ourOptions->right,false,-1), //right castle arrow Cright(genRect(24,11,225,133+serial*50),CPG->ourOptions->right,false,-1), //right castle arrow
Hleft(genRect(24,11,240,133+serial*50),CPG->ourOptions->left,true,0), //left hero arrow Hleft(genRect(24,11,240,133+serial*50),CPG->ourOptions->left,true,0), //left hero arrow
Hright(genRect(24,11,301,133+serial*50),CPG->ourOptions->right,false,0), //right hero arrow Hright(genRect(24,11,301,133+serial*50),CPG->ourOptions->right,false,0), //right hero arrow
Bleft(genRect(24,11,316,133+serial*50),CPG->ourOptions->left,true,1), //left bonus arrow Bleft(genRect(24,11,316,133+serial*50),CPG->ourOptions->left,true,1), //left bonus arrow
Bright(genRect(24,11,377,133+serial*50),CPG->ourOptions->right,false,1), //right bonus arrow Bright(genRect(24,11,377,133+serial*50),CPG->ourOptions->right,false,1) //right bonus arrow
flag(genRect(50,42,14,130+serial*50),CPG->ourOptions->flags[player],player)
{ {
Bleft.playerID=Bright.playerID=Hleft.playerID=Hright.playerID=Cleft.playerID=Cright.playerID=player; Bleft.playerID=Bright.playerID=Hleft.playerID=Hright.playerID=Cleft.playerID=Cright.playerID=player;
Bleft.serialID=Bright.serialID=Hleft.serialID=Hright.serialID=Cleft.serialID=Cright.serialID=serial; Bleft.serialID=Bright.serialID=Hleft.serialID=Hright.serialID=Cleft.serialID=Cright.serialID=serial;
@ -2508,17 +2508,17 @@ CPreGame::menuItems::~menuItems()
ScenSel::ScenSel() ScenSel::ScenSel()
: :
difficulty(new CPoinGroup()), difficulty(new CPoinGroup()),
bScens(genRect(0,0,414,81),boost::bind(&CPreGame::showScenList,CPG),CDefHandler::giveDef("GSPBUTT.DEF")),
bOptions(genRect(0,0,414,509),boost::bind(&CPreGame::showOptions,CPG),CDefHandler::giveDef("GSPBUTT.DEF")),
bRandom(genRect(0,0,414,105),boost::bind(&CPreGame::showScenList,CPG),CDefHandler::giveDef("GSPBUTT.DEF")),
bBegin(genRect(0,0,414,535),boost::bind(&CPreGame::begin,CPG),CDefHandler::giveDef("SCNRBEG.DEF")),
bLoad(genRect(0,0,414,535),boost::bind(&CPreGame::begin,CPG),CDefHandler::giveDef("SCNRLOD.DEF")),
bBack(genRect(0,0,584,535),boost::bind(&CPreGame::showNewMenu,CPG),CDefHandler::giveDef("SCNRBACK.DEF")),
bEasy(genRect(0,0,506,456),NULL,CDefHandler::giveDef("GSPBUT3.DEF"),true,difficulty,0), bEasy(genRect(0,0,506,456),NULL,CDefHandler::giveDef("GSPBUT3.DEF"),true,difficulty,0),
bNormal(genRect(0,0,538,456),NULL,CDefHandler::giveDef("GSPBUT4.DEF"),true,difficulty,1), bNormal(genRect(0,0,538,456),NULL,CDefHandler::giveDef("GSPBUT4.DEF"),true,difficulty,1),
bHard(genRect(0,0,570,456),NULL,CDefHandler::giveDef("GSPBUT5.DEF"),true,difficulty,2), bHard(genRect(0,0,570,456),NULL,CDefHandler::giveDef("GSPBUT5.DEF"),true,difficulty,2),
bExpert(genRect(0,0,602,456),NULL,CDefHandler::giveDef("GSPBUT6.DEF"),true,difficulty,3), bExpert(genRect(0,0,602,456),NULL,CDefHandler::giveDef("GSPBUT6.DEF"),true,difficulty,3),
bImpossible(genRect(0,0,634,456),NULL,CDefHandler::giveDef("GSPBUT7.DEF"),true,difficulty,4), bImpossible(genRect(0,0,634,456),NULL,CDefHandler::giveDef("GSPBUT7.DEF"),true,difficulty,4)
bBack(genRect(0,0,584,535),boost::bind(&CPreGame::showNewMenu,CPG),CDefHandler::giveDef("SCNRBACK.DEF")),
bBegin(genRect(0,0,414,535),boost::bind(&CPreGame::begin,CPG),CDefHandler::giveDef("SCNRBEG.DEF")),
bLoad(genRect(0,0,414,535),boost::bind(&CPreGame::begin,CPG),CDefHandler::giveDef("SCNRLOD.DEF")),
bScens(genRect(0,0,414,81),boost::bind(&CPreGame::showScenList,CPG),CDefHandler::giveDef("GSPBUTT.DEF")),
bRandom(genRect(0,0,414,105),boost::bind(&CPreGame::showScenList,CPG),CDefHandler::giveDef("GSPBUTT.DEF")),
bOptions(genRect(0,0,414,509),boost::bind(&CPreGame::showOptions,CPG),CDefHandler::giveDef("GSPBUTT.DEF"))
{ {
pressed=NULL; pressed=NULL;
listShowed=false; listShowed=false;

View File

@ -45,10 +45,10 @@ struct DLL_EXPORT HeroBonus
std::string description; std::string description;
HeroBonus(ui8 Dur, ui8 Type, ui8 Src, si32 Val, ui32 ID, std::string Desc, si32 Subtype=-1) HeroBonus(ui8 Dur, ui8 Type, ui8 Src, si32 Val, ui32 ID, std::string Desc, si32 Subtype=-1)
:duration(Dur), type(Type), source(Src), val(Val), id(ID), description(Desc), subtype(Subtype) :duration(Dur), type(Type), subtype(Subtype), source(Src), val(Val), id(ID), description(Desc)
{} {}
HeroBonus(ui8 Dur, ui8 Type, ui8 Src, si32 Val, ui32 ID, si32 Subtype=-1) HeroBonus(ui8 Dur, ui8 Type, ui8 Src, si32 Val, ui32 ID, si32 Subtype=-1)
:duration(Dur), type(Type), source(Src), val(Val), id(ID), subtype(Subtype) :duration(Dur), type(Type), subtype(Subtype), source(Src), val(Val), id(ID)
{} {}
HeroBonus() HeroBonus()
{ {

View File

@ -895,7 +895,7 @@ struct DisbandCreature : public CPackForServer
struct BuildStructure : public CPackForServer struct BuildStructure : public CPackForServer
{ {
BuildStructure(){}; BuildStructure(){};
BuildStructure(si32 TID, si32 BID):tid(TID),bid(BID){}; BuildStructure(si32 TID, si32 BID):bid(BID),tid(TID){};
si32 bid, tid; //structure and town ids si32 bid, tid; //structure and town ids
void applyGh(CGameHandler *gh); void applyGh(CGameHandler *gh);

View File

@ -1403,5 +1403,5 @@ CMapHandler::CMapHandler()
} }
TerrainTile2::TerrainTile2() TerrainTile2::TerrainTile2()
:terbitmap(0),tileInfo(0) :tileInfo(0),terbitmap(0)
{} {}