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

Convert SVG bitmap to BGRA unpremultiplied #3829

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions Client/mods/deathmatch/logic/CClientVectorGraphicDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ void CClientVectorGraphicDisplay::UpdateTexture()
if (!bitmap.valid())
return;

// convert to BGRA unpremultiplied
bitmap.convert(B, G, R, A, true);
Lpsd marked this conversation as resolved.
Show resolved Hide resolved

// Lock surface
D3DLOCKED_RECT LockedRect;
if (SUCCEEDED(surface->LockRect(&LockedRect, nullptr, D3DLOCK_DISCARD)))
Expand Down
9 changes: 9 additions & 0 deletions Client/mods/deathmatch/logic/CClientVectorGraphicDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ class CClientVectorGraphicDisplay final : public CClientDisplay

void Update();

// Color indexes as per lunasvg::Bitmap
static enum ColorIndex
TheNormalnij marked this conversation as resolved.
Show resolved Hide resolved
Lpsd marked this conversation as resolved.
Show resolved Hide resolved
{
R = 0,
G = 1,
B = 2,
A = 3
};

private:
CClientVectorGraphic* m_pVectorGraphic;

Expand Down
Loading