mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-12-18 11:52:23 -05:00
Implement/match PickEntity (#1153)
* Implement/match PickEntity * Rename function
This commit is contained in:
parent
62f09570b0
commit
93c640a45f
3 changed files with 17 additions and 12 deletions
|
@ -40,9 +40,9 @@ class LegoTreeNode;
|
|||
|
||||
extern MxAtomId* g_isleScript;
|
||||
|
||||
LegoEntity* PickEntity(MxLong, MxLong);
|
||||
LegoROI* PickROI(MxLong, MxLong);
|
||||
LegoROI* PickParentROI(MxLong p_a, MxLong p_b);
|
||||
LegoEntity* PickEntity(MxLong p_x, MxLong p_y);
|
||||
LegoROI* PickROI(MxLong p_x, MxLong p_y);
|
||||
LegoROI* PickRootROI(MxLong p_x, MxLong p_y);
|
||||
void RotateY(LegoROI* p_roi, MxFloat p_angle);
|
||||
MxBool SpheresIntersect(const BoundingSphere& p_sphere1, const BoundingSphere& p_sphere2);
|
||||
MxBool FUN_1003ded0(MxFloat p_param1[2], MxFloat p_param2[3], MxFloat p_param3[3]);
|
||||
|
|
|
@ -253,7 +253,7 @@ MxLong Ambulance::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
|
|||
return 1;
|
||||
}
|
||||
|
||||
roi = PickParentROI(p_param.GetX(), p_param.GetY());
|
||||
roi = PickRootROI(p_param.GetX(), p_param.GetY());
|
||||
|
||||
if (roi != NULL && !strcmpi(roi->GetName(), "gd")) {
|
||||
m_unk0x170 = 3;
|
||||
|
|
|
@ -36,20 +36,20 @@
|
|||
|
||||
// FUNCTION: LEGO1 0x1003dd70
|
||||
// FUNCTION: BETA10 0x100d3410
|
||||
LegoROI* PickROI(MxLong p_a, MxLong p_b)
|
||||
LegoROI* PickROI(MxLong p_x, MxLong p_y)
|
||||
{
|
||||
LegoVideoManager* videoManager = VideoManager();
|
||||
Lego3DView* view = videoManager->Get3DManager()->GetLego3DView();
|
||||
return (LegoROI*) view->Pick(p_a, p_b);
|
||||
return (LegoROI*) view->Pick(p_x, p_y);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003dd90
|
||||
// FUNCTION: BETA10 0x100d3449
|
||||
LegoROI* PickParentROI(MxLong p_a, MxLong p_b)
|
||||
LegoROI* PickRootROI(MxLong p_x, MxLong p_y)
|
||||
{
|
||||
LegoVideoManager* videoManager = VideoManager();
|
||||
Lego3DView* view = videoManager->Get3DManager()->GetLego3DView();
|
||||
LegoROI* roi = (LegoROI*) view->Pick(p_a, p_b);
|
||||
LegoROI* roi = (LegoROI*) view->Pick(p_x, p_y);
|
||||
|
||||
while (roi != NULL && roi->GetParentROI() != NULL) {
|
||||
roi = (LegoROI*) roi->GetParentROI();
|
||||
|
@ -58,13 +58,18 @@ LegoROI* PickParentROI(MxLong p_a, MxLong p_b)
|
|||
return roi;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1003ddc0
|
||||
LegoEntity* PickEntity(MxLong, MxLong)
|
||||
// FUNCTION: LEGO1 0x1003ddc0
|
||||
LegoEntity* PickEntity(MxLong p_x, MxLong p_y)
|
||||
{
|
||||
// TODO
|
||||
LegoROI* roi = PickRootROI(p_x, p_y);
|
||||
|
||||
if (roi == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return roi->GetEntity();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003dde0
|
||||
// FUNCTION: BETA10 0x100d358e
|
||||
void RotateY(LegoROI* p_roi, MxFloat p_angle)
|
||||
|
|
Loading…
Reference in a new issue