Skip to content

Commit

Permalink
add doxygen file, more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sandsmark committed Sep 21, 2019
1 parent b2aa046 commit 2901b34
Show file tree
Hide file tree
Showing 10 changed files with 2,753 additions and 115 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@
build/
debug/
release/

# generated files by doxygen
doc/
2,536 changes: 2,536 additions & 0 deletions doc/genieutils.doxygen

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions include/genie/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@
namespace genie {

enum GameVersion {
GV_None = 0, //Game version not set
GV_TEST, // ?
GV_MIK, // ?
GV_DAVE, // ?
GV_MATT, // < 6.92
GV_AoEB, // 7.04 - 7.11
GV_AoE, // 7.2
GV_RoR, // 7.24
GV_Tapsa, GV_T2, GV_T3, GV_T4, GV_T5, GV_T6, GV_T7, GV_T8,
GV_AoKE3, // 9.36
GV_AoKA, // 10.19
GV_AoKB, // 11.05
GV_AoK, // 11.5
GV_TC, // 11.76 - 12.0
GV_Cysion, // 12.0
GV_SWGB, // 1.0
GV_CC // 1.1
GV_None = 0, /// Game version not set
GV_TEST, /// ?
GV_MIK, /// ?
GV_DAVE, /// ?
GV_MATT, /// < 6.92
GV_AoEB, /// 7.04 - 7.11
GV_AoE, /// 7.2
GV_RoR, /// 7.24
GV_Tapsa, GV_T2, GV_T3, GV_T4, GV_T5, GV_T6, GV_T7, GV_T8, /// From Tapsa testing, I think
GV_AoKE3, /// 9.36
GV_AoKA, /// 10.19
GV_AoKB, /// 11.05
GV_AoK, /// 11.5
GV_TC, /// 11.76 - 12.0
GV_Cysion, /// 12.0
GV_SWGB, /// 1.0
GV_CC /// 1.1
};

extern GameVersion GV_LatestTap;
Expand Down
47 changes: 37 additions & 10 deletions include/genie/dat/Terrain.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,55 @@ class Terrain : public SharedTerrain
{
public:
void setGameVersion(GameVersion gv) override;
static unsigned short getTerrainCount(GameVersion gv);

/// If set explicitly with setTerrainCount(), returns that.\n
/// Otherwise returns defaults:
/// - SWGB and above: 55
/// - Tapsa tsts: 96
/// - Cysion: 100
/// - TC: 42
/// - Other: 32
static size_t getTerrainCount(GameVersion gv);

static void setTerrainCount(unsigned short cnt);

/// If this is water.
int8_t IsWater = 0;

/// If this should not be shown in the map editor
int8_t HideInEditor = 0;

/// The string to show in the editor
int32_t StringID = 0;

/// Only in versions before SWGB
int16_t Phantom = 0;

size_t getNameSize() override;

int32_t BlendPriority = 0; //not in aoe/ror
int32_t BlendType = 0; //not in aoe/ror
/// Priority for blending over neighbouring tiles, not in AoE/RoR.
int32_t BlendPriority = 0;

/// The combination of this + the terrain to blend with defines which type of blending, not in aoe/ror.
int32_t BlendType = 0;

std::pair<uint8_t, uint8_t> CliffColors = { 0, 0 };

/// Is this passable? (I think)
int8_t PassableTerrain = -1;

/// Is this impassable? (I think)
int8_t ImpassableTerrain = -1;

/// Tile Graphics: flat, 2 x 8 elevation, 2 x 1:1
/// Tile Graphics: flat, 2 x 8 elevation, 2 x 1:1\n
/// Frame Count, Animations, Frame Index
std::array<FrameData, TILE_TYPE_COUNT> ElevationGraphics;

/// If this is an alias for another terrain that should actually be rendered
int16_t TerrainToDraw = 0;
std::pair<int16_t, int16_t> TerrainDimensions = { 0, 0 }; // rows + cols

/// Rows, cols
std::pair<int16_t, int16_t> TerrainDimensions = { 0, 0 };

/// These refer to terrain borders, which are actually used only in AoE and RoR.
std::vector<int16_t> Borders;
Expand All @@ -60,13 +86,14 @@ class Terrain : public SharedTerrain
std::array<int16_t, TERRAIN_UNITS_SIZE> TerrainUnitID{};
std::array<int16_t, TERRAIN_UNITS_SIZE> TerrainUnitDensity{};

/// If two terrain units are to be placed on same spot, this selects which one will prevail others.
/// 1 = prevails, others don't.
/// Centralize
/// 0 Place randomly on the tile
/// 1 Place in middle of the tile
/// If two terrain units are to be placed on same spot, this selects which one will prevail over others.\n
/// 1 = prevails, others don't.\n
/// Centralize\n
/// 0 Place randomly on the tile\n
/// 1 Place in middle of the tile\n
std::array<int8_t, TERRAIN_UNITS_SIZE> TerrainUnitCentering{};

/// Less than TERRAIN_UNITS_SIZE obviously
int16_t NumberOfTerrainUnitsUsed = 0;

private:
Expand Down
8 changes: 4 additions & 4 deletions include/genie/dat/TerrainBorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ class TerrainBorder : public SharedTerrain

size_t getNameSize() override;

/// Information about how to render all borders
std::array<std::vector<FrameData>, TILE_TYPE_COUNT> Borders{};

int16_t DrawTerrain = 0; // always 0
/// always 0
int16_t DrawTerrain = 0;

/// Used for terrain passability check
int16_t UnderlayTerrain = -1;

/// This has something to do with all 19 tile types
/// Mickey's DAT had this removed and
/// instead added one border shape to each 19 tile types
/// This has something to do with all 19 tile types. Mickey's DAT had this removed and instead added one border shape to each 19 tile types.
int16_t BorderStyle = 0;

private:
Expand Down
13 changes: 8 additions & 5 deletions include/genie/dat/TerrainCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,32 @@ class FrameData : public ISerializable
class SharedTerrain : public ISerializable
{
public:
// Was 17 before increased to 19.
/// Was 17 before increased to 19.
static constexpr unsigned short TILE_TYPE_COUNT = 19;

int8_t Enabled = 0; //must be one or the game will crash
/// Must be one or the game will crash
int8_t Enabled = 0;

int8_t Random = 0;

virtual size_t getNameSize(void) = 0;

/// Internal long name
std::string Name = "";

/// Internal SLP name
std::string Name2 = "";

/// SLP obviously
int32_t SLP = -1;

/// Pointer to loaded SLP (when object instatiated)
/// You probably don't want to use this
/// Pointer to loaded SLP (when object instatiated). You probably don't want to use this
int32_t ShapePtr = 0;

/// THe sound to play when visible
/// The sound to play when visible
int32_t SoundID = -1;

/// Minimap colors
std::array<uint8_t, 3> Colors = { 0, 0, 0 };

/// If the terrain has animated graphics
Expand Down
26 changes: 22 additions & 4 deletions include/genie/dat/unit/Moving.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,45 @@ namespace unit {
class Moving : public ISerializable
{
public:
/// Sprite used when unit is moving normally
int16_t WalkingGraphic = -1;

/// Sprite when unit is running
int16_t RunningGraphic = -1;

/// Max rotational speed
float RotationSpeed = 0;

/// Old type of size
int8_t OldSizeClass = 0;

/// Which unit is this tracking (?)
int16_t TrackingUnit = -1;

/// 0. Not used
/// 1. Appears while moving and at the start of the game
/// 2. Appears while moving, based on density
/// 0. Not used\n
/// 1. Appears while moving and at the start of the game\n
/// 2. Appears while moving, based on density\n
int8_t TrackingUnitMode = 0;

/// Only with TrackingUnitMode 2
float TrackingUnitDensity = 0;

/// Old algorithm used to define how the unit moves
int8_t OldMoveAlgorithm = 0;

// All can change while playing
/// How far is the unit turned, changed while playing
float TurnRadius = 0;

/// Speed of rotation, changed while playing
float TurnRadiusSpeed = std::numeric_limits<float>::max();

/// Max yaw change when moving, changed when playing
float MaxYawPerSecondMoving = std::numeric_limits<float>::max();

/// How long has the unit been not rotating, changed while playing
float StationaryYawRevolutionTime = 0;

/// Max yaw change per second when not moving forward, changed while playing
float MaxYawPerSecondStationary = std::numeric_limits<float>::max();

protected:
Expand Down
Loading

0 comments on commit 2901b34

Please sign in to comment.