summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2020-04-19 18:34:08 +0200
committerFilip Gawin <filip.gawin@zoho.com>2020-04-20 18:18:46 +0200
commit370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96 (patch)
tree5f5c66a542d7a121a7db88fed66e31f2a263b206 /src/animation
parentMerge pull request #474 from Nick007J/master (diff)
downloadre3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.gz
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.bz2
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.lz
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.xz
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.zst
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.zip
Diffstat (limited to '')
-rw-r--r--src/animation/AnimBlendAssocGroup.cpp15
-rw-r--r--src/animation/AnimBlendAssociation.cpp4
-rw-r--r--src/animation/AnimBlendHierarchy.cpp2
-rw-r--r--src/animation/AnimManager.h180
-rw-r--r--src/animation/AnimationId.h180
5 files changed, 197 insertions, 184 deletions
diff --git a/src/animation/AnimBlendAssocGroup.cpp b/src/animation/AnimBlendAssocGroup.cpp
index e65bdf8d..bdcca2f8 100644
--- a/src/animation/AnimBlendAssocGroup.cpp
+++ b/src/animation/AnimBlendAssocGroup.cpp
@@ -1,5 +1,7 @@
#include "common.h"
+#include "ctype.h"
+
#include "General.h"
#include "ModelInfo.h"
#include "AnimManager.h"
@@ -75,12 +77,21 @@ strcmpIgnoringDigits(const char *s1, const char *s2)
c2 = *s2;
if(c1) s1++;
if(c2) s2++;
- if(c1 == '\0' && c2 == '\0')
- return true;
+ if(c1 == '\0' && c2 == '\0') return true;
+#if defined _WIN32 && !defined __MINGW32__
if(__ascii_iswdigit(c1) && __ascii_iswdigit(c2))
+#else
+ if(iswdigit(c1) && iswdigit(c2))
+#endif
continue;
+#if defined _WIN32 && !defined __MINGW32__
c1 = __ascii_toupper(c1);
c2 = __ascii_toupper(c2);
+#else
+ c1 = toupper(c1);
+ c2 = toupper(c2);
+#endif
+
if(c1 != c2)
return false;
}
diff --git a/src/animation/AnimBlendAssociation.cpp b/src/animation/AnimBlendAssociation.cpp
index fb8c16d7..daca7d68 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.0f, 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.0f, blendDelta);
+ blendDelta = Min(0.0f, blendDelta);
}
return true;
diff --git a/src/animation/AnimBlendHierarchy.cpp b/src/animation/AnimBlendHierarchy.cpp
index 7f39d37a..feeaca3d 100644
--- a/src/animation/AnimBlendHierarchy.cpp
+++ b/src/animation/AnimBlendHierarchy.cpp
@@ -36,7 +36,7 @@ CAnimBlendHierarchy::CalcTotalTime(void)
float seqTime = 0.0f;
for(j = 0; j < sequences[i].numFrames; j++)
seqTime += sequences[i].GetKeyFrame(j)->deltaTime;
- totalTime = max(totalTime, seqTime);
+ totalTime = Max(totalTime, seqTime);
}
totalLength = totalTime;
}
diff --git a/src/animation/AnimManager.h b/src/animation/AnimManager.h
index 93fec74b..1b333b60 100644
--- a/src/animation/AnimManager.h
+++ b/src/animation/AnimManager.h
@@ -1,6 +1,7 @@
#pragma once
#include "AnimBlendHierarchy.h"
+#include "AnimationId.h"
enum AssocGroupId
{
@@ -33,185 +34,6 @@ enum AssocGroupId
NUM_ANIM_ASSOC_GROUPS
};
-enum AnimationId
-{
- ANIM_WALK,
- ANIM_RUN,
- ANIM_SPRINT,
- ANIM_IDLE_STANCE,
- ANIM_WALK_START,
- ANIM_RUN_STOP,
- ANIM_RUN_STOP_R,
- ANIM_IDLE_CAM,
- ANIM_IDLE_HBHB,
- ANIM_IDLE_TIRED,
- ANIM_IDLE_ARMED,
- ANIM_IDLE_CHAT,
- ANIM_IDLE_TAXI,
- ANIM_KO_SHOT_FRONT1,
- ANIM_KO_SHOT_FRONT2,
- ANIM_KO_SHOT_FRONT3,
- ANIM_KO_SHOT_FRONT4,
- ANIM_KO_SHOT_FACE,
- ANIM_KO_SHOT_STOM,
- ANIM_KO_SHOT_ARML,
- ANIM_KO_SHOT_ARMR,
- ANIM_KO_SHOT_LEGL,
- ANIM_KO_SHOT_LEGR,
- ANIM_KD_LEFT,
- ANIM_KD_RIGHT,
- ANIM_KO_SKID_FRONT,
- ANIM_KO_SPIN_R, // named left in VC
- ANIM_KO_SKID_BACK,
- ANIM_KO_SPIN_L, // named right in VC
- ANIM_SHOT_FRONT_PARTIAL,
- ANIM_SHOT_LEFT_PARTIAL,
- ANIM_SHOT_BACK_PARTIAL,
- ANIM_SHOT_RIGHT_PARTIAL,
- ANIM_HIT_FRONT,
- ANIM_HIT_LEFT,
- ANIM_HIT_BACK,
- ANIM_HIT_RIGHT,
- ANIM_FLOOR_HIT,
- ANIM_HIT_BODYBLOW,
- ANIM_HIT_CHEST,
- ANIM_HIT_HEAD,
- ANIM_HIT_WALK,
- ANIM_HIT_WALL,
- ANIM_FLOOR_HIT_F,
- ANIM_HIT_BEHIND,
- ANIM_PUNCH_R,
- ANIM_KICK_FLOOR,
- ANIM_WEAPON_BAT_H,
- ANIM_WEAPON_BAT_V,
- ANIM_WEAPON_HGUN_BODY,
- ANIM_WEAPON_AK_BODY,
- ANIM_WEAPON_PUMP,
- AN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ANIM_ARREST_GUN,
- ANIM_DROWN,
- ANIM_CPR,
- ANIM_DUCK_DOWN,
- ANIM_DUCK_LOW,
- ANIM_RBLOCK_CSHOOT,
- ANIM_WEAPON_THROWU2,
- ANIM_HANDSUP,
- ANIM_HANDSCOWER,
- ANIM_FUCKU,
- ANIM_PHONE_IN,
- ANIM_PHONE_OUT,
- ANIM_PHONE_TALK,
-
- NUM_ANIMS
-};
-
class CAnimBlendAssociation;
class CAnimBlendAssocGroup;
diff --git a/src/animation/AnimationId.h b/src/animation/AnimationId.h
new file mode 100644
index 00000000..82fed8bd
--- /dev/null
+++ b/src/animation/AnimationId.h
@@ -0,0 +1,180 @@
+#pragma once
+
+enum AnimationId
+{
+ ANIM_WALK,
+ ANIM_RUN,
+ ANIM_SPRINT,
+ ANIM_IDLE_STANCE,
+ ANIM_WALK_START,
+ ANIM_RUN_STOP,
+ ANIM_RUN_STOP_R,
+ ANIM_IDLE_CAM,
+ ANIM_IDLE_HBHB,
+ ANIM_IDLE_TIRED,
+ ANIM_IDLE_ARMED,
+ ANIM_IDLE_CHAT,
+ ANIM_IDLE_TAXI,
+ ANIM_KO_SHOT_FRONT1,
+ ANIM_KO_SHOT_FRONT2,
+ ANIM_KO_SHOT_FRONT3,
+ ANIM_KO_SHOT_FRONT4,
+ ANIM_KO_SHOT_FACE,
+ ANIM_KO_SHOT_STOM,
+ ANIM_KO_SHOT_ARML,
+ ANIM_KO_SHOT_ARMR,
+ ANIM_KO_SHOT_LEGL,
+ ANIM_KO_SHOT_LEGR,
+ ANIM_KD_LEFT,
+ ANIM_KD_RIGHT,
+ ANIM_KO_SKID_FRONT,
+ ANIM_KO_SPIN_R, // named left in VC
+ ANIM_KO_SKID_BACK,
+ ANIM_KO_SPIN_L, // named right in VC
+ ANIM_SHOT_FRONT_PARTIAL,
+ ANIM_SHOT_LEFT_PARTIAL,
+ ANIM_SHOT_BACK_PARTIAL,
+ ANIM_SHOT_RIGHT_PARTIAL,
+ ANIM_HIT_FRONT,
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