Skip to content

Commit

Permalink
Added customizable hero glow sprite for units.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tapsa authored and sandsmark committed Aug 3, 2021
1 parent d6fb090 commit 02baa4c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
12 changes: 8 additions & 4 deletions include/genie/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ enum GameVersion {
GV_AoE, /// 7.2
GV_RoR, /// 7.24
GV_Tapsa, /// I think maybe AoE1 Definitive Edition? Based on commit messages from Tapsa
GV_T2, GV_T3, GV_T4, GV_T5, GV_T6, GV_T7, GV_T8, /// From Tapsa testing, I think
GV_T2, GV_T3, GV_T4, GV_T5, GV_T6, GV_T7, GV_T8, // 10.1 - 10.8
GV_AoKE3, /// 9.36
GV_AoKA, /// 10.19
GV_AoKB, /// 11.05
GV_AoK, /// 11.5
GV_TC, // 11.76
GV_TCV, // Terrain patch
GV_UP15, // 11.76 with UserPatch 1.5
GV_Cysion, GV_C2, GV_C3, GV_C4, GV_CK, GV_C5, GV_C6, GV_C7, GV_C8, GV_C9, GV_C10, GV_C11, GV_C12, GV_C13, GV_C14, GV_C15, GV_C16,
// 12.0 - 12.74
GV_Cysion, // 12.0
GV_C2, GV_C3, GV_C4, GV_CK, GV_C5, GV_C6, GV_C7, GV_C8, GV_C9, GV_C10, GV_C11, GV_C12, GV_C13, GV_C14, // 12.52 - 12.94
GV_C15, // 13.11
GV_C16, // 20.01
GV_C17, // 20.14
GV_SWGB, /// 1.0
GV_CC, // 1.1
GV_CCV // Terrain patch
Expand All @@ -56,7 +59,8 @@ enum class GenieGame {
AgeOfEmpires2DefinitiveEdition
};

extern GameVersion GV_LatestTap, GV_LatestDE2;
const GameVersion GV_LatestTap = GV_T8;
const GameVersion GV_LatestDE2 = GV_C17;

struct XYZF {
float x = 0.f, y = 0.f, z = 0.f;
Expand Down
2 changes: 2 additions & 0 deletions include/genie/dat/unit/Creatable.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ class Creatable : public ISerializable
int16_t SpawningGraphic = -1;
int16_t UpgradeGraphic = -1;

int16_t HeroGlowGraphic = -1;

bool compareTo(const Creatable &other) const;

float MaxCharge = 0;
Expand Down
8 changes: 6 additions & 2 deletions src/dat/DatFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
namespace genie {

float ISerializable::dat_internal_ver = 0.f;
GameVersion GV_LatestTap = GV_T8;
GameVersion GV_LatestDE2 = GV_C16;

//------------------------------------------------------------------------------
DatFile::DatFile() :
Expand Down Expand Up @@ -117,6 +115,7 @@ std::string DatFile::versionName(const GameVersion version)
case genie::GV_C14: return "Age of Empires 3: Definitive Edition C14";
case genie::GV_C15: return "Age of Empires 3: Definitive Edition C15";
case genie::GV_C16: return "Age of Empires 3: Definitive Edition C16";
case genie::GV_C17: return "Age of Empires 3: Definitive Edition C17";
case genie::GV_SWGB: return "Star Wars: Galactic Battlegrounds";
case genie::GV_CC: return "Star Wars: Galactic Battlegrounds: Clone Campaigns";
case genie::GV_CCV: return "Star Wars: Galactic Battlegrounds: Clone Campaigns, terrain patch";
Expand Down Expand Up @@ -153,6 +152,8 @@ GameVersion DatFile::gameVersionFromString(const std::string &name)
return GV_C15;
case 3:
return GV_C16;
case 4:
return GV_C17;
default:
break;
}
Expand Down Expand Up @@ -425,6 +426,9 @@ void DatFile::serializeObject()

GameVersion gv = getGameVersion();
if (gv == GV_None) {
if (!m_rawMode) {
compressor_.endCompression();
}
throw std::runtime_error("No game version defined!");
}

Expand Down
4 changes: 4 additions & 0 deletions src/dat/unit/Creatable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ void Creatable::serializeObject()
serialize<float>(RechargeRate);
serialize<int16_t>(ChargeEvent);
serialize<int16_t>(ChargeType);

if (gv >= GV_C17) {
serialize<int16_t>(HeroGlowGraphic);
}
}
}
}
Expand Down

0 comments on commit 02baa4c

Please sign in to comment.