diff --git a/LEGO1/omni/include/mxbitmap.h b/LEGO1/omni/include/mxbitmap.h index a11853e4..a6854853 100644 --- a/LEGO1/omni/include/mxbitmap.h +++ b/LEGO1/omni/include/mxbitmap.h @@ -34,6 +34,7 @@ struct MxBITMAPINFO { // SIZE 0x20 // VTABLE: LEGO1 0x100dc7b0 +// VTABLE: BETA10 0x101c21f8 class MxBitmap : public MxCore { public: MxBitmap(); @@ -46,6 +47,7 @@ class MxBitmap : public MxCore { virtual MxLong Read(const char* p_filename); // vtable+24 // FUNCTION: LEGO1 0x1004e0d0 + // FUNCTION: BETA10 0x10060fc0 virtual int VTable0x28(int) { return -1; } // vtable+28 virtual void BitBlt( @@ -82,20 +84,32 @@ class MxBitmap : public MxCore { // Bit mask trick to round up to the nearest multiple of four. // Pixel data may be stored with padding. // https://learn.microsoft.com/en-us/windows/win32/medfound/image-stride + // FUNCTION: BETA10 0x1002c510 inline MxLong AlignToFourByte(MxLong p_value) const { return (p_value + 3) & -4; } // Same as the one from legoutils.h, but flipped the other way // TODO: While it's not outside the realm of possibility that they // reimplemented Abs for only this file, that seems odd, right? + // FUNCTION: BETA10 0x1002c690 inline MxLong AbsFlipped(MxLong p_value) const { return p_value > 0 ? p_value : -p_value; } inline BITMAPINFOHEADER* GetBmiHeader() const { return m_bmiHeader; } + + // FUNCTION: BETA10 0x1002c440 inline MxLong GetBmiWidth() const { return m_bmiHeader->biWidth; } inline MxLong GetBmiStride() const { return ((m_bmiHeader->biWidth + 3) & -4); } inline MxLong GetBmiHeight() const { return m_bmiHeader->biHeight; } + + // FUNCTION: BETA10 0x1002c470 inline MxLong GetBmiHeightAbs() const { return AbsFlipped(m_bmiHeader->biHeight); } + + // FUNCTION: BETA10 0x10083900 inline MxU8* GetImage() const { return m_data; } + + // FUNCTION: BETA10 0x100838d0 inline MxBITMAPINFO* GetBitmapInfo() const { return m_info; } + + // FUNCTION: BETA10 0x100982b0 inline MxLong GetDataSize() const { MxLong absHeight = GetBmiHeightAbs(); @@ -138,6 +152,7 @@ class MxBitmap : public MxCore { } // SYNTHETIC: LEGO1 0x100bc9f0 + // SYNTHETIC: BETA10 0x1013dcd0 // MxBitmap::`scalar deleting destructor' private: diff --git a/LEGO1/omni/src/video/mxbitmap.cpp b/LEGO1/omni/src/video/mxbitmap.cpp index de8dc6f2..d64e90d0 100644 --- a/LEGO1/omni/src/video/mxbitmap.cpp +++ b/LEGO1/omni/src/video/mxbitmap.cpp @@ -8,9 +8,11 @@ DECOMP_SIZE_ASSERT(MxBitmap, 0x20); DECOMP_SIZE_ASSERT(MxBITMAPINFO, 0x428); // GLOBAL: LEGO1 0x10102184 +// GLOBAL: BETA10 0x10203030 MxU16 g_bitmapSignature = TWOCC('B', 'M'); // FUNCTION: LEGO1 0x100bc980 +// FUNCTION: BETA10 0x1013cab0 MxBitmap::MxBitmap() { m_info = NULL; @@ -22,6 +24,7 @@ MxBitmap::MxBitmap() } // FUNCTION: LEGO1 0x100bca10 +// FUNCTION: BETA10 0x1013cb58 MxBitmap::~MxBitmap() { if (m_info) { @@ -36,6 +39,7 @@ MxBitmap::~MxBitmap() } // FUNCTION: LEGO1 0x100bcaa0 +// FUNCTION: BETA10 0x1013cc47 MxResult MxBitmap::SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette, MxBool p_isHighColor) { MxResult ret = FAILURE; @@ -81,6 +85,7 @@ MxResult MxBitmap::SetSize(MxS32 p_width, MxS32 p_height, MxPalette* p_palette, } // FUNCTION: LEGO1 0x100bcba0 +// FUNCTION: BETA10 0x1013ce25 MxResult MxBitmap::ImportBitmapInfo(MxBITMAPINFO* p_info) { MxResult result = FAILURE; @@ -115,6 +120,7 @@ MxResult MxBitmap::ImportBitmapInfo(MxBITMAPINFO* p_info) } // FUNCTION: LEGO1 0x100bcc40 +// FUNCTION: BETA10 0x1013cf6d MxResult MxBitmap::ImportBitmap(MxBitmap* p_bitmap) { MxResult result = FAILURE; @@ -148,6 +154,7 @@ MxResult MxBitmap::ImportBitmap(MxBitmap* p_bitmap) } // FUNCTION: LEGO1 0x100bcd10 +// FUNCTION: BETA10 0x1013d0c7 MxLong MxBitmap::Read(const char* p_filename) { MxResult result = FAILURE; @@ -166,6 +173,7 @@ MxLong MxBitmap::Read(const char* p_filename) } // FUNCTION: LEGO1 0x100bcd60 +// FUNCTION: BETA10 0x1013d169 MxResult MxBitmap::LoadFile(HANDLE p_handle) { MxResult result = FAILURE; @@ -212,6 +220,7 @@ MxResult MxBitmap::LoadFile(HANDLE p_handle) } // FUNCTION: LEGO1 0x100bce70 +// FUNCTION: BETA10 0x1013d399 void MxBitmap::BitBlt( MxBitmap* p_src, MxS32 p_srcLeft, @@ -251,6 +260,7 @@ void MxBitmap::BitBlt( } // FUNCTION: LEGO1 0x100bd020 +// FUNCTION: BETA10 0x1013d4ea void MxBitmap::BitBltTransparent( MxBitmap* p_src, MxS32 p_srcLeft, @@ -297,6 +307,7 @@ void MxBitmap::BitBltTransparent( } // FUNCTION: LEGO1 0x100bd1c0 +// FUNCTION: BETA10 0x1013d684 MxPalette* MxBitmap::CreatePalette() { MxBool success = FALSE; @@ -335,6 +346,7 @@ MxPalette* MxBitmap::CreatePalette() } // FUNCTION: LEGO1 0x100bd280 +// FUNCTION: BETA10 0x1013d80e void MxBitmap::ImportPalette(MxPalette* p_palette) { // Odd to use a switch on a boolean, but it matches. @@ -353,6 +365,7 @@ void MxBitmap::ImportPalette(MxPalette* p_palette) } // FUNCTION: LEGO1 0x100bd2d0 +// FUNCTION: BETA10 0x1013d8a9 MxResult MxBitmap::SetBitDepth(MxBool p_isHighColor) { MxResult ret = FAILURE; @@ -408,6 +421,7 @@ MxResult MxBitmap::SetBitDepth(MxBool p_isHighColor) } // FUNCTION: LEGO1 0x100bd3e0 +// FUNCTION: BETA10 0x1013dad2 MxResult MxBitmap::StretchBits( HDC p_hdc, MxS32 p_xSrc, @@ -441,6 +455,7 @@ MxResult MxBitmap::StretchBits( } // FUNCTION: LEGO1 0x100bd450 +// FUNCTION: BETA10 0x1013db55 MxResult MxBitmap::ImportColorsToPalette(RGBQUAD* p_rgbquad, MxPalette* p_palette) { MxResult ret = FAILURE;