Refactor surrounding MxBitmap::GetAdjustedStride (#1057)

* Refactor surrounding MxBitmap::GetAdjustedStride

* Remove this-> from MxDisplaySurface
This commit is contained in:
MS
2024-07-04 12:50:04 -04:00
committed by GitHub
parent 65e3c3dd05
commit 14653070cc
4 changed files with 352 additions and 353 deletions

View File

@@ -94,6 +94,7 @@ public:
// FUNCTION: BETA10 0x1002c690
static MxLong HeightAbs(MxLong p_value) { return p_value > 0 ? p_value : -p_value; }
// FUNCTION: BETA10 0x10142030
inline BITMAPINFOHEADER* GetBmiHeader() const { return m_bmiHeader; }
// FUNCTION: BETA10 0x1002c440
@@ -124,15 +125,9 @@ public:
}
}
inline MxLong GetAdjustedStride()
{
if (m_bmiHeader->biCompression == BI_RGB_TOPDOWN || m_bmiHeader->biHeight < 0) {
return GetBmiStride();
}
else {
return -GetBmiStride();
}
}
#define GetAdjustedStride(p_bitmap) \
(p_bitmap->IsTopDown() ? p_bitmap->AlignToFourByte(p_bitmap->GetBmiWidth()) \
: -p_bitmap->AlignToFourByte(p_bitmap->GetBmiWidth()))
// FUNCTION: BETA10 0x1002c320
inline MxU8* GetStart(MxS32 p_left, MxS32 p_top)