1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Fixed RETURN_IF_BATTLE(). Undid disabled warnings. Fixed indentation.

This commit is contained in:
John Bolton 2020-10-05 16:27:04 -07:00
parent aee51ecc27
commit c61bae4060
24 changed files with 99 additions and 102 deletions

View File

@ -50,7 +50,7 @@ TSubgoal VisitTile::whatToDoToAchieve()
else
{
return sptr(GatherArmy((int)(fh->evaluateDanger(tile, *ret->hero) * SAFE_ATTACK_CONSTANT))
.sethero(ret->hero).setisAbstract(true));
.sethero(ret->hero).setisAbstract(true));
}
}
return ret;

View File

@ -97,11 +97,11 @@ TSubgoal Win::whatToDoToAchieve()
{
auto towns = cb->getTownsInfo();
towns.erase(boost::remove_if(towns,
[](const CGTownInstance * t) -> bool
[](const CGTownInstance * t) -> bool
{
return vstd::contains(t->forbiddenBuildings, BuildingID::GRAIL);
}),
towns.end());
towns.end());
boost::sort(towns, CDistanceSorter(h.get()));
if(towns.size())
{

View File

@ -812,7 +812,7 @@ void VCAI::makeTurn()
}
catch (boost::thread_interrupted & e)
{
(void)e;
(void)e;
logAi->debug("Making turn thread has been interrupted. We'll end without calling endTurn.");
return;
}
@ -969,7 +969,7 @@ void VCAI::mainLoop()
}
catch (boost::thread_interrupted & e)
{
(void)e;
(void)e;
logAi->debug("Player %d: Making turn thread received an interruption!", playerID);
throw; //rethrow, we want to truly end this thread
}
@ -2332,7 +2332,7 @@ void VCAI::striveToGoal(Goals::TSubgoal basicGoal)
}
catch (boost::thread_interrupted & e)
{
(void)e;
(void)e;
logAi->debug("Player %d: Making turn thread received an interruption!", playerID);
throw; //rethrow, we want to truly end this thread
}

View File

