mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
More BETA matches in MxDiskStreamController
(#1292)
* More BETA matches in `MxDiskStreamController` * Fix
This commit is contained in:

committed by
GitHub

parent
2422d997cf
commit
8afa64048b
@@ -2478,6 +2478,8 @@ MxBool LegoAnimationManager::FUN_10064010(LegoPathBoundary* p_boundary, LegoUnkn
|
|||||||
Vector3* v1 = p_edge->CWVertex(*p_boundary);
|
Vector3* v1 = p_edge->CWVertex(*p_boundary);
|
||||||
Vector3* v2 = p_edge->CCWVertex(*p_boundary);
|
Vector3* v2 = p_edge->CCWVertex(*p_boundary);
|
||||||
|
|
||||||
|
assert(v1 && v2);
|
||||||
|
|
||||||
p1 = *v2;
|
p1 = *v2;
|
||||||
p1 -= *v1;
|
p1 -= *v1;
|
||||||
p1 *= p_destScale;
|
p1 *= p_destScale;
|
||||||
@@ -2490,7 +2492,12 @@ MxBool LegoAnimationManager::FUN_10064010(LegoPathBoundary* p_boundary, LegoUnkn
|
|||||||
boundingBox.Min() -= vec;
|
boundingBox.Min() -= vec;
|
||||||
boundingBox.Max() = p1;
|
boundingBox.Max() = p1;
|
||||||
boundingBox.Max() += vec;
|
boundingBox.Max() += vec;
|
||||||
return GetViewManager()->IsBoundingBoxInFrustum(boundingBox) == FALSE;
|
|
||||||
|
if (GetViewManager()->IsBoundingBoxInFrustum(boundingBox) == FALSE) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10064120
|
// FUNCTION: LEGO1 0x10064120
|
||||||
|
@@ -97,4 +97,7 @@ private:
|
|||||||
// TEMPLATE: BETA10 0x10150e60
|
// TEMPLATE: BETA10 0x10150e60
|
||||||
// MxUtilityList<MxNextActionDataStart *>::PushBack
|
// MxUtilityList<MxNextActionDataStart *>::PushBack
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10150ff0
|
||||||
|
// MxUtilityList<MxDSObject *>::PushBack
|
||||||
|
|
||||||
#endif // MXDISKSTREAMCONTROLLER_H
|
#endif // MXDISKSTREAMCONTROLLER_H
|
||||||
|
@@ -74,14 +74,14 @@ public:
|
|||||||
MxStreamProvider* GetProvider() { return m_provider; }
|
MxStreamProvider* GetProvider() { return m_provider; }
|
||||||
MxDSObjectList& GetUnk0x3c() { return m_unk0x3c; }
|
MxDSObjectList& GetUnk0x3c() { return m_unk0x3c; }
|
||||||
MxDSObjectList& GetUnk0x54() { return m_unk0x54; }
|
MxDSObjectList& GetUnk0x54() { return m_unk0x54; }
|
||||||
MxDSSubscriberList& GetSubscriberList() { return m_subscriberList; }
|
MxDSSubscriberList& GetSubscriberList() { return m_subscribers; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MxCriticalSection m_criticalSection; // 0x08
|
MxCriticalSection m_criticalSection; // 0x08
|
||||||
MxAtomId m_atom; // 0x24
|
MxAtomId m_atom; // 0x24
|
||||||
MxStreamProvider* m_provider; // 0x28
|
MxStreamProvider* m_provider; // 0x28
|
||||||
undefined4* m_unk0x2c; // 0x2c
|
undefined4* m_unk0x2c; // 0x2c
|
||||||
MxDSSubscriberList m_subscriberList; // 0x30
|
MxDSSubscriberList m_subscribers; // 0x30
|
||||||
MxDSObjectList m_unk0x3c; // 0x3c
|
MxDSObjectList m_unk0x3c; // 0x3c
|
||||||
MxNextActionDataStartList m_nextActionList; // 0x48
|
MxNextActionDataStartList m_nextActionList; // 0x48
|
||||||
MxDSObjectList m_unk0x54; // 0x54
|
MxDSObjectList m_unk0x54; // 0x54
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
#include "mxomni.h"
|
#include "mxomni.h"
|
||||||
#include "mxticklemanager.h"
|
#include "mxticklemanager.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxDiskStreamController, 0xc8);
|
DECOMP_SIZE_ASSERT(MxDiskStreamController, 0xc8);
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c7120
|
// FUNCTION: LEGO1 0x100c7120
|
||||||
@@ -17,6 +19,7 @@ MxDiskStreamController::MxDiskStreamController()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c7530
|
// FUNCTION: LEGO1 0x100c7530
|
||||||
|
// FUNCTION: BETA10 0x10153a2d
|
||||||
MxDiskStreamController::~MxDiskStreamController()
|
MxDiskStreamController::~MxDiskStreamController()
|
||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
@@ -35,6 +38,8 @@ MxDiskStreamController::~MxDiskStreamController()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(m_subscribers.size() == 0);
|
||||||
|
|
||||||
MxDSObject* object;
|
MxDSObject* object;
|
||||||
while (m_unk0x3c.PopFront(object)) {
|
while (m_unk0x3c.PopFront(object)) {
|
||||||
delete object;
|
delete object;
|
||||||
@@ -65,28 +70,32 @@ MxDiskStreamController::~MxDiskStreamController()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c7790
|
// FUNCTION: LEGO1 0x100c7790
|
||||||
|
// FUNCTION: BETA10 0x10153ea8
|
||||||
MxResult MxDiskStreamController::Open(const char* p_filename)
|
MxResult MxDiskStreamController::Open(const char* p_filename)
|
||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
MxResult result = MxStreamController::Open(p_filename);
|
MxResult result = MxStreamController::Open(p_filename);
|
||||||
|
|
||||||
if (result == SUCCESS) {
|
if (result != SUCCESS) {
|
||||||
m_provider = new MxDiskStreamProvider();
|
goto done;
|
||||||
if (m_provider == NULL) {
|
|
||||||
result = FAILURE;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
result = m_provider->SetResourceToGet(this);
|
|
||||||
if (result != SUCCESS) {
|
|
||||||
delete m_provider;
|
|
||||||
m_provider = NULL;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
TickleManager()->RegisterClient(this, 10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_provider = new MxDiskStreamProvider();
|
||||||
|
if (m_provider == NULL) {
|
||||||
|
result = FAILURE;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = m_provider->SetResourceToGet(this);
|
||||||
|
if (result != SUCCESS) {
|
||||||
|
delete m_provider;
|
||||||
|
m_provider = NULL;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
TickleManager()->RegisterClient(this, 10);
|
||||||
|
|
||||||
|
done:
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,6 +106,7 @@ MxResult MxDiskStreamController::VTable0x18(undefined4, undefined4)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c7890
|
// FUNCTION: LEGO1 0x100c7890
|
||||||
|
// FUNCTION: BETA10 0x101543bb
|
||||||
MxResult MxDiskStreamController::FUN_100c7890(MxDSStreamingAction* p_action)
|
MxResult MxDiskStreamController::FUN_100c7890(MxDSStreamingAction* p_action)
|
||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
@@ -104,7 +114,7 @@ MxResult MxDiskStreamController::FUN_100c7890(MxDSStreamingAction* p_action)
|
|||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_list0x80.push_back(p_action);
|
m_list0x80.PushBack(p_action);
|
||||||
FUN_100c7970();
|
FUN_100c7970();
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -122,6 +132,7 @@ void MxDiskStreamController::FUN_100c7970()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c7980
|
// FUNCTION: LEGO1 0x100c7980
|
||||||
|
// FUNCTION: BETA10 0x10154848
|
||||||
void MxDiskStreamController::FUN_100c7980()
|
void MxDiskStreamController::FUN_100c7980()
|
||||||
{
|
{
|
||||||
MxDSBuffer* buffer;
|
MxDSBuffer* buffer;
|
||||||
@@ -159,24 +170,33 @@ void MxDiskStreamController::FUN_100c7980()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c7ac0
|
// FUNCTION: LEGO1 0x100c7ac0
|
||||||
|
// FUNCTION: BETA10 0x10154abb
|
||||||
MxDSStreamingAction* MxDiskStreamController::VTable0x28()
|
MxDSStreamingAction* MxDiskStreamController::VTable0x28()
|
||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
MxDSObject* oldAction;
|
MxDSObject* oldAction;
|
||||||
MxDSStreamingAction* result = NULL;
|
|
||||||
|
assert(m_provider);
|
||||||
|
MxDSStreamingAction* request = NULL;
|
||||||
MxU32 filesize = m_provider->GetFileSize();
|
MxU32 filesize = m_provider->GetFileSize();
|
||||||
|
|
||||||
if (m_unk0x3c.PopFront(oldAction)) {
|
if (!m_unk0x3c.PopFront(oldAction)) {
|
||||||
result = new MxDSStreamingAction((MxDSStreamingAction&) *oldAction);
|
goto done;
|
||||||
if (result) {
|
|
||||||
MxU32 offset = result->GetBufferOffset() + filesize;
|
|
||||||
((MxDSStreamingAction*) oldAction)->SetUnknown94(offset);
|
|
||||||
((MxDSStreamingAction*) oldAction)->SetBufferOffset(offset);
|
|
||||||
m_unk0x3c.push_back(oldAction);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
request = new MxDSStreamingAction((MxDSStreamingAction&) *oldAction);
|
||||||
|
assert(request);
|
||||||
|
|
||||||
|
if (!request) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
((MxDSStreamingAction*) oldAction)->SetUnknown94(request->GetBufferOffset() + filesize);
|
||||||
|
((MxDSStreamingAction*) oldAction)->SetBufferOffset(((MxDSStreamingAction*) oldAction)->GetUnknown94());
|
||||||
|
m_unk0x3c.PushBack(oldAction);
|
||||||
|
|
||||||
|
done:
|
||||||
|
return request;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c7c00
|
// FUNCTION: LEGO1 0x100c7c00
|
||||||
|
@@ -32,7 +32,7 @@ MxStreamController::~MxStreamController()
|
|||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
|
|
||||||
MxDSSubscriber* subscriber;
|
MxDSSubscriber* subscriber;
|
||||||
while (m_subscriberList.PopFront(subscriber)) {
|
while (m_subscribers.PopFront(subscriber)) {
|
||||||
delete subscriber;
|
delete subscriber;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,14 +80,14 @@ MxResult MxStreamController::Open(const char* p_filename)
|
|||||||
// FUNCTION: BETA10 0x1014e730
|
// FUNCTION: BETA10 0x1014e730
|
||||||
void MxStreamController::AddSubscriber(MxDSSubscriber* p_subscriber)
|
void MxStreamController::AddSubscriber(MxDSSubscriber* p_subscriber)
|
||||||
{
|
{
|
||||||
m_subscriberList.PushBack(p_subscriber);
|
m_subscribers.PushBack(p_subscriber);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c1620
|
// FUNCTION: LEGO1 0x100c1620
|
||||||
// FUNCTION: BETA10 0x1014e7b4
|
// FUNCTION: BETA10 0x1014e7b4
|
||||||
void MxStreamController::RemoveSubscriber(MxDSSubscriber* p_subscriber)
|
void MxStreamController::RemoveSubscriber(MxDSSubscriber* p_subscriber)
|
||||||
{
|
{
|
||||||
m_subscriberList.Remove(p_subscriber);
|
m_subscribers.Remove(p_subscriber);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c1690
|
// FUNCTION: LEGO1 0x100c1690
|
||||||
@@ -173,7 +173,7 @@ MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_offset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (newUnknown24 == -1) {
|
if (newUnknown24 == -1) {
|
||||||
for (MxDSSubscriberList::iterator it = m_subscriberList.begin(); it != m_subscriberList.end(); it++) {
|
for (MxDSSubscriberList::iterator it = m_subscribers.begin(); it != m_subscribers.end(); it++) {
|
||||||
MxDSSubscriber* subscriber = *it;
|
MxDSSubscriber* subscriber = *it;
|
||||||
|
|
||||||
if (subscriber->GetObjectId() == p_action->GetObjectId()) {
|
if (subscriber->GetObjectId() == p_action->GetObjectId()) {
|
||||||
@@ -288,7 +288,7 @@ MxResult MxStreamController::FUN_100c1f00(MxDSAction* p_action)
|
|||||||
chunk->SetChunkFlags(DS_CHUNK_BIT3);
|
chunk->SetChunkFlags(DS_CHUNK_BIT3);
|
||||||
chunk->SetObjectId(objectId);
|
chunk->SetObjectId(objectId);
|
||||||
|
|
||||||
if (chunk->SendChunk(m_subscriberList, FALSE, p_action->GetUnknown24()) != SUCCESS) {
|
if (chunk->SendChunk(m_subscribers, FALSE, p_action->GetUnknown24()) != SUCCESS) {
|
||||||
delete chunk;
|
delete chunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ MxNextActionDataStart* MxStreamController::FindNextActionDataStartFromStreamingA
|
|||||||
// FUNCTION: BETA10 0x1014f3b5
|
// FUNCTION: BETA10 0x1014f3b5
|
||||||
MxBool MxStreamController::IsStoped(MxDSObject* p_obj)
|
MxBool MxStreamController::IsStoped(MxDSObject* p_obj)
|
||||||
{
|
{
|
||||||
MxDSSubscriber* subscriber = m_subscriberList.Find(p_obj);
|
MxDSSubscriber* subscriber = m_subscribers.Find(p_obj);
|
||||||
|
|
||||||
if (subscriber) {
|
if (subscriber) {
|
||||||
MxTrace(
|
MxTrace(
|
||||||
|
Reference in New Issue
Block a user