summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-08 20:58:40 +0200
committeraap <aap@papnet.eu>2020-05-08 20:58:40 +0200
commitf12e76fa135db3ca0a98c441cc3f5c0a4a14549d (patch)
tree29774d79de544892972dd8b1e31b5404353dd1ca /src/animation
parentsmall fixes (diff)
downloadre3-f12e76fa135db3ca0a98c441cc3f5c0a4a14549d.tar
re3-f12e76fa135db3ca0a98c441cc3f5c0a4a14549d.tar.gz
re3-f12e76fa135db3ca0a98c441cc3f5c0a4a14549d.tar.bz2
re3-f12e76fa135db3ca0a98c441cc3f5c0a4a14549d.tar.lz
re3-f12e76fa135db3ca0a98c441cc3f5c0a4a14549d.tar.xz
re3-f12e76fa135db3ca0a98c441cc3f5c0a4a14549d.tar.zst
re3-f12e76fa135db3ca0a98c441cc3f5c0a4a14549d.zip
Diffstat (limited to '')
-rw-r--r--src/animation/AnimBlendAssocGroup.cpp5
-rw-r--r--src/animation/AnimBlendAssociation.cpp5
-rw-r--r--src/animation/AnimBlendAssociation.h2
-rw-r--r--src/animation/AnimBlendList.h1
-rw-r--r--src/animation/AnimBlendNode.cpp4
-rw-r--r--src/animation/AnimManager.cpp8
-rw-r--r--src/animation/AnimManager.h4
7 files changed, 18 insertions, 11 deletions
diff --git a/src/animation/AnimBlendAssocGroup.cpp b/src/animation/AnimBlendAssocGroup.cpp
index bdcca2f8..5a6d10b4 100644
--- a/src/animation/AnimBlendAssocGroup.cpp
+++ b/src/animation/AnimBlendAssocGroup.cpp
@@ -3,6 +3,7 @@
#include "ctype.h"
#include "General.h"
+#include "RwHelper.h"
#include "ModelInfo.h"
#include "AnimManager.h"
#include "RpAnimBlend.h"
@@ -131,6 +132,10 @@ CAnimBlendAssocGroup::CreateAssociations(const char *name)
assert(model);
printf("Associated anim %s with model %s\n", anim->name, model->GetName());
RpClump *clump = (RpClump*)model->CreateInstance();
+#ifdef PED_SKIN
+ if(IsClumpSkinned(clump))
+ RpClumpForAllAtomics(clump, AtomicRemoveAnimFromSkinCB, nil);
+#endif
RpAnimBlendClumpInit(clump);
assocList[i].Init(clump, anim);
RpClumpDestroy(clump);
diff --git a/src/animation/AnimBlendAssociation.cpp b/src/animation/AnimBlendAssociation.cpp
index daca7d68..8c99b694 100644
--- a/src/animation/AnimBlendAssociation.cpp
+++ b/src/animation/AnimBlendAssociation.cpp
@@ -147,11 +147,11 @@ CAnimBlendAssociation::Start(float time)
SetCurrentTime(time);
}
-void
+bool
CAnimBlendAssociation::UpdateTime(float timeDelta, float relSpeed)
{
if(!IsRunning())
- return;
+ return true;
timeStep = (flags & ASSOC_MOVEMENT ? relSpeed*hierarchy->totalLength : speed) * timeDelta;
currentTime += timeStep;
@@ -174,6 +174,7 @@ CAnimBlendAssociation::UpdateTime(float timeDelta, float relSpeed)
}
}
}
+ return true;
}
// return whether we still exist after this function
diff --git a/src/animation/AnimBlendAssociation.h b/src/animation/AnimBlendAssociation.h
index d35db1db..f5070cda 100644
--- a/src/animation/AnimBlendAssociation.h
+++ b/src/animation/AnimBlendAssociation.h
@@ -75,7 +75,7 @@ public:
void SetCurrentTime(float time);
void SyncAnimation(CAnimBlendAssociation *other);
void Start(float time);
- void UpdateTime(float timeDelta, float relSpeed);
+ bool UpdateTime(float timeDelta, float relSpeed);
bool UpdateBlend(float timeDelta);
void SetRun(void) { flags |= ASSOC_RUNNING; }
diff --git a/src/animation/AnimBlendList.h b/src/animation/AnimBlendList.h
index d4b9a64a..018b5988 100644
--- a/src/animation/AnimBlendList.h
+++ b/src/animation/AnimBlendList.h
@@ -23,5 +23,6 @@ public:
prev->next = next;
if(next)
next->prev = prev;
+ Init();
}
};
diff --git a/src/animation/AnimBlendNode.cpp b/src/animation/AnimBlendNode.cpp
index 193e9176..df6cd1d5 100644
--- a/src/animation/AnimBlendNode.cpp
+++ b/src/animation/AnimBlendNode.cpp
@@ -6,8 +6,8 @@
void
CAnimBlendNode::Init(void)
{
- frameA = 0;
- frameB = 0;
+ frameA = -1;
+ frameB = -1;
remainingTime = 0.0f;
sequence = nil;
association = nil;
diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp
index ebd2e1fb..f21b3fed 100644
--- a/src/animation/AnimManager.cpp
+++ b/src/animation/AnimManager.cpp
@@ -11,8 +11,8 @@
#include "AnimBlendAssocGroup.h"
#include "AnimManager.h"
-CAnimBlock CAnimManager::ms_aAnimBlocks[2];
-CAnimBlendHierarchy CAnimManager::ms_aAnimations[250];
+CAnimBlock CAnimManager::ms_aAnimBlocks[NUMANIMBLOCKS];
+CAnimBlendHierarchy CAnimManager::ms_aAnimations[NUMANIMATIONS];
int32 CAnimManager::ms_numAnimBlocks;
int32 CAnimManager::ms_numAnimations;
CAnimBlendAssocGroup *CAnimManager::ms_aAnimAssocGroups;
@@ -750,8 +750,8 @@ CAnimManager::LoadAnimFiles(void)
CBaseModelInfo *mi = CModelInfo::GetModelInfo(ms_aAnimAssocDefinitions[i].modelIndex);
RpClump *clump = (RpClump*)mi->CreateInstance();
RpAnimBlendClumpInit(clump);
- CAnimBlendAssocGroup *group = &CAnimManager::ms_aAnimAssocGroups[i];
- const AnimAssocDefinition *def = &CAnimManager::ms_aAnimAssocDefinitions[i];
+ CAnimBlendAssocGroup *group = &ms_aAnimAssocGroups[i];
+ const AnimAssocDefinition *def = &ms_aAnimAssocDefinitions[i];
group->CreateAssociations(def->blockName, clump, def->animNames, def->numAnims);
for(j = 0; j < group->numAssociations; j++)
group->GetAnimation(j)->flags |= def->animDescs[j].flags;
diff --git a/src/animation/AnimManager.h b/src/animation/AnimManager.h
index 1b333b60..d27e4512 100644
--- a/src/animation/AnimManager.h
+++ b/src/animation/AnimManager.h
@@ -64,8 +64,8 @@ struct AnimAssocDefinition
class CAnimManager
{
static const AnimAssocDefinition ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS];
- static CAnimBlock ms_aAnimBlocks[2];
- static CAnimBlendHierarchy ms_aAnimations[250];
+ static CAnimBlock ms_aAnimBlocks[NUMANIMBLOCKS];
+ static CAnimBlendHierarchy ms_aAnimations[NUMANIMATIONS];
static int32 ms_numAnimBlocks;
static int32 ms_numAnimations;
static CAnimBlendAssocGroup *ms_aAnimAssocGroups;