Finish Bitmap (#458)

* Finish Bitmap

* Add missing vtable annotations

* Fixes

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Nathan M Gilbert
2024-01-19 09:38:06 -05:00
committed by GitHub
parent cecaced797
commit d5658efe02
6 changed files with 154 additions and 43 deletions

View File

@@ -44,10 +44,26 @@ public:
__declspec(dllexport) virtual MxLong Read(const char* p_filename); // vtable+24
// FUNCTION: LEGO1 0x1004e0d0
virtual int VTable0x28(int) { return -1; };
virtual int VTable0x28(int) { return -1; }; // vtable+28
virtual void VTable0x2c(int, int, int, int, int, int, int);
virtual void VTable0x30(int, int, int, int, int, int, int);
virtual void BitBlt(
MxBitmap* p_src,
MxS32 p_left,
MxS32 p_top,
MxS32 p_right,
MxS32 p_bottom,
MxS32 p_width,
MxS32 p_height
); // vtable+2c
virtual void BitBltTransparent(
MxBitmap* p_src,
MxS32 p_left,
MxS32 p_top,
MxS32 p_right,
MxS32 p_bottom,
MxS32 p_width,
MxS32 p_height
); // vtable+30
__declspec(dllexport) virtual MxPalette* CreatePalette(); // vtable+34
virtual void ImportPalette(MxPalette* p_palette); // vtable+38
virtual MxResult SetBitDepth(MxBool); // vtable+3c
@@ -92,6 +108,26 @@ public:
return -GetBmiStride();
}
inline MxLong GetLine(MxS32 p_top)
{
MxS32 height;
if (m_bmiHeader->biCompression == BI_RGB_TOPDOWN || m_bmiHeader->biHeight < 0)
height = p_top;
else
height = GetBmiHeightAbs() - p_top - 1;
return GetBmiStride() * height;
}
inline MxU8* GetStart(MxS32 p_left, MxS32 p_top)
{
if (m_bmiHeader->biCompression == BI_RGB)
return GetLine(p_top) + m_data + p_left;
else if (m_bmiHeader->biCompression == BI_RGB_TOPDOWN)
return m_data;
else
return GetLine(0) + m_data;
}
// SYNTHETIC: LEGO1 0x100bc9f0
// MxBitmap::`scalar deleting destructor'

View File

@@ -56,15 +56,15 @@ inline void GetString(MxU8** p_source, char** p_dest, T* p_obj, void (T::*p_sett
*p_source += strlen(*p_dest) + 1;
}
MxBool FUN_100b6e10(
MxS32 p_bitmapWidth,
MxS32 p_bitmapHeight,
MxS32 p_videoParamWidth,
MxS32 p_videoParamHeight,
MxS32* p_left,
MxS32* p_top,
MxS32* p_right,
MxS32* p_bottom,
MxBool GetRectIntersection(
MxS32 p_rect1Width,
MxS32 p_rect1Height,
MxS32 p_rect2Width,
MxS32 p_rect2Height,
MxS32* p_rect1Left,
MxS32* p_rect1Top,
MxS32* p_rect2Left,
MxS32* p_rect2Top,
MxS32* p_width,
MxS32* p_height
);