Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphics natives fixes and improvements for RedM #2268

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion code/client/shared/CfxRGBA.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,19 @@ struct CRGBA
return CRGBA((argb & 0xFF0000) >> 16, ((argb & 0xFF00) >> 8), argb & 0xFF, (argb & 0xFF000000) >> 24);
}

inline static CRGBA FromABGR(uint32_t abgr)
{
return CRGBA(abgr & 0xFF, ((abgr & 0xFF00) >> 8), (abgr & 0xFF0000) >> 16, (abgr & 0xFF000000) >> 24);
}


inline uint32_t AsARGB() const
{
return (alpha << 24) | (red << 16) | (green << 8) | blue;
}
};

inline uint32_t AsABGR() const
{
return (alpha << 24) | (blue << 16) | (green << 8) | red;
}
};
10 changes: 5 additions & 5 deletions code/components/extra-natives-five/include/GamePrimitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct alignas(16) Vec3V
float pad;

Vec3V()
: x(0), y(0), z(0), pad(0)
: x(0), y(0), z(0), pad(NAN)
{
}

Expand All @@ -74,8 +74,8 @@ struct alignas(16) Vec4V

struct spdAABB
{
rage::Vec3V mins;
rage::Vec3V maxs;
Vec3V mins;
Vec3V maxs;
};

struct spdSphere
Expand All @@ -88,8 +88,8 @@ struct spdSphere
// fake name
struct spdRay
{
rage::Vec3V start;
rage::Vec3V end;
Vec3V start;
Vec3V end;
};

enum class eSearchVolumeType : int
Expand Down
54 changes: 54 additions & 0 deletions code/components/extra-natives-rdr3/include/GamePrimitives.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#pragma once

// SSE4 is pretty common
#define _XM_SSE4_INTRINSICS_
#include <DirectXMath.h>

namespace rage
{
struct alignas(16) Vec3V
{
float x;
float y;
float z;
float pad;

Vec3V()
: x(0), y(0), z(0), pad(NAN)
{
}

Vec3V(float x, float y, float z)
: x(x), y(y), z(z), pad(NAN)
Disquse marked this conversation as resolved.
Show resolved Hide resolved
{
}
};

struct alignas(16) Vec4V
{
float x;
float y;
float z;
float w;
};

struct spdAABB
{
Vec3V mins;
Vec3V maxs;
};

struct spdSphere
{
// xyz = center
// w = radius
Vec4V sphere;
};

// fake name
struct spdRay
{
Vec3V start;
Vec3V end;
};
}
Loading