mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-23 20:00:01 +00:00
removed cutscene heads
This commit is contained in:
parent
36e1f7b4fb
commit
989ded6052
|
@ -188,7 +188,7 @@ 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_NOWALK },
|
||||
|
|
|
@ -22,7 +22,7 @@ enum AssocGroupId
|
|||
ASSOCGRP_BUSYWOMAN,
|
||||
ASSOCGRP_SEXYWOMAN,
|
||||
ASSOCGRP_OLDWOMAN,
|
||||
ASSOCGRP_FARWOMAN,
|
||||
ASSOCGRP_FATWOMAN,
|
||||
ASSOCGRP_PANICCHUNKY,
|
||||
ASSOCGRP_PLAYERBACK,
|
||||
ASSOCGRP_PLAYERLEFT,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue