From a7b81539b1b32bc80561120f2b3de31ce47dd4ad Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Wed, 6 Dec 2023 08:29:24 -0500 Subject: [PATCH] Match MxBitmap::ImportColorsToPalette --- LEGO1/mxbitmap.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/LEGO1/mxbitmap.cpp b/LEGO1/mxbitmap.cpp index 4e7e07de..38c0e710 100644 --- a/LEGO1/mxbitmap.cpp +++ b/LEGO1/mxbitmap.cpp @@ -375,15 +375,16 @@ MxResult MxBitmap::ImportColorsToPalette(RGBQUAD* p_rgbquad, MxPalette* p_palett if (p_palette) { if (p_palette->GetEntries(entries)) - return ret; + goto done; } else { MxPalette local_pal; if (local_pal.GetEntries(entries)) - return ret; + goto done; } - for (MxS32 i = 0; i < 256; i++) { + MxS32 i; + for (i = 0; i < 256; i++) { p_rgbquad[i].rgbRed = entries[i].peRed; p_rgbquad[i].rgbGreen = entries[i].peGreen; p_rgbquad[i].rgbBlue = entries[i].peBlue; @@ -391,5 +392,7 @@ MxResult MxBitmap::ImportColorsToPalette(RGBQUAD* p_rgbquad, MxPalette* p_palett } ret = SUCCESS; + +done: return ret; }