Skip to content

Commit

Permalink
feature: uh, some menu background stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
blattersturm committed May 18, 2020
1 parent 056bc99 commit c25e48c
Show file tree
Hide file tree
Showing 58 changed files with 3,560 additions and 200 deletions.
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
url = https://github.com/grpc/grpc.git
[submodule "vendor/librw"]
path = vendor/librw
url = https://github.com/aap/librw.git
url = https://github.com/blattersturm/librw.git
[submodule "vendor/librwgta"]
path = vendor/librwgta
url = https://github.com/aap/librwgta.git
Expand Down Expand Up @@ -208,3 +208,6 @@
[submodule "vendor/xenium"]
path = vendor/xenium
url = https://github.com/mpoeter/xenium
[submodule "vendor/re3"]
path = vendor/re3
url = https://github.com/blattersturm/re3.git
2 changes: 1 addition & 1 deletion code/client/common/Error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static thread_local std::tuple<const char*, int, uint32_t> g_thisError;
static int SysError(const char* buffer)
{
#ifdef WIN32
HWND wnd = FindWindow(
HWND wnd = FindWindowW(
#ifdef GTA_FIVE
L"grcWindow"
#elif defined(IS_RDR3)
Expand Down
96 changes: 48 additions & 48 deletions code/client/shared/RGBA.h → code/client/shared/CfxRGBA.h
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
/*
* This file is part of the CitizenFX project - http://citizen.re/
*
* See LICENSE and MENTIONS in the root of the source tree for information
* regarding licensing.
*/

#pragma once

struct CRGBA
{
uint8_t red;
uint8_t green;
uint8_t blue;
uint8_t alpha;

inline CRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
: red(r), green(g), blue(b), alpha(a)
{

}

inline CRGBA()
: CRGBA(0, 0, 0, 255)
{

}

inline CRGBA(uint8_t r, uint8_t g, uint8_t b)
: CRGBA(r, g, b, 255)
{

}

inline static CRGBA FromFloat(float r, float g, float b, float a)
{
return CRGBA((uint8_t)(r * 255.0f), (uint8_t)(g * 255.0f), (uint8_t)(b * 255.0f), (uint8_t)(a * 255.0f));
}

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

inline uint32_t AsARGB() const
{
return (alpha << 24) | (red << 16) | (green << 8) | blue;
}
/*
* This file is part of the CitizenFX project - http://citizen.re/
*
* See LICENSE and MENTIONS in the root of the source tree for information
* regarding licensing.
*/

#pragma once

struct CRGBA
{
uint8_t red;
uint8_t green;
uint8_t blue;
uint8_t alpha;

inline CRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
: red(r), green(g), blue(b), alpha(a)
{

}

inline CRGBA()
: CRGBA(0, 0, 0, 255)
{

}

inline CRGBA(uint8_t r, uint8_t g, uint8_t b)
: CRGBA(r, g, b, 255)
{

}

inline static CRGBA FromFloat(float r, float g, float b, float a)
{
return CRGBA((uint8_t)(r * 255.0f), (uint8_t)(g * 255.0f), (uint8_t)(b * 255.0f), (uint8_t)(a * 255.0f));
}

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

inline uint32_t AsARGB() const
{
return (alpha << 24) | (red << 16) | (green << 8) | blue;
}
};
170 changes: 85 additions & 85 deletions code/client/shared/Rect.h → code/client/shared/CfxRect.h
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
/*
* This file is part of the CitizenFX project - http://citizen.re/
*
* See LICENSE and MENTIONS in the root of the source tree for information
* regarding licensing.
*/

#pragma once

///
/// A class to represent a floating-point rectangle.
///
class CRect
{
public:
/// The values for the rectangle.
float fX1;
float fY1;
float fX2;
float fY2;

public:
///
/// Constructor, initializing the rectangle with the passed values.
///
inline CRect(float x1, float y1, float x2, float y2)
: fX1(x1), fY1(y1), fX2(x2), fY2(y2)
{

}

///
/// Constructor, initializing the rectangle to be empty.
///
inline CRect()
: CRect(0, 0, 0, 0)
{

}

///
/// Returns the left edge of the rectangle.
///
inline float Left() const { return fwMin(fX1, fX2); }

///
/// Returns the right edge of the rectangle.
///
inline float Right() const { return fwMax(fX1, fX2); }

///
/// Returns the top edge of the rectangle.
///
inline float Top() const { return fwMin(fY1, fY2); }

///
/// Returns the bottom edge of the rectangle.
///
inline float Bottom() const { return fwMax(fY1, fY2); }

///
/// Returns the width of the rectangle.
///
inline float Width() const { return Right() - Left(); }

///
/// Returns the height of the rectangle.
///
inline float Height() const { return Bottom() - Top(); }

///
/// Overwrites the rectangle with the passed values.
///
inline void SetRect(float x1, float y1, float x2, float y2)
{
fX1 = x1;
fY1 = y1;
fX2 = x2;
fY2 = y2;
}

///
/// Returns a string representation of the rectangle.
///
inline const char* Render() const { return va("CRect(%v, %v, %v, %v)", fX1, fX2, fY1, fY2); }
/*
* This file is part of the CitizenFX project - http://citizen.re/
*
* See LICENSE and MENTIONS in the root of the source tree for information
* regarding licensing.
*/

#pragma once

///
/// A class to represent a floating-point rectangle.
///
class CRect
{
public:
/// The values for the rectangle.
float fX1;
float fY1;
float fX2;
float fY2;

public:
///
/// Constructor, initializing the rectangle with the passed values.
///
inline CRect(float x1, float y1, float x2, float y2)
: fX1(x1), fY1(y1), fX2(x2), fY2(y2)
{

}

///
/// Constructor, initializing the rectangle to be empty.
///
inline CRect()
: CRect(0, 0, 0, 0)
{

}

///
/// Returns the left edge of the rectangle.
///
inline float Left() const { return fwMin(fX1, fX2); }

///
/// Returns the right edge of the rectangle.
///
inline float Right() const { return fwMax(fX1, fX2); }

///
/// Returns the top edge of the rectangle.
///
inline float Top() const { return fwMin(fY1, fY2); }

///
/// Returns the bottom edge of the rectangle.
///
inline float Bottom() const { return fwMax(fY1, fY2); }

///
/// Returns the width of the rectangle.
///
inline float Width() const { return Right() - Left(); }

///
/// Returns the height of the rectangle.
///
inline float Height() const { return Bottom() - Top(); }

///
/// Overwrites the rectangle with the passed values.
///
inline void SetRect(float x1, float y1, float x2, float y2)
{
fX1 = x1;
fY1 = y1;
fX2 = x2;
fY2 = y2;
}

///
/// Returns a string representation of the rectangle.
///
inline const char* Render() const { return va("CRect(%v, %v, %v, %v)", fX1, fX2, fY1, fY2); }
};
4 changes: 2 additions & 2 deletions code/client/shared/Registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ auto CoreGetComponentRegistry()
RefSource()
{
#ifdef _WIN32
auto func = (ComponentRegistry*(*)())GetProcAddress(GetModuleHandle(L"CoreRT.dll"), "CoreGetComponentRegistry");
auto func = (ComponentRegistry*(*)())GetProcAddress(GetModuleHandleW(L"CoreRT.dll"), "CoreGetComponentRegistry");
#else
auto func = (ComponentRegistry*(*)())dlsym(dlopen("./libCoreRT.so", RTLD_LAZY), "CoreGetComponentRegistry");
#endif
Expand Down Expand Up @@ -112,7 +112,7 @@ static
RefSource()
{
#ifdef _WIN32
auto func = (InstanceRegistry*(*)())GetProcAddress(GetModuleHandle(L"CoreRT.dll"), "CoreGetGlobalInstanceRegistry");
auto func = (InstanceRegistry*(*)())GetProcAddress(GetModuleHandleW(L"CoreRT.dll"), "CoreGetGlobalInstanceRegistry");
#else
auto func = (InstanceRegistry*(*)())dlsym(dlopen("./libCoreRT.so", RTLD_LAZY), "CoreGetGlobalInstanceRegistry");
#endif
Expand Down
6 changes: 3 additions & 3 deletions code/client/shared/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ inline bool CoreIsDebuggerPresent()

if (!func)
{
func = (bool(*)())GetProcAddress(GetModuleHandle(L"CoreRT.dll"), "CoreIsDebuggerPresent");
func = (bool(*)())GetProcAddress(GetModuleHandleW(L"CoreRT.dll"), "CoreIsDebuggerPresent");
}

return (!func) ? false : func();
Expand All @@ -315,7 +315,7 @@ inline void CoreSetDebuggerPresent()

if (!func)
{
func = (void(*)())GetProcAddress(GetModuleHandle(L"CoreRT.dll"), "CoreSetDebuggerPresent");
func = (void(*)())GetProcAddress(GetModuleHandleW(L"CoreRT.dll"), "CoreSetDebuggerPresent");
}

(func) ? func() : (void)0;
Expand All @@ -329,7 +329,7 @@ inline void CoreTrace(const char* channel, const char* funcName, const char* fil

if (!func)
{
func = (TCoreTraceFunc)GetProcAddress(GetModuleHandle(L"CoreRT.dll"), "CoreTrace");
func = (TCoreTraceFunc)GetProcAddress(GetModuleHandleW(L"CoreRT.dll"), "CoreTrace");
}

(func) ? func(channel, funcName, file, line, string) : (void)0;
Expand Down
4 changes: 2 additions & 2 deletions code/components/citizen-game-main/component.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
return function()
configuration {}
filter {}

includedirs {
'components/vfs-impl-server/include/'
'components/vfs-impl-server/include/', '../vendor/bgfx/examples/common/'
}

files {
Expand Down
2 changes: 1 addition & 1 deletion code/components/citizen-game-main/include/BgfxPrepare.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct DebugUvVertex
.end();
}

static bgfx::VertexDecl ms_decl;
static bgfx::VertexLayout ms_decl;
};

static DebugUvVertex s_quadVertices[4] =
Expand Down
4 changes: 2 additions & 2 deletions code/components/citizen-game-main/src/FrontendConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static const bgfx::EmbeddedShader s_embeddedShaders[] =

DLL_IMPORT extern fwEvent<ImDrawData*> OnRenderImDrawData;

inline bool checkAvailTransientBuffers(uint32_t _numVertices, const bgfx::VertexDecl& _layout, uint32_t _numIndices)
inline bool checkAvailTransientBuffers(uint32_t _numVertices, const bgfx::VertexLayout& _layout, uint32_t _numIndices)
{
return _numVertices == bgfx::getAvailTransientVertexBuffer(_numVertices, _layout)
&& (0 == _numIndices || _numIndices == bgfx::getAvailTransientIndexBuffer(_numIndices))
Expand All @@ -35,7 +35,7 @@ inline bool checkAvailTransientBuffers(uint32_t _numVertices, const bgfx::Vertex

static bool fontTextureCreated;

bgfx::VertexDecl m_decl;
bgfx::VertexLayout m_decl;
bgfx::ProgramHandle m_program;
bgfx::ProgramHandle m_imageProgram;
bgfx::TextureHandle m_texture;
Expand Down
2 changes: 2 additions & 0 deletions code/components/citizen-game-main/src/FrontendNui.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <StdInc.h>

#define WANT_CEF_INTERNALS
#include <CefOverlay.h>

#include <bgfx/bgfx.h>
Expand Down
Loading

5 comments on commit c25e48c

@nonamesex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you fix b1868 instead of doing that shit?

@manups4e
Copy link
Contributor

@manups4e manups4e commented on c25e48c May 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you help with a pr yourself instead of being an asshole

@nonamesex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you help with a pr yourself instead of being an asshole

Maybe you can help? I just want the developer of this project not to deal with bullshit, but to solve problems. After all, this project has many problems.

@manups4e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we all wish that kids stop complaining if you know how to fix problems..help.. complaining won't magically fix problems..

@blattersturm
Copy link
Contributor Author

@blattersturm blattersturm commented on c25e48c May 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After all, this project has many problems.

Then report them in the appropriate channels like the forums, not by complaining in a GitHub commit comment thread without any specific details as to 'problems' you're experiencing.

Please sign in to comment.