Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use MxGeometry header #1399

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LEGO1/lego/legoomni/include/infocenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "legostate.h"
#include "legoworld.h"
#include "misc.h"
#include "mxrect32.h"
#include "mxgeometry.h"
#include "radio.h"

class MxNotificationParam;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LEGO1/lego/legoomni/include/legocameracontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 7 additions & 13 deletions LEGO1/lego/legoomni/include/legometerpresenter.h
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -35,12 +29,12 @@ class LegoMeterPresenter : public MxStillPresenter {

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
Expand Down
2 changes: 1 addition & 1 deletion LEGO1/lego/legoomni/include/legopointofviewcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "decomp.h"
#include "mxcore.h"
#include "mxpoint32.h"
#include "mxgeometry.h"

#include <windows.h>

Expand Down
2 changes: 1 addition & 1 deletion LEGO1/lego/legoomni/include/legorace.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "legoracemap.h"
#include "legostate.h"
#include "legoworld.h"
#include "mxrect32.h"
#include "mxgeometry.h"
#include "mxtypes.h"

class Act1State;
Expand Down
35 changes: 7 additions & 28 deletions LEGO1/lego/legoomni/src/worlds/infocenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
5 changes: 5 additions & 0 deletions LEGO1/lego/sources/misc/legoutil.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef __LEGOUTIL_H
#define __LEGOUTIL_H

// TODO: 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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
Loading