Justifier: Fix byteswapped RGB colours

This commit is contained in:
Stenzek 2025-04-24 21:23:56 +10:00
parent 589b8f5139
commit 773ec046b5
No known key found for this signature in database
2 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com> // SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: CC-BY-NC-ND-4.0 // SPDX-License-Identifier: CC-BY-NC-ND-4.0
#include "guncon.h" #include "guncon.h"
@ -323,7 +323,10 @@ void GunCon::LoadSettings(const SettingsInterface& si, const char* section, bool
cursor_color_str[0] == '#' ? std::string_view(cursor_color_str).substr(1) : std::string_view(cursor_color_str), cursor_color_str[0] == '#' ? std::string_view(cursor_color_str).substr(1) : std::string_view(cursor_color_str),
16)); 16));
if (cursor_color_opt.has_value()) if (cursor_color_opt.has_value())
{
cursor_color = cursor_color_opt.value(); cursor_color = cursor_color_opt.value();
cursor_color = (cursor_color & 0x00FF00u) | ((cursor_color >> 16) & 0xFFu) | ((cursor_color & 0xFFu) << 16);
}
} }
const s32 prev_pointer_index = GetSoftwarePointerIndex(); const s32 prev_pointer_index = GetSoftwarePointerIndex();

View File

@ -418,7 +418,10 @@ void Justifier::LoadSettings(const SettingsInterface& si, const char* section, b
cursor_color_str[0] == '#' ? std::string_view(cursor_color_str).substr(1) : std::string_view(cursor_color_str), cursor_color_str[0] == '#' ? std::string_view(cursor_color_str).substr(1) : std::string_view(cursor_color_str),
16)); 16));
if (cursor_color_opt.has_value()) if (cursor_color_opt.has_value())
{
cursor_color = cursor_color_opt.value(); cursor_color = cursor_color_opt.value();
cursor_color = (cursor_color & 0x00FF00u) | ((cursor_color >> 16) & 0xFFu) | ((cursor_color & 0xFFu) << 16);
}
} }
const s32 prev_pointer_index = GetSoftwarePointerIndex(); const s32 prev_pointer_index = GetSoftwarePointerIndex();