summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-08-28 12:58:42 +0200
committerGitHub <noreply@github.com>2019-08-28 12:58:42 +0200
commit792893df594b8cd09d7e9e8486148aa0126eef3a (patch)
treef775059bd6cd968b096f989243e496bea776ae4f /src/animation
parentMerge pull request #197 from Nick007J/master (diff)
parentAudio fixes (diff)
downloadre3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar
re3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar.gz
re3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar.bz2
re3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar.lz
re3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar.xz
re3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar.zst
re3-792893df594b8cd09d7e9e8486148aa0126eef3a.zip
Diffstat (limited to 'src/animation')
-rw-r--r--src/animation/AnimBlendAssocGroup.cpp4
-rw-r--r--src/animation/AnimBlendAssocGroup.h2
-rw-r--r--src/animation/AnimBlendAssociation.cpp4
-rw-r--r--src/animation/AnimManager.cpp54
-rw-r--r--src/animation/AnimManager.h8
5 files changed, 36 insertions, 36 deletions
diff --git a/src/animation/AnimBlendAssocGroup.cpp b/src/animation/AnimBlendAssocGroup.cpp
index 05f9a06a..72c90233 100644
--- a/src/animation/AnimBlendAssocGroup.cpp
+++ b/src/animation/AnimBlendAssocGroup.cpp
@@ -129,7 +129,7 @@ CAnimBlendAssocGroup::CreateAssociations(const char *name)
// Create associations from hierarchies for a given clump
void
-CAnimBlendAssocGroup::CreateAssociations(const char *blockName, RpClump *clump, char **animNames, int numAssocs)
+CAnimBlendAssocGroup::CreateAssociations(const char *blockName, RpClump *clump, const char **animNames, int numAssocs)
{
int i;
CAnimBlock *animBlock;
@@ -157,5 +157,5 @@ STARTPATCHES
InjectHook(0x401420, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(uint32))&CAnimBlendAssocGroup::CopyAnimation, PATCH_JUMP);
InjectHook(0x4013E0, (CAnimBlendAssociation *(CAnimBlendAssocGroup::*)(const char*))&CAnimBlendAssocGroup::CopyAnimation, PATCH_JUMP);
InjectHook(0x401130, (void (CAnimBlendAssocGroup::*)(const char*))&CAnimBlendAssocGroup::CreateAssociations, PATCH_JUMP);
- InjectHook(0x401220, (void (CAnimBlendAssocGroup::*)(const char*, RpClump*, char**, int))&CAnimBlendAssocGroup::CreateAssociations, PATCH_JUMP);
+ InjectHook(0x401220, (void (CAnimBlendAssocGroup::*)(const char*, RpClump*, const char**, int))&CAnimBlendAssocGroup::CreateAssociations, PATCH_JUMP);
ENDPATCHES
diff --git a/src/animation/AnimBlendAssocGroup.h b/src/animation/AnimBlendAssocGroup.h
index 708a3cdd..aa58b0d3 100644
--- a/src/animation/AnimBlendAssocGroup.h
+++ b/src/animation/AnimBlendAssocGroup.h
@@ -16,5 +16,5 @@ public:
CAnimBlendAssociation *CopyAnimation(uint32 id);
CAnimBlendAssociation *CopyAnimation(const char *name);
void CreateAssociations(const char *name);
- void CreateAssociations(const char *blockName, RpClump *clump, char **animNames, int numAssocs);
+ void CreateAssociations(const char *blockName, RpClump *clump, const char **animNames, int numAssocs);
};
diff --git a/src/animation/AnimBlendAssociation.cpp b/src/animation/AnimBlendAssociation.cpp
index d94fe2c1..ec42191b 100644
--- a/src/animation/AnimBlendAssociation.cpp
+++ b/src/animation/AnimBlendAssociation.cpp
@@ -185,7 +185,7 @@ CAnimBlendAssociation::UpdateBlend(float timeDelta)
if(blendAmount <= 0.0f && blendDelta < 0.0f){
// We're faded out and are not fading in
blendAmount = 0.0f;
- blendDelta = max(0.0, blendDelta);
+ blendDelta = max(0.0f, blendDelta);
if(flags & ASSOC_DELETEFADEDOUT){
if(callbackType == CB_FINISH || callbackType == CB_DELETE)
callback(this, callbackArg);
@@ -197,7 +197,7 @@ CAnimBlendAssociation::UpdateBlend(float timeDelta)
if(blendAmount > 1.0f){
// Maximally faded in, clamp values
blendAmount = 1.0f;
- blendDelta = min(0.0, blendDelta);
+ blendDelta = min(0.0f, blendDelta);
}
return true;
diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp
index 6ad63e49..444ae93d 100644
--- a/src/animation/AnimManager.cpp
+++ b/src/animation/AnimManager.cpp
@@ -198,7 +198,7 @@ AnimAssocDesc aStdAnimDescsSide[] = {
{ ANIM_IDLE_STANCE, ASSOC_REPEAT },
{ ANIM_WALK_START, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
};
-char *aStdAnimations[] = {
+char const *aStdAnimations[] = {
"walk_civi",
"run_civi",
"sprint_panic",
@@ -373,162 +373,162 @@ char *aStdAnimations[] = {
"PHONE_out",
"PHONE_talk",
};
-char *aPlayerAnimations[] = {
+char const *aPlayerAnimations[] = {
"walk_player",
"run_player",
"SPRINT_civi",
"IDLE_STANCE",
"walk_start",
};
-char *aPlayerWithRocketAnimations[] = {
+char const *aPlayerWithRocketAnimations[] = {
"walk_rocket",
"run_rocket",
"run_rocket",
"idle_rocket",
"walk_start_rocket",
};
-char *aPlayer1ArmedAnimations[] = {
+char const *aPlayer1ArmedAnimations[] = {
"walk_player",
"run_1armed",
"SPRINT_civi",
"IDLE_STANCE",
"walk_start",
};
-char *aPlayer2ArmedAnimations[] = {
+char const *aPlayer2ArmedAnimations[] = {
"walk_player",
"run_armed",
"run_armed",
"idle_stance",
"walk_start",
};
-char *aPlayerBBBatAnimations[] = {
+char const *aPlayerBBBatAnimations[] = {
"walk_player",
"run_player",
"run_player",
"IDLE_STANCE",
"walk_start",
};
-char *aShuffleAnimations[] = {
+char const *aShuffleAnimations[] = {
"WALK_shuffle",
"RUN_civi",
"SPRINT_civi",
"IDLE_STANCE",
};
-char *aOldAnimations[] = {
+char const *aOldAnimations[] = {
"walk_old",
"run_civi",
"sprint_civi",
"idle_stance",
};
-char *aGang1Animations[] = {
+char const *aGang1Animations[] = {
"walk_gang1",
"run_gang1",
"sprint_civi",
"idle_stance",
};
-char *aGang2Animations[] = {
+char const *aGang2Animations[] = {
"walk_gang2",
"run_gang1",
"sprint_civi",
"idle_stance",
};
-char *aFatAnimations[] = {
+char const *aFatAnimations[] = {
"walk_fat",
"run_civi",
"woman_runpanic",
"idle_stance",
};
-char *aOldFatAnimations[] = {
+char const *aOldFatAnimations[] = {
"walk_fatold",
"run_fatold",
"woman_runpanic",
"idle_stance",
};
-char *aStdWomanAnimations[] = {
+char const *aStdWomanAnimations[] = {
"woman_walknorm",
"woman_run",
"woman_runpanic",
"woman_idlestance",
};
-char *aWomanShopAnimations[] = {
+char const *aWomanShopAnimations[] = {
"woman_walkshop",
"woman_run",
"woman_run",
"woman_idlestance",
};
-char *aBusyWomanAnimations[] = {
+char const *aBusyWomanAnimations[] = {
"woman_walkbusy",
"woman_run",
"woman_runpanic",
"woman_idlestance",
};
-char *aSexyWomanAnimations[] = {
+char const *aSexyWomanAnimations[] = {
"woman_walksexy",
"woman_run",
"woman_runpanic",
"woman_idlestance",
};
-char *aOldWomanAnimations[] = {
+char const *aOldWomanAnimations[] = {
"woman_walkold",
"woman_run",
"woman_runpanic",
"woman_idlestance",
};
-char *aFatWomanAnimations[] = {
+char const *aFatWomanAnimations[] = {
"walk_fat",
"woman_run",
"woman_runpanic",
"woman_idlestance",
};
-char *aPanicChunkyAnimations[] = {
+char const *aPanicChunkyAnimations[] = {
"run_fatold",
"woman_runpanic",
"woman_runpanic",
"idle_stance",
};
-char *aPlayerStrafeBackAnimations[] = {
+char const *aPlayerStrafeBackAnimations[] = {
"walk_player_back",
"run_player_back",
"run_player_back",
"IDLE_STANCE",
"walk_start_back",
};
-char *aPlayerStrafeLeftAnimations[] = {
+char const *aPlayerStrafeLeftAnimations[] = {
"walk_player_left",
"run_left",
"run_left",
"IDLE_STANCE",
"walk_start_left",
};
-char *aPlayerStrafeRightAnimations[] = {
+char const *aPlayerStrafeRightAnimations[] = {
"walk_player_right",
"run_right",
"run_right",
"IDLE_STANCE",
"walk_start_right",
};
-char *aRocketStrafeBackAnimations[] = {
+char const *aRocketStrafeBackAnimations[] = {
"walk_rocket_back",
"run_rocket_back",
"run_rocket_back",
"idle_rocket",
"walkst_rocket_back",
};
-char *aRocketStrafeLeftAnimations[] = {
+char const *aRocketStrafeLeftAnimations[] = {
"walk_rocket_left",
"run_rocket_left",
"run_rocket_left",
"idle_rocket",
"walkst_rocket_left",
};
-char *aRocketStrafeRightAnimations[] = {
+char const *aRocketStrafeRightAnimations[] = {
"walk_rocket_right",
"run_rocket_right",
"run_rocket_right",
"idle_rocket",
"walkst_rocket_right",
};
-AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS] = {
+const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS] = {
{ "man", "ped", MI_COP, 173, aStdAnimations, aStdAnimDescs },
{ "player", "ped", MI_COP, 5, aPlayerAnimations, aStdAnimDescs },
{ "playerrocket", "ped", MI_COP, 5, aPlayerWithRocketAnimations, aStdAnimDescs },
@@ -749,7 +749,7 @@ CAnimManager::LoadAnimFiles(void)
RpClump *clump = (RpClump*)mi->CreateInstance();
RpAnimBlendClumpInit(clump);
CAnimBlendAssocGroup *group = &CAnimManager::ms_aAnimAssocGroups[i];
- AnimAssocDefinition *def = &CAnimManager::ms_aAnimAssocDefinitions[i];
+ const AnimAssocDefinition *def = &CAnimManager::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 3a7c057c..d2e85c06 100644
--- a/src/animation/AnimManager.h
+++ b/src/animation/AnimManager.h
@@ -231,17 +231,17 @@ struct AnimAssocDesc
struct AnimAssocDefinition
{
- char *name;
- char *blockName;
+ char const *name;
+ char const *blockName;
int32 modelIndex;
int32 numAnims;
- char **animNames;
+ char const **animNames;
AnimAssocDesc *animDescs;
};
class CAnimManager
{
- static AnimAssocDefinition ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS];
+ static const AnimAssocDefinition ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS];
static CAnimBlock *ms_aAnimBlocks; //[2]
static CAnimBlendHierarchy *ms_aAnimations; //[250]
static int32 &ms_numAnimBlocks;