Skip to content

Commit

Permalink
added more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AkyrosXD committed Apr 20, 2024
1 parent 498d748 commit b9a06d4
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 6 deletions.
4 changes: 3 additions & 1 deletion game/FEManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "IGOFrontEnd.hpp"

#pragma pack(push, 1)
/// <summary>
/// Front-End Manager class
/// </summary>
Expand All @@ -20,4 +21,5 @@ class FEManager
/// </summary>
/// <returns>Status code</returns>
int DrawIGO();
};
};
#pragma pack(pop)
6 changes: 5 additions & 1 deletion game/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define SM3_CAMERA_MIN_FOV 1
#define SM3_CAMERA_MAX_FOV 180

#pragma pack(push, 1)
/// <summary>
/// NGL Camera Object class
/// </summary>
Expand All @@ -31,12 +32,15 @@ class camera : public entity
/// <param name="value">the value of field of view to set</param>
void set_fov(const int& value);
};
#pragma pack(pop)

#pragma pack(push, 1)
/// <summary>
/// Camera settings struct
/// </summary>
struct camera_settings
{
char unk[92];
bool is_user_mode;
};
};
#pragma pack(pop)
29 changes: 27 additions & 2 deletions game/entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,28 @@ struct entity_transform
float unk3[2];
float pitch2;
float unk2[2];

/// <summary>
/// Rotation yaw
/// </summary>
float real_yaw;

/// <summary>
/// Rotation pitch
/// </summary>
float pitch;

float unk[2];

/// <summary>
/// The world position of the entity
/// </summary>
vector3d position;

/// <summary>
/// Gets the forward axis of the transform
/// </summary>
/// <returns>The forward axis of the transform</returns>
inline vector3d forward() const
{
vector3d result{};
Expand All @@ -70,6 +83,10 @@ struct entity_transform
return result;
}

/// <summary>
/// Gets the back axis of the transform
/// </summary>
/// <returns>The back axis of the transform</returns>
inline vector3d back() const
{
vector3d result{};
Expand All @@ -79,6 +96,10 @@ struct entity_transform
return result;
}

/// <summary>
/// Gets the right axis of the transform
/// </summary>
/// <returns>The right axis of the transform</returns>
inline vector3d right() const
{
vector3d result{};
Expand All @@ -87,6 +108,10 @@ struct entity_transform
return result;
}

/// <summary>
/// Gets the left axis of the transform
/// </summary>
/// <returns>The left axis of the transform</returns>
inline vector3d left() const
{
vector3d result{};
Expand All @@ -95,15 +120,15 @@ struct entity_transform
return result;
}

inline vector3d up() const
/*inline vector3d up() const
{
return vector3d({ 0, 1, 0 });
}
inline vector3d down() const
{
return vector3d({ 0, -1, 0 });
}
}*/
};
#pragma pack(pop)

Expand Down
6 changes: 6 additions & 0 deletions game/experience_tracker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ enum class E_UPGRADE_NOTIFICATION_TYPE : DWORD
ANNOTATION
};

#pragma pack(push, 1)
/// <summary>
/// Expereince upgrade base struct
/// </summary>
Expand All @@ -33,7 +34,9 @@ struct experience_upgrade_base
/// </summary>
DWORD status;
};
#pragma pack(pop)

#pragma pack(push, 1)
/// <summary>
/// Experience upgrade struct
/// </summary>
Expand All @@ -46,7 +49,9 @@ struct experience_upgrade

void* unk0;
};
#pragma pack(pop)

#pragma pack(push, 1)
/// <summary>
/// Expereince upgrade grou struct
/// </summary>
Expand All @@ -72,6 +77,7 @@ struct experience_upgrade_group
/// </summary>
bool upgraded; // offset = 20
};
#pragma pack(pop)

/// <summary>
/// Experience tracker class
Expand Down
3 changes: 3 additions & 0 deletions game/mission_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ enum class E_MISSION_STATUS : DWORD
};

#pragma pack(push, 1)
/// <summary>
/// Mission manager class
/// </summary>
class mission_manager : public singleton<mission_manager, 0xDE7D88>
{
private:
Expand Down
4 changes: 2 additions & 2 deletions game/ngl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ struct nglWindow
};

/// <summary>
/// Creates a new nglBox
/// Creates a new nglWindow
/// </summary>
/// <param name="box">Pointer to the target nglBox</param>
/// <param name="box">Pointer to the target nglWindow</param>
void nglConstructWindow(nglWindow* const window);

/// <summary>
Expand Down
9 changes: 9 additions & 0 deletions game/numerics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@

#include <math.h>

/// <summary>
/// 3D vector struct
/// </summary>
struct vector3d
{
float x, y, z;

/// <summary>
/// Gets the distance between two points
/// </summary>
/// <param name="a">Point A</param>
/// <param name="b">Point B</param>
/// <returns>The distance between the two points</returns>
static inline float distance(const vector3d& a, const vector3d& b)
{
const float x = a.x - b.x;
Expand Down

0 comments on commit b9a06d4

Please sign in to comment.