From b0747c28ff4612ec359ae5125afe598f4682fe11 Mon Sep 17 00:00:00 2001 From: Joshua Peisach Date: Sat, 15 Jul 2023 20:45:32 -0400 Subject: [PATCH] Name variable m_unk18 (m_bmiColorsProvided) Since this variable is passed to StretchDIBits, we can see what its supposed to mean. We dont have DX5 docs, but we have docs of the current day, and this as its 'iUsage': "Specifies whether the bmiColors member of the BITMAPINFO structure was provided and, if so, whether bmiColors contains explicit red, green, blue (RGB) values or indexes." The second part (about what the bmiColors contains) seems redundant, since we know this is a boolean. Source: https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-stretchdibits --- LEGO1/mxbitmap.cpp | 8 ++++---- LEGO1/mxbitmap.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LEGO1/mxbitmap.cpp b/LEGO1/mxbitmap.cpp index c644c24c..58f52c6c 100644 --- a/LEGO1/mxbitmap.cpp +++ b/LEGO1/mxbitmap.cpp @@ -7,7 +7,7 @@ MxBitmap::MxBitmap() this->m_bmiHeader = NULL; this->m_paletteData = NULL; this->m_data = NULL; - this->m_unk18 = FALSE; + this->m_bmiColorsProvided = FALSE; this->m_palette = NULL; } @@ -93,10 +93,10 @@ MxPalette *MxBitmap::CreatePalette() MxPalette *ppal; MxBool success = FALSE; - if(this->m_unk18 == FALSE) { + if(this->m_bmiColorsProvided == FALSE) { // ppal = MxPalette::FromBitmapPalette(this->m_paletteData); } else { - if(this->m_unk18 != TRUE) { + if(this->m_bmiColorsProvided != TRUE) { if(!success && pal != NULL) { delete pal; pal = NULL; @@ -130,5 +130,5 @@ MxResult MxBitmap::CopyColorData(HDC p_hdc, int p_xSrc, int p_ySrc, int p_xDest, p_ySrc = (this->m_bmiHeader->biHeight - p_destHeight) - p_ySrc; } - return StretchDIBits(p_hdc, p_xDest, p_yDest, p_destWidth, p_destHeight, p_xSrc, p_ySrc, p_destWidth, p_destHeight, this->m_data, this->m_info, this->m_unk18, SRCCOPY); + return StretchDIBits(p_hdc, p_xDest, p_yDest, p_destWidth, p_destHeight, p_xSrc, p_ySrc, p_destWidth, p_destHeight, this->m_data, this->m_info, this->m_bmiColorsProvided, SRCCOPY); } \ No newline at end of file diff --git a/LEGO1/mxbitmap.h b/LEGO1/mxbitmap.h index b6886d51..65acfa5b 100644 --- a/LEGO1/mxbitmap.h +++ b/LEGO1/mxbitmap.h @@ -31,7 +31,7 @@ class MxBitmap : public MxCore BITMAPINFOHEADER *m_bmiHeader; RGBQUAD *m_paletteData; LPVOID *m_data; - MxBool m_unk18; + MxBool m_bmiColorsProvided; // 0x18 MxPalette *m_palette; };