mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
Implement FUN_100b6e10
and MxRect32 adjustments (#390)
* Some WIP rect * Adjustments to MxRect32 * Spacing * Changes * Spacing * Spacing
This commit is contained in:

committed by
GitHub

parent
b4b73465d0
commit
bb22b21260
@@ -695,6 +695,52 @@ MxResult Start(MxDSAction* p_dsAction)
|
||||
return MxOmni::GetInstance()->Start(p_dsAction);
|
||||
}
|
||||
|
||||
// Probably should be somewhere else
|
||||
// FUNCTION: LEGO1 0x100b6e10
|
||||
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,
|
||||
MxS32* p_width,
|
||||
MxS32* p_height
|
||||
)
|
||||
{
|
||||
MxPoint32 topLeft(*p_left, *p_top);
|
||||
MxRect32 bitmapRect(MxPoint32(0, 0), MxSize32(p_bitmapWidth, p_bitmapHeight));
|
||||
|
||||
MxPoint32 bottomRight(*p_right, *p_bottom);
|
||||
MxRect32 videoParamRect(MxPoint32(0, 0), MxSize32(p_videoParamWidth, p_videoParamHeight));
|
||||
|
||||
MxRect32 rect(0, 0, *p_width, *p_height);
|
||||
rect.AddPoint(topLeft);
|
||||
|
||||
if (!rect.IntersectsWith(bitmapRect))
|
||||
return FALSE;
|
||||
|
||||
rect.Intersect(bitmapRect);
|
||||
rect.SubtractPoint(topLeft);
|
||||
rect.AddPoint(bottomRight);
|
||||
|
||||
if (!rect.IntersectsWith(videoParamRect))
|
||||
return FALSE;
|
||||
|
||||
rect.Intersect(videoParamRect);
|
||||
rect.SubtractPoint(bottomRight);
|
||||
|
||||
*p_left += rect.GetLeft();
|
||||
*p_top += rect.GetTop();
|
||||
*p_right += rect.GetLeft();
|
||||
*p_bottom += rect.GetTop();
|
||||
*p_width = rect.GetWidth();
|
||||
*p_height = rect.GetHeight();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100b6ff0
|
||||
void MakeSourceName(char* p_output, const char* p_input)
|
||||
{
|
||||
|
Reference in New Issue
Block a user