mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-11 18:51:16 +00:00
Inline LegoHideAnimPresenter
This commit is contained in:
parent
6955c0732a
commit
ee2370c7e5
@ -257,6 +257,81 @@ class LegoLocomotionAnimPresenter : public LegoLoopingAnimPresenter {
|
||||
undefined2 m_unk0xd4; // 0xd4
|
||||
};
|
||||
|
||||
class LegoPathBoundary;
|
||||
|
||||
struct LegoHideAnimStructComparator {
|
||||
MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmp(p_a, p_b) < 0; }
|
||||
};
|
||||
|
||||
// SIZE 0x08
|
||||
struct LegoHideAnimStruct {
|
||||
LegoPathBoundary* m_boundary; // 0x00
|
||||
MxU32 m_index; // 0x04
|
||||
};
|
||||
|
||||
typedef map<const char*, LegoHideAnimStruct, LegoHideAnimStructComparator> LegoHideAnimStructMap;
|
||||
|
||||
// VTABLE: LEGO1 0x100d9278
|
||||
// SIZE 0xc4
|
||||
class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
|
||||
public:
|
||||
LegoHideAnimPresenter();
|
||||
~LegoHideAnimPresenter() override;
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d860
|
||||
void VTable0x8c() override {} // vtable+0x8c
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d870
|
||||
void VTable0x90() override {} // vtable+0x90
|
||||
|
||||
// FUNCTION: BETA10 0x1005d4a0
|
||||
static const char* HandlerClassName()
|
||||
{
|
||||
// STRING: LEGO1 0x100f06cc
|
||||
return "LegoHideAnimPresenter";
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d880
|
||||
// FUNCTION: BETA10 0x1005d470
|
||||
const char* ClassName() const override // vtable+0x0c
|
||||
{
|
||||
return HandlerClassName();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d890
|
||||
MxBool IsA(const char* p_name) const override // vtable+0x10
|
||||
{
|
||||
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
|
||||
}
|
||||
|
||||
void ReadyTickle() override; // vtable+0x18
|
||||
void StartingTickle() override; // vtable+0x18
|
||||
MxResult AddToManager() override; // vtable+0x34
|
||||
void Destroy() override; // vtable+0x38
|
||||
void EndAction() override; // vtable+0x40
|
||||
void PutFrame() override; // vtable+0x6c
|
||||
|
||||
void FUN_1006db40(LegoTime p_time);
|
||||
|
||||
// SYNTHETIC: LEGO1 0x1006d9d0
|
||||
// LegoHideAnimPresenter::`scalar deleting destructor'
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void Destroy(MxBool p_fromDestructor);
|
||||
void FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time);
|
||||
void FUN_1006dc10();
|
||||
void FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node);
|
||||
void FUN_1006e470(
|
||||
LegoHideAnimStructMap& p_map,
|
||||
LegoAnimNodeData* p_data,
|
||||
const char* p_name,
|
||||
LegoPathBoundary* p_boundary
|
||||
);
|
||||
|
||||
LegoPathBoundary** m_boundaryMap; // 0xc0
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
|
||||
// TEMPLATE: LEGO1 0x100689c0
|
||||
@ -315,6 +390,33 @@ class LegoLocomotionAnimPresenter : public LegoLoopingAnimPresenter {
|
||||
|
||||
// GLOBAL: LEGO1 0x100f7688
|
||||
// _Tree<char const *,pair<char const * const,LegoAnimStruct>,map<char const *,LegoAnimStruct,LegoAnimStructComparator,allocator<LegoAnimStruct> >::_Kfn,LegoAnimStructComparator,allocator<LegoAnimStruct> >::_Nil
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006ddb0
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~_Tree<char const *,pair<ch
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006de80
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Inc
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006dec0
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::erase
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006e310
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Erase
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006e350
|
||||
// Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>::~Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006e3a0
|
||||
// map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006e6d0
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Dec
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006e720
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Insert
|
||||
|
||||
// GLOBAL: LEGO1 0x100f768c
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Nil
|
||||
// clang-format on
|
||||
|
||||
#endif // LEGOANIMPRESENTER_H
|
||||
|
||||
@ -1,112 +0,0 @@
|
||||
#ifndef LEGOHIDEANIMPRESENTER_H
|
||||
#define LEGOHIDEANIMPRESENTER_H
|
||||
|
||||
#include "decomp.h"
|
||||
// TODO: Maybe this one is inlined as well?
|
||||
#include "legoanimpresenter.h"
|
||||
|
||||
class LegoPathBoundary;
|
||||
|
||||
struct LegoHideAnimStructComparator {
|
||||
MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmp(p_a, p_b) < 0; }
|
||||
};
|
||||
|
||||
// SIZE 0x08
|
||||
struct LegoHideAnimStruct {
|
||||
LegoPathBoundary* m_boundary; // 0x00
|
||||
MxU32 m_index; // 0x04
|
||||
};
|
||||
|
||||
typedef map<const char*, LegoHideAnimStruct, LegoHideAnimStructComparator> LegoHideAnimStructMap;
|
||||
|
||||
// VTABLE: LEGO1 0x100d9278
|
||||
// SIZE 0xc4
|
||||
class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
|
||||
public:
|
||||
LegoHideAnimPresenter();
|
||||
~LegoHideAnimPresenter() override;
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d860
|
||||
void VTable0x8c() override {} // vtable+0x8c
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d870
|
||||
void VTable0x90() override {} // vtable+0x90
|
||||
|
||||
// FUNCTION: BETA10 0x1005d4a0
|
||||
static const char* HandlerClassName()
|
||||
{
|
||||
// STRING: LEGO1 0x100f06cc
|
||||
return "LegoHideAnimPresenter";
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d880
|
||||
// FUNCTION: BETA10 0x1005d470
|
||||
const char* ClassName() const override // vtable+0x0c
|
||||
{
|
||||
return HandlerClassName();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d890
|
||||
MxBool IsA(const char* p_name) const override // vtable+0x10
|
||||
{
|
||||
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
|
||||
}
|
||||
|
||||
void ReadyTickle() override; // vtable+0x18
|
||||
void StartingTickle() override; // vtable+0x18
|
||||
MxResult AddToManager() override; // vtable+0x34
|
||||
void Destroy() override; // vtable+0x38
|
||||
void EndAction() override; // vtable+0x40
|
||||
void PutFrame() override; // vtable+0x6c
|
||||
|
||||
void FUN_1006db40(LegoTime p_time);
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void Destroy(MxBool p_fromDestructor);
|
||||
void FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time);
|
||||
void FUN_1006dc10();
|
||||
void FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node);
|
||||
void FUN_1006e470(
|
||||
LegoHideAnimStructMap& p_map,
|
||||
LegoAnimNodeData* p_data,
|
||||
const char* p_name,
|
||||
LegoPathBoundary* p_boundary
|
||||
);
|
||||
|
||||
LegoPathBoundary** m_boundaryMap; // 0xc0
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
// SYNTHETIC: LEGO1 0x1006d9d0
|
||||
// LegoHideAnimPresenter::`scalar deleting destructor'
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006ddb0
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~_Tree<char const *,pair<ch
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006de80
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Inc
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006dec0
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::erase
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006e310
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Erase
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006e350
|
||||
// Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>::~Map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator>
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006e3a0
|
||||
// map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::~map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006e6d0
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::iterator::_Dec
|
||||
|
||||
// TEMPLATE: LEGO1 0x1006e720
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Insert
|
||||
|
||||
// GLOBAL: LEGO1 0x100f768c
|
||||
// _Tree<char const *,pair<char const * const,LegoHideAnimStruct>,map<char const *,LegoHideAnimStruct,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Kfn,LegoHideAnimStructComparator,allocator<LegoHideAnimStruct> >::_Nil
|
||||
// clang-format on
|
||||
|
||||
#endif // LEGOHIDEANIMPRESENTER_H
|
||||
@ -71,7 +71,6 @@
|
||||
#include "legoentity.h"
|
||||
#include "legoentitypresenter.h"
|
||||
#include "legoflctexturepresenter.h"
|
||||
#include "legohideanimpresenter.h"
|
||||
#include "legoloadcachesoundpresenter.h"
|
||||
#include "legometerpresenter.h"
|
||||
#include "legomodelpresenter.h"
|
||||
@ -350,7 +349,8 @@ MxCore* LegoObjectFactory::Create(const char* p_name)
|
||||
else if (m_idCarRace == atom) {
|
||||
object = new CarRace();
|
||||
}
|
||||
else if (m_idLegoRaceCarBuildState == atom || m_idLegoCopterBuildState == atom || m_idLegoDuneCarBuildState == atom || m_idLegoJetskiBuildState == atom) {
|
||||
else if (m_idLegoRaceCarBuildState == atom || m_idLegoCopterBuildState == atom ||
|
||||
m_idLegoDuneCarBuildState == atom || m_idLegoJetskiBuildState == atom) {
|
||||
object = new LegoVehicleBuildState(p_name);
|
||||
}
|
||||
else if (m_idHospitalState == atom) {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
#include "isle.h"
|
||||
#include "jukebox.h"
|
||||
#include "jukebox_actions.h"
|
||||
#include "legohideanimpresenter.h"
|
||||
#include "legoanimpresenter.h"
|
||||
#include "legopathactor.h"
|
||||
#include "legoutils.h"
|
||||
#include "misc.h"
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
#include "isle.h"
|
||||
#include "jukebox_actions.h"
|
||||
#include "legoanimationmanager.h"
|
||||
#include "legoanimpresenter.h"
|
||||
#include "legocontrolmanager.h"
|
||||
#include "legohideanimpresenter.h"
|
||||
#include "legomain.h"
|
||||
#include "legonavcontroller.h"
|
||||
#include "legopathstruct.h"
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
#include "jetski_actions.h"
|
||||
#include "jukebox_actions.h"
|
||||
#include "legoanimationmanager.h"
|
||||
#include "legoanimpresenter.h"
|
||||
#include "legocontrolmanager.h"
|
||||
#include "legohideanimpresenter.h"
|
||||
#include "legomain.h"
|
||||
#include "legopathstruct.h"
|
||||
#include "legoracers.h"
|
||||
|
||||
@ -30,6 +30,8 @@
|
||||
DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xbc)
|
||||
DECOMP_SIZE_ASSERT(LegoLoopingAnimPresenter, 0xc0)
|
||||
DECOMP_SIZE_ASSERT(LegoLocomotionAnimPresenter, 0xd8)
|
||||
DECOMP_SIZE_ASSERT(LegoHideAnimPresenter, 0xc4)
|
||||
DECOMP_SIZE_ASSERT(LegoHideAnimStruct, 0x08)
|
||||
|
||||
// FUNCTION: LEGO1 0x10068420
|
||||
// FUNCTION: BETA10 0x1004e5f0
|
||||
@ -1444,3 +1446,214 @@ void LegoLocomotionAnimPresenter::FUN_1006d680(LegoAnimActor* p_actor, MxFloat p
|
||||
m_sceneROIs = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// We do not have any hard evidence that `LegoHideAnimPresenter` is part of this file as well.
|
||||
// However, since all of the other AnimPresenters are in the same file, it is reasonable to assume
|
||||
// that the same holds here.
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d7e0
|
||||
LegoHideAnimPresenter::LegoHideAnimPresenter()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d9f0
|
||||
LegoHideAnimPresenter::~LegoHideAnimPresenter()
|
||||
{
|
||||
Destroy(TRUE);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006da50
|
||||
void LegoHideAnimPresenter::Init()
|
||||
{
|
||||
m_boundaryMap = NULL;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006da60
|
||||
void LegoHideAnimPresenter::Destroy(MxBool p_fromDestructor)
|
||||
{
|
||||
ENTER(m_criticalSection);
|
||||
|
||||
if (m_boundaryMap) {
|
||||
delete[] m_boundaryMap;
|
||||
}
|
||||
Init();
|
||||
|
||||
m_criticalSection.Leave();
|
||||
|
||||
// This appears to be a bug, since it results in an endless loop
|
||||
if (!p_fromDestructor) {
|
||||
LegoHideAnimPresenter::Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006dab0
|
||||
MxResult LegoHideAnimPresenter::AddToManager()
|
||||
{
|
||||
return LegoAnimPresenter::AddToManager();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006dac0
|
||||
void LegoHideAnimPresenter::Destroy()
|
||||
{
|
||||
Destroy(FALSE);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006dad0
|
||||
void LegoHideAnimPresenter::PutFrame()
|
||||
{
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006dae0
|
||||
// FUNCTION: BETA10 0x100530f4
|
||||
void LegoHideAnimPresenter::ReadyTickle()
|
||||
{
|
||||
LegoLoopingAnimPresenter::ReadyTickle();
|
||||
|
||||
if (m_currentWorld) {
|
||||
if (m_currentTickleState == e_starting && m_compositePresenter != NULL) {
|
||||
SendToCompositePresenter(Lego());
|
||||
}
|
||||
|
||||
m_currentWorld->Add(this);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006db20
|
||||
// FUNCTION: BETA10 0x1005316b
|
||||
void LegoHideAnimPresenter::StartingTickle()
|
||||
{
|
||||
LegoLoopingAnimPresenter::StartingTickle();
|
||||
|
||||
if (m_currentTickleState == e_streaming) {
|
||||
FUN_1006dc10();
|
||||
FUN_1006db40(0);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006db40
|
||||
// FUNCTION: BETA10 0x100531ab
|
||||
void LegoHideAnimPresenter::FUN_1006db40(LegoTime p_time)
|
||||
{
|
||||
FUN_1006db60(m_anim->GetRoot(), p_time);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006db60
|
||||
// FUNCTION: BETA10 0x100531de
|
||||
void LegoHideAnimPresenter::FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time)
|
||||
{
|
||||
LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
|
||||
MxBool newB = FALSE;
|
||||
MxBool previousB = FALSE;
|
||||
|
||||
if (m_roiMap != NULL) {
|
||||
LegoROI* roi = m_roiMap[data->GetROIIndex()];
|
||||
|
||||
if (roi != NULL) {
|
||||
newB = data->GetVisibility(p_time);
|
||||
previousB = roi->GetVisibility();
|
||||
roi->SetVisibility(newB);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_boundaryMap != NULL) {
|
||||
LegoPathBoundary* boundary = m_boundaryMap[data->GetBoundaryIndex()];
|
||||
|
||||
if (boundary != NULL) {
|
||||
newB = data->GetVisibility(p_time);
|
||||
previousB = boundary->GetFlag0x10();
|
||||
boundary->SetFlag0x10(newB);
|
||||
}
|
||||
}
|
||||
|
||||
for (MxS32 i = 0; i < p_node->GetNumChildren(); i++) {
|
||||
FUN_1006db60(p_node->GetChild(i), p_time);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006dc10
|
||||
// FUNCTION: BETA10 0x100532fd
|
||||
void LegoHideAnimPresenter::FUN_1006dc10()
|
||||
{
|
||||
LegoHideAnimStructMap anims;
|
||||
|
||||
FUN_1006e3f0(anims, m_anim->GetRoot());
|
||||
|
||||
if (m_boundaryMap != NULL) {
|
||||
delete[] m_boundaryMap;
|
||||
}
|
||||
|
||||
m_boundaryMap = new LegoPathBoundary*[anims.size() + 1];
|
||||
m_boundaryMap[0] = NULL;
|
||||
|
||||
for (LegoHideAnimStructMap::iterator it = anims.begin(); !(it == anims.end()); it++) {
|
||||
m_boundaryMap[(*it).second.m_index] = (*it).second.m_boundary;
|
||||
delete[] const_cast<char*>((*it).first);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006e3f0
|
||||
// FUNCTION: BETA10 0x1005345e
|
||||
void LegoHideAnimPresenter::FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node)
|
||||
{
|
||||
LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
|
||||
const char* name = data->GetName();
|
||||
|
||||
if (name != NULL) {
|
||||
LegoPathBoundary* boundary = m_currentWorld->FindPathBoundary(name);
|
||||
|
||||
if (boundary != NULL) {
|
||||
FUN_1006e470(p_map, data, name, boundary);
|
||||
}
|
||||
else {
|
||||
data->SetBoundaryIndex(0);
|
||||
}
|
||||
}
|
||||
|
||||
MxS32 count = p_node->GetNumChildren();
|
||||
for (MxS32 i = 0; i < count; i++) {
|
||||
FUN_1006e3f0(p_map, p_node->GetChild(i));
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006e470
|
||||
// FUNCTION: BETA10 0x10053520
|
||||
void LegoHideAnimPresenter::FUN_1006e470(
|
||||
LegoHideAnimStructMap& p_map,
|
||||
LegoAnimNodeData* p_data,
|
||||
const char* p_name,
|
||||
LegoPathBoundary* p_boundary
|
||||
)
|
||||
{
|
||||
LegoHideAnimStructMap::iterator it;
|
||||
|
||||
it = p_map.find(p_name);
|
||||
if (it == p_map.end()) {
|
||||
LegoHideAnimStruct animStruct;
|
||||
animStruct.m_index = p_map.size() + 1;
|
||||
animStruct.m_boundary = p_boundary;
|
||||
|
||||
p_data->SetBoundaryIndex(animStruct.m_index);
|
||||
|
||||
char* name = new char[strlen(p_name) + 1];
|
||||
strcpy(name, p_name);
|
||||
|
||||
p_map[name] = animStruct;
|
||||
}
|
||||
else {
|
||||
p_data->SetBoundaryIndex((*it).second.m_index);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006e9e0
|
||||
// FUNCTION: BETA10 0x100535ef
|
||||
void LegoHideAnimPresenter::EndAction()
|
||||
{
|
||||
if (m_action) {
|
||||
MxVideoPresenter::EndAction();
|
||||
|
||||
if (m_currentWorld) {
|
||||
m_currentWorld->Remove(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,216 +0,0 @@
|
||||
#include "legohideanimpresenter.h"
|
||||
|
||||
#include "anim/legoanim.h"
|
||||
#include "legomain.h"
|
||||
#include "legoworld.h"
|
||||
#include "misc.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoHideAnimPresenter, 0xc4)
|
||||
DECOMP_SIZE_ASSERT(LegoHideAnimStruct, 0x08)
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d7e0
|
||||
LegoHideAnimPresenter::LegoHideAnimPresenter()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006d9f0
|
||||
LegoHideAnimPresenter::~LegoHideAnimPresenter()
|
||||
{
|
||||
Destroy(TRUE);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006da50
|
||||
void LegoHideAnimPresenter::Init()
|
||||
{
|
||||
m_boundaryMap = NULL;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006da60
|
||||
void LegoHideAnimPresenter::Destroy(MxBool p_fromDestructor)
|
||||
{
|
||||
ENTER(m_criticalSection);
|
||||
|
||||
if (m_boundaryMap) {
|
||||
delete[] m_boundaryMap;
|
||||
}
|
||||
Init();
|
||||
|
||||
m_criticalSection.Leave();
|
||||
|
||||
// This appears to be a bug, since it results in an endless loop
|
||||
if (!p_fromDestructor) {
|
||||
LegoHideAnimPresenter::Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006dab0
|
||||
MxResult LegoHideAnimPresenter::AddToManager()
|
||||
{
|
||||
return LegoAnimPresenter::AddToManager();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006dac0
|
||||
void LegoHideAnimPresenter::Destroy()
|
||||
{
|
||||
Destroy(FALSE);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006dad0
|
||||
void LegoHideAnimPresenter::PutFrame()
|
||||
{
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006dae0
|
||||
// FUNCTION: BETA10 0x100530f4
|
||||
void LegoHideAnimPresenter::ReadyTickle()
|
||||
{
|
||||
LegoLoopingAnimPresenter::ReadyTickle();
|
||||
|
||||
if (m_currentWorld) {
|
||||
if (m_currentTickleState == e_starting && m_compositePresenter != NULL) {
|
||||
SendToCompositePresenter(Lego());
|
||||
}
|
||||
|
||||
m_currentWorld->Add(this);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006db20
|
||||
// FUNCTION: BETA10 0x1005316b
|
||||
void LegoHideAnimPresenter::StartingTickle()
|
||||
{
|
||||
LegoLoopingAnimPresenter::StartingTickle();
|
||||
|
||||
if (m_currentTickleState == e_streaming) {
|
||||
FUN_1006dc10();
|
||||
FUN_1006db40(0);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006db40
|
||||
// FUNCTION: BETA10 0x100531ab
|
||||
void LegoHideAnimPresenter::FUN_1006db40(LegoTime p_time)
|
||||
{
|
||||
FUN_1006db60(m_anim->GetRoot(), p_time);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006db60
|
||||
// FUNCTION: BETA10 0x100531de
|
||||
void LegoHideAnimPresenter::FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time)
|
||||
{
|
||||
LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
|
||||
MxBool newB = FALSE;
|
||||
MxBool previousB = FALSE;
|
||||
|
||||
if (m_roiMap != NULL) {
|
||||
LegoROI* roi = m_roiMap[data->GetROIIndex()];
|
||||
|
||||
if (roi != NULL) {
|
||||
newB = data->GetVisibility(p_time);
|
||||
previousB = roi->GetVisibility();
|
||||
roi->SetVisibility(newB);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_boundaryMap != NULL) {
|
||||
LegoPathBoundary* boundary = m_boundaryMap[data->GetBoundaryIndex()];
|
||||
|
||||
if (boundary != NULL) {
|
||||
newB = data->GetVisibility(p_time);
|
||||
previousB = boundary->GetFlag0x10();
|
||||
boundary->SetFlag0x10(newB);
|
||||
}
|
||||
}
|
||||
|
||||
for (MxS32 i = 0; i < p_node->GetNumChildren(); i++) {
|
||||
FUN_1006db60(p_node->GetChild(i), p_time);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006dc10
|
||||
// FUNCTION: BETA10 0x100532fd
|
||||
void LegoHideAnimPresenter::FUN_1006dc10()
|
||||
{
|
||||
LegoHideAnimStructMap anims;
|
||||
|
||||
FUN_1006e3f0(anims, m_anim->GetRoot());
|
||||
|
||||
if (m_boundaryMap != NULL) {
|
||||
delete[] m_boundaryMap;
|
||||
}
|
||||
|
||||
m_boundaryMap = new LegoPathBoundary*[anims.size() + 1];
|
||||
m_boundaryMap[0] = NULL;
|
||||
|
||||
for (LegoHideAnimStructMap::iterator it = anims.begin(); !(it == anims.end()); it++) {
|
||||
m_boundaryMap[(*it).second.m_index] = (*it).second.m_boundary;
|
||||
delete[] const_cast<char*>((*it).first);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006e3f0
|
||||
// FUNCTION: BETA10 0x1005345e
|
||||
void LegoHideAnimPresenter::FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node)
|
||||
{
|
||||
LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
|
||||
const char* name = data->GetName();
|
||||
|
||||
if (name != NULL) {
|
||||
LegoPathBoundary* boundary = m_currentWorld->FindPathBoundary(name);
|
||||
|
||||
if (boundary != NULL) {
|
||||
FUN_1006e470(p_map, data, name, boundary);
|
||||
}
|
||||
else {
|
||||
data->SetBoundaryIndex(0);
|
||||
}
|
||||
}
|
||||
|
||||
MxS32 count = p_node->GetNumChildren();
|
||||
for (MxS32 i = 0; i < count; i++) {
|
||||
FUN_1006e3f0(p_map, p_node->GetChild(i));
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006e470
|
||||
// FUNCTION: BETA10 0x10053520
|
||||
void LegoHideAnimPresenter::FUN_1006e470(
|
||||
LegoHideAnimStructMap& p_map,
|
||||
LegoAnimNodeData* p_data,
|
||||
const char* p_name,
|
||||
LegoPathBoundary* p_boundary
|
||||
)
|
||||
{
|
||||
LegoHideAnimStructMap::iterator it;
|
||||
|
||||
it = p_map.find(p_name);
|
||||
if (it == p_map.end()) {
|
||||
LegoHideAnimStruct animStruct;
|
||||
animStruct.m_index = p_map.size() + 1;
|
||||
animStruct.m_boundary = p_boundary;
|
||||
|
||||
p_data->SetBoundaryIndex(animStruct.m_index);
|
||||
|
||||
char* name = new char[strlen(p_name) + 1];
|
||||
strcpy(name, p_name);
|
||||
|
||||
p_map[name] = animStruct;
|
||||
}
|
||||
else {
|
||||
p_data->SetBoundaryIndex((*it).second.m_index);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1006e9e0
|
||||
// FUNCTION: BETA10 0x100535ef
|
||||
void LegoHideAnimPresenter::EndAction()
|
||||
{
|
||||
if (m_action) {
|
||||
MxVideoPresenter::EndAction();
|
||||
|
||||
if (m_currentWorld) {
|
||||
m_currentWorld->Remove(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user