diff --git a/client/battle/CBattleInterface.cpp b/client/battle/CBattleInterface.cpp index a3b7b8085..ca7bccdda 100644 --- a/client/battle/CBattleInterface.cpp +++ b/client/battle/CBattleInterface.cpp @@ -898,8 +898,7 @@ void CBattleInterface::bSpellf() ESpellCastProblem::ESpellCastProblem spellCastProblem; if (curInt->cb->battleCanCastSpell(&spellCastProblem)) { - auto spellWindow = new CSpellWindow(genRect(595, 620, (screen->w - 620)/2, (screen->h - 595)/2), myHero, curInt.get()); - GH.pushInt(spellWindow); + GH.pushInt(new CSpellWindow(myHero, curInt.get())); } else if(spellCastProblem == ESpellCastProblem::MAGIC_IS_BLOCKED) { diff --git a/client/battle/CBattleInterfaceClasses.cpp b/client/battle/CBattleInterfaceClasses.cpp index 2246ce545..b1ce9b305 100644 --- a/client/battle/CBattleInterfaceClasses.cpp +++ b/client/battle/CBattleInterfaceClasses.cpp @@ -200,8 +200,7 @@ void CBattleHero::clickLeft(tribool down, bool previousState) } CCS->curh->changeGraphic(ECursor::ADVENTURE, 0); - auto spellWindow = new CSpellWindow(genRect(595, 620, (screen->w - 620)/2, (screen->h - 595)/2), myHero, myOwner->getCurrentPlayerInterface()); - GH.pushInt(spellWindow); + GH.pushInt(new CSpellWindow(myHero, myOwner->getCurrentPlayerInterface())); } } @@ -380,7 +379,7 @@ CBattleResultWindow::CBattleResultWindow(const BattleResult &br, const SDL_Rect auto heroInfo = owner.cb->battleGetHeroInfo(i); const int xs[] = {21, 392}; - if(heroInfo.portrait >= 0) //attacking hero + if(heroInfo.portrait >= 0) //attacking hero { new CAnimImage("PortraitsLarge", heroInfo.portrait, 0, xs[i], 38); sideNames[i] = heroInfo.name; @@ -448,7 +447,7 @@ CBattleResultWindow::CBattleResultWindow(const BattleResult &br, const SDL_Rect boost::algorithm::replace_first(str,"%s",ourHero->name); boost::algorithm::replace_first(str,"%d",boost::lexical_cast(br.exp[weAreAttacker?0:1])); } - + new CTextBox(str, Rect(69, 203, 330, 68), 0, FONT_SMALL, CENTER, Colors::WHITE); } else // we lose @@ -509,7 +508,7 @@ void CBattleResultWindow::bExitf() if(dynamic_cast(GH.topInt())) GH.popInts(1); //pop battle interface if present - //Result window and battle interface are gone. We requested all dialogs to be closed before opening the battle, + //Result window and battle interface are gone. We requested all dialogs to be closed before opening the battle, //so we can be sure that there is no dialogs left on GUI stack. intTmp.showingDialog->setn(false); CCS->videoh->close(); @@ -532,7 +531,7 @@ Point CClickableHex::getXYUnitAnim(BattleHex hexNum, const CStack * stack, CBatt break; case -4: //upper turret ret = cbi->siegeH->town->town->clientInfo.siegePositions[20]; - break; + break; } } else diff --git a/client/widgets/CArtifactHolder.cpp b/client/widgets/CArtifactHolder.cpp index 2c6be9976..8284b6b67 100644 --- a/client/widgets/CArtifactHolder.cpp +++ b/client/widgets/CArtifactHolder.cpp @@ -123,10 +123,7 @@ void CArtPlace::clickLeft(tribool down, bool previousState) if(ourArt && !down && previousState && !ourOwner->commonInfo->src.AOH) { if(ourArt->artType->id == ArtifactID::SPELLBOOK) - { - auto spellWindow = new CSpellWindow(genRect(595, 620, (screen->w - 620)/2, (screen->h - 595)/2), ourOwner->curHero, LOCPLINT, LOCPLINT->battleInt); - GH.pushInt(spellWindow); - } + GH.pushInt(new CSpellWindow(ourOwner->curHero, LOCPLINT, LOCPLINT->battleInt)); } if (!down && previousState) diff --git a/client/windows/CAdvmapInterface.cpp b/client/windows/CAdvmapInterface.cpp index 3ff25f631..d9bd91cde 100644 --- a/client/windows/CAdvmapInterface.cpp +++ b/client/windows/CAdvmapInterface.cpp @@ -714,8 +714,7 @@ void CAdvMapInt::fshowSpellbok() centerOn(selection); - auto spellWindow = new CSpellWindow(genRect(595, 620, (screen->w - 620)/2, (screen->h - 595)/2), curHero(), LOCPLINT, false); - GH.pushInt(spellWindow); + GH.pushInt(new CSpellWindow(curHero(), LOCPLINT, false)); } void CAdvMapInt::fadventureOPtions() diff --git a/client/windows/CHeroWindow.cpp b/client/windows/CHeroWindow.cpp index 54c61870e..802706495 100644 --- a/client/windows/CHeroWindow.cpp +++ b/client/windows/CHeroWindow.cpp @@ -4,7 +4,6 @@ #include "CAdvmapInterface.h" #include "CCreatureWindow.h" #include "CKingdomInterface.h" -#include "CSpellWindow.h" #include "GUIClasses.h" #include "../CBitmapHandler.h" diff --git a/client/windows/CSpellWindow.cpp b/client/windows/CSpellWindow.cpp index 912400118..a66325900 100644 --- a/client/windows/CSpellWindow.cpp +++ b/client/windows/CSpellWindow.cpp @@ -74,7 +74,7 @@ void CSpellWindow::InteractiveArea::hover(bool on) owner->statusBar->clear(); } -CSpellWindow::CSpellWindow(const SDL_Rect &, const CGHeroInstance * _myHero, CPlayerInterface * _myInt, bool openOnBattleSpells): +CSpellWindow::CSpellWindow(const CGHeroInstance * _myHero, CPlayerInterface * _myInt, bool openOnBattleSpells): CWindowObject(PLAYER_COLORED, "SpelBack"), battleSpellsOnly(openOnBattleSpells), selectedTab(4), diff --git a/client/windows/CSpellWindow.h b/client/windows/CSpellWindow.h index 747d7a646..c563b8fd8 100644 --- a/client/windows/CSpellWindow.h +++ b/client/windows/CSpellWindow.h @@ -92,7 +92,7 @@ private: public: - CSpellWindow(const SDL_Rect & myRect, const CGHeroInstance * _myHero, CPlayerInterface * _myInt, bool openOnBattleSpells = true); //c-tor + CSpellWindow(const CGHeroInstance * _myHero, CPlayerInterface * _myInt, bool openOnBattleSpells = true); //c-tor ~CSpellWindow(); //d-tor void fexitb(); diff --git a/client/windows/GUIClasses.cpp b/client/windows/GUIClasses.cpp index f7541bc49..e5706d102 100644 --- a/client/windows/GUIClasses.cpp +++ b/client/windows/GUIClasses.cpp @@ -5,7 +5,6 @@ #include "CCastleInterface.h" #include "CCreatureWindow.h" #include "CHeroWindow.h" -#include "CSpellWindow.h" #include "../CBitmapHandler.h" #include "../CGameInfo.h"