Skip to content

Commit

Permalink
Readying for 1.02 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ciplogic committed Apr 27, 2019
1 parent 2191004 commit e03eca3
Show file tree
Hide file tree
Showing 38 changed files with 162 additions and 164 deletions.
2 changes: 1 addition & 1 deletion VisualStudio/FHeroes2Enh/FHeroes2Enh.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ProjectGuid>{44565893-C329-4A99-AEDE-0167E3565389}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>FHeroes2Enh</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down
4 changes: 2 additions & 2 deletions fheroes2.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sound = on
sound volume = 0
sound volume =7
music = on
music volume = 0
music volume = 7
fullscreen = off
videomode = 1024x768
heroes speed = 10
Expand Down
Binary file modified src/Installer/Installer/fh2enh.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions src/engine/audio_cdrom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void Cdrom::Close()
}
}

bool Cdrom::isValid()
bool Cdrom::IsValid()
{
return cd;
}
Expand All @@ -104,7 +104,7 @@ int Cdrom::LoopCheck(void *data)

void Cdrom::Play(const u8 track, bool loop, bool force)
{
if(Mixer::isValid() && cd)
if(Mixer::IsValid() && cd)
{
SDL_LockMutex(cdLock);

Expand Down
2 changes: 1 addition & 1 deletion src/engine/audio_cdrom.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace Cdrom
{
bool isValid();
bool IsValid();
void Play(const u8 track, bool loop, bool force = false);
void Pause();
}
Expand Down
2 changes: 1 addition & 1 deletion src/engine/audio_mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void Mixer::Reset()
{
Music::Reset();
#ifdef WITH_AUDIOCD
if(Cdrom::isValid()) Cdrom::Pause();
if(Cdrom::IsValid()) Cdrom::Pause();
#endif
Mix_HaltChannel(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/agg/agg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ void AGG::PlayMusic(int mus, bool loop)
}
else
#ifdef WITH_AUDIOCD
if(conf.MusicCD() && Cdrom::isValid())
if(conf.MusicCD() && Cdrom::IsValid())
{
Cdrom::Play(mus, loop);
}
Expand Down
34 changes: 17 additions & 17 deletions src/fheroes2/ai/ai_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ void AIToCastle(Heroes& hero, uint32_t obj, s32 dst_index)
Army& army = castle->GetActualArmy();
//bool allow_enter = false;

if (army.m_troops.isValid())
if (army.m_troops.IsValid())
{
Heroes* defender = heroes.GuardFirst();
castle->ActionPreBattle();
Expand Down Expand Up @@ -735,7 +735,7 @@ void AIToTreasureChest(Heroes& hero, uint32_t obj, s32 dst_index)
{
const Artifact& art = tile.QuantityArtifact();

if (art.isValid() && !hero.PickupArtifact(art))
if (art.IsValid() && !hero.PickupArtifact(art))
gold = GoldInsteadArtifact(obj);
}
}
Expand All @@ -753,7 +753,7 @@ void AIToTreasureChest(Heroes& hero, uint32_t obj, s32 dst_index)
hero.IncreaseExperience(expr);
}
}
else if (art.isValid() && !hero.PickupArtifact(art))
else if (art.IsValid() && !hero.PickupArtifact(art))
gold = GoldInsteadArtifact(obj);
}

