mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-12-25 09:11:50 +01:00
Merge remote-tracking branch 'upstream/miami' into miami
This commit is contained in:
commit
609caad7a4
@ -159,6 +159,7 @@ CAnimBlendAssociation::Start(float time)
|
||||
flags |= ASSOC_RUNNING;
|
||||
SetCurrentTime(time);
|
||||
}
|
||||
|
||||
bool
|
||||
CAnimBlendAssociation::UpdateTime(float timeDelta, float relSpeed)
|
||||
{
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "AnimBlendHierarchy.h"
|
||||
|
||||
enum {
|
||||
// TODO
|
||||
ASSOC_RUNNING = 1,
|
||||
ASSOC_REPEAT = 2,
|
||||
ASSOC_DELETEFADEDOUT = 4,
|
||||
@ -13,13 +12,12 @@ enum {
|
||||
ASSOC_PARTIAL = 0x10,
|
||||
ASSOC_MOVEMENT = 0x20, // ???
|
||||
ASSOC_HAS_TRANSLATION = 0x40,
|
||||
ASSOC_FLAG80 = 0x80, // used for footstep sound calculation
|
||||
ASSOC_FLAG100 = 0x100,
|
||||
ASSOC_FLAG200 = 0x200,
|
||||
ASSOC_FLAG400 = 0x400, // unused, blending it with move anims makes them stop. 0x800 in VC
|
||||
ASSOC_FLAG800 = 0x800, // anims that we fall to front. 0x1000 in VC
|
||||
ASSOC_HAS_X_TRANSLATION = 0x1000,
|
||||
// 0x2000 is vehicle anims in VC
|
||||
ASSOC_WALK = 0x80, // for CPed::PlayFootSteps(void)
|
||||
ASSOC_FLAG_XPRESS = 0x100, // only used by xpress scratch, see CPed::Chat(void)
|
||||
ASSOC_NOWALK = 0x200, // see CPed::PlayFootSteps(void)
|
||||
ASSOC_BLOCK = 0x400, // unused in assoc description, blocks other anims from being played
|
||||
ASSOC_FRONTAL = 0x800, // anims that we fall to front
|
||||
ASSOC_HAS_X_TRANSLATION = 0x1000, // for 2d velocity extraction
|
||||
};
|
||||
|
||||
// Anim hierarchy associated with a clump
|
||||
|
@ -22,9 +22,9 @@ CAnimBlendAssocGroup *CAnimManager::ms_aAnimAssocGroups;
|
||||
CLinkList<CAnimBlendHierarchy*> CAnimManager::ms_animCache;
|
||||
|
||||
AnimAssocDesc aStdAnimDescs[] = {
|
||||
{ ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_FLAG80 },
|
||||
{ ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_FLAG80 },
|
||||
{ ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_FLAG80 },
|
||||
{ ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
|
||||
{ ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
|
||||
{ ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
|
||||
{ ANIM_IDLE_STANCE, ASSOC_REPEAT },
|
||||
{ ANIM_WALK_START, ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_RUN_STOP, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION },
|
||||
@ -35,26 +35,26 @@ AnimAssocDesc aStdAnimDescs[] = {
|
||||
{ ANIM_IDLE_ARMED, ASSOC_REPEAT | ASSOC_PARTIAL },
|
||||
{ ANIM_IDLE_CHAT, ASSOC_REPEAT | ASSOC_PARTIAL },
|
||||
{ ANIM_IDLE_TAXI, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_KO_SHOT_FRONT1, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FLAG800 },
|
||||
{ ANIM_KO_SHOT_FRONT2, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FLAG800 },
|
||||
{ ANIM_KO_SHOT_FRONT3, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FLAG800 },
|
||||
{ ANIM_KO_SHOT_FRONT4, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FLAG800 },
|
||||
{ ANIM_KO_SHOT_FACE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FLAG800 },
|
||||
{ ANIM_KO_SHOT_FRONT1, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ ANIM_KO_SHOT_FRONT2, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ ANIM_KO_SHOT_FRONT3, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ ANIM_KO_SHOT_FRONT4, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ ANIM_KO_SHOT_FACE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ ANIM_KO_SHOT_STOM, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_KO_SHOT_ARML, ASSOC_PARTIAL | ASSOC_FLAG800 },
|
||||
{ ANIM_KO_SHOT_ARMR, ASSOC_PARTIAL | ASSOC_FLAG800 },
|
||||
{ ANIM_KO_SHOT_ARML, ASSOC_PARTIAL | ASSOC_FRONTAL },
|
||||
{ ANIM_KO_SHOT_ARMR, ASSOC_PARTIAL | ASSOC_FRONTAL },
|
||||
{ ANIM_KO_SHOT_LEGL, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_KO_SHOT_LEGR, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_KD_LEFT, ASSOC_PARTIAL | ASSOC_FLAG800 },
|
||||
{ ANIM_KD_RIGHT, ASSOC_PARTIAL | ASSOC_FLAG800 },
|
||||
{ ANIM_KD_LEFT, ASSOC_PARTIAL | ASSOC_FRONTAL },
|
||||
{ ANIM_KD_RIGHT, ASSOC_PARTIAL | ASSOC_FRONTAL },
|
||||
{ ANIM_KO_SKID_FRONT, ASSOC_PARTIAL },
|
||||
{ ANIM_KO_SPIN_R, ASSOC_PARTIAL },
|
||||
{ ANIM_KO_SKID_BACK, ASSOC_PARTIAL | ASSOC_FLAG800 },
|
||||
{ ANIM_KO_SKID_BACK, ASSOC_PARTIAL | ASSOC_FRONTAL },
|
||||
{ ANIM_KO_SPIN_L, ASSOC_PARTIAL },
|
||||
{ ANIM_SHOT_FRONT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_FLAG200 },
|
||||
{ ANIM_SHOT_LEFT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_FLAG200 },
|
||||
{ ANIM_SHOT_BACK_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_FLAG200 },
|
||||
{ ANIM_SHOT_RIGHT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_FLAG200 },
|
||||
{ ANIM_SHOT_FRONT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
{ ANIM_SHOT_LEFT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
{ ANIM_SHOT_BACK_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
{ ANIM_SHOT_RIGHT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
{ ANIM_HIT_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_HIT_LEFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_HIT_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
@ -65,29 +65,29 @@ AnimAssocDesc aStdAnimDescs[] = {
|
||||
{ ANIM_HIT_HEAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_HIT_WALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_HIT_WALL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FLOOR_HIT_F, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FLAG800 },
|
||||
{ ANIM_FLOOR_HIT_F, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL },
|
||||
{ ANIM_HIT_BEHIND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_PUNCH_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_KICK_FLOOR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_BAT_H, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_BAT_V, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_HGUN_BODY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_FLAG200 },
|
||||
{ ANIM_WEAPON_HGUN_BODY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
{ ANIM_WEAPON_AK_BODY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_PUMP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_SNIPER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_THROW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_THROWU, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_START_THROW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BOMBER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_FLAG200 },
|
||||
{ ANIM_HGUN_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_FLAG200 },
|
||||
{ ANIM_AK_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_FLAG200 },
|
||||
{ ANIM_FPS_PUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FPS_BAT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FPS_UZI, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FPS_PUMP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FPS_AK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FPS_M16, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FPS_ROCKET, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_BOMBER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
{ ANIM_HGUN_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
{ ANIM_AK_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
// { ANIM_FPS_PUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
// { ANIM_FPS_BAT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
// { ANIM_FPS_UZI, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
// { ANIM_FPS_PUMP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
// { ANIM_FPS_AK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
// { ANIM_FPS_M16, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
// { ANIM_FPS_ROCKET, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FIGHT_IDLE, ASSOC_REPEAT },
|
||||
{ ANIM_FIGHT2_IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FIGHT_SH_F, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
@ -99,7 +99,7 @@ AnimAssocDesc aStdAnimDescs[] = {
|
||||
{ ANIM_FIGHT_PUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_FIGHT_ROUNDHOUSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_LONGKICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FIGHT_PPUNCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FLAG200 },
|
||||
{ ANIM_FIGHT_PPUNCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
{ ANIM_CAR_JACKED_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_CAR_LJACKED_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_CAR_JACKED_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
@ -178,8 +178,8 @@ AnimAssocDesc aStdAnimDescs[] = {
|
||||
{ ANIM_FALL_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FALL_COLLAPSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_EV_STEP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_EV_DIVE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FLAG800 },
|
||||
{ ANIM_XPRESS_SCRATCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_FLAG100 },
|
||||
{ ANIM_EV_DIVE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
|
||||
{ ANIM_XPRESS_SCRATCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_FLAG_XPRESS },
|
||||
{ ANIM_ROAD_CROSS, ASSOC_REPEAT | ASSOC_PARTIAL },
|
||||
{ ANIM_TURN_180, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_ARREST_GUN, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
@ -188,18 +188,18 @@ AnimAssocDesc aStdAnimDescs[] = {
|
||||
{ ANIM_DUCK_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_DUCK_LOW, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_RBLOCK_CSHOOT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_THROWU, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_WEAPON_THROWU2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_HANDSUP, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_HANDSCOWER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
|
||||
{ ANIM_FUCKU, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_FLAG200 },
|
||||
{ ANIM_FUCKU, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
|
||||
{ ANIM_PHONE_IN, ASSOC_PARTIAL },
|
||||
{ ANIM_PHONE_OUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
|
||||
{ ANIM_PHONE_TALK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
|
||||
};
|
||||
AnimAssocDesc aStdAnimDescsSide[] = {
|
||||
{ ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_FLAG80 | ASSOC_HAS_X_TRANSLATION },
|
||||
{ ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_FLAG80 | ASSOC_HAS_X_TRANSLATION },
|
||||
{ ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_FLAG80 | ASSOC_HAS_X_TRANSLATION },
|
||||
{ ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK | ASSOC_HAS_X_TRANSLATION },
|
||||
{ ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK | ASSOC_HAS_X_TRANSLATION },
|
||||
{ ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK | ASSOC_HAS_X_TRANSLATION },
|
||||
{ ANIM_IDLE_STANCE, ASSOC_REPEAT },
|
||||
{ ANIM_WALK_START, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
|
||||
};
|
||||
@ -263,13 +263,13 @@ char const *aStdAnimations[] = {
|
||||
"bomber",
|
||||
"WEAPON_hgun_rload",
|
||||
"WEAPON_AK_rload",
|
||||
"FPS_PUNCH",
|
||||
"FPS_BAT",
|
||||
"FPS_UZI",
|
||||
"FPS_PUMP",
|
||||
"FPS_AK",
|
||||
"FPS_M16",
|
||||
"FPS_ROCKET",
|
||||
// "FPS_PUNCH",
|
||||
// "FPS_BAT",
|
||||
// "FPS_UZI",
|
||||
// "FPS_PUMP",
|
||||
// "FPS_AK",
|
||||
// "FPS_M16",
|
||||
// "FPS_ROCKET",
|
||||
"FIGHTIDLE",
|
||||
"FIGHT2IDLE",
|
||||
"FIGHTsh_F",
|
||||
@ -825,7 +825,8 @@ CAnimManager::BlendAnimation(RpClump *clump, AssocGroupId groupId, AnimationId a
|
||||
void
|
||||
CAnimManager::LoadAnimFiles(void)
|
||||
{
|
||||
LoadAnimFile("ANIM\\PED.IFP");
|
||||
// LoadAnimFile("ANIM\\PED.IFP");
|
||||
LoadAnimFile("ANIM\\PED_MIAMI.IFP");
|
||||
ms_aAnimAssocGroups = new CAnimBlendAssocGroup[NUM_ANIM_ASSOC_GROUPS];
|
||||
CreateAnimAssocGroups();
|
||||
}
|
||||
@ -986,15 +987,6 @@ CAnimManager::LoadAnimFile(RwStream *stream, bool compress, char (*somename)[32]
|
||||
kf->deltaTime = fbuf[10]; // absolute time here
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// convert absolute time to deltas
|
||||
for(l = seq->numFrames-1; l > 0; l--){
|
||||
KeyFrame *kf1 = seq->GetKeyFrame(l);
|
||||
KeyFrame *kf2 = seq->GetKeyFrame(l-1);
|
||||
kf1->deltaTime -= kf2->deltaTime;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
hier->RemoveQuaternionFlips();
|
||||
|
@ -22,7 +22,7 @@ enum AssocGroupId
|
||||
ASSOCGRP_BUSYWOMAN,
|
||||
ASSOCGRP_SEXYWOMAN,
|
||||
ASSOCGRP_OLDWOMAN,
|
||||
ASSOCGRP_FARWOMAN,
|
||||
ASSOCGRP_FATWOMAN,
|
||||
ASSOCGRP_PANICCHUNKY,
|
||||
ASSOCGRP_PLAYERBACK,
|
||||
ASSOCGRP_PLAYERLEFT,
|
||||
|
@ -61,13 +61,13 @@ enum AnimationId
|
||||
ANIM_BOMBER,
|
||||
ANIM_HGUN_RELOAD,
|
||||
ANIM_AK_RELOAD,
|
||||
ANIM_FPS_PUNCH,
|
||||
ANIM_FPS_BAT,
|
||||
ANIM_FPS_UZI,
|
||||
ANIM_FPS_PUMP,
|
||||
ANIM_FPS_AK,
|
||||
ANIM_FPS_M16,
|
||||
ANIM_FPS_ROCKET,
|
||||
// ANIM_FPS_PUNCH,
|
||||
// ANIM_FPS_BAT,
|
||||
// ANIM_FPS_UZI,
|
||||
// ANIM_FPS_PUMP,
|
||||
// ANIM_FPS_AK,
|
||||
// ANIM_FPS_M16,
|
||||
// ANIM_FPS_ROCKET,
|
||||
ANIM_FIGHT_IDLE,
|
||||
ANIM_FIGHT2_IDLE,
|
||||
ANIM_FIGHT_SH_F,
|
||||
|
@ -2,26 +2,29 @@
|
||||
#include "PedModelInfo.h"
|
||||
#include "Bones.h"
|
||||
|
||||
#ifdef PED_SKIN
|
||||
|
||||
int
|
||||
ConvertPedNode2BoneTag(int node)
|
||||
{
|
||||
switch(node){
|
||||
case PED_TORSO: return BONE_waist;
|
||||
case PED_MID: return BONE_torso; // this is what Xbox/Mobile use
|
||||
// return BONE_mid; // this is what PS2/PC use
|
||||
case PED_HEAD: return BONE_head;
|
||||
case PED_UPPERARML: return BONE_upperarml;
|
||||
case PED_UPPERARMR: return BONE_upperarmr;
|
||||
case PED_HANDL: return BONE_Lhand;
|
||||
case PED_HANDR: return BONE_Rhand;
|
||||
case PED_UPPERLEGL: return BONE_upperlegl;
|
||||
case PED_UPPERLEGR: return BONE_upperlegr;
|
||||
case PED_FOOTL: return BONE_footl;
|
||||
case PED_FOOTR: return BONE_footr;
|
||||
case PED_LOWERLEGR: return BONE_lowerlegl;
|
||||
case PED_MID: return BONE_spine1;
|
||||
case PED_HEAD: return BONE_head;
|
||||
case PED_UPPERARML: return BONE_l_upperarm;
|
||||
case PED_UPPERARMR: return BONE_r_upperarm;
|
||||
case PED_HANDL: return BONE_l_hand;
|
||||
case PED_HANDR: return BONE_r_hand;
|
||||
case PED_UPPERLEGL: return BONE_l_thigh;
|
||||
case PED_UPPERLEGR: return BONE_r_thigh;
|
||||
case PED_FOOTL: return BONE_l_foot;
|
||||
case PED_FOOTR: return BONE_r_foot;
|
||||
case PED_LOWERLEGR: return BONE_r_calf;
|
||||
case PED_LOWERLEGL: return BONE_l_calf;
|
||||
case PED_FOREARML: return BONE_l_forearm;
|
||||
case PED_FOREARMR: return BONE_r_forearm;
|
||||
case PED_CLAVICLEL: return BONE_l_clavicle;
|
||||
case PED_CLAVICLER: return BONE_r_clavicle;
|
||||
case PED_NECK: return BONE_neck;
|
||||
}
|
||||
assert(0 && "this node has no bone");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -29,24 +32,28 @@ const char*
|
||||
ConvertBoneTag2BoneName(int tag)
|
||||
{
|
||||
switch(tag){
|
||||
case BONE_waist: return "Swaist";
|
||||
case BONE_upperlegr: return "Supperlegr";
|
||||
case BONE_lowerlegr: return "Slowerlegr";
|
||||
case BONE_footr: return "Sfootr";
|
||||
case BONE_upperlegl: return "Supperlegl";
|
||||
case BONE_lowerlegl: return "Slowerlegl";
|
||||
case BONE_footl: return "Sfootl";
|
||||
case BONE_mid: return "Smid";
|
||||
case BONE_torso: return "Storso";
|
||||
case BONE_head: return "Shead";
|
||||
case BONE_upperarmr: return "Supperarmr";
|
||||
case BONE_lowerarmr: return "Slowerarmr";
|
||||
case BONE_Rhand: return "SRhand";
|
||||
case BONE_upperarml: return "Supperarml";
|
||||
case BONE_lowerarml: return "Slowerarml";
|
||||
case BONE_Lhand: return "SLhand";
|
||||
case BONE_root: return "Root";
|
||||
case BONE_pelvis: return "Pelvis";
|
||||
case BONE_spine: return "Spine";
|
||||
case BONE_spine1: return "Spine1";
|
||||
case BONE_neck: return "Neck";
|
||||
case BONE_head: return "Head";
|
||||
case BONE_r_clavicle: return "Bip01 R Clavicle";
|
||||
case BONE_r_upperarm: return "R UpperArm";
|
||||
case BONE_r_forearm: return "R Forearm";
|
||||
case BONE_r_hand: return "R Hand";
|
||||
case BONE_r_finger: return "R Fingers";
|
||||
case BONE_l_clavicle: return "Bip01 L Clavicle";
|
||||
case BONE_l_upperarm: return "L UpperArm";
|
||||
case BONE_l_forearm: return "L Forearm";
|
||||
case BONE_l_hand: return "L Hand";
|
||||
case BONE_l_finger: return "L Fingers";
|
||||
case BONE_l_thigh: return "L Thigh";
|
||||
case BONE_l_calf: return "L Calf";
|
||||
case BONE_l_foot: return "L Foot";
|
||||
case BONE_r_thigh: return "R Thigh";
|
||||
case BONE_r_calf: return "R Calf";
|
||||
case BONE_r_foot: return "R Foot";
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -2,22 +2,28 @@
|
||||
|
||||
enum BoneTag
|
||||
{
|
||||
BONE_waist,
|
||||
BONE_upperlegr,
|
||||
BONE_lowerlegr,
|
||||
BONE_footr,
|
||||
BONE_upperlegl,
|
||||
BONE_lowerlegl,
|
||||
BONE_footl,
|
||||
BONE_mid,
|
||||
BONE_torso,
|
||||
BONE_head,
|
||||
BONE_upperarmr,
|
||||
BONE_lowerarmr,
|
||||
BONE_Rhand,
|
||||
BONE_upperarml,
|
||||
BONE_lowerarml,
|
||||
BONE_Lhand,
|
||||
BONE_root = 0,
|
||||
BONE_pelvis = 1,
|
||||
BONE_spine = 2,
|
||||
BONE_spine1 = 3,
|
||||
BONE_neck = 4,
|
||||
BONE_head = 5,
|
||||
BONE_l_clavicle = 31,
|
||||
BONE_l_upperarm = 32,
|
||||
BONE_l_forearm = 33,
|
||||
BONE_l_hand = 34,
|
||||
BONE_l_finger = 35,
|
||||
BONE_r_clavicle = 21,
|
||||
BONE_r_upperarm = 22,
|
||||
BONE_r_forearm = 23,
|
||||
BONE_r_hand = 24,
|
||||
BONE_r_finger = 25,
|
||||
BONE_l_thigh = 41,
|
||||
BONE_l_calf = 42,
|
||||
BONE_l_foot = 43,
|
||||
BONE_r_thigh = 51,
|
||||
BONE_r_calf = 52,
|
||||
BONE_r_foot = 53,
|
||||
};
|
||||
|
||||
int ConvertPedNode2BoneTag(int node);
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "World.h"
|
||||
#include "PlayerPed.h"
|
||||
#include "Wanted.h"
|
||||
#include "CutsceneHead.h"
|
||||
#include "RpAnimBlend.h"
|
||||
#include "ModelIndices.h"
|
||||
#include "TempColModels.h"
|
||||
@ -239,16 +238,6 @@ CCutsceneMgr::LoadCutsceneData(const char *szCutsceneName)
|
||||
CWorld::Players[CWorld::PlayerInFocus].MakePlayerSafe(true);
|
||||
}
|
||||
|
||||
void
|
||||
CCutsceneMgr::SetHeadAnim(const char *animName, CObject *pObject)
|
||||
{
|
||||
CCutsceneHead *pCutsceneHead = (CCutsceneHead*)pObject;
|
||||
char szAnim[CUTSCENENAMESIZE * 2];
|
||||
|
||||
sprintf(szAnim, "%s_%s", ms_cutsceneName, animName);
|
||||
pCutsceneHead->PlayAnimation(szAnim);
|
||||
}
|
||||
|
||||
void
|
||||
CCutsceneMgr::FinishCutscene()
|
||||
{
|
||||
@ -307,11 +296,7 @@ CCutsceneMgr::SetCutsceneAnim(const char *animName, CObject *pObject)
|
||||
CCutsceneHead *
|
||||
CCutsceneMgr::AddCutsceneHead(CObject *pObject, int modelId)
|
||||
{
|
||||
CCutsceneHead *pHead = new CCutsceneHead(pObject);
|
||||
pHead->SetModelIndex(modelId);
|
||||
CWorld::Add(pHead);
|
||||
ms_pCutsceneObjects[ms_numCutsceneObjs++] = pHead;
|
||||
return pHead;
|
||||
return nil;
|
||||
}
|
||||
|
||||
CCutsceneObject *
|
||||
|
@ -41,7 +41,6 @@ public:
|
||||
static void Shutdown(void);
|
||||
static void LoadCutsceneData(const char *szCutsceneName);
|
||||
static void FinishCutscene(void);
|
||||
static void SetHeadAnim(const char *animName, CObject *pObject);
|
||||
static void SetupCutsceneToStart(void);
|
||||
static void SetCutsceneAnim(const char *animName, CObject *pObject);
|
||||
static CCutsceneHead *AddCutsceneHead(CObject *pObject, int modelId);
|
||||
|
@ -1357,8 +1357,9 @@ cAudioManager::GetBlackProjectMaleTalkSfx(int16 sound, int32 model)
|
||||
return GetGenericMaleTalkSfx(sound);
|
||||
}
|
||||
|
||||
if (model == MI_P_MAN2)
|
||||
sfx += (SFX_BLACK_PROJECT_MALE_VOICE_2_DRIVER_ABUSE_1 - SFX_BLACK_PROJECT_MALE_VOICE_1_DRIVER_ABUSE_1);
|
||||
// TODO(MIAMI): just making this compile
|
||||
// if (model == MI_P_MAN2)
|
||||
// sfx += (SFX_BLACK_PROJECT_MALE_VOICE_2_DRIVER_ABUSE_1 - SFX_BLACK_PROJECT_MALE_VOICE_1_DRIVER_ABUSE_1);
|
||||
return sfx;
|
||||
}
|
||||
|
||||
@ -2188,8 +2189,9 @@ cAudioManager::GetBusinessMaleYoungTalkSfx(int16 sound, int32 model)
|
||||
return GetGenericMaleTalkSfx(sound);
|
||||
}
|
||||
|
||||
if (model == MI_B_MAN3)
|
||||
sfx += (SFX_BUSINESS_MALE_YOUNG_VOICE_2_DRIVER_ABUSE_1 - SFX_BUSINESS_MALE_YOUNG_VOICE_1_DRIVER_ABUSE_1);
|
||||
// TODO(MIAMI): just making this compile
|
||||
// if (model == MI_B_MAN3)
|
||||
// sfx += (SFX_BUSINESS_MALE_YOUNG_VOICE_2_DRIVER_ABUSE_1 - SFX_BUSINESS_MALE_YOUNG_VOICE_1_DRIVER_ABUSE_1);
|
||||
return sfx;
|
||||
}
|
||||
|
||||
@ -2265,8 +2267,9 @@ cAudioManager::GetWhiteBusinessFemaleTalkSfx(int16 sound, int32 model)
|
||||
return GetGenericFemaleTalkSfx(sound);
|
||||
}
|
||||
|
||||
if (model == MI_B_WOM2)
|
||||
sfx += (SFX_WHITE_BUSINESS_FEMALE_VOICE_2_DRIVER_ABUSE_1 - SFX_WHITE_BUSINESS_FEMALE_VOICE_1_DRIVER_ABUSE_1);
|
||||
// TODO(MIAMI): just making this compile
|
||||
// if (model == MI_B_WOM2)
|
||||
// sfx += (SFX_WHITE_BUSINESS_FEMALE_VOICE_2_DRIVER_ABUSE_1 - SFX_WHITE_BUSINESS_FEMALE_VOICE_1_DRIVER_ABUSE_1);
|
||||
return sfx;
|
||||
}
|
||||
|
||||
@ -2451,8 +2454,9 @@ cAudioManager::GetFanMaleTalkSfx(int16 sound, int32 model)
|
||||
return GetGenericMaleTalkSfx(sound);
|
||||
}
|
||||
|
||||
if (model == MI_FAN_MAN2)
|
||||
sfx += (SFX_FOOTBALL_MALE_VOICE_2_DRIVER_ABUSE_1 - SFX_FOOTBALL_MALE_VOICE_1_DRIVER_ABUSE_1);
|
||||
// TODO(MIAMI): just making this compile
|
||||
// if (model == MI_FAN_MAN2)
|
||||
// sfx += (SFX_FOOTBALL_MALE_VOICE_2_DRIVER_ABUSE_1 - SFX_FOOTBALL_MALE_VOICE_1_DRIVER_ABUSE_1);
|
||||
return sfx;
|
||||
}
|
||||
|
||||
@ -2631,11 +2635,12 @@ cAudioManager::GetShopperFemaleTalkSfx(int16 sound, int32 model)
|
||||
return GetGenericFemaleTalkSfx(sound);
|
||||
}
|
||||
|
||||
if (model == MI_SHOPPER2) {
|
||||
sfx += (SFX_SHOPPER_VOICE_2_DRIVER_ABUSE_1 - SFX_SHOPPER_VOICE_1_DRIVER_ABUSE_1);
|
||||
} else if (model == MI_SHOPPER3) {
|
||||
sfx += (SFX_SHOPPER_VOICE_3_DRIVER_ABUSE_1 - SFX_SHOPPER_VOICE_1_DRIVER_ABUSE_1);
|
||||
}
|
||||
// TODO(MIAMI): just making this compile
|
||||
// if (model == MI_SHOPPER2) {
|
||||
// sfx += (SFX_SHOPPER_VOICE_2_DRIVER_ABUSE_1 - SFX_SHOPPER_VOICE_1_DRIVER_ABUSE_1);
|
||||
// } else if (model == MI_SHOPPER3) {
|
||||
// sfx += (SFX_SHOPPER_VOICE_3_DRIVER_ABUSE_1 - SFX_SHOPPER_VOICE_1_DRIVER_ABUSE_1);
|
||||
// }
|
||||
return sfx;
|
||||
}
|
||||
|
||||
@ -3044,6 +3049,8 @@ cAudioManager::GetPedCommentSfx(CPed *ped, int32 sound)
|
||||
return GetNormalMaleTalkSfx(sound);
|
||||
case MI_TAXI_D:
|
||||
return GetTaxiDriverTalkSfx(sound);
|
||||
// TODO(MIAMI): just making this compile
|
||||
/*
|
||||
case MI_PIMP:
|
||||
return GetPimpTalkSfx(sound);
|
||||
case MI_GANG01:
|
||||
@ -3173,6 +3180,7 @@ cAudioManager::GetPedCommentSfx(CPed *ped, int32 sound)
|
||||
return GetStudentFemaleTalkSfx(sound);
|
||||
case MI_CAS_MAN:
|
||||
return GetCasualMaleOldTalkSfx(sound);
|
||||
*/
|
||||
default:
|
||||
return GetGenericMaleTalkSfx(sound);
|
||||
}
|
||||
@ -6303,8 +6311,9 @@ cAudioManager::ProcessPed(CPhysical *ped)
|
||||
// params.m_bDistanceCalculated = false;
|
||||
params.m_pPed = (CPed *)ped;
|
||||
params.m_fDistance = GetDistanceSquared(m_sQueueSample.m_vecPos);
|
||||
if (ped->GetModelIndex() == MI_FATMALE02)
|
||||
ProcessPedHeadphones(¶ms);
|
||||
// TODO(MIAMI): just making this compile
|
||||
// if (ped->GetModelIndex() == MI_FATMALE02)
|
||||
// ProcessPedHeadphones(¶ms);
|
||||
ProcessPedOneShots(¶ms);
|
||||
}
|
||||
|
||||
|
@ -884,7 +884,7 @@ int32
|
||||
CCarCtrl::ChooseGangCarModel(int32 gang)
|
||||
{
|
||||
if (CStreaming::HasModelLoaded(MI_GANG01 + 2 * gang) &&
|
||||
CStreaming::HasModelLoaded(MI_GANG02 + 2 * gang))
|
||||
CStreaming::HasModelLoaded(MI_GANG01+1 + 2 * gang))
|
||||
return CGangs::GetGangVehicleModel(gang);
|
||||
return -1;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ CAutomobile *CReplay::pBuf1;
|
||||
uint8 *CReplay::pBuf2;
|
||||
CPlayerPed *CReplay::pBuf3;
|
||||
uint8 *CReplay::pBuf4;
|
||||
CCutsceneHead *CReplay::pBuf5;
|
||||
CCutsceneObject *CReplay::pBuf5;
|
||||
uint8 *CReplay::pBuf6;
|
||||
CPtrNode *CReplay::pBuf7;
|
||||
uint8 *CReplay::pBuf8;
|
||||
|
@ -213,7 +213,7 @@ private:
|
||||
static uint8* pBuf2;
|
||||
static CPlayerPed* pBuf3;
|
||||
static uint8* pBuf4;
|
||||
static CCutsceneHead* pBuf5;
|
||||
static CCutsceneObject* pBuf5;
|
||||
static uint8* pBuf6;
|
||||
static CPtrNode* pBuf7;
|
||||
static uint8* pBuf8;
|
||||
|
@ -76,7 +76,7 @@ static int32 NextValidModelId(int32 mi, int32 step)
|
||||
int32 i = mi;
|
||||
while (result == -1) {
|
||||
i += step;
|
||||
if (i < 0 || i > 5500) {
|
||||
if (i < 0 || i > MODELINFOSIZE) {
|
||||
step = -step;
|
||||
continue;
|
||||
}
|
||||
@ -86,7 +86,7 @@ static int32 NextValidModelId(int32 mi, int32 step)
|
||||
continue;
|
||||
if (pInfo->GetModelType() == MITYPE_PED
|
||||
#ifdef FIX_BUGS
|
||||
&& !(i >= MI_SPECIAL01 && i <= MI_SPECIAL04)
|
||||
&& !(i >= MI_SPECIAL01 && i <= MI_SPECIAL21)
|
||||
#endif
|
||||
|| pInfo->GetModelType() == MITYPE_VEHICLE &&
|
||||
#ifdef FIX_BUGS
|
||||
|
@ -5903,8 +5903,8 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
|
||||
continue;
|
||||
if (pPed->bFadeOut)
|
||||
continue;
|
||||
if (pPed->GetModelIndex() == MI_SCUM_WOM || pPed->GetModelIndex() == MI_SCUM_MAN)
|
||||
continue;
|
||||
// if (pPed->GetModelIndex() == MI_SCUM_WOM || pPed->GetModelIndex() == MI_SCUM_MAN)
|
||||
// continue;
|
||||
if (!ThisIsAValidRandomPed(pPed->m_nPedType))
|
||||
continue;
|
||||
if (pPed->bIsLeader || pPed->m_leader)
|
||||
@ -5952,8 +5952,8 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
|
||||
continue;
|
||||
if (pPed->bFadeOut)
|
||||
continue;
|
||||
if (pPed->GetModelIndex() == MI_SCUM_WOM || pPed->GetModelIndex() == MI_SCUM_MAN)
|
||||
continue;
|
||||
// if (pPed->GetModelIndex() == MI_SCUM_WOM || pPed->GetModelIndex() == MI_SCUM_MAN)
|
||||
// continue;
|
||||
if (!ThisIsAValidRandomPed(pPed->m_nPedType))
|
||||
continue;
|
||||
if (pPed->bIsLeader || pPed->m_leader)
|
||||
@ -6175,25 +6175,12 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
|
||||
}
|
||||
case COMMAND_CREATE_CUTSCENE_HEAD:
|
||||
{
|
||||
CollectParameters(&m_nIp, 2);
|
||||
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
||||
assert(pObject);
|
||||
CCutsceneHead* pCutHead = CCutsceneMgr::AddCutsceneHead(pObject, ScriptParams[1]);
|
||||
ScriptParams[0] = CPools::GetObjectPool()->GetIndex(pCutHead);
|
||||
StoreParameters(&m_nIp, 1);
|
||||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_SET_CUTSCENE_HEAD_ANIM:
|
||||
{
|
||||
CollectParameters(&m_nIp, 1);
|
||||
CObject* pCutHead = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
||||
assert(pCutHead);
|
||||
char name[KEY_LENGTH_IN_SCRIPT];
|
||||
strncpy(name, (const char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
||||
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
||||
CTimer::Stop();
|
||||
CCutsceneMgr::SetHeadAnim(name, pCutHead);
|
||||
CTimer::Update();
|
||||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_SIN:
|
||||
|
@ -25,8 +25,6 @@
|
||||
#include "Camera.h"
|
||||
#include "DMAudio.h"
|
||||
|
||||
const float DefaultFOV = 70.0f; // beta: 80.0f
|
||||
|
||||
bool PrintDebugCode = false;
|
||||
int16 DebugCamMode;
|
||||
|
||||
|
@ -40,6 +40,8 @@ enum
|
||||
#define DEFAULT_CAR_ZOOM_VALUE_2 (1.9f)
|
||||
#define DEFAULT_CAR_ZOOM_VALUE_3 (3.9f)
|
||||
|
||||
const float DefaultFOV = 70.0f; // beta: 80.0f
|
||||
|
||||
class CCam
|
||||
{
|
||||
public:
|
||||
|
@ -67,8 +67,6 @@ CEventList::RegisterEvent(eEventType type, eEventEntity entityType, CEntity *ent
|
||||
switch(entityType){
|
||||
case EVENT_ENTITY_PED:
|
||||
ref = CPools::GetPedRef((CPed*)ent);
|
||||
if(ent->GetModelIndex() >= MI_GANG01 && ent->GetModelIndex() <= MI_CRIMINAL02)
|
||||
copsDontCare = true;
|
||||
break;
|
||||
case EVENT_ENTITY_VEHICLE:
|
||||
ref = CPools::GetVehicleRef((CVehicle*)ent);
|
||||
|
@ -861,15 +861,16 @@ CFileLoader::LoadPedObject(const char *line)
|
||||
{
|
||||
int id;
|
||||
char model[24], txd[24];
|
||||
char pedType[24], pedStats[24], animGroup[24];
|
||||
char pedType[24], pedStats[24], animGroup[24], animFile[16];
|
||||
int carsCanDrive;
|
||||
CPedModelInfo *mi;
|
||||
int animGroupId;
|
||||
int radio1, radio2;
|
||||
|
||||
if(sscanf(line, "%d %s %s %s %s %s %x",
|
||||
sscanf(line, "%d %s %s %s %s %s %x %s %d %d",
|
||||
&id, model, txd,
|
||||
pedType, pedStats, animGroup, &carsCanDrive) != 7)
|
||||
return;
|
||||
pedType, pedStats, animGroup, &carsCanDrive,
|
||||
animFile, &radio1, &radio2);
|
||||
|
||||
mi = CModelInfo::AddPedModel(id);
|
||||
mi->SetName(model);
|
||||
|
@ -901,6 +901,25 @@ CMenuManager::Draw()
|
||||
bool foundTheHoveringItem = false;
|
||||
wchar unicodeTemp[64];
|
||||
|
||||
#ifdef MENU_MAP
|
||||
if (m_nCurrScreen == MENUPAGE_MAP) {
|
||||
// Back button
|
||||
wchar *backTx = TheText.Get("FEDS_TB");
|
||||
CFont::SetDropShadowPosition(1);
|
||||
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
|
||||
CFont::PrintString(MENU_X(60.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), backTx);
|
||||
CFont::SetDropShadowPosition(0);
|
||||
if (!CheckHover(MENU_X(30.0f), MENU_X(30.0f) + CFont::GetStringWidth(backTx), SCREEN_SCALE_FROM_BOTTOM(125.0f), SCREEN_SCALE_FROM_BOTTOM(105.0f))) {
|
||||
m_nHoverOption = HOVEROPTION_NOT_HOVERING;
|
||||
m_nCurrOption = m_nPrevOption = 0;
|
||||
} else {
|
||||
m_nHoverOption = HOVEROPTION_RANDOM_ITEM;
|
||||
m_nCurrOption = m_nPrevOption = 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < NUM_MENUROWS; ++i) {
|
||||
if (aScreens[m_nCurrScreen].m_aEntries[i].m_Action != MENUACTION_LABEL && aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName[0] != '\0') {
|
||||
wchar *rightText = nil;
|
||||
@ -5381,13 +5400,13 @@ CMenuManager::PrintController(void)
|
||||
|
||||
#define ZOOM(x, y, in) \
|
||||
do { \
|
||||
if(fMapSize > SCREEN_WIDTH * 2 && in) \
|
||||
if(fMapSize > SCREEN_HEIGHT * 3.0f && in) \
|
||||
break; \
|
||||
float z2 = in? 1.1f : 1.f/1.1f; \
|
||||
fMapCenterX += (x - fMapCenterX) * (1.0f - z2); \
|
||||
fMapCenterY += (y - fMapCenterY) * (1.0f - z2); \
|
||||
\
|
||||
if (fMapSize < SCREEN_WIDTH / 3 && !in) \
|
||||
if (fMapSize < SCREEN_HEIGHT / 2 && !in) \
|
||||
break; \
|
||||
\
|
||||
fMapSize *= z2; \
|
||||
@ -5400,10 +5419,18 @@ CMenuManager::PrintMap(void)
|
||||
bMenuMapActive = true;
|
||||
CRadar::InitFrontEndMap();
|
||||
|
||||
// Just entered to map
|
||||
if (!bMapLoaded) {
|
||||
fMapCenterX = SCREEN_WIDTH / 2;
|
||||
fMapCenterY = SCREEN_HEIGHT / 3;
|
||||
fMapSize = SCREEN_HEIGHT / CDraw::GetAspectRatio();
|
||||
fMapSize = SCREEN_HEIGHT * 2.0f;
|
||||
fMapCenterX = 0.0f;
|
||||
fMapCenterY = 0.0f;
|
||||
CVector2D radarSpacePlayer;
|
||||
CVector2D screenSpacePlayer;
|
||||
CRadar::TransformRealWorldPointToRadarSpace(radarSpacePlayer, CVector2D(FindPlayerCoors()));
|
||||
CRadar::TransformRadarPointToScreenSpace(screenSpacePlayer, radarSpacePlayer);
|
||||
|
||||
fMapCenterX = (-screenSpacePlayer.x) + SCREEN_WIDTH / 2;
|
||||
fMapCenterY = (-screenSpacePlayer.y) + SCREEN_HEIGHT / 2;
|
||||
bMapMouseShownOnce = false;
|
||||
bMapLoaded = true;
|
||||
|
||||
|
@ -459,6 +459,8 @@ const CMenuScreen aScreens[] = {
|
||||
#ifdef MENU_MAP
|
||||
// MENUPAGE_MAP = 59
|
||||
{ "FEG_MAP", 1, MENUPAGE_NONE, MENUPAGE_NONE, 5, 2,
|
||||
MENUACTION_UNK110, "", SAVESLOT_NONE, MENUPAGE_NONE, // to prevent cross/enter to go back
|
||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
@ -140,9 +140,9 @@ void ChangePlayerCheat()
|
||||
do
|
||||
{
|
||||
do
|
||||
modelId = CGeneral::GetRandomNumberInRange(0, MI_CAS_WOM+1);
|
||||
modelId = CGeneral::GetRandomNumberInRange(0, MI_WFYG2+1);
|
||||
while (!CModelInfo::GetModelInfo(modelId));
|
||||
} while (modelId >= MI_SPECIAL01 && modelId <= MI_SPECIAL04 || modelId == MI_TAXI_D);
|
||||
} while (modelId == MI_TAXI_D);
|
||||
|
||||
uint8 flags = CStreaming::ms_aInfoForModel[modelId].m_flags;
|
||||
ped->DeleteRwObject();
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "Lists.h"
|
||||
#include "Treadable.h"
|
||||
#include "Object.h"
|
||||
#include "CutsceneHead.h"
|
||||
#include "CutsceneObject.h"
|
||||
#include "PlayerPed.h"
|
||||
#include "Automobile.h"
|
||||
#include "DummyPed.h"
|
||||
@ -16,7 +16,7 @@ typedef CPool<CPed,CPlayerPed> CPedPool;
|
||||
typedef CPool<CVehicle,CAutomobile> CVehiclePool;
|
||||
typedef CPool<CBuilding> CBuildingPool;
|
||||
typedef CPool<CTreadable> CTreadablePool;
|
||||
typedef CPool<CObject, CCutsceneHead> CObjectPool;
|
||||
typedef CPool<CObject, CCutsceneObject> CObjectPool;
|
||||
typedef CPool<CDummy, CDummyPed> CDummyPool;
|
||||
typedef CPool<cAudioScriptObject> CAudioScriptObjectPool;
|
||||
|
||||
|
@ -1435,9 +1435,9 @@ CRadar::DrawYouAreHereSprite(float x, float y)
|
||||
|
||||
if (show) {
|
||||
float left = x - SCREEN_SCALE_X(12.0f);
|
||||
float top = y - SCREEN_SCALE_Y(2.0f);
|
||||
float top = y;
|
||||
float right = SCREEN_SCALE_X(12.0) + x;
|
||||
float bottom = y - SCREEN_SCALE_Y(26.0f);
|
||||
float bottom = y - SCREEN_SCALE_Y(24.0f);
|
||||
CentreSprite.Draw(CRect(left, top, right, bottom), CRGBA(255, 255, 255, 255));
|
||||
}
|
||||
MapLegendList[MapLegendCounter++] = RADAR_SPRITE_CENTRE;
|
||||
|
@ -108,8 +108,8 @@ enum Config {
|
||||
|
||||
NUMPEDROUTES = 200,
|
||||
NUMPHONES = 50,
|
||||
NUMPEDGROUPS = 31,
|
||||
NUMMODELSPERPEDGROUP = 8, // TODO(MIAMI): 16 once we have peds
|
||||
NUMPEDGROUPS = 67,
|
||||
NUMMODELSPERPEDGROUP = 16,
|
||||
NUMSHOTINFOS = 100,
|
||||
|
||||
NUMROADBLOCKS = 300,
|
||||
|
@ -176,6 +176,14 @@ enum
|
||||
MI_MEDIC,
|
||||
MI_FIREMAN,
|
||||
MI_MALE01,
|
||||
|
||||
MI_TAXI_D = 28, // HMOCA
|
||||
MI_GANG01 = 83, // CBa
|
||||
MI_VICE1 = 97,
|
||||
MI_WFYG2 = 106, // last regular ped
|
||||
MI_SPECIAL01 = 109,
|
||||
MI_SPECIAL21 = 129,
|
||||
/*
|
||||
MI_TAXI_D,
|
||||
MI_PIMP,
|
||||
MI_GANG01,
|
||||
@ -256,6 +264,7 @@ enum
|
||||
MI_BUSKER3,
|
||||
MI_BUSKER4,
|
||||
// three more peds possible
|
||||
*/
|
||||
|
||||
MI_FIRST_VEHICLE = 130,
|
||||
MI_LANDSTAL = MI_FIRST_VEHICLE,
|
||||
|
@ -187,16 +187,18 @@ struct ColNodeInfo
|
||||
float radius;
|
||||
};
|
||||
|
||||
#define NUMPEDINFONODES 8
|
||||
#define NUMPEDINFONODES 10
|
||||
ColNodeInfo m_pColNodeInfos[NUMPEDINFONODES] = {
|
||||
{ nil, PED_HEAD, PEDPIECE_HEAD, 0.0f, 0.05f, 0.2f },
|
||||
{ "Storso", 0, PEDPIECE_TORSO, 0.0f, 0.15f, 0.2f },
|
||||
{ "Storso", 0, PEDPIECE_TORSO, 0.0f, -0.05f, 0.3f },
|
||||
{ nil, PED_MID, PEDPIECE_MID, 0.0f, -0.07f, 0.3f },
|
||||
{ nil, PED_UPPERARML, PEDPIECE_LEFTARM, 0.07f, -0.1f, 0.2f },
|
||||
{ nil, PED_UPPERARMR, PEDPIECE_RIGHTARM, -0.07f, -0.1f, 0.2f },
|
||||
{ "Slowerlegl", 0, PEDPIECE_LEFTLEG, 0.0f, 0.07f, 0.25f },
|
||||
{ nil, PED_LOWERLEGR, PEDPIECE_RIGHTLEG, 0.0f, 0.07f, 0.25f },
|
||||
{ nil, PED_HEAD, PEDPIECE_HEAD, 0.0f, 0.05f, 0.15f },
|
||||
{ nil, PED_MID, PEDPIECE_TORSO, 0.0f, 0.15f, 0.2f },
|
||||
{ nil, PED_MID, PEDPIECE_TORSO, 0.0f, -0.05f, 0.25f },
|
||||
{ nil, PED_MID, PEDPIECE_MID, 0.0f, -0.25f, 0.25f },
|
||||
{ nil, PED_UPPERARML, PEDPIECE_LEFTARM, 0.03f, -0.05f, 0.16f },
|
||||
{ nil, PED_UPPERARMR, PEDPIECE_RIGHTARM, -0.03f, -0.05f, 0.16f },
|
||||
{ nil, PED_LOWERLEGL, PEDPIECE_LEFTLEG, 0.0f, 0.15f, 0.2f },
|
||||
{ nil, PED_LOWERLEGR, PEDPIECE_RIGHTLEG, 0.0f, 0.15f, 0.2f },
|
||||
{ nil, PED_FOOTL, PEDPIECE_LEFTLEG, 0.0f, 0.15f, 0.15f },
|
||||
{ nil, PED_FOOTR, PEDPIECE_RIGHTLEG, 0.0f, 0.15f, 0.15f },
|
||||
};
|
||||
|
||||
RwObject*
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "PedStats.h"
|
||||
|
||||
enum PedNode {
|
||||
PED_TORSO,
|
||||
PED_MID, // Smid on PS2/PC, Storso on mobile/xbox
|
||||
PED_TORSO = 0, // has no bone!
|
||||
PED_MID,
|
||||
PED_HEAD,
|
||||
PED_UPPERARML,
|
||||
PED_UPPERARMR,
|
||||
@ -17,7 +17,15 @@ enum PedNode {
|
||||
PED_FOOTL,
|
||||
PED_FOOTR,
|
||||
PED_LOWERLEGR,
|
||||
PED_NODE_MAX// Not valid: PED_LOWERLEGL
|
||||
PED_LOWERLEGL,
|
||||
|
||||
PED_FOREARML,
|
||||
PED_FOREARMR,
|
||||
PED_CLAVICLEL,
|
||||
PED_CLAVICLER,
|
||||
PED_NECK,
|
||||
|
||||
PED_NODE_MAX
|
||||
};
|
||||
|
||||
class CPedModelInfo : public CClumpModelInfo
|
||||
|
@ -1,186 +0,0 @@
|
||||
#include "common.h"
|
||||
#include <rpskin.h>
|
||||
|
||||
#include "main.h"
|
||||
#include "RwHelper.h"
|
||||
#include "RpAnimBlend.h"
|
||||
#include "AnimBlendClumpData.h"
|
||||
#include "Bones.h"
|
||||
#include "Directory.h"
|
||||
#include "CutsceneMgr.h"
|
||||
#include "Streaming.h"
|
||||
#include "CutsceneHead.h"
|
||||
#include "CdStream.h"
|
||||
|
||||
|
||||
CCutsceneHead::CCutsceneHead(CObject *obj)
|
||||
{
|
||||
RpAtomic *atm;
|
||||
|
||||
assert(RwObjectGetType(obj->m_rwObject) == rpCLUMP);
|
||||
#ifdef PED_SKIN
|
||||
unk1 = 0;
|
||||
bIsSkinned = false;
|
||||
m_parentObject = (CCutsceneObject*)obj;
|
||||
// Hide original head
|
||||
if(IsClumpSkinned(obj->GetClump())){
|
||||
m_parentObject->SetRenderHead(false);
|
||||
bIsSkinned = true;
|
||||
}else
|
||||
#endif
|
||||
{
|
||||
m_pHeadNode = RpAnimBlendClumpFindFrame((RpClump*)obj->m_rwObject, "Shead")->frame;
|
||||
atm = (RpAtomic*)GetFirstObject(m_pHeadNode);
|
||||
if(atm){
|
||||
assert(RwObjectGetType((RwObject*)atm) == rpATOMIC);
|
||||
RpAtomicSetFlags(atm, RpAtomicGetFlags(atm) & ~rpATOMICRENDER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CCutsceneHead::CreateRwObject(void)
|
||||
{
|
||||
RpAtomic *atm;
|
||||
|
||||
CEntity::CreateRwObject();
|
||||
assert(RwObjectGetType(m_rwObject) == rpCLUMP);
|
||||
atm = GetFirstAtomic((RpClump*)m_rwObject);
|
||||
RpSkinAtomicSetHAnimHierarchy(atm, RpHAnimFrameGetHierarchy(GetFirstChild(RpClumpGetFrame((RpClump*)m_rwObject))));
|
||||
}
|
||||
|
||||
void
|
||||
CCutsceneHead::DeleteRwObject(void)
|
||||
{
|
||||
CEntity::DeleteRwObject();
|
||||
}
|
||||
|
||||
void
|
||||
CCutsceneHead::ProcessControl(void)
|
||||
{
|
||||
RpAtomic *atm;
|
||||
RpHAnimHierarchy *hier;
|
||||
|
||||
// android/xbox calls is at the end
|
||||
CPhysical::ProcessControl();
|
||||
|
||||
#ifdef PED_SKIN
|
||||
if(bIsSkinned){
|
||||
UpdateRpHAnim();
|
||||
UpdateRwFrame();
|
||||
|
||||
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(m_parentObject->GetClump());
|
||||
int idx = RpHAnimIDGetIndex(hier, BONE_head);
|
||||
RwMatrix *mat = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
|
||||
if(RwV3dLength(&mat->pos) > 100.0f){
|
||||
m_matrix.SetRotateY(PI/2);
|
||||
m_matrix = CMatrix(mat) * m_matrix;
|
||||
}
|
||||
}else
|
||||
#endif
|
||||
{
|
||||
m_matrix.SetRotateY(PI/2);
|
||||
m_matrix = CMatrix(RwFrameGetLTM(m_pHeadNode)) * m_matrix;
|
||||
UpdateRwFrame(); // android/xbox don't call this
|
||||
}
|
||||
|
||||
assert(RwObjectGetType(m_rwObject) == rpCLUMP);
|
||||
atm = GetFirstAtomic((RpClump*)m_rwObject);
|
||||
hier = RpSkinAtomicGetHAnimHierarchy(atm);
|
||||
RpHAnimHierarchyAddAnimTime(hier, CTimer::GetTimeStepNonClipped()/50.0f);
|
||||
}
|
||||
|
||||
void
|
||||
CCutsceneHead::Render(void)
|
||||
{
|
||||
RpAtomic *atm;
|
||||
|
||||
#ifdef PED_SKIN
|
||||
if(bIsSkinned){
|
||||
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(m_parentObject->GetClump());
|
||||
RpHAnimHierarchyUpdateMatrices(hier);
|
||||
int idx = RpHAnimIDGetIndex(hier, BONE_head);
|
||||
RwMatrix *mat = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
|
||||
if(RwV3dLength(&mat->pos) > 100.0f){
|
||||
m_matrix.SetRotateY(PI/2);
|
||||
m_matrix = CMatrix(mat) * m_matrix;
|
||||
}
|
||||
RenderLimb(BONE_Lhand);
|
||||
RenderLimb(BONE_Rhand);
|
||||
}else
|
||||
#endif
|
||||
{
|
||||
m_matrix.SetRotateY(PI/2);
|
||||
m_matrix = CMatrix(RwFrameGetLTM(m_pHeadNode)) * m_matrix;
|
||||
}
|
||||
|
||||
UpdateRwFrame();
|
||||
|
||||
assert(RwObjectGetType(m_rwObject) == rpCLUMP);
|
||||
atm = GetFirstAtomic((RpClump*)m_rwObject);
|
||||
RpHAnimHierarchyUpdateMatrices(RpSkinAtomicGetHAnimHierarchy(atm));
|
||||
|
||||
CObject::Render();
|
||||
}
|
||||
|
||||
#ifdef PED_SKIN
|
||||
void
|
||||
CCutsceneHead::RenderLimb(int32 bone)
|
||||
{
|
||||
RpAtomic *atomic;
|
||||
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(m_parentObject->GetClump());
|
||||
int idx = RpHAnimIDGetIndex(hier, bone);
|
||||
RwMatrix *mats = RpHAnimHierarchyGetMatrixArray(hier);
|
||||
CPedModelInfo *mi = (CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex());
|
||||
switch(bone){
|
||||
case BONE_Lhand:
|
||||
atomic = mi->getLeftHand();
|
||||
break;
|
||||
case BONE_Rhand:
|
||||
atomic = mi->getRightHand();
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if(atomic){
|
||||
RwFrame *frame = RpAtomicGetFrame(atomic);
|
||||
RwMatrixTransform(RwFrameGetMatrix(frame), &mats[idx], rwCOMBINEREPLACE);
|
||||
RwFrameUpdateObjects(frame);
|
||||
RpAtomicRender(atomic);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
CCutsceneHead::PlayAnimation(const char *animName)
|
||||
{
|
||||
RpAtomic *atm;
|
||||
RpHAnimHierarchy *hier;
|
||||
RpHAnimAnimation *anim;
|
||||
uint32 offset, size;
|
||||
RwStream *stream;
|
||||
|
||||
assert(RwObjectGetType(m_rwObject) == rpCLUMP);
|
||||
atm = GetFirstAtomic((RpClump*)m_rwObject);
|
||||
hier = RpSkinAtomicGetHAnimHierarchy(atm);
|
||||
|
||||
sprintf(gString, "%s.anm", animName);
|
||||
|
||||
if(CCutsceneMgr::ms_pCutsceneDir->FindItem(gString, offset, size)){
|
||||
stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "ANIM\\CUTS.IMG");
|
||||
assert(stream);
|
||||
|
||||
CStreaming::MakeSpaceFor(size * CDSTREAM_SECTOR_SIZE);
|
||||
CStreaming::ImGonnaUseStreamingMemory();
|
||||
|
||||
RwStreamSkip(stream, offset*2048);
|
||||
if(RwStreamFindChunk(stream, rwID_HANIMANIMATION, nil, nil)){
|
||||
anim = RpHAnimAnimationStreamRead(stream);
|
||||
RpHAnimHierarchySetCurrentAnim(hier, anim);
|
||||
}
|
||||
|
||||
CStreaming::IHaveUsedStreamingMemory();
|
||||
|
||||
RwStreamClose(stream, nil);
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CutsceneObject.h"
|
||||
|
||||
class CCutsceneHead : public CCutsceneObject
|
||||
{
|
||||
public:
|
||||
RwFrame *m_pHeadNode;
|
||||
#ifdef PED_SKIN
|
||||
int32 unk1;
|
||||
CCutsceneObject *m_parentObject;
|
||||
int32 unk2;
|
||||
int32 bIsSkinned;
|
||||
#endif
|
||||
|
||||
CCutsceneHead(CObject *obj);
|
||||
|
||||
void CreateRwObject(void);
|
||||
void DeleteRwObject(void);
|
||||
void ProcessControl(void);
|
||||
void Render(void);
|
||||
void RenderLimb(int32 bone);
|
||||
|
||||
void PlayAnimation(const char *animName);
|
||||
};
|
||||
#ifndef PED_SKIN
|
||||
static_assert(sizeof(CCutsceneHead) == 0x19C, "CCutsceneHead: error");
|
||||
#endif
|
@ -21,12 +21,6 @@ CCutsceneObject::CCutsceneObject(void)
|
||||
ObjectCreatedBy = CUTSCENE_OBJECT;
|
||||
m_fMass = 1.0f;
|
||||
m_fTurnMass = 1.0f;
|
||||
|
||||
#ifdef PED_SKIN
|
||||
bRenderHead = true;
|
||||
bRenderRightHand = true;
|
||||
bRenderLeftHand = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@ -85,47 +79,9 @@ CCutsceneObject::PreRender(void)
|
||||
void
|
||||
CCutsceneObject::Render(void)
|
||||
{
|
||||
#ifdef PED_SKIN
|
||||
if(IsClumpSkinned(GetClump())){
|
||||
if(bRenderLeftHand) RenderLimb(BONE_Lhand);
|
||||
if(bRenderRightHand) RenderLimb(BONE_Rhand);
|
||||
if(bRenderHead) RenderLimb(BONE_head);
|
||||
}
|
||||
#endif
|
||||
CObject::Render();
|
||||
}
|
||||
|
||||
#ifdef PED_SKIN
|
||||
void
|
||||
CCutsceneObject::RenderLimb(int32 bone)
|
||||
{
|
||||
RpAtomic *atomic;
|
||||
CPedModelInfo *mi = (CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex());
|
||||
switch(bone){
|
||||
case BONE_head:
|
||||
atomic = mi->getHead();
|
||||
break;
|
||||
case BONE_Lhand:
|
||||
atomic = mi->getLeftHand();
|
||||
break;
|
||||
case BONE_Rhand:
|
||||
atomic = mi->getRightHand();
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if(atomic){
|
||||
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(GetClump());
|
||||
int idx = RpHAnimIDGetIndex(hier, bone);
|
||||
RwMatrix *mat = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
|
||||
RwFrame *frame = RpAtomicGetFrame(atomic);
|
||||
*RwFrameGetMatrix(frame) = *mat;
|
||||
RwFrameUpdateObjects(frame);
|
||||
RpAtomicRender(atomic);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
CCutsceneObject::SetupLighting(void)
|
||||
{
|
||||
|
@ -5,29 +5,12 @@
|
||||
class CCutsceneObject : public CObject
|
||||
{
|
||||
public:
|
||||
#ifdef PED_SKIN
|
||||
bool bRenderHead;
|
||||
bool bRenderRightHand;
|
||||
bool bRenderLeftHand;
|
||||
|
||||
bool GetRenderHead(void) { return bRenderHead; }
|
||||
bool GetRenderRightHand(void) { return bRenderRightHand; }
|
||||
bool GetRenderLeftHand(void) { return bRenderLeftHand; }
|
||||
void SetRenderHead(bool render) { bRenderHead = render; }
|
||||
void SetRenderRightHand(bool render) { bRenderRightHand = render; }
|
||||
void SetRenderLeftHand(bool render) { bRenderLeftHand = render; }
|
||||
#endif
|
||||
|
||||
CCutsceneObject(void);
|
||||
|
||||
void SetModelIndex(uint32 id);
|
||||
void ProcessControl(void);
|
||||
void PreRender(void);
|
||||
void Render(void);
|
||||
void RenderLimb(int32 bone);
|
||||
bool SetupLighting(void);
|
||||
void RemoveLighting(bool reset);
|
||||
};
|
||||
#ifndef PED_SKIN
|
||||
static_assert(sizeof(CCutsceneObject) == 0x198, "CCutsceneObject: error");
|
||||
#endif
|
||||
|
@ -2104,10 +2104,10 @@ CPed::PlayFootSteps(void)
|
||||
float walkRunAssocBlend = 0.0f, idleAssocBlend = 0.0f;
|
||||
|
||||
for (; assoc; assoc = RpAnimBlendGetNextAssociation(assoc)) {
|
||||
if (assoc->flags & ASSOC_FLAG80) {
|
||||
if (assoc->flags & ASSOC_WALK) {
|
||||
walkRunAssoc = assoc;
|
||||
walkRunAssocBlend += assoc->blendAmount;
|
||||
} else if ((assoc->flags & ASSOC_FLAG200) == 0) {
|
||||
} else if ((assoc->flags & ASSOC_NOWALK) == 0) {
|
||||
idleAssocBlend += assoc->blendAmount;
|
||||
}
|
||||
}
|
||||
@ -3295,7 +3295,7 @@ CPed::Chat(void)
|
||||
} else
|
||||
Say(SOUND_PED_CHAT);
|
||||
|
||||
} else if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG100)) {
|
||||
} else if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG_XPRESS)) {
|
||||
|
||||
if (CGeneral::GetRandomNumber() < 20) {
|
||||
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_XPRESS_SCRATCH, 4.0f);
|
||||
@ -3751,7 +3751,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
|
||||
bool detectDieAnim = true;
|
||||
if (m_nPedState == PED_FALL || m_nPedState == PED_GETUP) {
|
||||
if (!IsPedHeadAbovePos(-0.3f)) {
|
||||
if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800))
|
||||
if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL))
|
||||
dieAnim = ANIM_FLOOR_HIT_F;
|
||||
else
|
||||
dieAnim = ANIM_FLOOR_HIT;
|
||||
@ -3773,7 +3773,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
|
||||
if (IsPedHeadAbovePos(-0.3f)) {
|
||||
dieAnim = NUM_ANIMS;
|
||||
} else {
|
||||
if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800))
|
||||
if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL))
|
||||
dieAnim = ANIM_FLOOR_HIT_F;
|
||||
else
|
||||
dieAnim = ANIM_FLOOR_HIT;
|
||||
@ -3813,7 +3813,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
|
||||
if (IsPedHeadAbovePos(-0.3f)) {
|
||||
dieAnim = NUM_ANIMS;
|
||||
} else {
|
||||
if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800))
|
||||
if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL))
|
||||
dieAnim = ANIM_FLOOR_HIT_F;
|
||||
else
|
||||
dieAnim = ANIM_FLOOR_HIT;
|
||||
@ -4281,7 +4281,7 @@ CPed::SetGetUp(void)
|
||||
animAssoc->flags |= ASSOC_DELETEFADEDOUT;
|
||||
}
|
||||
|
||||
if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800))
|
||||
if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL))
|
||||
animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_GETUP_FRONT, 1000.0f);
|
||||
else
|
||||
animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_GETUP1, 1000.0f);
|
||||
@ -8036,83 +8036,11 @@ CPed::GetNextPointOnRoute(void)
|
||||
return nextPoint;
|
||||
}
|
||||
|
||||
// These categories are purely random, most of ped models have no correlation. So I don't think making an enum.
|
||||
uint8
|
||||
CPed::GetPedRadioCategory(uint32 modelIndex)
|
||||
{
|
||||
switch (modelIndex) {
|
||||
case MI_MALE01:
|
||||
case MI_FEMALE03:
|
||||
case MI_PROSTITUTE2:
|
||||
case MI_WORKER1:
|
||||
case MI_MOD_MAN:
|
||||
case MI_MOD_WOM:
|
||||
case MI_ST_WOM:
|
||||
case MI_FAN_WOM:
|
||||
return 3;
|
||||
case MI_TAXI_D:
|
||||
case MI_PIMP:
|
||||
case MI_MALE02:
|
||||
case MI_FEMALE02:
|
||||
case MI_FATFEMALE01:
|
||||
case MI_FATFEMALE02:
|
||||
case MI_DOCKER1:
|
||||
case MI_WORKER2:
|
||||
case MI_FAN_MAN2:
|
||||
return 9;
|
||||
case MI_GANG01:
|
||||
case MI_GANG02:
|
||||
case MI_SCUM_MAN:
|
||||
case MI_SCUM_WOM:
|
||||
case MI_HOS_WOM:
|
||||
case MI_CONST1:
|
||||
return 1;
|
||||
case MI_GANG03:
|
||||
case MI_GANG04:
|
||||
case MI_GANG07:
|
||||
case MI_GANG08:
|
||||
case MI_CT_MAN2:
|
||||
case MI_CT_WOM2:
|
||||
case MI_B_MAN3:
|
||||
case MI_SHOPPER3:
|
||||
return 4;
|
||||
case MI_GANG05:
|
||||
case MI_GANG06:
|
||||
case MI_GANG11:
|
||||
case MI_GANG12:
|
||||
case MI_CRIMINAL02:
|
||||
case MI_B_WOM2:
|
||||
case MI_ST_MAN:
|
||||
case MI_HOS_MAN:
|
||||
return 5;
|
||||
case MI_FATMALE01:
|
||||
case MI_LI_MAN2:
|
||||
case MI_SHOPPER1:
|
||||
case MI_CAS_MAN:
|
||||
return 6;
|
||||
case MI_PROSTITUTE:
|
||||
case MI_P_WOM2:
|
||||
case MI_LI_WOM2:
|
||||
case MI_B_WOM3:
|
||||
case MI_CAS_WOM:
|
||||
return 2;
|
||||
case MI_P_WOM1:
|
||||
case MI_DOCKER2:
|
||||
case MI_STUD_MAN:
|
||||
return 7;
|
||||
case MI_CT_MAN1:
|
||||
case MI_CT_WOM1:
|
||||
case MI_LI_MAN1:
|
||||
case MI_LI_WOM1:
|
||||
case MI_B_MAN1:
|
||||
case MI_B_MAN2:
|
||||
case MI_B_WOM1:
|
||||
case MI_SHOPPER2:
|
||||
case MI_STUD_WOM:
|
||||
return 8;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
// TODO(MIAMI): remove this function and use modelinfo for radio
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Some kind of VC leftover I think
|
||||
@ -16306,7 +16234,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
|
||||
if (CGame::nastyGame) {
|
||||
if (hitLevel == HITLEVEL_GROUND) {
|
||||
CAnimBlendAssociation *floorHitAssoc;
|
||||
if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800)) {
|
||||
if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL)) {
|
||||
floorHitAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT_F, 8.0f);
|
||||
} else {
|
||||
floorHitAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[FIGHTMOVE_HITONFLOOR].animId, 8.0f);
|
||||
@ -16328,7 +16256,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
|
||||
}
|
||||
} else if (m_nPedState == PED_FALL) {
|
||||
if (hitLevel == HITLEVEL_GROUND && !IsPedHeadAbovePos(-0.3f)) {
|
||||
CAnimBlendAssociation *floorHitAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800) ?
|
||||
CAnimBlendAssociation *floorHitAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL) ?
|
||||
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT_F, 8.0f) :
|
||||
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT, 8.0f);
|
||||
if (floorHitAssoc) {
|
||||
@ -17153,7 +17081,7 @@ CPed::SetMoveAnim(void)
|
||||
else
|
||||
animGroupToUse = m_animGroup;
|
||||
|
||||
CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG400);
|
||||
CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_BLOCK);
|
||||
if (!animAssoc) {
|
||||
CAnimBlendAssociation *fightIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE);
|
||||
animAssoc = fightIdleAssoc;
|
||||
|
@ -33,13 +33,18 @@ CPedIK::CPedIK(CPed *ped)
|
||||
|
||||
#ifdef PED_SKIN
|
||||
inline RwMatrix*
|
||||
GetComponentMatrix(CPed *ped, int32 node)
|
||||
GetBoneMatrix(CPed *ped, int32 bone)
|
||||
{
|
||||
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(ped->GetClump());
|
||||
int idx = RpHAnimIDGetIndex(hier, ped->m_pFrames[node]->nodeID);
|
||||
int idx = RpHAnimIDGetIndex(hier, bone);
|
||||
RwMatrix *mats = RpHAnimHierarchyGetMatrixArray(hier);
|
||||
return &mats[idx];
|
||||
}
|
||||
inline RwMatrix*
|
||||
GetComponentMatrix(CPed *ped, int32 node)
|
||||
{
|
||||
return GetBoneMatrix(ped, ped->m_pFrames[node]->nodeID);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
@ -245,7 +250,7 @@ CPedIK::LookInDirection(float phi, float theta)
|
||||
}
|
||||
|
||||
// parent of head is torso
|
||||
RwMatrix worldMat = *GetComponentMatrix(m_ped, BONE_torso);
|
||||
RwMatrix worldMat = *GetComponentMatrix(m_ped, PED_NECK);
|
||||
ExtractYawAndPitchWorld(&worldMat, &yaw, &pitch);
|
||||
|
||||
LimbMoveStatus headStatus = MoveLimb(m_headOrient, CGeneral::LimitRadianAngle(phi - yaw),
|
||||
|
@ -37,6 +37,11 @@ enum ePedStats
|
||||
PEDSTAT_SPORTSFAN,
|
||||
PEDSTAT_SHOPPER,
|
||||
PEDSTAT_OLDSHOPPER,
|
||||
PEDSTAT_BEACH_GUY,
|
||||
PEDSTAT_BEACH_GIRL,
|
||||
PEDSTAT_SKATER,
|
||||
PEDSTAT_STD_MISSION,
|
||||
PEDSTAT_COWARD,
|
||||
|
||||
NUM_PEDSTATS
|
||||
};
|
||||
|
@ -1327,7 +1327,7 @@ CPlayerPed::ProcessControl(void)
|
||||
case PED_ATTACK:
|
||||
case PED_FIGHT:
|
||||
case PED_AIM_GUN:
|
||||
if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG400)) {
|
||||
if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_BLOCK)) {
|
||||
if (TheCamera.Cams[0].Using3rdPersonMouseCam()) {
|
||||
if (padUsed)
|
||||
PlayerControl1stPersonRunAround(padUsed);
|
||||
|
@ -29,13 +29,17 @@ CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh,
|
||||
float recip = 1.0f/out->z;
|
||||
out->x *= SCREEN_WIDTH * recip;
|
||||
out->y *= SCREEN_HEIGHT * recip;
|
||||
// What is this? size?
|
||||
*outw = 70.0f/CDraw::GetFOV() * SCREEN_WIDTH * recip;
|
||||
#ifdef ASPECT_RATIO_SCALE
|
||||
*outh = 70.0f/CDraw::GetFOV() / (DEFAULT_ASPECT_RATIO / SCREEN_ASPECT_RATIO) * SCREEN_HEIGHT * recip;
|
||||
float fov = CDraw::ConvertFOV(DefaultFOV);
|
||||
#else
|
||||
*outh = 70.0f/CDraw::GetFOV() * SCREEN_HEIGHT * recip;
|
||||
const float fov = DefaultFOV;
|
||||
#endif
|
||||
// this is used to scale correctly if you zoom in with sniper rifle
|
||||
float fovScale = fov / CDraw::GetFOV();
|
||||
|
||||
*outw = fovScale * SCREEN_SCALE_AR(recip) * SCREEN_WIDTH;
|
||||
*outh = fovScale * recip * SCREEN_HEIGHT;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1024,12 +1024,14 @@ void resizeCB(GLFWwindow* window, int width, int height) {
|
||||
if (RwInitialised && height > 0 && width > 0) {
|
||||
RwRect r;
|
||||
|
||||
// TODO support resizing with mouse. Now enabling this makes weird things to trails and CameraSize messing with sizes
|
||||
// TODO fix artifacts of resizing with mouse
|
||||
RsGlobal.maximumHeight = height;
|
||||
RsGlobal.maximumWidth = width;
|
||||
|
||||
r.x = 0;
|
||||
r.y = 0;
|
||||
r.w = RsGlobal.maximumWidth;
|
||||
r.h = RsGlobal.maximumHeight;
|
||||
r.w = width;
|
||||
r.h = height;
|
||||
|
||||
RsEventHandler(rsCAMERASIZE, &r);
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ void CBulletInfo::Update(void)
|
||||
}
|
||||
if (pPed->GetPedState() == PED_DEAD) {
|
||||
CAnimBlendAssociation* pAnim;
|
||||
if (RpAnimBlendClumpGetFirstAssociation(pPed->GetClump(), ASSOC_FLAG800))
|
||||
if (RpAnimBlendClumpGetFirstAssociation(pPed->GetClump(), ASSOC_FRONTAL))
|
||||
pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT_F, 8.0f);
|
||||
else
|
||||
pAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT, 8.0f);
|
||||
|
@ -973,7 +973,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim,
|
||||
if ( victimPed->Dead() )
|
||||
{
|
||||
CAnimBlendAssociation *asoc;
|
||||
if ( RpAnimBlendClumpGetFirstAssociation(victimPed->GetClump(), ASSOC_FLAG800) )
|
||||
if ( RpAnimBlendClumpGetFirstAssociation(victimPed->GetClump(), ASSOC_FRONTAL) )
|
||||
asoc = CAnimManager::BlendAnimation(victimPed->GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT_F, 8.0f);
|
||||
else
|
||||
asoc = CAnimManager::BlendAnimation(victimPed->GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT, 8.0f);
|
||||
|
Loading…
Reference in New Issue
Block a user