Use MxGeometry header ()

* Use MxGeometry header

* Fix comment

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
MS 2025-03-11 21:13:13 -04:00 committed by GitHub
parent fbf71990c9
commit d663e26321
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 674 additions and 479 deletions

View file

@ -6,7 +6,7 @@
#include "legostate.h"
#include "legoworld.h"
#include "misc.h"
#include "mxrect32.h"
#include "mxgeometry.h"
#include "radio.h"
class MxNotificationParam;
@ -82,7 +82,7 @@ struct InfocenterMapEntry {
MxStillPresenter* m_destCtl; // 0x00
undefined4 m_unk0x04; // 0x04
MxRect32 m_area; // 0x08
MxRect<MxS32> m_area; // 0x08
};
// VTABLE: LEGO1 0x100d9338

View file

@ -2,9 +2,9 @@
#define LEGOCAMERACONTROLLER_H
#include "legopointofviewcontroller.h"
#include "mxgeometry.h"
#include "mxgeometry/mxgeometry3d.h"
#include "mxgeometry/mxmatrix.h"
#include "mxpoint32.h"
// VTABLE: LEGO1 0x100d57b0
// VTABLE: BETA10 0x101bb748

View file

@ -1,16 +1,10 @@
#ifndef LEGOMETERPRESENTER_H
#define LEGOMETERPRESENTER_H
#include "mxrect16.h"
#include "mxgeometry.h"
#include "mxstillpresenter.h"
#include "mxstring.h"
// SIZE 0x08
struct MeterRect : public MxRect16 {
// FUNCTION: BETA10 0x10097eb0
MeterRect() {}
};
// VTABLE: LEGO1 0x100d7ac8
// VTABLE: BETA10 0x101bca68
// SIZE 0x94
@ -35,12 +29,12 @@ private:
void DrawMeter();
MxU8* m_meterPixels; // 0x6c
MxU16 m_fillColor; // 0x70
MxString m_variable; // 0x74
MxFloat m_curPercent; // 0x84
MeterRect m_meterRect; // 0x88
MxS16 m_layout; // 0x90
MxU8* m_meterPixels; // 0x6c
MxU16 m_fillColor; // 0x70
MxString m_variable; // 0x74
MxFloat m_curPercent; // 0x84
MxRect16 m_meterRect; // 0x88
MxS16 m_layout; // 0x90
};
// SYNTHETIC: LEGO1 0x10043760

View file

@ -3,7 +3,7 @@
#include "decomp.h"
#include "mxcore.h"
#include "mxpoint32.h"
#include "mxgeometry.h"
#include <windows.h>

View file

@ -7,7 +7,7 @@
#include "legoracemap.h"
#include "legostate.h"
#include "legoworld.h"
#include "mxrect32.h"
#include "mxgeometry.h"
#include "mxtypes.h"
class Act1State;

View file

@ -630,58 +630,37 @@ void Infocenter::InitializeBitmaps()
m_glowInfo[0].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Info_A_Bitmap");
assert(m_glowInfo[0].m_destCtl);
m_glowInfo[0].m_area.SetLeft(391);
m_glowInfo[0].m_area.SetTop(182);
m_glowInfo[0].m_area.SetRight(427);
m_glowInfo[0].m_area.SetBottom(230);
m_glowInfo[0].m_area = MxRect<MxS32>(391, 182, 427, 230);
m_glowInfo[0].m_unk0x04 = 3;
m_glowInfo[1].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Boat_A_Bitmap");
assert(m_glowInfo[1].m_destCtl);
m_glowInfo[1].m_area.SetLeft(304);
m_glowInfo[1].m_area.SetTop(225);
m_glowInfo[1].m_area.SetRight(350);
m_glowInfo[1].m_area.SetBottom(268);
m_glowInfo[1].m_area = MxRect<MxS32>(304, 225, 350, 268);
m_glowInfo[1].m_unk0x04 = 10;
m_glowInfo[2].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Race_A_Bitmap");
assert(m_glowInfo[1].m_destCtl); // DECOMP: intentional typo
m_glowInfo[2].m_area.SetLeft(301);
m_glowInfo[2].m_area.SetTop(133);
m_glowInfo[2].m_area.SetRight(347);
m_glowInfo[2].m_area.SetBottom(181);
m_glowInfo[2].m_area = MxRect<MxS32>(301, 133, 347, 181);
m_glowInfo[2].m_unk0x04 = 11;
m_glowInfo[3].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Pizza_A_Bitmap");
assert(m_glowInfo[3].m_destCtl);
m_glowInfo[3].m_area.SetLeft(289);
m_glowInfo[3].m_area.SetTop(182);
m_glowInfo[3].m_area.SetRight(335);
m_glowInfo[3].m_area.SetBottom(225);
m_glowInfo[3].m_area = MxRect<MxS32>(289, 182, 335, 225);
m_glowInfo[3].m_unk0x04 = 12;
m_glowInfo[4].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Gas_A_Bitmap");
assert(m_glowInfo[4].m_destCtl);
m_glowInfo[4].m_area.SetLeft(350);
m_glowInfo[4].m_area.SetTop(161);
m_glowInfo[4].m_area.SetRight(391);
m_glowInfo[4].m_area.SetBottom(209);
m_glowInfo[4].m_area = MxRect<MxS32>(350, 161, 391, 209);
m_glowInfo[4].m_unk0x04 = 13;
m_glowInfo[5].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Med_A_Bitmap");
assert(m_glowInfo[5].m_destCtl);
m_glowInfo[5].m_area.SetLeft(392);
m_glowInfo[5].m_area.SetTop(130);
m_glowInfo[5].m_area.SetRight(438);
m_glowInfo[5].m_area.SetBottom(176);
m_glowInfo[5].m_area = MxRect<MxS32>(392, 130, 438, 176);
m_glowInfo[5].m_unk0x04 = 14;
m_glowInfo[6].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Cop_A_Bitmap");
assert(m_glowInfo[6].m_destCtl);
m_glowInfo[6].m_area.SetLeft(396);
m_glowInfo[6].m_area.SetTop(229);
m_glowInfo[6].m_area.SetRight(442);
m_glowInfo[6].m_area.SetBottom(272);
m_glowInfo[6].m_area = MxRect<MxS32>(396, 229, 442, 272);
m_glowInfo[6].m_unk0x04 = 15;
m_frame = (MxStillPresenter*) Find("MxStillPresenter", "FrameHot_Bitmap");

View file