@ -143,11 +143,8 @@ if(WIN32)
# Suppress warnings
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
# 4003: not enough actual parameters for macro 'identifier'
# 4250: 'class1' : inherits 'class2::member' via dominance
# 4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
# 4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /wd4003 /wd4250 /wd4251 /wd4275")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /wd4250")
if(ENABLE_MULTI_PROCESS_BUILDS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")

View File

@ -137,9 +137,9 @@ SDL_Surface * BitmapHandler::loadBitmapFromDir(std::string path, std::string fna
else
{ //loading via SDL_Image
ret = IMG_Load_RW(
//create SDL_RW with our data (will be deleted by SDL)
SDL_RWFromConstMem((void*)readFile.first.get(), (int)readFile.second),
1); // mark it for auto-deleting
//create SDL_RW with our data (will be deleted by SDL)
SDL_RWFromConstMem((void*)readFile.first.get(), (int)readFile.second),
1); // mark it for auto-deleting
if (ret)
{
if (ret->format->palette)

View File

@ -146,9 +146,9 @@ static void prog_help(const po::options_description &opts)
}
static void SDLLogCallback(void* userdata,
int category,
SDL_LogPriority priority,
const char* message)
int category,
SDL_LogPriority priority,
const char* message)
{
//todo: convert SDL log priority to vcmi log priority
//todo: make separate log domain for SDL
@ -173,7 +173,7 @@ int main(int argc, char * argv[])
// Correct working dir executable folder (not bundle folder) so we can use executable relative paths
boost::filesystem::current_path(boost::filesystem::system_complete(argv[0]).parent_path());
#endif
std::cout << "Starting... " << std::endl;
std::cout << "Starting... " << std::endl;
po::options_description opts("Allowed options");
opts.add_options()
("help,h", "display help and exit")
@ -208,7 +208,7 @@ int main(int argc, char * argv[])
}
catch(std::exception &e)
{
std::cerr << "Failure during parsing command-line options:\n" << e.what() << std::endl;
std::cerr << "Failure during parsing command-line options:\n" << e.what() << std::endl;
}
}
@ -1196,9 +1196,9 @@ static bool recreateWindow(int w, int h, int bpp, bool fullscreen, int displayIn
SDL_SetSurfaceBlendMode(screen, SDL_BLENDMODE_NONE);
screenTexture = SDL_CreateTexture(mainRenderer,
SDL_PIXELFORMAT_ARGB8888,
SDL_TEXTUREACCESS_STREAMING,
w, h);
SDL_PIXELFORMAT_ARGB8888,
SDL_TEXTUREACCESS_STREAMING,
w, h);
if(nullptr == screenTexture)
{
@ -1286,7 +1286,7 @@ static void handleEvent(SDL_Event & ev)
handleQuit(false);
return;
}
break;
break;
case EUserEvent::RETURN_TO_MAIN_MENU:
{
CSH->endGameplay();

View File

@ -74,7 +74,7 @@ void CMessage::init()
dialogBorders[i] = make_unique<CAnimation>("DIALGBOX");
dialogBorders[i]->preload();
for(int j=0; j < dialogBorders[i]->size(0); j++)
for(int j=0; j < dialogBorders[i]->size(0); j++)
{
auto image = dialogBorders[i]->getImage(j, 0);
//assume blue color initially
@ -478,7 +478,7 @@ void ComponentsToBlit::blitCompsOnSur( bool blitOr, int inter, int &curh, SDL_Su
curw+=inter;
graphics->fonts[FONT_MEDIUM]->renderTextLeft(ret, CGI->generaltexth->allTexts[4], Colors::WHITE,
Point(curw,middleh-((int)graphics->fonts[FONT_MEDIUM]->getLineHeight()/2)));
Point(curw,middleh-((int)graphics->fonts[FONT_MEDIUM]->getLineHeight()/2)));
curw+=orWidth;
}

View File

@ -27,8 +27,8 @@
// sounds mapped to soundBase enum
static std::string sounds[] = {
"", // invalid
"", // todo
"", // invalid
"", // todo
VCMI_SOUND_LIST
};
#undef VCMI_SOUND_NAME
@ -94,19 +94,19 @@ CSoundHandler::CSoundHandler():
soundBase::pickup04, soundBase::pickup05, soundBase::pickup06, soundBase::pickup07
};
horseSounds = // must be the same order as terrains (see ETerrainType);
{
horseSounds = // must be the same order as terrains (see ETerrainType);
{
soundBase::horseDirt, soundBase::horseSand, soundBase::horseGrass,
soundBase::horseSnow, soundBase::horseSwamp, soundBase::horseRough,
soundBase::horseSubterranean, soundBase::horseLava,
soundBase::horseWater, soundBase::horseRock
};
};
battleIntroSounds =
{
soundBase::battle00, soundBase::battle01,
soundBase::battle02, soundBase::battle03, soundBase::battle04,
soundBase::battle05, soundBase::battle06, soundBase::battle07
soundBase::battle02, soundBase::battle03, soundBase::battle04,
soundBase::battle05, soundBase::battle06, soundBase::battle07
};
};
@ -510,7 +510,7 @@ MusicEntry::MusicEntry(CMusicHandler *owner, std::string setName, std::string mu
owner(owner),
music(nullptr),
loop(looped ? -1 : 1),
setName(std::move(setName))
setName(std::move(setName))
{
if (!musicURI.empty())
load(std::move(musicURI));

View File

@ -2524,7 +2524,7 @@ void CPlayerInterface::askToAssembleArtifact(const ArtifactLocation &al)
if(art == nullptr)
{
logGlobal->error("artifact location %d points to nothing",
al.slot.num);
al.slot.num);
return;
}
CHeroArtPlace::askToAssemble(art, al.slot, hero);

View File

@ -32,7 +32,7 @@
#include "../../lib/spells/CSpellHandler.h"
CBattleAnimation::CBattleAnimation(CBattleInterface * _owner)
: owner(_owner), ID(_owner->animIDhelper++)
: owner(_owner), ID(_owner->animIDhelper++)
{
logAnim->trace("Animation #%d created", ID);
}
@ -83,9 +83,9 @@ bool CBattleAnimation::isEarliest(bool perStackConcurrency)
}
CBattleStackAnimation::CBattleStackAnimation(CBattleInterface * owner, const CStack * stack)
: CBattleAnimation(owner),
myAnim(owner->creAnims[stack->ID]),
stack(stack)
: CBattleAnimation(owner),
myAnim(owner->creAnims[stack->ID]),
stack(stack)
{
assert(myAnim);
}
@ -213,7 +213,7 @@ bool CDefenceAnimation::init()
if (!rangedAttack && getMyAnimType() != CCreatureAnim::DEFENCE)
{
float frameLength = AnimationControls::getCreatureAnimationSpeed(
stack->getCreature(), owner->creAnims[stack->ID].get(), getMyAnimType());
stack->getCreature(), owner->creAnims[stack->ID].get(), getMyAnimType());
timeToWait = myAnim->framesInGroup(getMyAnimType()) * frameLength / 2;
@ -339,7 +339,7 @@ bool CMeleeAttackAnimation::init()
// opponent must face attacker ( = different directions) before he can be attacked
if(attackingStack && attackedStack &&
owner->creDir[attackingStack->ID] == owner->creDir[attackedStack->ID])
owner->creDir[attackingStack->ID] == owner->creDir[attackedStack->ID])
return false;
//reversed
@ -392,7 +392,7 @@ bool CMeleeAttackAnimation::init()
case 4:
case 5:
group = mutPosToGroup[mutPos];
if(attackingStack->hasBonusOfType(Bonus::TWO_HEX_ATTACK_BREATH))
if(attackingStack->hasBonusOfType(Bonus::TWO_HEX_ATTACK_BREATH))
{
CCreatureAnim::EAnimType group2H = mutPosToGroup2H[mutPos];
if(myAnim->framesInGroup(group2H)>0)
@ -560,15 +560,15 @@ void CMovementAnimation::endAnim()
}
CMovementAnimation::CMovementAnimation(CBattleInterface *_owner, const CStack *_stack, std::vector<BattleHex> _destTiles, int _distance)
: CBattleStackAnimation(_owner, _stack),
destTiles(_destTiles),
curentMoveIndex(0),
oldPos(stack->getPosition()),
begX(0), begY(0),
distanceX(0), distanceY(0),
timeToMove(0.0),
progress(0.0),
nextHex(destTiles.front())
: CBattleStackAnimation(_owner, _stack),
destTiles(_destTiles),
curentMoveIndex(0),
oldPos(stack->getPosition()),
begX(0), begY(0),
distanceX(0), distanceY(0),
timeToMove(0.0),
progress(0.0),
nextHex(destTiles.front())
{
logAnim->debug("Created movement anim for %s", stack->getName());
}
@ -840,7 +840,7 @@ bool CShootingAnimation::init()
// Add explosion anim
Point animPos(destPos.x - 126 + img->width() / 2,
destPos.y - 105 + img->height() / 2);
destPos.y - 105 + img->height() / 2);
owner->addNewAnim( new CEffectAnimation(owner, catapultDamage ? "SGEXPL.DEF" : "CSGRCK.DEF", animPos.x, animPos.y));
}
@ -944,7 +944,7 @@ bool CCastAnimation::init()
//reverse unit if necessary
if(attackedStack)
{
if(owner->getCurrentPlayerInterface()->cb->isToReverse(attackingStack->getPosition(), attackedStack->getPosition(), owner->creDir[attackingStack->ID], attackingStack->doubleWide(), owner->creDir[attackedStack->ID]))
if(owner->getCurrentPlayerInterface()->cb->isToReverse(attackingStack->getPosition(), attackedStack->getPosition(), owner->creDir[attackingStack->ID], attackingStack->doubleWide(), owner->creDir[attackedStack->ID]))
{
owner->addNewAnim(new CReverseAnimation(owner, attackingStack, attackingStack->getPosition(), true));
return false;
@ -952,7 +952,7 @@ bool CCastAnimation::init()
}
else
{
if(dest.isValid() && owner->getCurrentPlayerInterface()->cb->isToReverse(attackingStack->getPosition(), dest, owner->creDir[attackingStack->ID], false, false))
if(dest.isValid() && owner->getCurrentPlayerInterface()->cb->isToReverse(attackingStack->getPosition(), dest, owner->creDir[attackingStack->ID], false, false))
{
owner->addNewAnim(new CReverseAnimation(owner, attackingStack, attackingStack->getPosition(), true));
return false;

View File

@ -83,9 +83,9 @@ static void transformPalette(SDL_Surface *surf, double rCor, double gCor, double
color->g != 231 &&
color->r != 255) //it's not yellow border
{
color->r = static_cast<Uint8>(color->r * rCor);
color->g = static_cast<Uint8>(color->g * gCor);
color->b = static_cast<Uint8>(color->b * bCor);
color->r = static_cast<Uint8>(color->r * rCor);
color->g = static_cast<Uint8>(color->g * gCor);
color->b = static_cast<Uint8>(color->b * bCor);
}
}
}
@ -1696,7 +1696,7 @@ void CBattleInterface::enterCreatureCastingMode()
if (tacticsMode)
return;
//hero is casting a spell
//hero is casting a spell
if (spellDestSelectMode)
return;
@ -2347,7 +2347,7 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType)
cursorFrame = ECursor::COMBAT_SHOOT;
realizeAction = [=](){giveCommand(EActionType::SHOOT, myNumber);};
TDmgRange damage = curInt->cb->battleEstimateDamage(activeStack, shere);
TDmgRange damage = curInt->cb->battleEstimateDamage(activeStack, shere);
std::string estDmgText = formatDmgRange(std::make_pair((ui32)damage.first, (ui32)damage.second)); //calculating estimated dmg
//printing - Shoot %s (%d shots left, %s damage)
consoleMsg = (boost::format(CGI->generaltexth->allTexts[296]) % shere->getName() % activeStack->shots.available() % estDmgText).str();
@ -3157,7 +3157,7 @@ void CBattleInterface::showHighlightedHexes(SDL_Surface *to)
spells::Mode mode = spells::Mode::HERO;
if(spellToCast)//hero casts spell
if(spellToCast)//hero casts spell
{
spell = SpellID(spellToCast->actionSubtype).toSpell();
caster = getActiveHero();
@ -3212,7 +3212,7 @@ void CBattleInterface::showProjectiles(SDL_Surface *to)
{
// frame we're waiting for is reached OR animation has already finished
if (creAnims[it->stackID]->getCurrentFrame() >= it->animStartDelay ||
creAnims[it->stackID]->isShooting() == false)
creAnims[it->stackID]->isShooting() == false)
{
//at this point projectile should become visible
creAnims[it->stackID]->pause(); // pause animation
@ -3311,8 +3311,8 @@ void CBattleInterface::showAliveStacks(SDL_Surface *to, std::vector<const CStack
BattleHex currentActionTarget;
if(curInt->curAction)
{
auto target = curInt->curAction->getTarget(curInt->cb.get());
if(!target.empty())
auto target = curInt->curAction->getTarget(curInt->cb.get());
if(!target.empty())
currentActionTarget = target.at(0).hexValue;
}
@ -3397,7 +3397,7 @@ void CBattleInterface::showAliveStacks(SDL_Surface *to, std::vector<const CStack
//blitting amount
Point textPos(creAnims[stack->ID]->pos.x + xAdd + amountNormal->w/2,
creAnims[stack->ID]->pos.y + yAdd + amountNormal->h/2);
creAnims[stack->ID]->pos.y + yAdd + amountNormal->h/2);
graphics->fonts[FONT_TINY]->renderTextCenter(to, makeNumberShort(stack->getCount()), Colors::WHITE, textPos);
}
}

View File

@ -366,8 +366,8 @@ void CDefFile::loadFrame(size_t frame, size_t group, ImageLoader &loader) const
const ui32 BaseOffset = currentOffset;
loader.init(Point(sprite.width, sprite.height),
Point(sprite.leftMargin, sprite.topMargin),
Point(sprite.fullWidth, sprite.fullHeight), palette.get());
Point(sprite.leftMargin, sprite.topMargin),
Point(sprite.fullWidth, sprite.fullHeight), palette.get());
switch(sprite.format)
{
@ -1070,7 +1070,7 @@ void CAnimation::duplicateImage(const size_t sourceGroup, const size_t sourceFra
if(clone.getType() == JsonNode::JsonType::DATA_NULL)
{
std::string temp = name+":"+boost::lexical_cast<std::string>(sourceGroup)+":"+boost::lexical_cast<std::string>(sourceFrame);
clone["file"].String() = temp;
clone["file"].String() = temp;
}
source[targetGroup].push_back(clone);

View File

@ -121,7 +121,7 @@ void CGuiHandler::pushInt(std::shared_ptr<IShowActivatable> newInt)
if(!listInt.empty())
listInt.front()->deactivate();
listInt.push_front(newInt);
CCS->curh->changeGraphic(ECursor::ADVENTURE, 0);
CCS->curh->changeGraphic(ECursor::ADVENTURE, 0);
newInt->activate();
objsToBlit.push_back(newInt);
totalRedraw();

View File

@ -214,5 +214,5 @@ class WindowBase : public CIntObject
public:
WindowBase(int used_ = 0, Point pos_ = Point());
protected:
void close();
void close();
};

View File

@ -105,9 +105,9 @@ std::array<CBitmapFont::BitmapChar, CBitmapFont::totalChars> CBitmapFont::loadCh
}
CBitmapFont::CBitmapFont(const std::string & filename):
data(CResourceHandler::get()->load(ResourceID("data/" + filename, EResType::BMP_FONT))->readAll()),
chars(loadChars()),
height(data.first.get()[5])
data(CResourceHandler::get()->load(ResourceID("data/" + filename, EResType::BMP_FONT))->readAll()),
chars(loadChars()),
height(data.first.get()[5])
{}
size_t CBitmapFont::getLineHeight() const
@ -234,9 +234,9 @@ int CTrueTypeFont::getFontStyle(const JsonNode &config)
}
CTrueTypeFont::CTrueTypeFont(const JsonNode & fontConfig):
data(loadData(fontConfig)),
font(loadFont(fontConfig), TTF_CloseFont),
blended(fontConfig["blend"].Bool())
data(loadData(fontConfig)),
font(loadFont(fontConfig), TTF_CloseFont),
blended(fontConfig["blend"].Bool())
{
assert(font);
@ -366,9 +366,9 @@ void CBitmapHanFont::renderText(SDL_Surface * surface, const std::string & data,
}
CBitmapHanFont::CBitmapHanFont(const JsonNode &config):
fallback(new CBitmapFont(config["fallback"].String())),
data(CResourceHandler::get()->load(ResourceID("data/" + config["name"].String(), EResType::OTHER))->readAll()),
size((size_t)config["size"].Float())
fallback(new CBitmapFont(config["fallback"].String())),
data(CResourceHandler::get()->load(ResourceID("data/" + config["name"].String(), EResType::OTHER))->readAll()),
size((size_t)config["size"].Float())
{
// basic tests to make sure that fonts are OK
// 1) fonts must contain 190 "sections", 126 symbols each.

View File

@ -185,8 +185,8 @@ void CSDL_Ext::alphaTransform(SDL_Surface *src)
assert(src->format->BitsPerPixel == 8);
SDL_Color colors[] =
{
{ 0, 0, 0, 0}, { 0, 0, 0, 32}, { 0, 0, 0, 64},
{ 0, 0, 0, 128}, { 0, 0, 0, 128}
{ 0, 0, 0, 0}, { 0, 0, 0, 32}, { 0, 0, 0, 64},
{ 0, 0, 0, 128}, { 0, 0, 0, 128}
};

View File

@ -133,17 +133,17 @@ void CLobbyScreen::startScenario(bool allowOnlyAI)
}
catch(ExceptionMapMissing & e)
{
(void)e;
(void)e; // unused
}
catch(ExceptionNoHuman & e)
{
(void)e;
(void)e; // unused
// You must position yourself prior to starting the game.
CInfoWindow::showYesNoDialog(std::ref(CGI->generaltexth->allTexts[530]), CInfoWindow::TCompsInfo(), 0, std::bind(&CLobbyScreen::startScenario, this, true), PlayerColor(1));
}
catch(ExceptionNoTemplate & e)
{
(void)e;
(void)e; // unused
CInfoWindow::showInfoDialog(std::ref(CGI->generaltexth->allTexts[751]), CInfoWindow::TCompsInfo(), PlayerColor(1));
}
catch(...)

View File

@ -101,7 +101,7 @@ bool mapSorter::operator()(const std::shared_ptr<CMapInfo> aaa, const std::share
{
case _numOfMaps: //by number of maps in campaign
return CGI->generaltexth->campaignRegionNames[aaa->campaignHeader->mapVersion].size() <
CGI->generaltexth->campaignRegionNames[bbb->campaignHeader->mapVersion].size();
CGI->generaltexth->campaignRegionNames[bbb->campaignHeader->mapVersion].size();
break;
case _name: //by name
return boost::ilexicographical_compare(aaa->campaignHeader->name, bbb->campaignHeader->name);

View File

@ -988,7 +988,7 @@ CMapHandler::AnimBitmapHolder CMapHandler::CMapBlitter::findHeroBitmap(const CGH
bool moving = !hero->isStanding;
int group = getHeroFrameGroup(hero->moveDir, moving);
if(animation->size(group) > 0)
if(animation->size(group) > 0)
{
int frame = anim % animation->size(group);
auto heroImage = animation->getImage(frame, group);
@ -1073,7 +1073,7 @@ CMapHandler::AnimBitmapHolder CMapHandler::CMapBlitter::findObjectBitmap(const C
// normal object
std::shared_ptr<CAnimation> animation = graphics->getAnimation(obj);
size_t groupSize = animation->size();
if(groupSize == 0)
if(groupSize == 0)
return CMapHandler::AnimBitmapHolder();
auto bitmap = animation->getImage((anim + getPhaseShift(obj)) % groupSize);

View File

@ -140,10 +140,10 @@ void CBuildingRect::clickRight(tribool down, bool previousState)
SDL_Color multiplyColors(const SDL_Color & b, const SDL_Color & a, double f)
{
SDL_Color ret;
ret.r = static_cast<Uint8>(a.r * f + b.r * (1 - f));
ret.g = static_cast<Uint8>(a.g * f + b.g * (1 - f));
ret.b = static_cast<Uint8>(a.b * f + b.b * (1 - f));
ret.a = static_cast<Uint8>(a.a * f + b.b * (1 - f));
ret.r = static_cast<Uint8>(a.r * f + b.r * (1 - f));
ret.g = static_cast<Uint8>(a.g * f + b.g * (1 - f));
ret.b = static_cast<Uint8>(a.b * f + b.b * (1 - f));
ret.a = static_cast<Uint8>(a.a * f + b.b * (1 - f));
return ret;
}
@ -604,7 +604,7 @@ void CCastleBuildings::recreate()
const CStructure * toAdd = *boost::max_element(entry.second, [=](const CStructure * a, const CStructure * b)
{
return build->getDistance(a->building->bid)
< build->getDistance(b->building->bid);
< build->getDistance(b->building->bid);
});
buildings.push_back(std::make_shared<CBuildingRect>(this, town, toAdd));
@ -1359,7 +1359,7 @@ CHallInterface::CHallInterface(const CGTownInstance * Town):
}
}
int posX = pos.w/2 - (int)boxList[row].size()*154/2 - ((int)boxList[row].size()-1)*20 + 194*(int)col,
posY = 35 + 104*(int)row;
posY = 35 + 104*(int)row;
if(building)
boxes[row].push_back(std::make_shared<CBuildingBox>(posX, posY, town, building));
@ -1770,10 +1770,10 @@ CBlacksmithDialog::CBlacksmithDialog(bool possible, CreatureID creMachineID, Art
anim->clipRect(113,125,200,150);
title = std::make_shared<CLabel>(165, 28, FONT_BIG, CENTER, Colors::YELLOW,
boost::str(boost::format(CGI->generaltexth->allTexts[274]) % creature->nameSing));
boost::str(boost::format(CGI->generaltexth->allTexts[274]) % creature->nameSing));
costText = std::make_shared<CLabel>(165, 218, FONT_MEDIUM, CENTER, Colors::WHITE, CGI->generaltexth->jktexts[43]);
costValue = std::make_shared<CLabel>(165, 290, FONT_MEDIUM, CENTER, Colors::WHITE,
boost::lexical_cast<std::string>(CGI->arth->artifacts[aid]->price));
boost::lexical_cast<std::string>(CGI->arth->artifacts[aid]->price));
std::string text = boost::str(boost::format(CGI->generaltexth->allTexts[595]) % creature->nameSing);
buy = std::make_shared<CButton>(Point(42, 312), "IBUY30.DEF", CButton::tooltip(text), [&](){ close(); }, SDLK_RETURN);

View File

@ -207,8 +207,8 @@ private:
ui32 count;
std::string hoverText;
OwnedObjectInfo():
imageID(0),
count(0)
imageID(0),
count(0)
{}
};
std::vector<OwnedObjectInfo> objects;
@ -309,7 +309,7 @@ class CHeroItem : public CIntObject, public CGarrisonHolder
std::shared_ptr<CIntObject> onTabSelected(size_t index);
public:
std::shared_ptr<CArtifactsOfHero> heroArts;
std::shared_ptr<CArtifactsOfHero> heroArts;
void updateGarrisons() override;

View File

@ -486,8 +486,8 @@ void CTradeWindow::getPositionsFor(std::vector<Rect> &poss, bool Left, EType typ
for (int j = 0; j < 5 ; j++)
poss.push_back(Rect(x + dx*j, y + dy*i, w, h));
poss.push_back(Rect((int)(x + dx * 1.5), (y + dy * 4), w, h));
poss.push_back(Rect((int)(x + dx * 2.5), (y + dy * 4), w, h));
poss.push_back(Rect((int)(x + dx * 1.5), (y + dy * 4), w, h));
poss.push_back(Rect((int)(x + dx * 2.5), (y + dy * 4), w, h));
}
else
{
@ -836,7 +836,7 @@ void CMarketplaceWindow::selectionChanged(bool side)
if(mode == EMarketMode::RESOURCE_RESOURCE)
readyToTrade = readyToTrade && (hLeft->id != hRight->id); //for resource trade, two DIFFERENT resources must be selected
if(mode == EMarketMode::ARTIFACT_RESOURCE && !hLeft)
if(mode == EMarketMode::ARTIFACT_RESOURCE && !hLeft)
arts->unmarkSlots(false);
if(readyToTrade)
@ -1095,7 +1095,7 @@ CAltarWindow::CAltarWindow(const IMarket * Market, const CGHeroInstance * Hero,
{
//%s's Creatures
labels.push_back(std::make_shared<CLabel>(155, 30, FONT_SMALL, CENTER, Colors::YELLOW,
boost::str(boost::format(CGI->generaltexth->allTexts[272]) % hero->name)));
boost::str(boost::format(CGI->generaltexth->allTexts[272]) % hero->name)));
//Altar of Sacrifice
labels.push_back(std::make_shared<CLabel>(450, 30, FONT_SMALL, CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[479]));

View File

@ -10,7 +10,7 @@
#pragma once
#include "../GameConstants.h"
#define RETURN_IF_NOT_BATTLE(X) if(!duringBattle()) {logGlobal->error("%s called when no battle!", __FUNCTION__); return X; }
#define RETURN_IF_NOT_BATTLE(...) if(!duringBattle()) {logGlobal->error("%s called when no battle!", __FUNCTION__); return __VA_ARGS__; }
class IBattleInfo;
class BattleInfo;

View File

@ -693,7 +693,7 @@ std::vector<JsonNode> CSpellHandler::loadLegacyData(size_t dataSize)
skip(3);
read(true,true);//read creature abilities
//TODO: maybe move to config
//TODO: maybe move to config
//clone Acid Breath attributes for Acid Breath damage effect
JsonNode temp = legacyData[SpellID::ACID_BREATH_DEFENSE];
temp["index"].Integer() = SpellID::ACID_BREATH_DAMAGE;
@ -1036,7 +1036,7 @@ std::vector<bool> CSpellHandler::getDefaultAllowed() const
void CSpellHandler::update780()
{
static_assert(MINIMAL_SERIALIZATION_VERSION < 780, "No longer needed CSpellHandler::update780");
static_assert(MINIMAL_SERIALIZATION_VERSION < 780, "No longer needed CSpellHandler::update780");
auto spellsContent = VLC->modh->content["spells"];