diff --git a/AI/VCAI/Fuzzy.cpp b/AI/VCAI/Fuzzy.cpp index 53d746f7b..b452ebbad 100644 --- a/AI/VCAI/Fuzzy.cpp +++ b/AI/VCAI/Fuzzy.cpp @@ -15,7 +15,7 @@ #define MIN_AI_STRENGHT (0.5f) //lower when combat AI gets smarter -class BankConfig; +struct BankConfig; class FuzzyEngine; class InputLVar; class CGTownInstance; diff --git a/client/BattleInterface/CBattleInterfaceClasses.h b/client/BattleInterface/CBattleInterfaceClasses.h index 539d35a22..e3f008c1c 100644 --- a/client/BattleInterface/CBattleInterfaceClasses.h +++ b/client/BattleInterface/CBattleInterfaceClasses.h @@ -11,7 +11,7 @@ class CAdventureMapButton; class CHighlightableButton; class CHighlightableButtonsGroup; class CLabel; -class BattleResult; +struct BattleResult; class CStack; /* diff --git a/client/CAnimation.cpp b/client/CAnimation.cpp index f87712a84..2a28a30f2 100644 --- a/client/CAnimation.cpp +++ b/client/CAnimation.cpp @@ -749,7 +749,7 @@ void CompImage::BlitBlock(ui8 type, ui8 size, ui8 *&data, ui8 *&dest, ui8 alpha) for (size_t i=0; i::PutColorAlpha(dest, col); } return; diff --git a/client/CCreatureWindow.h b/client/CCreatureWindow.h index 25d08bca5..1d7a0e94b 100644 --- a/client/CCreatureWindow.h +++ b/client/CCreatureWindow.h @@ -19,7 +19,7 @@ class CCreature; class CStackInstance; class CCommanderInstance; class CStack; -class ArtifactLocation; +struct ArtifactLocation; class CCreatureArtifactInstance; class CAdventureMapButton; class CBonusItem; diff --git a/client/CHeroWindow.cpp b/client/CHeroWindow.cpp index f81af8f6f..b01cc67cf 100644 --- a/client/CHeroWindow.cpp +++ b/client/CHeroWindow.cpp @@ -305,13 +305,13 @@ void CHeroWindow::questlog() void CHeroWindow::commanderWindow() { //TODO: allow equipping commander artifacts by drag / drop - bool artSelected = false; + //bool artSelected = false; const CArtifactsOfHero::SCommonPart *commonInfo = artSets.front()->commonInfo; if (const CArtifactInstance *art = commonInfo->src.art) { const CGHeroInstance *srcHero = commonInfo->src.AOH->getHero(); - artSelected = true; + //artSelected = true; int freeSlot = art->firstAvailableSlot (curHero->commander); if (freeSlot < ArtifactPosition::COMMANDER_AFTER_LAST) //we don't want to put it in commander's backpack! { diff --git a/client/CPreGame.cpp b/client/CPreGame.cpp index e9d2b4fbe..837939e69 100644 --- a/client/CPreGame.cpp +++ b/client/CPreGame.cpp @@ -1554,7 +1554,7 @@ CChatBox::CChatBox(const Rect &rect) inputBox->used &= ~KEYBOARD; chatHistory = new CTextBox("", Rect(0, 0, rect.w, rect.h - height), 1); - SDL_Color green = {0,252,0}; + SDL_Color green = {0,252,0, SDL_ALPHA_OPAQUE}; chatHistory->color = green; } diff --git a/client/UIFramework/SDL_Extensions.cpp b/client/UIFramework/SDL_Extensions.cpp index 9a375afac..08eee102a 100644 --- a/client/UIFramework/SDL_Extensions.cpp +++ b/client/UIFramework/SDL_Extensions.cpp @@ -896,7 +896,7 @@ void CSDL_Ext::setPlayerColor(SDL_Surface * sur, ui8 player) tlog3 << "Warning, setPlayerColor called on not 8bpp surface!\n"; } -const TColorPutter CSDL_Ext::getPutterFor(SDL_Surface * const &dest, int incrementing) +TColorPutter CSDL_Ext::getPutterFor(SDL_Surface * const &dest, int incrementing) { #define CASE_BPP(BytesPerPixel) \ case BytesPerPixel: \ @@ -920,7 +920,7 @@ case BytesPerPixel: \ } -const TColorPutterAlpha CSDL_Ext::getPutterAlphaFor(SDL_Surface * const &dest, int incrementing) +TColorPutterAlpha CSDL_Ext::getPutterAlphaFor(SDL_Surface * const &dest, int incrementing) { switch(dest->format->BytesPerPixel) { diff --git a/client/UIFramework/SDL_Extensions.h b/client/UIFramework/SDL_Extensions.h index 5131ae751..502205ffd 100644 --- a/client/UIFramework/SDL_Extensions.h +++ b/client/UIFramework/SDL_Extensions.h @@ -133,8 +133,8 @@ namespace CSDL_Ext Uint8 *getPxPtr(const SDL_Surface * const &srf, const int x, const int y); - const TColorPutter getPutterFor(SDL_Surface * const &dest, int incrementing); //incrementing: -1, 0, 1 - const TColorPutterAlpha getPutterAlphaFor(SDL_Surface * const &dest, int incrementing); //incrementing: -1, 0, 1 + TColorPutter getPutterFor(SDL_Surface * const &dest, int incrementing); //incrementing: -1, 0, 1 + TColorPutterAlpha getPutterAlphaFor(SDL_Surface * const &dest, int incrementing); //incrementing: -1, 0, 1 BlitterWithRotationVal getBlitterWithRotation(SDL_Surface *dest); BlitterWithRotationVal getBlitterWithRotationAndAlpha(SDL_Surface *dest); diff --git a/lib/BattleState.cpp b/lib/BattleState.cpp index ce674b5db..5f227569f 100644 --- a/lib/BattleState.cpp +++ b/lib/BattleState.cpp @@ -3064,7 +3064,7 @@ const CGHeroInstance * CStack::getMyHero() const else //we are attached directly? BOOST_FOREACH(const CBonusSystemNode *n, getParentNodes()) if(n->getNodeType() == HERO) - dynamic_cast(n); + dynamic_cast(n);//FIXME: unused result. Missing return? return NULL; } diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index 82e1b7e71..69820574f 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -1520,7 +1520,7 @@ void CGameState::init(StartInfo * si) for(std::map::iterator k=players.begin(); k!=players.end(); ++k) { - if(k->first==-1 || k->first==255) + if(k->first==255) continue; //init visiting and garrisoned heroes diff --git a/lib/HeroBonus.cpp b/lib/HeroBonus.cpp index ab9a3bce0..b117862a3 100644 --- a/lib/HeroBonus.cpp +++ b/lib/HeroBonus.cpp @@ -858,7 +858,7 @@ void CBonusSystemNode::exportBonuses() exportBonus(b); } -const ui8 CBonusSystemNode::getNodeType() const +ui8 CBonusSystemNode::getNodeType() const { return nodeType; } diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index 9d4cbac7e..df97ef060 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -591,7 +591,7 @@ public: BonusList &getBonusList(); const BonusList &getBonusList() const; BonusList &getExportedBonusList(); - const ui8 getNodeType() const; + ui8 getNodeType() const; void setNodeType(ui8 type); const TNodesVector &getParentNodes() const; const TNodesVector &getChildrenNodes() const; diff --git a/lib/IGameCallback.cpp b/lib/IGameCallback.cpp index 9cfb61bd8..93a4b1687 100644 --- a/lib/IGameCallback.cpp +++ b/lib/IGameCallback.cpp @@ -443,7 +443,7 @@ int CBattleInfoCallback::battleGetMoatDmg() return 0; } -CGameState *const CPrivilagedInfoCallback::gameState () +CGameState * CPrivilagedInfoCallback::gameState () { return gs; } diff --git a/lib/IGameCallback.h b/lib/IGameCallback.h index 3b581f669..cbf8349a7 100644 --- a/lib/IGameCallback.h +++ b/lib/IGameCallback.h @@ -245,7 +245,7 @@ public: class DLL_LINKAGE CPrivilagedInfoCallback : public CGameInfoCallback { public: - CGameState *const gameState (); + CGameState * gameState (); void getFreeTiles (std::vector &tiles) const; //used for random spawns void getTilesInRange(boost::unordered_set &tiles, int3 pos, int radious, int player=-1, int mode=0) const; //mode 1 - only unrevealed tiles; mode 0 - all, mode -1 - only unrevealed void getAllTiles (boost::unordered_set &tiles, int player=-1, int level=-1, int surface=0) const; //returns all tiles on given level (-1 - both levels, otherwise number of level); surface: 0 - land and water, 1 - only land, 2 - only water diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index bb29f6d3e..ab9123e6f 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -1200,7 +1200,7 @@ DLL_LINKAGE void BattleSpellCast::applyGs( CGameState *gs ) vstd::amax(h->mana, 0); if (enemy && manaGained) enemy->mana += manaGained; - if (side >= 0 && side < 2) + if (side < 2) { gs->curB->castSpells[side]++; } diff --git a/lib/int3.h b/lib/int3.h index bd3c5a81e..54c3ace16 100644 --- a/lib/int3.h +++ b/lib/int3.h @@ -16,7 +16,7 @@ class int3 public: si32 x,y,z; inline int3():x(0),y(0),z(0){}; //c-tor, x/y/z initialized to 0 - inline int3(const si32 & X, const si32 & Y, const si32 & Z):x(X),y(Y),z(Z){}; //c-tor + inline int3(const si32 X, const si32 Y, const si32 Z):x(X),y(Y),z(Z){}; //c-tor inline int3(const int3 & val) : x(val.x), y(val.y), z(val.z){} //copy c-tor inline int3 operator=(const int3 & val) {x = val.x; y = val.y; z = val.z; return *this;} //assignemt operator ~int3() {} // d-tor - does nothing diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index c004b9d1c..f17802fb8 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -1517,7 +1517,7 @@ void CGameHandler::run(bool resume) for(; i != gs->players.end(); i++) { if((i->second.towns.size()==0 && i->second.heroes.size()==0) - || i->second.color<0 + //|| i->second.color<0 //FIXME: color is unsigned. Redundant or incorrect check? || i->first>=GameConstants::PLAYER_LIMIT || i->second.status) { @@ -4984,7 +4984,7 @@ void CGameHandler::checkLossVictory( ui8 player ) } } -void CGameHandler::getLossVicMessage( ui8 player, ui8 standard, bool victory, InfoWindow &out ) const +void CGameHandler::getLossVicMessage( ui8 player, si8 standard, bool victory, InfoWindow &out ) const { // const PlayerState *p = gs->getPlayer(player); // if(!p->human) @@ -4994,7 +4994,7 @@ void CGameHandler::getLossVicMessage( ui8 player, ui8 standard, bool victory, In if(victory) { - if(standard < 0) //not std loss + if(standard > 0) //not std loss { switch(gs->map->victoryCondition.condition) { @@ -5055,7 +5055,7 @@ void CGameHandler::getLossVicMessage( ui8 player, ui8 standard, bool victory, In } else { - if(standard < 0) //not std loss + if(standard > 0) //not std loss { switch(gs->map->lossCondition.typeOfLossCon) { diff --git a/server/CGameHandler.h b/server/CGameHandler.h index 048317d43..2ce922825 100644 --- a/server/CGameHandler.h +++ b/server/CGameHandler.h @@ -107,7 +107,7 @@ public: void runBattle(); void checkLossVictory(ui8 player); void winLoseHandle(ui8 players=255); //players: bit field - colours of players to be checked; default: all - void getLossVicMessage(ui8 player, ui8 standard, bool victory, InfoWindow &out) const; + void getLossVicMessage(ui8 player, si8 standard, bool victory, InfoWindow &out) const; ////used only in endBattle - don't touch elsewhere boost::function * battleEndCallback;