1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 08:10:01 +00:00

Merge remote-tracking branch 'origin/master'

This commit is contained in:
Sergeanur 2020-05-09 02:51:40 +03:00
commit d686f587cc
9 changed files with 36 additions and 19 deletions

View file

@ -3,6 +3,7 @@
#include "ctype.h" #include "ctype.h"
#include "General.h" #include "General.h"
#include "RwHelper.h"
#include "ModelInfo.h" #include "ModelInfo.h"
#include "AnimManager.h" #include "AnimManager.h"
#include "RpAnimBlend.h" #include "RpAnimBlend.h"
@ -131,6 +132,10 @@ CAnimBlendAssocGroup::CreateAssociations(const char *name)
assert(model); assert(model);
printf("Associated anim %s with model %s\n", anim->name, model->GetName()); printf("Associated anim %s with model %s\n", anim->name, model->GetName());
RpClump *clump = (RpClump*)model->CreateInstance(); RpClump *clump = (RpClump*)model->CreateInstance();
#ifdef PED_SKIN
if(IsClumpSkinned(clump))
RpClumpForAllAtomics(clump, AtomicRemoveAnimFromSkinCB, nil);
#endif
RpAnimBlendClumpInit(clump); RpAnimBlendClumpInit(clump);
assocList[i].Init(clump, anim); assocList[i].Init(clump, anim);
RpClumpDestroy(clump); RpClumpDestroy(clump);

View file

@ -147,11 +147,11 @@ CAnimBlendAssociation::Start(float time)
SetCurrentTime(time); SetCurrentTime(time);
} }
void bool
CAnimBlendAssociation::UpdateTime(float timeDelta, float relSpeed) CAnimBlendAssociation::UpdateTime(float timeDelta, float relSpeed)
{ {
if(!IsRunning()) if(!IsRunning())
return; return true;
timeStep = (flags & ASSOC_MOVEMENT ? relSpeed*hierarchy->totalLength : speed) * timeDelta; timeStep = (flags & ASSOC_MOVEMENT ? relSpeed*hierarchy->totalLength : speed) * timeDelta;
currentTime += timeStep; currentTime += timeStep;
@ -174,6 +174,7 @@ CAnimBlendAssociation::UpdateTime(float timeDelta, float relSpeed)
} }
} }
} }
return true;
} }
// return whether we still exist after this function // return whether we still exist after this function

View file

@ -75,7 +75,7 @@ public:
void SetCurrentTime(float time); void SetCurrentTime(float time);
void SyncAnimation(CAnimBlendAssociation *other); void SyncAnimation(CAnimBlendAssociation *other);
void Start(float time); void Start(float time);
void UpdateTime(float timeDelta, float relSpeed); bool UpdateTime(float timeDelta, float relSpeed);
bool UpdateBlend(float timeDelta); bool UpdateBlend(float timeDelta);
void SetRun(void) { flags |= ASSOC_RUNNING; } void SetRun(void) { flags |= ASSOC_RUNNING; }

View file

@ -23,5 +23,6 @@ public:
prev->next = next; prev->next = next;
if(next) if(next)
next->prev = prev; next->prev = prev;
Init();
} }
}; };

View file