@ -1,6 +1,9 @@
#ifndef __LEGOUTIL_H
#define __LEGOUTIL_H
// Exclude from modern compilers due to clash with mxutilities.h
#ifndef COMPAT_MODE
template <class T>
inline T Min(T p_t1, T p_t2)
{
@ -31,6 +34,8 @@ inline T Abs(T p_t)
return p_t < 0 ? -p_t : p_t;
}
#endif
template <class T>
inline void Swap(T& p_t1, T& p_t2)
{

View file

@ -0,0 +1,604 @@
#ifndef MXGEOMETRY_H
#define MXGEOMETRY_H
#include "mxlist.h"
#include "mxutilities.h"
template <class T>
class MxPoint {
protected:
T m_x;
T m_y;
public:
MxPoint() {}
MxPoint(const MxPoint& p_p)
{
m_x = p_p.m_x;
m_y = p_p.m_y;
}
MxPoint(T p_x, T p_y)
{
m_x = p_x;
m_y = p_y;
}
T GetX() const { return m_x; }
T GetY() const { return m_y; }
void SetX(T p_x) { m_x = p_x; }
void SetY(T p_y) { m_y = p_y; }
void operator+=(const MxPoint& p_p)
{
m_x += p_p.m_x;
m_y += p_p.m_y;
}
void operator-=(const MxPoint& p_p)
{
m_x -= p_p.m_x;
m_y -= p_p.m_y;
}
MxPoint operator+(const MxPoint& p_p) const { return MxPoint(m_x + p_p.m_x, m_y + p_p.m_y); }
MxPoint operator-(const MxPoint& p_p) const { return MxPoint(m_x - p_p.m_x, m_y - p_p.m_y); }
};
template <class T>
class MxSize {
protected:
T m_width;
T m_height;
public:
MxSize() {}
MxSize(const MxSize& p_s)
{
m_width = p_s.m_width;
m_height = p_s.m_height;
}
MxSize(T p_width, T p_height)
{
m_width = p_width;
m_height = p_height;
}
T GetWidth() const { return m_width; }
T GetHeight() const { return m_height; }
void SetWidth(T p_width) { m_width = p_width; }
void SetHeight(T p_height) { m_height = p_height; }
};
template <class T>
class MxRect {
protected:
T m_left;
T m_top;
T m_right;
T m_bottom;
public:
MxRect() {}
MxRect(const MxRect& p_r)
{
m_left = p_r.m_left;
m_top = p_r.m_top;
m_right = p_r.m_right;
m_bottom = p_r.m_bottom;
}
MxRect(T p_l, T p_t, T p_r, T p_b)
{
m_left = p_l;
m_top = p_t;
m_right = p_r;
m_bottom = p_b;
}
MxRect(const MxPoint<T>& p_p, const MxSize<T>& p_s)
{
m_left = p_p.GetX();
m_top = p_p.GetY();
m_right = p_p.GetX() + p_s.GetWidth() - 1;
m_bottom = p_p.GetY() + p_s.GetHeight() - 1;
}
T GetLeft() const { return m_left; }
void SetLeft(T p_left) { m_left = p_left; }
T GetTop() const { return m_top; }
void SetTop(T p_top) { m_top = p_top; }
T GetRight() const { return m_right; }
void SetRight(T p_right) { m_right = p_right; }
T GetBottom() const { return m_bottom; }
void SetBottom(T p_bottom) { m_bottom = p_bottom; }
T GetWidth() const { return (m_right - m_left + 1); }
T GetHeight() const { return (m_bottom - m_top + 1); }
MxPoint<T> GetLT() const { return MxPoint<T>(m_left, m_top); }
MxPoint<T> GetRB() const { return MxPoint<T>(m_right, m_bottom); }
MxBool Empty() const { return m_left >= m_right || m_top >= m_bottom; }
MxBool Contains(const MxPoint<T>& p_p) const
{
return p_p.GetX() >= m_left && p_p.GetX() <= m_right && p_p.GetY() >= m_top && p_p.GetY() <= m_bottom;
}
MxBool Intersects(const MxRect& p_r) const
{
return p_r.m_right > m_left && p_r.m_left < m_right && p_r.m_bottom > m_top && p_r.m_top < m_bottom;
}
void operator=(const MxRect& p_r)
{
m_left = p_r.m_left;
m_top = p_r.m_top;
m_right = p_r.m_right;
m_bottom = p_r.m_bottom;
}
MxBool operator==(const MxRect& p_r) const
{
return m_left == p_r.m_left && m_top == p_r.m_top && m_right == p_r.m_right && m_bottom == p_r.m_bottom;
}
MxBool operator!=(const MxRect& p_r) const { return !operator==(p_r); }
void operator+=(const MxPoint<T>& p_p)
{
m_left += p_p.GetX();
m_top += p_p.GetY();
m_right += p_p.GetX();
m_bottom += p_p.GetY();
}
void operator-=(const MxPoint<T>& p_p)
{
m_left -= p_p.GetX();
m_top -= p_p.GetY();
m_right -= p_p.GetX();
m_bottom -= p_p.GetY();
}
void operator&=(const MxRect& p_r)
{
m_left = Max(p_r.m_left, m_left);
m_top = Max(p_r.m_top, m_top);
m_right = Min(p_r.m_right, m_right);
m_bottom = Min(p_r.m_bottom, m_bottom);
}
void operator|=(const MxRect& p_r)
{
m_left = Min(p_r.m_left, m_left);
m_top = Min(p_r.m_top, m_top);
m_right = Max(p_r.m_right, m_right);
m_bottom = Max(p_r.m_bottom, m_bottom);
}
MxRect operator+(const MxPoint<T>& p_p) const
{
return MxRect(m_left + p_p.GetX(), m_top + p_p.GetY(), m_left + p_p.GetX(), m_bottom + p_p.GetY());
}
MxRect operator-(const MxPoint<T>& p_p) const
{
return MxRect(m_left - p_p.GetX(), m_top - p_p.GetY(), m_left - p_p.GetX(), m_bottom - p_p.GetY());
}
MxRect operator&(const MxRect& p_r) const
{
return MxRect(
Max(p_r.m_left, m_left),
Max(p_r.m_top, m_top),
Min(p_r.m_right, m_right),
Min(p_r.m_bottom, m_bottom)
);
}
MxRect operator|(const MxRect& p_r) const
{
return MxRect(
Min(p_r.m_left, m_left),
Min(p_r.m_top, m_top),
Max(p_r.m_right, m_right),
Max(p_r.m_bottom, m_bottom)
);
}
};
/******************************* MxPoint16 **********************************/
// SIZE 0x04
class MxPoint16 : public MxPoint<MxS16> {
public:
MxPoint16() {}
MxPoint16(const MxPoint16& p_p) : MxPoint<MxS16>(p_p) {}
MxPoint16(MxS16 p_x, MxS16 p_y) : MxPoint<MxS16>(p_x, p_y) {}
};
class MxPoint16List : public MxPtrList<MxPoint16> {
public:
MxPoint16List(MxBool p_ownership) : MxPtrList<MxPoint16>(p_ownership) {}
};
class MxPoint16ListCursor : public MxPtrListCursor<MxPoint16> {
public:
MxPoint16ListCursor(MxPoint16List* p_list) : MxPtrListCursor<MxPoint16>(p_list) {}
};
/******************************* MxPoint32 **********************************/
// SIZE 0x08
class MxPoint32 : public MxPoint<MxS32> {
public:
// FUNCTION: BETA10 0x10054d10
MxPoint32() {}
// FUNCTION: BETA10 0x10031a50
MxPoint32(const MxPoint32& p_p) : MxPoint<MxS32>(p_p) {}
// FUNCTION: LEGO1 0x10012170
// FUNCTION: BETA10 0x1006aa70
MxPoint32(MxS32 p_x, MxS32 p_y) : MxPoint<MxS32>(p_x, p_y) {}
};
class MxPoint32List : public MxPtrList<MxPoint32> {
public:
MxPoint32List(MxBool p_ownership) : MxPtrList<MxPoint32>(p_ownership) {}
};
class MxPoint32ListCursor : public MxPtrListCursor<MxPoint32> {
public:
MxPoint32ListCursor(MxPoint32List* p_list) : MxPtrListCursor<MxPoint32>(p_list) {}
};
// TEMPLATE: BETA10 0x10031a80
// ??0?$MxPoint@H@@QAE@ABV0@@Z
// TEMPLATE: BETA10 0x100318f0
// MxPoint<int>::GetX
// TEMPLATE: BETA10 0x10031920
// MxPoint<int>::GetY
// TEMPLATE: BETA10 0x10031cf0
// ??0?$MxPoint@H@@QAE@HH@Z
// TEMPLATE: BETA10 0x10054d40
// ??0?$MxPoint@H@@QAE@XZ
// TEMPLATE: BETA10 0x10142c90
// MxPoint<int>::SetX
// TEMPLATE: BETA10 0x10142cb0
// MxPoint<int>::SetY
/******************************** MxSize16 **********************************/
// SIZE 0x04
class MxSize16 : public MxSize<MxS16> {
public:
MxSize16() {}
MxSize16(const MxSize16& p_s) : MxSize<MxS16>(p_s) {}
MxSize16(MxS16 p_width, MxS16 p_height) : MxSize<MxS16>(p_width, p_height) {}
};
class MxSize16List : public MxPtrList<MxSize16> {
public:
MxSize16List(MxBool p_ownership) : MxPtrList<MxSize16>(p_ownership) {}
};
class MxSize16ListCursor : public MxPtrListCursor<MxSize16> {
public:
MxSize16ListCursor(MxSize16List* p_list) : MxPtrListCursor<MxSize16>(p_list) {}
};
/******************************** MxSize32 **********************************/
// SIZE 0x08
class MxSize32 : public MxSize<MxS32> {
public:
MxSize32() {}
MxSize32(const MxSize32& p_s) : MxSize<MxS32>(p_s) {}
// FUNCTION: BETA10 0x10137030
MxSize32(MxS32 p_width, MxS32 p_height) : MxSize<MxS32>(p_width, p_height) {}
};
class MxSize32List : public MxPtrList<MxSize32> {
public:
MxSize32List(MxBool p_ownership) : MxPtrList<MxSize32>(p_ownership) {}
};
class MxSize32ListCursor : public MxPtrListCursor<MxSize32> {
public:
MxSize32ListCursor(MxSize32List* p_list) : MxPtrListCursor<MxSize32>(p_list) {}
};
// TEMPLATE: BETA10 0x10031820
// ??0?$MxSize@H@@QAE@HH@Z
// TEMPLATE: BETA10 0x10031950
// MxSize<int>::GetWidth
// TEMPLATE: BETA10 0x10031980
// MxSize<int>::GetHeight
/******************************** MxRect16 **********************************/
// SIZE 0x08
class MxRect16 : public MxRect<MxS16> {
public:
// FUNCTION: BETA10 0x10097eb0
MxRect16() {}
MxRect16(const MxRect16& p_r) : MxRect<MxS16>(p_r) {}
MxRect16(MxS16 p_l, MxS16 p_t, MxS16 p_r, MxS16 p_b) : MxRect<MxS16>(p_l, p_t, p_r, p_b) {}
MxRect16(MxPoint16& p_p, MxSize16& p_s) : MxRect<MxS16>(p_p, p_s) {}
};
class MxRect16List : public MxPtrList<MxRect16> {
public:
MxRect16List(MxBool p_ownership) : MxPtrList<MxRect16>(p_ownership) {}
};
class MxRect16ListCursor : public MxPtrListCursor<MxRect16> {
public:
MxRect16ListCursor(MxRect16List* p_list) : MxPtrListCursor<MxRect16>(p_list) {}
};
// TEMPLATE: BETA10 0x10097ee0
// ??0?$MxRect@F@@QAE@XZ
// TEMPLATE: BETA10 0x100981f0
// MxRect<short>::SetLeft
// TEMPLATE: BETA10 0x10098220
// MxRect<short>::SetTop
// TEMPLATE: BETA10 0x10098250
// MxRect<short>::SetRight
// TEMPLATE: BETA10 0x10098280
// MxRect<short>::SetBottom
// TEMPLATE: BETA10 0x10098300
// MxRect<short>::GetLeft
// TEMPLATE: BETA10 0x10098330
// MxRect<short>::GetTop
// TEMPLATE: BETA10 0x10098360
// MxRect<short>::GetBottom
// TEMPLATE: BETA10 0x10098390
// MxRect<short>::GetWidth
// TEMPLATE: BETA10 0x100983c0
// MxRect<short>::GetHeight
/******************************** MxRect32 **********************************/
// SIZE 0x10
class MxRect32 : public MxRect<MxS32> {
public:
// FUNCTION: BETA10 0x1012df70
MxRect32() {}
// FUNCTION: BETA10 0x1012de40
MxRect32(const MxRect32& p_r) : MxRect<MxS32>(p_r) {}
// FUNCTION: BETA10 0x100d8e90
MxRect32(MxS32 p_l, MxS32 p_t, MxS32 p_r, MxS32 p_b) : MxRect<MxS32>(p_l, p_t, p_r, p_b) {}
#ifndef COMPAT_MODE
// FUNCTION: LEGO1 0x100b6fc0
// FUNCTION: BETA10 0x10137060
MxRect32(MxPoint32& p_p, MxSize32& p_s) : MxRect<MxS32>(p_p, p_s) {}
#else
MxRect32(const MxPoint32& p_p, const MxSize32& p_s) : MxRect<MxS32>(p_p, p_s) {}
#endif
};
// VTABLE: LEGO1 0x100dc3f0
// VTABLE: BETA10 0x101c1fb8
// SIZE 0x18
class MxRect32List : public MxPtrList<MxRect32> {
public:
// FUNCTION: BETA10 0x1013b980
MxRect32List(MxBool p_ownership) : MxPtrList<MxRect32>(p_ownership) {}
};
// VTABLE: LEGO1 0x100dc438
// VTABLE: BETA10 0x101c2048
// class MxListCursor<MxRect32 *>
// VTABLE: LEGO1 0x100dc408
// VTABLE: BETA10 0x101c2030
// class MxPtrListCursor<MxRect32>
// VTABLE: LEGO1 0x100dc420
// VTABLE: BETA10 0x101c2018
// SIZE 0x10
class MxRect32ListCursor : public MxPtrListCursor<MxRect32> {
public:
// FUNCTION: BETA10 0x1013bf10
MxRect32ListCursor(MxRect32List* p_list) : MxPtrListCursor<MxRect32>(p_list) {}
};
// TEMPLATE: BETA10 0x10031800
// ??0?$MxRect@H@@QAE@XZ
// TEMPLATE: BETA10 0x10031860
// ??0?$MxRect@H@@QAE@ABV?$MxPoint@H@@ABV?$MxSize@H@@@Z
// TEMPLATE: BETA10 0x100319b0
// MxRect<int>::operator=
// TEMPLATE: BETA10 0x100d8090
// MxRect<int>::GetWidth
// TEMPLATE: BETA10 0x100d80c0
// MxRect<int>::GetHeight
// TEMPLATE: BETA10 0x100d8ed0
// ??0?$MxRect@H@@QAE@HHHH@Z
// TEMPLATE: BETA10 0x100ec100
// MxRect<int>::GetLeft
// TEMPLATE: BETA10 0x100ec130
// MxRect<int>::GetTop
// TEMPLATE: BETA10 0x100ec160
// MxRect<int>::GetRight
// TEMPLATE: BETA10 0x100ec190
// MxRect<int>::GetBottom
// TEMPLATE: BETA10 0x100ec1c0
// MxRect<int>::operator+=
// TEMPLATE: BETA10 0x1012de70
// ??0?$MxRect@H@@QAE@ABV0@@Z
// TEMPLATE: BETA10 0x1012dec0
// MxRect<int>::operator&=
// SYNTHETIC: BETA10 0x1012dfa0
// MxRect32::operator=
// TEMPLATE: BETA10 0x10031d30
// MxRect<int>::Contains
// TEMPLATE: BETA10 0x10137090
// MxRect<int>::Intersects
// TEMPLATE: BETA10 0x10137100
// MxRect<int>::operator-=
// TEMPLATE: BETA10 0x1014b320
// MxRect<int>::operator|=
// TEMPLATE: BETA10 0x1014b2d0
// MxRect<int>::Empty
// TEMPLATE: BETA10 0x1014bd80
// MxRect<int>::SetLeft
// TEMPLATE: BETA10 0x1014b270
// MxRect<int>::SetTop
// TEMPLATE: BETA10 0x1014bda0
// MxRect<int>::SetRight
// TEMPLATE: BETA10 0x1014b2a0
// MxRect<int>::SetBottom
// VTABLE: LEGO1 0x100dc3d8
// VTABLE: BETA10 0x101c1fd0
// class MxPtrList<MxRect32>
// VTABLE: LEGO1 0x100dc450
// VTABLE: BETA10 0x101c1fe8
// class MxList<MxRect32 *>
// VTABLE: LEGO1 0x100dc468
// VTABLE: BETA10 0x101c2000
// class MxCollection<MxRect32 *>
// TEMPLATE: LEGO1 0x100b3c00
// TEMPLATE: BETA10 0x1013ba00
// MxCollection<MxRect32 *>::Compare
// TEMPLATE: LEGO1 0x100b3c10
// TEMPLATE: BETA10 0x1013bb30
// MxCollection<MxRect32 *>::MxCollection<MxRect32 *>
// TEMPLATE: LEGO1 0x100b3c80
// TEMPLATE: BETA10 0x1013bbc0
// MxCollection<MxRect32 *>::~MxCollection<MxRect32 *>
// TEMPLATE: LEGO1 0x100b3cd0
// TEMPLATE: BETA10 0x1013bc60
// MxCollection<MxRect32 *>::Destroy
// TEMPLATE: LEGO1 0x100b3ce0
// TEMPLATE: BETA10 0x1013bc70
// MxList<MxRect32 *>::~MxList<MxRect32 *>
// TEMPLATE: LEGO1 0x100b3d70
// TEMPLATE: BETA10 0x1013bd20
// MxPtrList<MxRect32>::Destroy
// SYNTHETIC: LEGO1 0x100b3d80
// SYNTHETIC: BETA10 0x1013bd50
// MxRect32List::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x100b3df0
// TEMPLATE: BETA10 0x1013bd90
// MxPtrList<MxRect32>::~MxPtrList<MxRect32>
// SYNTHETIC: LEGO1 0x100b3e40
// SYNTHETIC: BETA10 0x1013bdf0
// MxCollection<MxRect32 *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100b3eb0
// SYNTHETIC: BETA10 0x1013be30
// MxList<MxRect32 *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100b3f60
// SYNTHETIC: BETA10 0x1013be70
// MxPtrList<MxRect32>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100b3fd0
// SYNTHETIC: BETA10 0x1013beb0
// MxRect32List::~MxRect32List
// SYNTHETIC: LEGO1 0x100b4020
// SYNTHETIC: BETA10 0x1013c0a0
// MxRect32ListCursor::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x100b4090
// TEMPLATE: BETA10 0x1013c0e0
// MxPtrListCursor<MxRect32>::~MxPtrListCursor<MxRect32>
// SYNTHETIC: LEGO1 0x100b40e0
// SYNTHETIC: BETA10 0x1013c140
// MxListCursor<MxRect32 *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100b4150
// SYNTHETIC: BETA10 0x1013c180
// MxPtrListCursor<MxRect32>::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x100b41c0
// TEMPLATE: BETA10 0x1013c1c0
// MxListCursor<MxRect32 *>::~MxListCursor<MxRect32 *>
// SYNTHETIC: LEGO1 0x100b4210
// SYNTHETIC: BETA10 0x1013c220
// MxRect32ListCursor::~MxRect32ListCursor
// TEMPLATE: BETA10 0x1013ba20
// MxPtrList<MxRect32>::MxPtrList<MxRect32>
// TEMPLATE: BETA10 0x1013baa0
// MxList<MxRect32 *>::MxList<MxRect32 *>
// TEMPLATE: BETA10 0x1013bc30
// MxCollection<MxRect32 *>::SetDestroy
// TEMPLATE: BETA10 0x1013bce0
// MxPtrList<MxRect32>::SetOwnership
// TEMPLATE: BETA10 0x1013bf90
// MxPtrListCursor<MxRect32>::MxPtrListCursor<MxRect32>
// TEMPLATE: BETA10 0x1013c010
// MxListCursor<MxRect32 *>::MxListCursor<MxRect32 *>
// TEMPLATE: BETA10 0x1013c3c0
// MxList<MxRect32 *>::DeleteAll
// TEMPLATE: BETA10 0x1013c450
// MxListCursor<MxRect32 *>::Next
// TEMPLATE: BETA10 0x1013c610
// MxListEntry<MxRect32 *>::GetNext
// TEMPLATE: BETA10 0x1013c630
// MxListEntry<MxRect32 *>::GetValue
// TEMPLATE: BETA10 0x10152860
// MxList<MxRect32 *>::Append
// TEMPLATE: BETA10 0x10152890
// MxList<MxRect32 *>::InsertEntry
// TEMPLATE: BETA10 0x10152980
// MxListEntry<MxRect32 *>::MxListEntry<MxRect32 *>
// TEMPLATE: BETA10 0x101529c0
// MxListEntry<MxRect32 *>::SetPrev
// TEMPLATE: BETA10 0x101529f0
// MxListEntry<MxRect32 *>::SetNext
#endif // MXGEOMETRY_H

View file

@ -1,36 +0,0 @@
#ifndef MXPOINT32_H
#define MXPOINT32_H
#include "mxtypes.h"
class MxPoint32 {
public:
MxPoint32() {}
// FUNCTION: LEGO1 0x10012170
MxPoint32(MxS32 p_x, MxS32 p_y) { CopyFrom(p_x, p_y); }
MxPoint32(const MxPoint32& p_point)
{
this->m_x = p_point.m_x;
this->m_y = p_point.m_y;
}
MxS32 GetX() const { return m_x; }
MxS32 GetY() const { return m_y; }
void SetX(MxS32 p_x) { m_x = p_x; }
void SetY(MxS32 p_y) { m_y = p_y; }
private:
void CopyFrom(MxS32 p_x, MxS32 p_y)
{
this->m_x = p_x;
this->m_y = p_y;
}
MxS32 m_x; // 0x00
MxS32 m_y; // 0x04
};
#endif // MXPOINT32_H

View file

@ -4,7 +4,7 @@
#include "decomp.h"
#include "mxcore.h"
#include "mxcriticalsection.h"
#include "mxpoint32.h"
#include "mxgeometry.h"
class MxCompositePresenter;
class MxDSAction;

View file

@ -1,47 +0,0 @@
#ifndef MXRECT16_H
#define MXRECT16_H
#include "mxtypes.h"
// SIZE 0x08
struct MxRect16 {
// FUNCTION: BETA10 0x10097ee0
MxRect16() {}
// FUNCTION: BETA10 0x100981f0
void SetLeft(MxS16 p_left) { m_left = p_left; }
// FUNCTION: BETA10 0x10098220
void SetTop(MxS16 p_top) { m_top = p_top; }
// FUNCTION: BETA10 0x10098250
void SetRight(MxS16 p_right) { m_right = p_right; }
// FUNCTION: BETA10 0x10098280
void SetBottom(MxS16 p_bottom) { m_bottom = p_bottom; }
// FUNCTION: BETA10 0x10098300
MxS16 GetLeft() const { return m_left; }
// FUNCTION: BETA10 0x10098330
MxS16 GetTop() const { return m_top; }
// There is no GetRight()
// FUNCTION: BETA10 0x10098360
MxS16 GetBottom() const { return m_bottom; }
// FUNCTION: BETA10 0x10098390
MxS16 GetWidth() const { return m_right - m_left + 1; }
// FUNCTION: BETA10 0x100983c0
MxS16 GetHeight() const { return m_bottom - m_top + 1; }
private:
MxS16 m_left; // 0x00
MxS16 m_top; // 0x02
MxS16 m_right; // 0x04
MxS16 m_bottom; // 0x06
};
#endif // MXRECT16_H

View file

@ -1,127 +0,0 @@
#ifndef MXRECT32_H
#define MXRECT32_H
#include "mxpoint32.h"
#include "mxsize32.h"
// SIZE 0x10
class MxRect32 {
public:
MxRect32() {}
MxRect32(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom) { CopyFrom(p_left, p_top, p_right, p_bottom); }
MxRect32(const MxPoint32& p_point, const MxSize32& p_size) { CopyFrom(p_point, p_size); }
MxRect32(const MxRect32& p_a, const MxRect32& p_b)
{
m_left = Max(p_a.m_left, p_b.m_left);
m_top = Max(p_a.m_top, p_b.m_top);
m_right = Min(p_a.m_right, p_b.m_right);
m_bottom = Min(p_a.m_bottom, p_b.m_bottom);
}
MxRect32(const MxRect32& p_rect) { CopyFrom(p_rect); }
MxRect32& operator=(const MxRect32& p_rect)
{
CopyFrom(p_rect);
return *this;
}
void Intersect(const MxRect32& p_rect)
{
m_left = Max(p_rect.m_left, m_left);
m_top = Max(p_rect.m_top, m_top);
m_right = Min(p_rect.m_right, m_right);
m_bottom = Min(p_rect.m_bottom, m_bottom);
}
void SetPoint(const MxPoint32& p_point)
{
this->m_left = p_point.GetX();
this->m_top = p_point.GetY();
}
void AddPoint(const MxPoint32& p_point)
{
this->m_left += p_point.GetX();
this->m_top += p_point.GetY();
this->m_right += p_point.GetX();
this->m_bottom += p_point.GetY();
}
void SubtractPoint(const MxPoint32& p_point)
{
this->m_left -= p_point.GetX();
this->m_top -= p_point.GetY();
this->m_right -= p_point.GetX();
this->m_bottom -= p_point.GetY();
}
void UpdateBounds(const MxRect32& p_rect)
{
m_left = Min(m_left, p_rect.m_left);
m_top = Min(m_top, p_rect.m_top);
m_right = Max(m_right, p_rect.m_right);
m_bottom = Max(m_bottom, p_rect.m_bottom);
}
MxBool IsValid() const { return m_left < m_right && m_top < m_bottom; }
MxBool IntersectsWith(const MxRect32& p_rect) const
{
return m_left < p_rect.m_right && p_rect.m_left < m_right && m_top < p_rect.m_bottom && p_rect.m_top < m_bottom;
}
MxS32 GetWidth() const { return (m_right - m_left) + 1; }
MxS32 GetHeight() const { return (m_bottom - m_top) + 1; }
MxPoint32 GetPoint() const { return MxPoint32(this->m_left, this->m_top); }
MxSize32 GetSize() const { return MxSize32(this->m_right, this->m_bottom); }
MxS32 GetLeft() const { return m_left; }
MxS32 GetTop() const { return m_top; }
MxS32 GetRight() const { return m_right; }
MxS32 GetBottom() const { return m_bottom; }
void SetLeft(MxS32 p_left) { m_left = p_left; }
void SetTop(MxS32 p_top) { m_top = p_top; }
void SetRight(MxS32 p_right) { m_right = p_right; }
void SetBottom(MxS32 p_bottom) { m_bottom = p_bottom; }
private:
void CopyFrom(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom)
{
this->m_left = p_left;
this->m_top = p_top;
this->m_right = p_right;
this->m_bottom = p_bottom;
}
void CopyFrom(const MxRect32& p_rect)
{
this->m_left = p_rect.m_left;
this->m_top = p_rect.m_top;
this->m_right = p_rect.m_right;
this->m_bottom = p_rect.m_bottom;
}
// The address might also be the constructor that calls CopyFrom
// FUNCTION: LEGO1 0x100b6fc0
MxRect32* CopyFrom(const MxPoint32& p_point, const MxSize32& p_size)
{
this->m_left = p_point.GetX();
this->m_top = p_point.GetY();
this->m_right = p_size.GetWidth() + p_point.GetX() - 1;
this->m_bottom = p_size.GetHeight() + p_point.GetY() - 1;
return this;
}
static MxS32 Min(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_a : p_b; }
static MxS32 Max(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_b : p_a; }
MxS32 m_left; // 0x00
MxS32 m_top; // 0x04
MxS32 m_right; // 0x08
MxS32 m_bottom; // 0x0c
};
#endif // MXRECT32_H

View file

@ -1,161 +0,0 @@
#ifndef MXRECTLIST_H
#define MXRECTLIST_H
#include "mxlist.h"
#include "mxrect32.h"
// VTABLE: LEGO1 0x100dc3f0
// VTABLE: BETA10 0x101c1fb8
// SIZE 0x18
class MxRectList : public MxPtrList<MxRect32> {
public:
// FUNCTION: BETA10 0x1013b980
MxRectList(MxBool p_ownership = FALSE) : MxPtrList<MxRect32>(p_ownership) {}
};
// VTABLE: LEGO1 0x100dc438
// VTABLE: BETA10 0x101c2048
// class MxListCursor<MxRect32 *>
// VTABLE: LEGO1 0x100dc408
// VTABLE: BETA10 0x101c2030
// class MxPtrListCursor<MxRect32>
// VTABLE: LEGO1 0x100dc420
// VTABLE: BETA10 0x101c2018
class MxRectListCursor : public MxPtrListCursor<MxRect32> {
public:
// FUNCTION: BETA10 0x1013bf10
MxRectListCursor(MxRectList* p_list) : MxPtrListCursor<MxRect32>(p_list) {}
};
// VTABLE: LEGO1 0x100dc3d8
// VTABLE: BETA10 0x101c1fd0
// class MxPtrList<MxRect32>
// VTABLE: LEGO1 0x100dc450
// VTABLE: BETA10 0x101c1fe8
// class MxList<MxRect32 *>
// VTABLE: LEGO1 0x100dc468
// VTABLE: BETA10 0x101c2000
// class MxCollection<MxRect32 *>
// TEMPLATE: LEGO1 0x100b3c00
// TEMPLATE: BETA10 0x1013ba00
// MxCollection<MxRect32 *>::Compare
// TEMPLATE: LEGO1 0x100b3c10
// TEMPLATE: BETA10 0x1013bb30
// MxCollection<MxRect32 *>::MxCollection<MxRect32 *>
// TEMPLATE: LEGO1 0x100b3c80
// TEMPLATE: BETA10 0x1013bbc0
// MxCollection<MxRect32 *>::~MxCollection<MxRect32 *>
// TEMPLATE: LEGO1 0x100b3cd0
// TEMPLATE: BETA10 0x1013bc60
// MxCollection<MxRect32 *>::Destroy
// TEMPLATE: LEGO1 0x100b3ce0
// TEMPLATE: BETA10 0x1013bc70
// MxList<MxRect32 *>::~MxList<MxRect32 *>
// TEMPLATE: LEGO1 0x100b3d70
// TEMPLATE: BETA10 0x1013bd20
// MxPtrList<MxRect32>::Destroy
// SYNTHETIC: LEGO1 0x100b3d80
// SYNTHETIC: BETA10 0x1013bd50
// MxRectList::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x100b3df0
// TEMPLATE: BETA10 0x1013bd90
// MxPtrList<MxRect32>::~MxPtrList<MxRect32>
// SYNTHETIC: LEGO1 0x100b3e40
// SYNTHETIC: BETA10 0x1013bdf0
// MxCollection<MxRect32 *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100b3eb0
// SYNTHETIC: BETA10 0x1013be30
// MxList<MxRect32 *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100b3f60
// SYNTHETIC: BETA10 0x1013be70
// MxPtrList<MxRect32>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100b3fd0
// SYNTHETIC: BETA10 0x1013beb0
// MxRectList::~MxRectList
// SYNTHETIC: LEGO1 0x100b4020
// SYNTHETIC: BETA10 0x1013c0a0
// MxRectListCursor::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x100b4090
// TEMPLATE: BETA10 0x1013c0e0
// MxPtrListCursor<MxRect32>::~MxPtrListCursor<MxRect32>
// SYNTHETIC: LEGO1 0x100b40e0
// SYNTHETIC: BETA10 0x1013c140
// MxListCursor<MxRect32 *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x100b4150
// SYNTHETIC: BETA10 0x1013c180
// MxPtrListCursor<MxRect32>::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x100b41c0
// TEMPLATE: BETA10 0x1013c1c0
// MxListCursor<MxRect32 *>::~MxListCursor<MxRect32 *>
// SYNTHETIC: LEGO1 0x100b4210
// SYNTHETIC: BETA10 0x1013c220
// MxRectListCursor::~MxRectListCursor
// TEMPLATE: BETA10 0x1013ba20
// MxPtrList<MxRect32>::MxPtrList<MxRect32>
// TEMPLATE: BETA10 0x1013baa0
// MxList<MxRect32 *>::MxList<MxRect32 *>
// TEMPLATE: BETA10 0x1013bc30
// MxCollection<MxRect32 *>::SetDestroy
// TEMPLATE: BETA10 0x1013bce0
// MxPtrList<MxRect32>::SetOwnership
// TEMPLATE: BETA10 0x1013bf90
// MxPtrListCursor<MxRect32>::MxPtrListCursor<MxRect32>
// TEMPLATE: BETA10 0x1013c010
// MxListCursor<MxRect32 *>::MxListCursor<MxRect32 *>
// TEMPLATE: BETA10 0x1013c3c0
// MxList<MxRect32 *>::DeleteAll
// TEMPLATE: BETA10 0x1013c450
// MxListCursor<MxRect32 *>::Next
// TEMPLATE: BETA10 0x1013c610
// MxListEntry<MxRect32 *>::GetNext
// TEMPLATE: BETA10 0x1013c630
// MxListEntry<MxRect32 *>::GetValue
// TEMPLATE: BETA10 0x10152860
// MxList<MxRect32 *>::Append
// TEMPLATE: BETA10 0x10152890
// MxList<MxRect32 *>::InsertEntry
// TEMPLATE: BETA10 0x10152980
// MxListEntry<MxRect32 *>::MxListEntry<MxRect32 *>
// TEMPLATE: BETA10 0x101529c0
// MxListEntry<MxRect32 *>::SetPrev
// TEMPLATE: BETA10 0x101529f0
// MxListEntry<MxRect32 *>::SetNext
#endif // MXRECTLIST_H

View file

@ -3,8 +3,8 @@
#include "decomp.h"
#include "mxcore.h"
#include "mxgeometry.h"
#include "mxlist.h"
#include "mxrect32.h" // should be mxgeometry.h
// SIZE 0x08
class MxSegment {

View file

@ -1,25 +0,0 @@
#ifndef MXSIZE32_H
#define MXSIZE32_H
#include "mxtypes.h"
class MxSize32 {
public:
MxSize32() {}
MxSize32(MxS32 p_width, MxS32 p_height) { CopyFrom(p_width, p_height); }
MxS32 GetWidth() const { return m_width; }
MxS32 GetHeight() const { return m_height; }
private:
void CopyFrom(MxS32 p_width, MxS32 p_height)
{
this->m_width = p_width;
this->m_height = p_height;
}
MxS32 m_width;
MxS32 m_height;
};
#endif // MXSIZE32_H

View file

@ -2,7 +2,7 @@
#define MXSMK_H
#include "decomp.h"
#include "mxrectlist.h"
#include "mxgeometry.h"
#include "mxtypes.h"
#include <smack.h>
@ -46,7 +46,7 @@ struct MxSmk {
MxSmk* p_mxSmk,
MxU8* p_chunkData,
MxBool p_paletteChanged,
MxRectList* p_list
MxRect32List* p_list
);
static MxBool GetRect(MxU8* p_unk0x6b4, MxU16* p_und, u32* p_smackRect, MxRect32* p_rect);
};

View file

@ -78,4 +78,10 @@ MxBool ContainsPresenter(MxCompositePresenterList& p_presenterList, MxPresenter*
void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags);
MxBool KeyValueStringParse(char*, const char*, const char*);
// TEMPLATE: BETA10 0x1012dfd0
// ?Max@@YAHHH@Z
// TEMPLATE: BETA10 0x1012dff0
// ?Min@@YAHHH@Z
#endif // MXUTILITIES_H

View file

@ -2,7 +2,7 @@
#define MXVIDEOPARAM_H
#include "compat.h"
#include "mxrect32.h"
#include "mxgeometry.h"
#include "mxtypes.h"
#include "mxvideoparamflags.h"

View file

@ -3,8 +3,8 @@
#include "decomp.h"
#include "mxbitmap.h"
#include "mxgeometry.h"
#include "mxmediapresenter.h"
#include "mxrect32.h"
#include <ddraw.h>

View file

@ -6,8 +6,8 @@
#include "mxdsfile.h"
#include "mxdsmultiaction.h"
#include "mxdsobject.h"
#include "mxgeometry.h"
#include "mxpresenterlist.h"
#include "mxrect32.h"
#include <assert.h>
@ -15,6 +15,7 @@
void (*g_omniUserMessage)(const char*, MxS32) = NULL;
// FUNCTION: LEGO1 0x100b6e10
// FUNCTION: BETA10 0x10136970
MxBool GetRectIntersection(
MxS32 p_rect1Width,
MxS32 p_rect1Height,
@ -35,22 +36,22 @@ MxBool GetRectIntersection(
MxRect32 rect2(MxPoint32(0, 0), MxSize32(p_rect2Width, p_rect2Height));
MxRect32 rect(0, 0, *p_width, *p_height);
rect.AddPoint(rect1Origin);
rect += rect1Origin;
if (!rect.IntersectsWith(rect1)) {
if (!rect.Intersects(rect1)) {
return FALSE;
}
rect.Intersect(rect1);
rect.SubtractPoint(rect1Origin);
rect.AddPoint(rect2Origin);
rect &= rect1;
rect -= rect1Origin;
rect += rect2Origin;
if (!rect.IntersectsWith(rect2)) {
if (!rect.Intersects(rect2)) {
return FALSE;
}
rect.Intersect(rect2);
rect.SubtractPoint(rect2Origin);
rect &= rect2;
rect -= rect2Origin;
*p_rect1Left += rect.GetLeft();
*p_rect1Top += rect.GetTop();

View file

@ -70,7 +70,7 @@ void MxFlcPresenter::LoadFrame(MxStreamChunk* p_chunk)
for (MxS32 i = 0; i < rectCount; i++) {
MxRect32 rect(rects[i]);
rect.AddPoint(m_location);
rect += m_location;
MVideoManager()->InvalidateRect(rect);
}
}

View file

@ -39,7 +39,7 @@ void MxRegion::AddRect(MxRect32& p_rect)
MxSpanListCursor cursor(m_spanList);
MxSpan* span;
while (rect.IsValid() && cursor.Next(span)) {
while (!rect.Empty() && cursor.Next(span)) {
if (span->GetMin() >= rect.GetBottom()) {
MxSpan* newSpan = new MxSpan(rect);
cursor.Prepend(newSpan);
@ -75,19 +75,19 @@ void MxRegion::AddRect(MxRect32& p_rect)
}
}
if (rect.IsValid()) {
if (!rect.Empty()) {
MxSpan* newSpan = new MxSpan(rect);
m_spanList->Append(newSpan);
}
m_boundingRect.UpdateBounds(p_rect);
m_boundingRect |= p_rect;
}
// FUNCTION: LEGO1 0x100c3e20
// FUNCTION: BETA10 0x10149535
MxBool MxRegion::Intersects(MxRect32& p_rect)
{
if (!m_boundingRect.IntersectsWith(p_rect)) {
if (!m_boundingRect.Intersects(p_rect)) {
return FALSE;
}
@ -253,7 +253,7 @@ MxRect32* MxRegionCursor::Next(MxRect32& p_rect)
if (span->IntersectsV(p_rect) && segment->IntersectsH(p_rect)) {
SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax());
m_rect->Intersect(p_rect);
*m_rect &= p_rect;
}
else {
NextSpan(p_rect);
@ -278,7 +278,7 @@ MxRect32* MxRegionCursor::Prev(MxRect32& p_rect)
if (span->IntersectsV(p_rect) && segment->IntersectsH(p_rect)) {
SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax());
m_rect->Intersect(p_rect);
*m_rect &= p_rect;
}
else {
PrevSpan(p_rect);
@ -351,7 +351,7 @@ void MxRegionCursor::NextSpan(MxRect32& p_rect)
if (p_rect.GetLeft() < segment->GetMax()) {
SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax());
m_rect->Intersect(p_rect);
*m_rect &= p_rect;
return;
}
}
@ -382,7 +382,7 @@ void MxRegionCursor::PrevSpan(MxRect32& p_rect)
if (segment->GetMin() < p_rect.GetRight()) {
SetRect(segment->GetMin(), span->GetMin(), segment->GetMax(), span->GetMax());
m_rect->Intersect(p_rect);
*m_rect &= p_rect;
return;
}
}

View file

@ -165,7 +165,7 @@ MxResult MxSmk::LoadFrame(
MxSmk* p_mxSmk,
MxU8* p_chunkData,
MxBool p_paletteChanged,
MxRectList* p_list
MxRect32List* p_list
)
{
p_bitmapInfo->m_bmiHeader.biHeight = -MxBitmap::HeightAbs(p_bitmapInfo->m_bmiHeader.biHeight);

View file

@ -72,7 +72,7 @@ void MxSmkPresenter::LoadFrame(MxStreamChunk* p_chunk)
m_currentFrame++;
VTable0x88();
MxRectList rects(TRUE);
MxRect32List rects(TRUE);
MxSmk::LoadFrame(bitmapInfo, bitmapData, &m_mxSmk, chunkData, paletteChanged, &rects);
if (((MxDSMediaAction*) m_action)->GetPaletteManagement() && paletteChanged) {
@ -80,12 +80,12 @@ void MxSmkPresenter::LoadFrame(MxStreamChunk* p_chunk)
}
MxRect32 invalidateRect;
MxRectListCursor cursor(&rects);
MxRect32ListCursor cursor(&rects);
MxRect32* rect;
while (cursor.Next(rect)) {
invalidateRect = *rect;
invalidateRect.AddPoint(GetLocation());
invalidateRect += GetLocation();
MVideoManager()->InvalidateRect(invalidateRect);
}
}

View file

@ -148,20 +148,21 @@ void MxStillPresenter::RepeatingTickle()
}
// FUNCTION: LEGO1 0x100ba040
// FUNCTION: BETA10 0x10142724
void MxStillPresenter::SetPosition(MxS32 p_x, MxS32 p_y)
{
MxS32 x = m_location.GetX();
MxS32 y = m_location.GetY();
MxPoint32 oldLocation(m_location);
m_location.SetX(p_x);
m_location.SetY(p_y);
if (IsEnabled()) {
// Most likely needs to work with MxSize32 and MxPoint32
MxS32 height = GetHeight() - 1;
MxS32 width = GetWidth() - 1;
MxRect32 area(0, 0, GetWidth() - 1, GetHeight() - 1);
MxRect32 rectA(x, y, width + x, height + y);
MxRect32 rectB(m_location.GetX(), m_location.GetY(), width + m_location.GetX(), height + m_location.GetY());
MxRect32 rectA(area);
rectA += oldLocation;
MxRect32 rectB(area);
rectB += m_location;
MVideoManager()->InvalidateRect(rectA);
MVideoManager()->UpdateView(rectA.GetLeft(), rectA.GetTop(), rectA.GetWidth(), rectA.GetHeight());

View file

@ -84,11 +84,12 @@ void MxVideoManager::Destroy(MxBool p_fromDestructor)
}
// FUNCTION: LEGO1 0x100be3e0
// FUNCTION: BETA10 0x1012cdaa
void MxVideoManager::UpdateRegion()
{
if (m_region->IsEmpty() == FALSE) {
MxRect32 rect(m_region->GetBoundingRect());
rect.Intersect(m_videoParam.GetRect());
rect &= m_videoParam.GetRect();
m_displaySurface
->Display(rect.GetLeft(), rect.GetTop(), rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight());

View file

@ -301,7 +301,7 @@ void MxVideoPresenter::PutFrame()
MxDisplaySurface* displaySurface = MVideoManager()->GetDisplaySurface();
MxRegion* region = MVideoManager()->GetRegion();
MxRect32 rect(MxPoint32(0, 0), MxSize32(GetWidth(), GetHeight()));
rect.AddPoint(GetLocation());
rect += GetLocation();
LPDIRECTDRAWSURFACE ddSurface = displaySurface->GetDirectDrawSurface2();
if (m_action->GetFlags() & MxDSAction::c_bit5) {