Skip to content

Commit

Permalink
Add enum for LunaSVG bitmap color index
Browse files Browse the repository at this point in the history
  • Loading branch information
Lpsd committed Oct 26, 2024
1 parent 1f8662d commit 9fe960f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Client/mods/deathmatch/logic/CClientVectorGraphicDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ void CClientVectorGraphicDisplay::UpdateTexture()
if (!bitmap.valid())
return;

bitmap.convert(2, 1, 0, 3, true); // convert To BGRA unpremultiplied
// convert to BGRA unpremultiplied
bitmap.convert(B, G, R, A, true);

// Lock surface
D3DLOCKED_RECT LockedRect;
Expand Down
11 changes: 11 additions & 0 deletions Client/mods/deathmatch/logic/CClientVectorGraphicDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class CClientVectorGraphicDisplay;
#include "CClientDisplay.h"
#include "CClientDisplayManager.h"



class CClientVectorGraphicDisplay final : public CClientDisplay
{
friend class CClientDisplayManager;
Expand All @@ -34,6 +36,15 @@ class CClientVectorGraphicDisplay final : public CClientDisplay

void Update();

// Color indexes as per lunasvg::Bitmap
static enum ColorIndex
{
R = 0,
G = 1,
B = 2,
A = 3
};

private:
CClientVectorGraphic* m_pVectorGraphic;

Expand Down

0 comments on commit 9fe960f

Please sign in to comment.