@ -6,8 +6,8 @@
void void
CAnimBlendNode::Init(void) CAnimBlendNode::Init(void)
{ {
frameA = 0; frameA = -1;
frameB = 0; frameB = -1;
remainingTime = 0.0f; remainingTime = 0.0f;
sequence = nil; sequence = nil;
association = nil; association = nil;

View file

@ -11,8 +11,8 @@
#include "AnimBlendAssocGroup.h" #include "AnimBlendAssocGroup.h"
#include "AnimManager.h" #include "AnimManager.h"
CAnimBlock CAnimManager::ms_aAnimBlocks[2]; CAnimBlock CAnimManager::ms_aAnimBlocks[NUMANIMBLOCKS];
CAnimBlendHierarchy CAnimManager::ms_aAnimations[250]; CAnimBlendHierarchy CAnimManager::ms_aAnimations[NUMANIMATIONS];
int32 CAnimManager::ms_numAnimBlocks; int32 CAnimManager::ms_numAnimBlocks;
int32 CAnimManager::ms_numAnimations; int32 CAnimManager::ms_numAnimations;
CAnimBlendAssocGroup *CAnimManager::ms_aAnimAssocGroups; CAnimBlendAssocGroup *CAnimManager::ms_aAnimAssocGroups;
@ -750,8 +750,8 @@ CAnimManager::LoadAnimFiles(void)
CBaseModelInfo *mi = CModelInfo::GetModelInfo(ms_aAnimAssocDefinitions[i].modelIndex); CBaseModelInfo *mi = CModelInfo::GetModelInfo(ms_aAnimAssocDefinitions[i].modelIndex);
RpClump *clump = (RpClump*)mi->CreateInstance(); RpClump *clump = (RpClump*)mi->CreateInstance();
RpAnimBlendClumpInit(clump); RpAnimBlendClumpInit(clump);
CAnimBlendAssocGroup *group = &CAnimManager::ms_aAnimAssocGroups[i]; CAnimBlendAssocGroup *group = &ms_aAnimAssocGroups[i];
const AnimAssocDefinition *def = &CAnimManager::ms_aAnimAssocDefinitions[i]; const AnimAssocDefinition *def = &ms_aAnimAssocDefinitions[i];
group->CreateAssociations(def->blockName, clump, def->animNames, def->numAnims); group->CreateAssociations(def->blockName, clump, def->animNames, def->numAnims);
for(j = 0; j < group->numAssociations; j++) for(j = 0; j < group->numAssociations; j++)
group->GetAnimation(j)->flags |= def->animDescs[j].flags; group->GetAnimation(j)->flags |= def->animDescs[j].flags;

View file

@ -64,8 +64,8 @@ struct AnimAssocDefinition
class CAnimManager class CAnimManager
{ {
static const AnimAssocDefinition ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS]; static const AnimAssocDefinition ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS];
static CAnimBlock ms_aAnimBlocks[2]; static CAnimBlock ms_aAnimBlocks[NUMANIMBLOCKS];
static CAnimBlendHierarchy ms_aAnimations[250]; static CAnimBlendHierarchy ms_aAnimations[NUMANIMATIONS];
static int32 ms_numAnimBlocks; static int32 ms_numAnimBlocks;
static int32 ms_numAnimations; static int32 ms_numAnimations;
static CAnimBlendAssocGroup *ms_aAnimAssocGroups; static CAnimBlendAssocGroup *ms_aAnimAssocGroups;

View file

@ -1493,12 +1493,14 @@ CStreaming::GetCdImageOffset(int32 lastPosn)
} }
inline bool inline bool
TxdAvailable(int32 txdId) ModelNotLoaded(int32 modelId)
{ {
CStreamingInfo *si = &CStreaming::ms_aInfoForModel[txdId + STREAM_OFFSET_TXD]; CStreamingInfo *si = &CStreaming::ms_aInfoForModel[modelId];
return si->m_loadState == STREAMSTATE_LOADED || si->m_loadState == STREAMSTATE_READING; return si->m_loadState != STREAMSTATE_LOADED && si->m_loadState != STREAMSTATE_READING;
} }
inline bool TxdNotLoaded(int32 txdId) { return ModelNotLoaded(txdId + STREAM_OFFSET_TXD); }
// Find stream id of next requested file in cdimage // Find stream id of next requested file in cdimage
int32 int32
CStreaming::GetNextFileOnCd(int32 lastPosn, bool priority) CStreaming::GetNextFileOnCd(int32 lastPosn, bool priority)
@ -1523,10 +1525,15 @@ CStreaming::GetNextFileOnCd(int32 lastPosn, bool priority)
continue; continue;
// request Txd if necessary // request Txd if necessary
if(streamId < STREAM_OFFSET_TXD && if(streamId < STREAM_OFFSET_TXD){
!TxdAvailable(CModelInfo::GetModelInfo(streamId)->GetTxdSlot())){ int txdId = CModelInfo::GetModelInfo(streamId)->GetTxdSlot();
ReRequestTxd(CModelInfo::GetModelInfo(streamId)->GetTxdSlot()); if(TxdNotLoaded(txdId)){
}else if(ms_aInfoForModel[streamId].GetCdPosnAndSize(posn, size)){ ReRequestTxd(txdId);
continue;
}
}
if(ms_aInfoForModel[streamId].GetCdPosnAndSize(posn, size)){
if(posn < posnFirst){ if(posn < posnFirst){
// find first requested file in image // find first requested file in image
streamIdFirst = streamId; streamIdFirst = streamId;
@ -1624,7 +1631,7 @@ CStreaming::RequestModelStream(int32 ch)
if(streamId < STREAM_OFFSET_TXD){ if(streamId < STREAM_OFFSET_TXD){
if (havePed && CModelInfo::GetModelInfo(streamId)->GetModelType() == MITYPE_PED || if (havePed && CModelInfo::GetModelInfo(streamId)->GetModelType() == MITYPE_PED ||
haveBigFile && CModelInfo::GetModelInfo(streamId)->GetModelType() == MITYPE_VEHICLE || haveBigFile && CModelInfo::GetModelInfo(streamId)->GetModelType() == MITYPE_VEHICLE ||
!TxdAvailable(CModelInfo::GetModelInfo(streamId)->GetTxdSlot())) TxdNotLoaded(CModelInfo::GetModelInfo(streamId)->GetTxdSlot()))
break; break;
}else{ }else{
if(haveBigFile && size > 200) if(haveBigFile && size > 200)

View file

@ -38,6 +38,9 @@ enum Config {
NUMAUDIOSCRIPTOBJECTS = 256, NUMAUDIOSCRIPTOBJECTS = 256,
NUMCUTSCENEOBJECTS = 50, NUMCUTSCENEOBJECTS = 50,
NUMANIMBLOCKS = 2,
NUMANIMATIONS = 250,
NUMTEMPOBJECTS = 30, NUMTEMPOBJECTS = 30,
// Path data // Path data