Update referenes to SnesColor members

This commit is contained in:
scawful
2024-01-31 23:58:35 -05:00
parent 7784e17768
commit 14e60b248f
10 changed files with 111 additions and 84 deletions

View File

@@ -13,9 +13,9 @@ namespace app {
namespace gui {
ImVec4 ConvertSNESColorToImVec4(const SnesColor& color) {
return ImVec4(static_cast<float>(color.GetRGB().x) / 255.0f,
static_cast<float>(color.GetRGB().y) / 255.0f,
static_cast<float>(color.GetRGB().z) / 255.0f,
return ImVec4(static_cast<float>(color.rgb().x) / 255.0f,
static_cast<float>(color.rgb().y) / 255.0f,
static_cast<float>(color.rgb().z) / 255.0f,
1.0f // Assuming alpha is always fully opaque for SNES colors,
// adjust if necessary
);
@@ -45,9 +45,9 @@ void DisplayPalette(app::gfx::SnesPalette& palette, bool loaded) {
static ImVec4 saved_palette[32] = {};
if (loaded && !init) {
for (int n = 0; n < palette.size(); n++) {
saved_palette[n].x = palette.GetColor(n).GetRGB().x / 255;
saved_palette[n].y = palette.GetColor(n).GetRGB().y / 255;
saved_palette[n].z = palette.GetColor(n).GetRGB().z / 255;
saved_palette[n].x = palette.GetColor(n).rgb().x / 255;
saved_palette[n].y = palette.GetColor(n).rgb().y / 255;
saved_palette[n].z = palette.GetColor(n).rgb().z / 255;
saved_palette[n].w = 255; // Alpha
}
init = true;