mirror of
https://github.com/halpz/re3.git
synced 2025-07-23 22:49:45 +00:00
rename clamp macro to Clamp to fix compilation with g++11
This commit is contained in:
@ -404,8 +404,8 @@ void CReplay::StorePedAnimation(CPed *ped, CStoredAnimationState *state)
|
||||
CAnimBlendAssociation* main = RpAnimBlendClumpGetMainAssociation((RpClump*)ped->m_rwObject, &second, &blend_amount);
|
||||
if (main){
|
||||
state->animId = main->animId;
|
||||
state->time = 255.0f / 4.0f * clamp(main->currentTime, 0.0f, 4.0f);
|
||||
state->speed = 255.0f / 3.0f * clamp(main->speed, 0.0f, 3.0f);
|
||||
state->time = 255.0f / 4.0f * Clamp(main->currentTime, 0.0f, 4.0f);
|
||||
state->speed = 255.0f / 3.0f * Clamp(main->speed, 0.0f, 3.0f);
|
||||
}else{
|
||||
state->animId = 3;
|
||||
state->time = 0;
|
||||
@ -413,9 +413,9 @@ void CReplay::StorePedAnimation(CPed *ped, CStoredAnimationState *state)
|
||||
}
|
||||
if (second) {
|
||||
state->secAnimId = second->animId;
|
||||
state->secTime = 255.0f / 4.0f * clamp(second->currentTime, 0.0f, 4.0f);
|
||||
state->secSpeed = 255.0f / 3.0f * clamp(second->speed, 0.0f, 3.0f);
|
||||
state->blendAmount = 255.0f / 2.0f * clamp(blend_amount, 0.0f, 2.0f);
|
||||
state->secTime = 255.0f / 4.0f * Clamp(second->currentTime, 0.0f, 4.0f);
|
||||
state->secSpeed = 255.0f / 3.0f * Clamp(second->speed, 0.0f, 3.0f);
|
||||
state->blendAmount = 255.0f / 2.0f * Clamp(blend_amount, 0.0f, 2.0f);
|
||||
}else{
|
||||
state->secAnimId = 0;
|
||||
state->secTime = 0;
|
||||
@ -425,9 +425,9 @@ void CReplay::StorePedAnimation(CPed *ped, CStoredAnimationState *state)
|
||||
CAnimBlendAssociation* partial = RpAnimBlendClumpGetMainPartialAssociation((RpClump*)ped->m_rwObject);
|
||||
if (partial) {
|
||||
state->partAnimId = partial->animId;
|
||||
state->partAnimTime = 255.0f / 4.0f * clamp(partial->currentTime, 0.0f, 4.0f);
|
||||
state->partAnimSpeed = 255.0f / 3.0f * clamp(partial->speed, 0.0f, 3.0f);
|
||||
state->partBlendAmount = 255.0f / 2.0f * clamp(partial->blendAmount, 0.0f, 2.0f);
|
||||
state->partAnimTime = 255.0f / 4.0f * Clamp(partial->currentTime, 0.0f, 4.0f);
|
||||
state->partAnimSpeed = 255.0f / 3.0f * Clamp(partial->speed, 0.0f, 3.0f);
|
||||
state->partBlendAmount = 255.0f / 2.0f * Clamp(partial->blendAmount, 0.0f, 2.0f);
|
||||
}else{
|
||||
state->partAnimId = 0;
|
||||
state->partAnimTime = 0;
|
||||
@ -442,11 +442,11 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState
|
||||
CAnimBlendAssociation* assoc = RpAnimBlendClumpGetMainAssociation_N((RpClump*)ped->m_rwObject, i);
|
||||
if (assoc){
|
||||
state->aAnimId[i] = assoc->animId;
|
||||
state->aCurTime[i] = 255.0f / 4.0f * clamp(assoc->currentTime, 0.0f, 4.0f);
|
||||
state->aSpeed[i] = 255.0f / 3.0f * clamp(assoc->speed, 0.0f, 3.0f);
|
||||
state->aBlendAmount[i] = 255.0f / 2.0f * clamp(assoc->blendAmount, 0.0f, 2.0f);
|
||||
state->aCurTime[i] = 255.0f / 4.0f * Clamp(assoc->currentTime, 0.0f, 4.0f);
|
||||
state->aSpeed[i] = 255.0f / 3.0f * Clamp(assoc->speed, 0.0f, 3.0f);
|
||||
state->aBlendAmount[i] = 255.0f / 2.0f * Clamp(assoc->blendAmount, 0.0f, 2.0f);
|
||||
#ifdef FIX_REPLAY_BUGS
|
||||
state->aBlendDelta[i] = 127.0f / 32.0f * clamp(assoc->blendDelta, -16.0f, 16.0f);
|
||||
state->aBlendDelta[i] = 127.0f / 32.0f * Clamp(assoc->blendDelta, -16.0f, 16.0f);
|
||||
#endif
|
||||
state->aFlags[i] = assoc->flags;
|
||||
if (assoc->callbackType == CAnimBlendAssociation::CB_FINISH || assoc->callbackType == CAnimBlendAssociation::CB_DELETE) {
|
||||
@ -468,11 +468,11 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState
|
||||
CAnimBlendAssociation* assoc = RpAnimBlendClumpGetMainPartialAssociation_N((RpClump*)ped->m_rwObject, i);
|
||||
if (assoc) {
|
||||
state->aAnimId2[i] = assoc->animId;
|
||||
state->aCurTime2[i] = 255.0f / 4.0f * clamp(assoc->currentTime, 0.0f, 4.0f);
|
||||
state->aSpeed2[i] = 255.0f / 3.0f * clamp(assoc->speed, 0.0f, 3.0f);
|
||||
state->aBlendAmount2[i] = 255.0f / 2.0f * clamp(assoc->blendAmount, 0.0f, 2.0f);
|
||||
state->aCurTime2[i] = 255.0f / 4.0f * Clamp(assoc->currentTime, 0.0f, 4.0f);
|
||||
state->aSpeed2[i] = 255.0f / 3.0f * Clamp(assoc->speed, 0.0f, 3.0f);
|
||||
state->aBlendAmount2[i] = 255.0f / 2.0f * Clamp(assoc->blendAmount, 0.0f, 2.0f);
|
||||
#ifdef FIX_REPLAY_BUGS
|
||||
state->aBlendDelta2[i] = 127.0f / 16.0f * clamp(assoc->blendDelta, -16.0f, 16.0f);
|
||||
state->aBlendDelta2[i] = 127.0f / 16.0f * Clamp(assoc->blendDelta, -16.0f, 16.0f);
|
||||
#endif
|
||||
state->aFlags2[i] = assoc->flags;
|
||||
if (assoc->callbackType == CAnimBlendAssociation::CB_FINISH || assoc->callbackType == CAnimBlendAssociation::CB_DELETE) {
|
||||
|
@ -735,7 +735,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
|
||||
CollectParameters(&m_nIp, 2);
|
||||
CPlayerPed* pPlayerPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
||||
script_assert(pPlayerPed);
|
||||
pPlayerPed->m_fArmour = clamp(pPlayerPed->m_fArmour + ScriptParams[1], 0.0f, 100.0f);
|
||||
pPlayerPed->m_fArmour = Clamp(pPlayerPed->m_fArmour + ScriptParams[1], 0.0f, 100.0f);
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_ADD_ARMOUR_TO_CHAR:
|
||||
@ -743,7 +743,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
|
||||
CollectParameters(&m_nIp, 2);
|
||||
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
||||
script_assert(pPed);
|
||||
pPed->m_fArmour = clamp(pPed->m_fArmour + ScriptParams[1], 0.0f, 100.0f);
|
||||
pPed->m_fArmour = Clamp(pPed->m_fArmour + ScriptParams[1], 0.0f, 100.0f);
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_OPEN_GARAGE:
|
||||
|
Reference in New Issue
Block a user