mirror of
https://github.com/YimMenu/RDR-Classes.git
synced 2026-10-12 02:08:08 +08:00
Invoker stuff (#1)
* feat: initialize classes repo * feat(script): stuff for native invoker * feat: add some more classes * feat(player): complete CNetworkPlayerMgr * feat(network): add some more stuff * feat(network): add rlGamerInfo * feat(player): add CPlayerInfo
This commit is contained in:
1 parent
d07e253439
commit
a2a74e151a
21 files changed
+800
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
|
||||
namespace rage
|
||||
{
|
||||
using joaat_t = std::uint32_t;
|
||||
inline constexpr char joaat_to_lower(char c)
|
||||
{
|
||||
return c >= 'A' && c <= 'Z' ? c | 1 << 5 : c;
|
||||
}
|
||||
|
||||
inline constexpr joaat_t joaat(const std::string_view str)
|
||||
{
|
||||
joaat_t hash = 0;
|
||||
for (auto c : str)
|
||||
{
|
||||
hash += joaat_to_lower(c);
|
||||
hash += (hash << 10);
|
||||
hash ^= (hash >> 6);
|
||||
}
|
||||
hash += (hash << 3);
|
||||
hash ^= (hash >> 11);
|
||||
hash += (hash << 15);
|
||||
return hash;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,87 @@
|
||||
#pragma once
|
||||
|
||||
namespace rage
|
||||
{
|
||||
template<typename T>
|
||||
union vector2
|
||||
{
|
||||
T data[2];
|
||||
struct { T x, y; };
|
||||
|
||||
vector2(T x, T y) :
|
||||
x(x),
|
||||
y(y)
|
||||
{
|
||||
}
|
||||
|
||||
vector2() :
|
||||
x(),
|
||||
y()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
union vector3
|
||||
{
|
||||
T data[3];
|
||||
struct { T x, y, z; };
|
||||
|
||||
vector3(T x, T y, T z) :
|
||||
x(x),
|
||||
y(y),
|
||||
z(z)
|
||||
{
|
||||
}
|
||||
|
||||
vector3() :
|
||||
x(),
|
||||
y(),
|
||||
z()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
union vector4
|
||||
{
|
||||
T data[4];
|
||||
struct { T x, y, z, w; };
|
||||
|
||||
vector4(T x, T y, T z, T w) :
|
||||
x(x),
|
||||
y(y),
|
||||
z(z),
|
||||
w(w)
|
||||
{
|
||||
}
|
||||
|
||||
vector4() :
|
||||
x(),
|
||||
y(),
|
||||
z(),
|
||||
w()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
union matrix34
|
||||
{
|
||||
T data[3][4];
|
||||
struct { struct { T x, y, z, w; } rows[3]; };
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
union matrix44
|
||||
{
|
||||
T data[4][4];
|
||||
struct { struct { T x, y, z, w; } rows[4]; };
|
||||
};
|
||||
|
||||
typedef vector2<float> fvector2;
|
||||
typedef vector3<float> fvector3;
|
||||
typedef vector4<float> fvector4;
|
||||
typedef matrix34<float> fmatrix34;
|
||||
typedef matrix44<float> fmatrix44;
|
||||
}
|
||||
Reference in new issue
Block a user