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
This commit is contained in:
Joshua Peisach 2023-07-15 20:45:32 -04:00
parent 5a061ed4f3
commit b0747c28ff
No known key found for this signature in database
GPG Key ID: 41C3D4189AFEDB5A
2 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ MxBitmap::MxBitmap()
this->m_bmiHeader = NULL; this->m_bmiHeader = NULL;
this->m_paletteData = NULL; this->m_paletteData = NULL;
this->m_data = NULL; this->m_data = NULL;
this->m_unk18 = FALSE; this->m_bmiColorsProvided = FALSE;
this->m_palette = NULL; this->m_palette = NULL;
} }
@ -93,10 +93,10 @@ MxPalette *MxBitmap::CreatePalette()
MxPalette *ppal; MxPalette *ppal;
MxBool success = FALSE; MxBool success = FALSE;
if(this->m_unk18 == FALSE) { if(this->m_bmiColorsProvided == FALSE) {
// ppal = MxPalette::FromBitmapPalette(this->m_paletteData); // ppal = MxPalette::FromBitmapPalette(this->m_paletteData);
} else { } else {
if(this->m_unk18 != TRUE) { if(this->m_bmiColorsProvided != TRUE) {
if(!success && pal != NULL) { if(!success && pal != NULL) {
delete pal; delete pal;
pal = NULL; 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; 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);
} }

View File

@ -31,7 +31,7 @@ class MxBitmap : public MxCore
BITMAPINFOHEADER *m_bmiHeader; BITMAPINFOHEADER *m_bmiHeader;
RGBQUAD *m_paletteData; RGBQUAD *m_paletteData;
LPVOID *m_data; LPVOID *m_data;
MxBool m_unk18; MxBool m_bmiColorsProvided; // 0x18
MxPalette *m_palette; MxPalette *m_palette;
}; };