diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp index 687e4439..3dafe3da 100644 --- a/src/animation/AnimManager.cpp +++ b/src/animation/AnimManager.cpp @@ -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 }, diff --git a/src/animation/AnimManager.h b/src/animation/AnimManager.h index 5ec72d80..7cfafcd9 100644 --- a/src/animation/AnimManager.h +++ b/src/animation/AnimManager.h @@ -22,7 +22,7 @@ enum AssocGroupId ASSOCGRP_BUSYWOMAN, ASSOCGRP_SEXYWOMAN, ASSOCGRP_OLDWOMAN, - ASSOCGRP_FARWOMAN, + ASSOCGRP_FATWOMAN, ASSOCGRP_PANICCHUNKY, ASSOCGRP_PLAYERBACK, ASSOCGRP_PLAYERLEFT, diff --git a/src/animation/CutsceneMgr.cpp b/src/animation/CutsceneMgr.cpp index 3cd66697..035c2b49 100644 --- a/src/animation/CutsceneMgr.cpp +++ b/src/animation/CutsceneMgr.cpp @@ -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 * diff --git a/src/animation/CutsceneMgr.h b/src/animation/CutsceneMgr.h index bfdcdb57..18eff0e5 100644 --- a/src/animation/CutsceneMgr.h +++ b/src/animation/CutsceneMgr.h @@ -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); diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 92cadab7..ab187c10 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -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; diff --git a/src/control/Replay.h b/src/control/Replay.h index bf70a28a..6a07e593 100644 --- a/src/control/Replay.h +++ b/src/control/Replay.h @@ -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; diff --git a/src/control/Script.cpp b/src/control/Script.cpp index b6729486..badcebf2 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -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: diff --git a/src/core/Pools.h b/src/core/Pools.h index b0ba6598..2f0537ff 100644 --- a/src/core/Pools.h +++ b/src/core/Pools.h @@ -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 CPedPool; typedef CPool CVehiclePool; typedef CPool CBuildingPool; typedef CPool CTreadablePool; -typedef CPool CObjectPool; +typedef CPool CObjectPool; typedef CPool CDummyPool; typedef CPool CAudioScriptObjectPool; diff --git a/src/objects/CutsceneHead.cpp b/src/objects/CutsceneHead.cpp deleted file mode 100644 index 0938960e..00000000 --- a/src/objects/CutsceneHead.cpp +++ /dev/null @@ -1,186 +0,0 @@ -#include "common.h" -#include - -#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); - } -} diff --git a/src/objects/CutsceneHead.h b/src/objects/CutsceneHead.h deleted file mode 100644 index 0a70353d..00000000 --- a/src/objects/CutsceneHead.h +++ /dev/null @@ -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