Expand Down Expand Up @@ -808,7 +808,7 @@ void AIToWagon(Heroes& hero, uint32_t obj, s32 dst_index)
{
const Artifact& art = tile.QuantityArtifact();

if (art.isValid())
if (art.IsValid())
hero.PickupArtifact(art);
else
hero.GetKingdom().AddFundsResource(tile.QuantityFunds());
Expand Down Expand Up @@ -1163,7 +1163,7 @@ void AIToEvent(Heroes& hero, uint32_t obj, s32 dst_index)
{
if (event_maps->resources.GetValidItemsCount())
hero.GetKingdom().AddFundsResource(event_maps->resources);
if (event_maps->artifact.isValid())
if (event_maps->artifact.IsValid())
hero.PickupArtifact(event_maps->artifact);
event_maps->SetVisited(hero.GetColor());

Expand Down Expand Up @@ -1219,7 +1219,7 @@ void AIToPoorMoraleObject(Heroes& hero, uint32_t obj, s32 dst_index)
complete = true;
const Artifact& art = tile.QuantityArtifact();

if (art.isValid() && !hero.PickupArtifact(art))
if (art.IsValid() && !hero.PickupArtifact(art))
gold = GoldInsteadArtifact(obj);

hero.GetKingdom().AddFundsResource(Funds(Resource::GOLD, gold));
Expand Down Expand Up @@ -1338,15 +1338,15 @@ void AIToDwellingJoinMonster(Heroes& hero, uint32_t obj, s32 dst_index)
Maps::Tiles& tile = world.GetTiles(dst_index);
const Troop& troop = tile.QuantityTroop();

if (troop.isValid() && hero.GetArmy().m_troops.JoinTroop(troop)) tile.MonsterSetCount(0);
if (troop.IsValid() && hero.GetArmy().m_troops.JoinTroop(troop)) tile.MonsterSetCount(0);
}

void AIToDwellingRecruitMonster(Heroes& hero, uint32_t obj, s32 dst_index)
{
Maps::Tiles& tile = world.GetTiles(dst_index);
const Troop& troop = tile.QuantityTroop();

if (troop.isValid())
if (troop.IsValid())
{
Kingdom& kingdom = hero.GetKingdom();
const payment_t paymentCosts = troop.GetCost();
Expand Down Expand Up @@ -1588,7 +1588,7 @@ bool AI::HeroesValidObject(const Heroes& hero, s32 index)
if (tile.CaptureObjectIsProtection())
{
Army enemy(tile);
return !enemy.m_troops.isValid() || Army::TroopsStrongerEnemyTroops(army.m_troops, enemy.m_troops);
return !enemy.m_troops.IsValid() || Army::TroopsStrongerEnemyTroops(army.m_troops, enemy.m_troops);
}
return true;
}
Expand All @@ -1611,7 +1611,7 @@ bool AI::HeroesValidObject(const Heroes& hero, s32 index)
if (tile.CaptureObjectIsProtection())
{
Army enemy(tile);
return !enemy.m_troops.isValid() ||
return !enemy.m_troops.IsValid() ||
Army::TroopsStrongerEnemyTroops(army.m_troops, enemy.m_troops);
}
return true;
Expand Down Expand Up @@ -1649,7 +1649,7 @@ bool AI::HeroesValidObject(const Heroes& hero, s32 index)
if (5 < variants && 14 > variants)
{
Army enemy(tile);
return !enemy.m_troops.isValid()
return !enemy.m_troops.IsValid()
|| Army::TroopsStrongerEnemyTroops(army.m_troops, enemy.m_troops);
}
// other
Expand Down Expand Up @@ -1766,7 +1766,7 @@ bool AI::HeroesValidObject(const Heroes& hero, s32 index)
case MP2::OBJ_THATCHEDHUT:
{
const Troop& troop = tile.QuantityTroop();
if (troop.isValid() &&
if (troop.IsValid() &&
(army.m_troops.HasMonster(troop()) ||
(!army.isFullHouse() && (troop._monster.isArchers() || troop._monster.isFly()))))
return true;
Expand All @@ -1787,7 +1787,7 @@ bool AI::HeroesValidObject(const Heroes& hero, s32 index)
const Troop& troop = tile.QuantityTroop();
const payment_t paymentCosts = troop.GetCost();

if (troop.isValid() && kingdom.AllowPayment(paymentCosts) &&
if (troop.IsValid() && kingdom.AllowPayment(paymentCosts) &&
(army.m_troops.HasMonster(troop()) ||
(!army.isFullHouse() && (troop._monster.isArchers() || troop._monster.isFly()))))
return true;
Expand All @@ -1805,7 +1805,7 @@ bool AI::HeroesValidObject(const Heroes& hero, s32 index)
const Troop& troop = tile.QuantityTroop();
const payment_t paymentCosts = troop.GetCost();

if (troop.isValid() && kingdom.AllowPayment(paymentCosts) &&
if (troop.IsValid() && kingdom.AllowPayment(paymentCosts) &&
(army.m_troops.HasMonster(troop()) ||
!army.isFullHouse()))
return true;
Expand All @@ -1819,7 +1819,7 @@ bool AI::HeroesValidObject(const Heroes& hero, s32 index)
const Troop& troop = tile.QuantityTroop();
const payment_t paymentCosts = troop.GetCost();

if (troop.isValid() && kingdom.AllowPayment(paymentCosts) &&
if (troop.IsValid() && kingdom.AllowPayment(paymentCosts) &&
(army.m_troops.HasMonster(troop()) ||
!army.isFullHouse()))
return true;
Expand Down Expand Up @@ -1861,7 +1861,7 @@ bool AI::HeroesValidObject(const Heroes& hero, s32 index)
tile.QuantityIsValid())
{
Army enemy(tile);
return enemy.m_troops.isValid()
return enemy.m_troops.IsValid()
&& Army::TroopsStrongerEnemyTroops(army.m_troops, enemy.m_troops);
}
break;
Expand All @@ -1875,7 +1875,7 @@ bool AI::HeroesValidObject(const Heroes& hero, s32 index)
case MP2::OBJ_MONSTER:
{
Army enemy(tile);
return !enemy.m_troops.isValid()
return !enemy.m_troops.IsValid()
|| Army::TroopsStrongerEnemyTroops(army.m_troops, enemy.m_troops);
}
break;
Expand Down
6 changes: 3 additions & 3 deletions src/fheroes2/ai/simple/ai_castle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void AI::CastleTurn(Castle& castle)

// part II
if (enemy &&
castle.GetArmy().m_troops.isValid() &&
castle.GetArmy().m_troops.IsValid() &&
Army::TroopsStrongerEnemyTroops(castle.GetArmy().m_troops, enemy->GetArmy().m_troops))
{
if (can_recruit)
Expand All @@ -223,7 +223,7 @@ void AI::CastleTurn(Castle& castle)
// part III
AIKingdom& ai = AIKingdoms::Get(castle.GetColor());
if (ai.capital != &castle &&
castle.GetArmy().m_troops.isValid() && !hero &&
castle.GetArmy().m_troops.IsValid() && !hero &&
2 < castle.GetArmy().m_troops.GetCount() &&
150 < castle.GetArmy().m_troops.GetHitPoints() &&
can_recruit)
Expand All @@ -244,7 +244,7 @@ void AI::CastleTurn(Castle& castle)
void AI::CastlePreBattle(Castle& castle)
{
Heroes* hero = castle.GetHeroes().GuardFirst();
if (hero && castle.GetArmy().m_troops.isValid())
if (hero && castle.GetArmy().m_troops.IsValid())
hero->GetArmy().JoinStrongestFromArmy(castle.GetArmy());
}

Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/ai/simple/ai_heroes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ bool AIHeroesPriorityObject(const Heroes& hero, s32 index)
{
// maybe need join army
return hero.Modes(AI::HEROES_HUNTER) &&
castle->GetArmy().m_troops.isValid() &&
castle->GetArmy().m_troops.IsValid() &&
!hero.isVisited(world.GetTiles(castle->GetIndex()));
}
if (!hero.isFriends(castle->GetColor()))
Expand Down
Loading

0 comments on commit e03eca3

Please sign in to comment.