Skip to content

Commit

Permalink
Implement/match Act3Shark::Animate (#1231)
Browse files Browse the repository at this point in the history
* Implement/match `Act3Shark::Animate`

* Add BETA annotation

* Raise max functions

* Mark as FUNCTION
  • Loading branch information
foxtacles authored Dec 15, 2024
1 parent ace2a9f commit 661c76c
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
run: |
reccmp-reccmp -S CONFIGPROGRESS.SVG --svg-icon assets/config.png --target CONFIG | tee CONFIGPROGRESS.TXT
reccmp-reccmp -S ISLEPROGRESS.SVG --svg-icon assets/isle.png --target ISLE | tee ISLEPROGRESS.TXT
reccmp-reccmp -S LEGO1PROGRESS.SVG -T 4340 --svg-icon assets/lego1.png --target LEGO1 | tee LEGO1PROGRESS.TXT
reccmp-reccmp -S LEGO1PROGRESS.SVG -T 4345 --svg-icon assets/lego1.png --target LEGO1 | tee LEGO1PROGRESS.TXT
- name: Compare Accuracy With Current Master
shell: bash
Expand Down
5 changes: 4 additions & 1 deletion LEGO1/lego/legoomni/include/act3actors.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class Act3Shark : public LegoAnimActor {

private:
list<Act3Ammo*> m_unk0x1c; // 0x1c
undefined4 m_unk0x28; // 0x28
Act3Ammo* m_unk0x28; // 0x28
MxFloat m_unk0x2c; // 0x2c
LegoWorld* m_world; // 0x30
LegoAnimActorStruct* m_unk0x34; // 0x34
Expand All @@ -173,6 +173,9 @@ class Act3Shark : public LegoAnimActor {
// TEMPLATE: LEGO1 0x10042c90
// List<Act3Ammo *>::~List<Act3Ammo *>

// TEMPLATE: LEGO1 0x10042ee0
// list<Act3Ammo *,allocator<Act3Ammo *> >::erase

// GLOBAL: LEGO1 0x100d7660
// Act3Actor::`vbtable'

Expand Down
56 changes: 52 additions & 4 deletions LEGO1/lego/legoomni/src/actors/act3actors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "act3.h"
#include "act3ammo.h"
#include "anim/legoanim.h"
#include "define.h"
#include "legocachesoundmanager.h"
#include "legolocomotionanimpresenter.h"
Expand Down Expand Up @@ -299,6 +300,7 @@ void Act3Brickster::ParseAction(char* p_extra)
}

// STUB: LEGO1 0x10041050
// STUB: BETA10 0x100197d7
void Act3Brickster::Animate(float p_time)
{
// TODO
Expand Down Expand Up @@ -386,7 +388,7 @@ MxResult Act3Brickster::VTable0x9c()
Act3Shark::Act3Shark()
{
m_unk0x2c = 0.0f;
m_unk0x28 = 0;
m_unk0x28 = NULL;
}

// FUNCTION: LEGO1 0x10042ce0
Expand All @@ -397,18 +399,64 @@ MxResult Act3Shark::FUN_10042ce0(Act3Ammo* p_ammo)
return SUCCESS;
}

// STUB: LEGO1 0x10042d40
// FUNCTION: LEGO1 0x10042d40
void Act3Shark::Animate(float p_time)
{
// TODO
LegoROI** roiMap = m_unk0x34->GetROIMap();

if (m_unk0x28 == NULL) {
if (m_unk0x1c.size() > 0) {
m_unk0x28 = m_unk0x1c.front();
m_unk0x1c.pop_front();
m_unk0x2c = p_time;
roiMap[1] = m_unk0x28->GetROI();
m_unk0x3c = roiMap[1]->GetLocal2World()[3];
roiMap[1]->SetVisibility(TRUE);
roiMap[2]->SetVisibility(TRUE);
}

if (m_unk0x28 == NULL) {
return;
}
}

float time = m_unk0x2c + m_unk0x34->GetDuration();

if (time > p_time) {
float duration = p_time - m_unk0x2c;

if (duration < 0) {
duration = 0;
}

if (m_unk0x34->GetDuration() < duration) {
duration = m_unk0x34->GetDuration();
}

MxMatrix mat;
mat.SetIdentity();

Vector3 vec(mat[3]);
vec = m_unk0x3c;

LegoTreeNode* node = m_unk0x34->GetAnimTreePtr()->GetRoot();
LegoROI::FUN_100a8e80(node, mat, duration, m_unk0x34->GetROIMap());
}
else {
roiMap[1] = m_unk0x38;
((Act3*) m_world)->RemovePizza(*m_unk0x28);
m_unk0x28 = NULL;
roiMap[1]->SetVisibility(FALSE);
roiMap[2]->SetVisibility(FALSE);
}
}

// FUNCTION: LEGO1 0x10042f30
void Act3Shark::ParseAction(char* p_extra)
{
LegoPathActor::ParseAction(p_extra);

m_world = (LegoWorld*) CurrentWorld();
m_world = CurrentWorld();

char value[256];
if (KeyValueStringParse(value, g_strANIMATION, p_extra)) {
Expand Down
2 changes: 1 addition & 1 deletion LEGO1/lego/legoomni/src/common/legotextureinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ LegoTextureInfo* LegoTextureInfo::Create(const char* p_name, LegoTexture* p_text
return NULL;
}

// STUB: LEGO1 0x10065f60
// FUNCTION: LEGO1 0x10065f60
BOOL LegoTextureInfo::SetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo* p_textureInfo)
{
TglImpl::MeshImpl::MeshData* data = ((TglImpl::MeshImpl*) pMesh)->ImplementationData();
Expand Down

0 comments on commit 661c76c

Please sign in to comment.