mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-12-24 00:31:48 +01:00
merge
This commit is contained in:
commit
e10f5ee6a3
@ -13,12 +13,13 @@ enum {
|
|||||||
ASSOC_PARTIAL = 0x10,
|
ASSOC_PARTIAL = 0x10,
|
||||||
ASSOC_MOVEMENT = 0x20, // ???
|
ASSOC_MOVEMENT = 0x20, // ???
|
||||||
ASSOC_HAS_TRANSLATION = 0x40,
|
ASSOC_HAS_TRANSLATION = 0x40,
|
||||||
ASSOC_FLAG80 = 0x80, // walking and running have it
|
ASSOC_FLAG80 = 0x80, // used for footstep sound calculation
|
||||||
ASSOC_FLAG100 = 0x100,
|
ASSOC_FLAG100 = 0x100,
|
||||||
ASSOC_FLAG200 = 0x200,
|
ASSOC_FLAG200 = 0x200,
|
||||||
ASSOC_FLAG400 = 0x400, // not seen yet
|
ASSOC_FLAG400 = 0x400, // not seen yet
|
||||||
ASSOC_FLAG800 = 0x800,
|
ASSOC_FLAG800 = 0x800, // anims that we fall to front. 0x1000 in VC
|
||||||
ASSOC_HAS_X_TRANSLATION = 0x1000,
|
ASSOC_HAS_X_TRANSLATION = 0x1000,
|
||||||
|
// 0x2000 is vehicle anims in VC
|
||||||
};
|
};
|
||||||
|
|
||||||
// Anim hierarchy associated with a clump
|
// Anim hierarchy associated with a clump
|
||||||
|
@ -101,25 +101,25 @@ enum eSound : int16
|
|||||||
SOUND_EVIDENCE_PICKUP = 94,
|
SOUND_EVIDENCE_PICKUP = 94,
|
||||||
SOUND_UNLOAD_GOLD = 95,
|
SOUND_UNLOAD_GOLD = 95,
|
||||||
SOUND_PAGER = 96,
|
SOUND_PAGER = 96,
|
||||||
SOUND_PED_DEATH = 97,
|
SOUND_PED_DEATH = 97, // 103 in VC
|
||||||
SOUND_PED_DAMAGE = 98,
|
SOUND_PED_DAMAGE = 98, // 104 in VC
|
||||||
SOUND_PED_HIT = 99,
|
SOUND_PED_HIT = 99, // 105 in VC
|
||||||
SOUND_PED_LAND = 100,
|
SOUND_PED_LAND = 100, // hopefully 106 in VC
|
||||||
SOUND_PED_BULLET_HIT = 101,
|
SOUND_PED_BULLET_HIT = 101,
|
||||||
SOUND_PED_BOMBER = 102,
|
SOUND_PED_BOMBER = 102,
|
||||||
SOUND_PED_BURNING = 103,
|
SOUND_PED_BURNING = 103, // 108 in VC
|
||||||
SOUND_PED_ARREST_FBI = 104,
|
SOUND_PED_ARREST_FBI = 104,
|
||||||
SOUND_PED_ARREST_SWAT = 105,
|
SOUND_PED_ARREST_SWAT = 105,
|
||||||
SOUND_PED_ARREST_COP = 106,
|
SOUND_PED_ARREST_COP = 106,
|
||||||
SOUND_PED_HELI_PLAYER_FOUND = 107,
|
SOUND_PED_HELI_PLAYER_FOUND = 107,
|
||||||
SOUND_PED_HANDS_UP = 108,
|
SOUND_PED_HANDS_UP = 108,
|
||||||
SOUND_PED_HANDS_COWER = 109,
|
SOUND_PED_HANDS_COWER = 109,
|
||||||
SOUND_PED_FLEE_SPRINT = 110,
|
SOUND_PED_FLEE_SPRINT = 110, // 120 in VC
|
||||||
SOUND_PED_CAR_JACKING = 111,
|
SOUND_PED_CAR_JACKING = 111,
|
||||||
SOUND_PED_MUGGING = 112,
|
SOUND_PED_MUGGING = 112,
|
||||||
SOUND_PED_CAR_JACKED = 113,
|
SOUND_PED_CAR_JACKED = 113,
|
||||||
SOUND_PED_ROBBED = 114,
|
SOUND_PED_ROBBED = 114,
|
||||||
SOUND_PED_TAXI_WAIT = 115,
|
SOUND_PED_TAXI_WAIT = 115, // 137 in VC
|
||||||
SOUND_PED_ATTACK = 116,
|
SOUND_PED_ATTACK = 116,
|
||||||
SOUND_PED_DEFEND = 117,
|
SOUND_PED_DEFEND = 117,
|
||||||
SOUND_PED_PURSUIT_ARMY = 118,
|
SOUND_PED_PURSUIT_ARMY = 118,
|
||||||
@ -129,9 +129,9 @@ enum eSound : int16
|
|||||||
SOUND_PED_HEALING = 122,
|
SOUND_PED_HEALING = 122,
|
||||||
SOUND_PED_7B = 123,
|
SOUND_PED_7B = 123,
|
||||||
SOUND_PED_LEAVE_VEHICLE = 124,
|
SOUND_PED_LEAVE_VEHICLE = 124,
|
||||||
SOUND_PED_EVADE = 125,
|
SOUND_PED_EVADE = 125, // 142 in VC
|
||||||
SOUND_PED_FLEE_RUN = 126,
|
SOUND_PED_FLEE_RUN = 126,
|
||||||
SOUND_PED_CAR_COLLISION = 127,
|
SOUND_PED_CAR_COLLISION = 127, // 144-145-146 in VC
|
||||||
SOUND_PED_SOLICIT = 128,
|
SOUND_PED_SOLICIT = 128,
|
||||||
SOUND_PED_EXTINGUISHING_FIRE = 129,
|
SOUND_PED_EXTINGUISHING_FIRE = 129,
|
||||||
SOUND_PED_WAIT_DOUBLEBACK = 130,
|
SOUND_PED_WAIT_DOUBLEBACK = 130,
|
||||||
|
@ -696,7 +696,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
|
|||||||
}
|
}
|
||||||
if (pVehicle->bExtendedRange)
|
if (pVehicle->bExtendedRange)
|
||||||
threshold *= 1.5f;
|
threshold *= 1.5f;
|
||||||
if (distanceToPlayer > threshold && !CGarages::IsPointWithinHideOutGarage(&pVehicle->GetPosition())){
|
if (distanceToPlayer > threshold && !CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){
|
||||||
if (pVehicle->GetIsOnScreen() && CRenderer::IsEntityCullZoneVisible(pVehicle)){
|
if (pVehicle->GetIsOnScreen() && CRenderer::IsEntityCullZoneVisible(pVehicle)){
|
||||||
pVehicle->bFadeOut = true;
|
pVehicle->bFadeOut = true;
|
||||||
}else{
|
}else{
|
||||||
@ -712,9 +712,10 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
|
|||||||
(pVehicle->GetPosition() - vecPlayerPos).Magnitude2D() > 25.0f &&
|
(pVehicle->GetPosition() - vecPlayerPos).Magnitude2D() > 25.0f &&
|
||||||
!IsThisVehicleInteresting(pVehicle) &&
|
!IsThisVehicleInteresting(pVehicle) &&
|
||||||
!pVehicle->bIsLocked &&
|
!pVehicle->bIsLocked &&
|
||||||
|
pVehicle->CanBeDeleted() &&
|
||||||
!CTrafficLights::ShouldCarStopForLight(pVehicle, true) &&
|
!CTrafficLights::ShouldCarStopForLight(pVehicle, true) &&
|
||||||
!CTrafficLights::ShouldCarStopForBridge(pVehicle) &&
|
!CTrafficLights::ShouldCarStopForBridge(pVehicle) &&
|
||||||
!CGarages::IsPointWithinHideOutGarage(&pVehicle->GetPosition())){
|
!CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){
|
||||||
CWorld::Remove(pVehicle);
|
CWorld::Remove(pVehicle);
|
||||||
delete pVehicle;
|
delete pVehicle;
|
||||||
return;
|
return;
|
||||||
@ -724,7 +725,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
|
|||||||
if (CTimer::GetTimeInMilliseconds() > pVehicle->m_nTimeOfDeath + 60000 &&
|
if (CTimer::GetTimeInMilliseconds() > pVehicle->m_nTimeOfDeath + 60000 &&
|
||||||
(!pVehicle->GetIsOnScreen() || !CRenderer::IsEntityCullZoneVisible(pVehicle))){
|
(!pVehicle->GetIsOnScreen() || !CRenderer::IsEntityCullZoneVisible(pVehicle))){
|
||||||
if ((pVehicle->GetPosition() - vecPlayerPos).MagnitudeSqr() > SQR(7.5f)){
|
if ((pVehicle->GetPosition() - vecPlayerPos).MagnitudeSqr() > SQR(7.5f)){
|
||||||
if (!CGarages::IsPointWithinHideOutGarage(&pVehicle->GetPosition())){
|
if (!CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){
|
||||||
CWorld::Remove(pVehicle);
|
CWorld::Remove(pVehicle);
|
||||||
delete pVehicle;
|
delete pVehicle;
|
||||||
}
|
}
|
||||||
@ -1322,7 +1323,7 @@ void CCarCtrl::WeaveThroughPedsSectorList(CPtrList& lst, CVehicle* pVehicle, CPh
|
|||||||
continue;
|
continue;
|
||||||
if (pPed->GetPosition().y < y_inf || pPed->GetPosition().y > y_sup)
|
if (pPed->GetPosition().y < y_inf || pPed->GetPosition().y > y_sup)
|
||||||
continue;
|
continue;
|
||||||
if (Abs(pPed->GetPosition().z - pPed->GetPosition().z) >= PED_HEIGHT_DIFF_TO_CONSIDER_WEAVING)
|
if (Abs(pPed->GetPosition().z - pVehicle->GetPosition().z) >= PED_HEIGHT_DIFF_TO_CONSIDER_WEAVING)
|
||||||
continue;
|
continue;
|
||||||
if (pPed->m_pCurSurface != pVehicle)
|
if (pPed->m_pCurSurface != pVehicle)
|
||||||
WeaveForPed(pPed, pVehicle, pAngleToWeaveLeft, pAngleToWeaveRight);
|
WeaveForPed(pPed, pVehicle, pAngleToWeaveLeft, pAngleToWeaveRight);
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
#include "patcher.h"
|
#include "patcher.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "Darkel.h"
|
#include "Darkel.h"
|
||||||
|
#include "PlayerPed.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "DMAudio.h"
|
#include "DMAudio.h"
|
||||||
#include "Population.h"
|
#include "Population.h"
|
||||||
#include "Weapon.h"
|
#include "Weapon.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "PlayerPed.h"
|
|
||||||
#include "Stats.h"
|
#include "Stats.h"
|
||||||
#include "Font.h"
|
#include "Font.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
@ -19,105 +19,140 @@ int32 &CDarkel::WeaponType = *(int32*)0x9430F0;
|
|||||||
int32 &CDarkel::AmmoInterruptedWeapon = *(int32*)0x8E29C8;
|
int32 &CDarkel::AmmoInterruptedWeapon = *(int32*)0x8E29C8;
|
||||||
int32 &CDarkel::KillsNeeded = *(int32*)0x8F1AB8;
|
int32 &CDarkel::KillsNeeded = *(int32*)0x8F1AB8;
|
||||||
int8 &CDarkel::InterruptedWeapon = *(int8*)0x95CD60;
|
int8 &CDarkel::InterruptedWeapon = *(int8*)0x95CD60;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* bStandardSoundAndMessages is a completely beta thing,
|
||||||
|
* makes game handle sounds & messages instead of SCM (just like in GTA2)
|
||||||
|
* but it's never been used in the game. Has unused sliding text when frenzy completed etc.
|
||||||
|
*/
|
||||||
int8 &CDarkel::bStandardSoundAndMessages = *(int8*)0x95CDB6;
|
int8 &CDarkel::bStandardSoundAndMessages = *(int8*)0x95CDB6;
|
||||||
int8 &CDarkel::bNeedHeadShot = *(int8*)0x95CDCA;
|
int8 &CDarkel::bNeedHeadShot = *(int8*)0x95CDCA;
|
||||||
int8 &CDarkel::bProperKillFrenzy = *(int8*)0x95CD98;
|
int8 &CDarkel::bProperKillFrenzy = *(int8*)0x95CD98;
|
||||||
eKillFrenzyStatus &CDarkel::Status = *(eKillFrenzyStatus*)0x95CCB4;
|
eKillFrenzyStatus &CDarkel::Status = *(eKillFrenzyStatus*)0x95CCB4;
|
||||||
int16 *CDarkel::RegisteredKills = (int16*)0x6EDBE0;
|
uint16 (&CDarkel::RegisteredKills)[NUMDEFAULTMODELS] = *(uint16(*)[NUMDEFAULTMODELS]) * (uintptr*)0x6EDBE0;
|
||||||
int32 &CDarkel::ModelToKill = *(int32*)0x8F2C78;
|
int32 &CDarkel::ModelToKill = *(int32*)0x8F2C78;
|
||||||
int32 &CDarkel::ModelToKill2 = *(int32*)0x885B40;
|
int32 &CDarkel::ModelToKill2 = *(int32*)0x885B40;
|
||||||
int32 &CDarkel::ModelToKill3 = *(int32*)0x885B3C;
|
int32 &CDarkel::ModelToKill3 = *(int32*)0x885B3C;
|
||||||
int32 &CDarkel::ModelToKill4 = *(int32*)0x885B34;
|
int32 &CDarkel::ModelToKill4 = *(int32*)0x885B34;
|
||||||
wchar *CDarkel::pStartMessage = (wchar*)0x8F2C08;
|
wchar *CDarkel::pStartMessage = (wchar*)0x8F2C08;
|
||||||
|
|
||||||
int32 CDarkel::CalcFade(uint32 time, int32 start, uint32 end) {
|
uint8
|
||||||
|
CDarkel::CalcFade(uint32 time, uint32 start, uint32 end)
|
||||||
|
{
|
||||||
if (time >= start && time <= end) {
|
if (time >= start && time <= end) {
|
||||||
if (time >= start + 500) {
|
if (time >= start + 500) {
|
||||||
if (time <= end - 500)
|
if (time <= end - 500)
|
||||||
return 255;
|
return 255;
|
||||||
else
|
else
|
||||||
return 255 * (end - time) / 500;
|
return 255 * (end - time) / 500;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
return 255 * (time - start) / 500;
|
return 255 * (time - start) / 500;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function has been cleaned up from unused stuff.
|
// Screen positions taken from VC
|
||||||
#if 0
|
void
|
||||||
WRAPPER void CDarkel::DrawMessages(void) { EAXJMP(0x420920); }
|
CDarkel::DrawMessages()
|
||||||
#else
|
|
||||||
void CDarkel::DrawMessages()
|
|
||||||
{
|
{
|
||||||
bool DisplayTimers = false;
|
|
||||||
|
|
||||||
switch (Status) {
|
switch (Status) {
|
||||||
case KILLFRENZY_ONGOING:
|
case KILLFRENZY_ONGOING:
|
||||||
assert(pStartMessage != nil);
|
{
|
||||||
DisplayTimers = true;
|
CFont::SetJustifyOff();
|
||||||
break;
|
|
||||||
case KILLFRENZY_PASSED:
|
|
||||||
case KILLFRENZY_FAILED:
|
|
||||||
DisplayTimers = false;
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (DisplayTimers) {
|
|
||||||
CFont::SetPropOn();
|
|
||||||
CFont::SetBackgroundOff();
|
CFont::SetBackgroundOff();
|
||||||
CFont::SetBackGroundOnlyTextOn();
|
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(30.0f));
|
||||||
CFont::SetAlignment(ALIGN_RIGHT);
|
CFont::SetCentreOn();
|
||||||
CFont::SetRightJustifyWrap(-SCREEN_WIDTH);
|
CFont::SetPropOn();
|
||||||
|
uint32 timePassedSinceStart = CTimer::GetTimeInMilliseconds() - CDarkel::TimeOfFrenzyStart;
|
||||||
|
if (CDarkel::bStandardSoundAndMessages) {
|
||||||
|
if (timePassedSinceStart >= 3000 && timePassedSinceStart < 11000) {
|
||||||
|
CFont::SetScale(SCREEN_SCALE_X(1.3f), SCREEN_SCALE_Y(1.3f));
|
||||||
|
CFont::SetJustifyOff();
|
||||||
|
CFont::SetColor(CRGBA(255, 255, 128, CalcFade(timePassedSinceStart, 3000, 11000)));
|
||||||
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
|
if (pStartMessage) {
|
||||||
|
CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, pStartMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (timePassedSinceStart < 8000) {
|
||||||
|
CFont::SetScale(SCREEN_SCALE_X(1.3f), SCREEN_SCALE_Y(1.3f));
|
||||||
|
CFont::SetJustifyOff();
|
||||||
|
CFont::SetColor(CRGBA(255, 255, 128, CalcFade(timePassedSinceStart, 0, 8000)));
|
||||||
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
|
if (pStartMessage) {
|
||||||
|
CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, pStartMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CFont::SetScale(SCREEN_SCALE_X(0.75f), SCREEN_SCALE_Y(1.5f));
|
||||||
|
CFont::SetCentreOff();
|
||||||
|
CFont::SetRightJustifyOn();
|
||||||
CFont::SetFontStyle(FONT_HEADING);
|
CFont::SetFontStyle(FONT_HEADING);
|
||||||
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
if (CDarkel::TimeLimit >= 0) {
|
||||||
|
uint32 timeLeft = CDarkel::TimeLimit - (CTimer::GetTimeInMilliseconds() - CDarkel::TimeOfFrenzyStart);
|
||||||
float AlignToHUD = SCREEN_SCALE_X(-10.0f);
|
sprintf(gString, "%d:%02d", timeLeft / 60000, timeLeft % 60000 / 1000);
|
||||||
int32 a = (TimeLimit - (CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart));
|
|
||||||
if (CTimer::GetFrameCounter() & 8 || a > 4000) {
|
|
||||||
sprintf(gString, "%d:%02d", a / 60000, a % 60000 / 1000);
|
|
||||||
AsciiToUnicode(gString, gUString);
|
AsciiToUnicode(gString, gUString);
|
||||||
|
if (timeLeft > 4000 || CTimer::GetFrameCounter() & 1) {
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(25.0f) + AlignToHUD, SCREEN_SCALE_Y(112.0f), gUString);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(35.0f), SCREEN_SCALE_Y(109.0f), gUString);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(150, 100, 255, 255));
|
CFont::SetColor(CRGBA(150, 100, 255, 255));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(27.0f) + AlignToHUD, SCREEN_SCALE_Y(110.0f), gUString);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(34.0f), SCREEN_SCALE_Y(108.0f), gUString);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (KillsNeeded <= 0)
|
sprintf(gString, "%d", (CDarkel::KillsNeeded >= 0 ? CDarkel::KillsNeeded : 0));
|
||||||
KillsNeeded = 0;
|
|
||||||
|
|
||||||
sprintf((char *)gString, "%d", KillsNeeded);
|
|
||||||
AsciiToUnicode(gString, gUString);
|
AsciiToUnicode(gString, gUString);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(25.0f) + AlignToHUD, SCREEN_SCALE_Y(134.0f), gUString);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(35.0f), SCREEN_SCALE_Y(144.0f), gUString);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(255, 128, 128, 255));
|
CFont::SetColor(CRGBA(255, 128, 128, 255));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(27.0f) + AlignToHUD, SCREEN_SCALE_Y(132.0f), gUString);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(34.0f), SCREEN_SCALE_Y(143.0f), gUString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case KILLFRENZY_PASSED:
|
||||||
|
{
|
||||||
|
if (CDarkel::bStandardSoundAndMessages) {
|
||||||
|
uint32 timePassedSinceStart = CTimer::GetTimeInMilliseconds() - CDarkel::TimeOfFrenzyStart;
|
||||||
|
if (CTimer::GetTimeInMilliseconds() - CDarkel::TimeOfFrenzyStart < 5000) {
|
||||||
|
CFont::SetBackgroundOff();
|
||||||
|
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(20.0f));
|
||||||
|
CFont::SetCentreOn();
|
||||||
|
CFont::SetScale(SCREEN_SCALE_X(1.5f), SCREEN_SCALE_Y(1.5f));
|
||||||
|
CFont::SetJustifyOff();
|
||||||
|
CFont::SetColor(CRGBA(128, 255, 128, CalcFade(timePassedSinceStart, 0, 5000)));
|
||||||
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
|
int y = SCREEN_HEIGHT / 2 + SCREEN_SCALE_Y(25.0f - timePassedSinceStart * 0.01f);
|
||||||
|
CFont::PrintString(SCREEN_WIDTH / 2, y, TheText.Get("KF_3"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void CDarkel::Init()
|
void
|
||||||
|
CDarkel::Init()
|
||||||
{
|
{
|
||||||
Status = KILLFRENZY_NONE;
|
Status = KILLFRENZY_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 CDarkel::QueryModelsKilledByPlayer(int32 modelId)
|
uint16
|
||||||
|
CDarkel::QueryModelsKilledByPlayer(int32 modelId)
|
||||||
{
|
{
|
||||||
return RegisteredKills[modelId];
|
return RegisteredKills[modelId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CDarkel::FrenzyOnGoing()
|
bool
|
||||||
|
CDarkel::FrenzyOnGoing()
|
||||||
{
|
{
|
||||||
return Status == KILLFRENZY_ONGOING;
|
return Status == KILLFRENZY_ONGOING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
eKillFrenzyStatus CDarkel::ReadStatus()
|
uint16
|
||||||
|
CDarkel::ReadStatus()
|
||||||
{
|
{
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -141,21 +176,24 @@ void CDarkel::RegisterKillByPlayer(CPed *victim, eWeaponType weapontype, bool he
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void CDarkel::RegisterKillNotByPlayer(CPed* victim, eWeaponType weapontype)
|
void
|
||||||
|
CDarkel::RegisterKillNotByPlayer(CPed* victim, eWeaponType weapontype)
|
||||||
{
|
{
|
||||||
++CStats::NumberKillFrenziesPassed;
|
++CStats::PeopleKilledByOthers;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDarkel::ResetModelsKilledByPlayer()
|
void
|
||||||
|
CDarkel::ResetModelsKilledByPlayer()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 200; i++)
|
for (int i = 0; i < NUMDEFAULTMODELS; i++)
|
||||||
RegisteredKills[i] = 0;
|
RegisteredKills[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
WRAPPER void CDarkel::ResetOnPlayerDeath() { EAXJMP(0x420E70); }
|
WRAPPER void CDarkel::ResetOnPlayerDeath() { EAXJMP(0x420E70); }
|
||||||
#else
|
#else
|
||||||
void CDarkel::ResetOnPlayerDeath()
|
void
|
||||||
|
CDarkel::ResetOnPlayerDeath()
|
||||||
{
|
{
|
||||||
if (Status != KILLFRENZY_ONGOING)
|
if (Status != KILLFRENZY_ONGOING)
|
||||||
return;
|
return;
|
||||||
@ -164,48 +202,37 @@ void CDarkel::ResetOnPlayerDeath()
|
|||||||
Status = KILLFRENZY_FAILED;
|
Status = KILLFRENZY_FAILED;
|
||||||
TimeOfFrenzyStart = CTimer::GetTimeInMilliseconds();
|
TimeOfFrenzyStart = CTimer::GetTimeInMilliseconds();
|
||||||
|
|
||||||
|
eWeaponType fixedWeapon;
|
||||||
if (WeaponType == WEAPONTYPE_UZI_DRIVEBY)
|
if (WeaponType == WEAPONTYPE_UZI_DRIVEBY)
|
||||||
WeaponType = WEAPONTYPE_UZI;
|
fixedWeapon = WEAPONTYPE_UZI;
|
||||||
|
else
|
||||||
|
fixedWeapon = (eWeaponType)WeaponType;
|
||||||
|
|
||||||
if (WeaponType < WEAPONTYPE_TOTALWEAPONS) {
|
CPlayerPed *player = FindPlayerPed();
|
||||||
FindPlayerPed()->m_nSelectedWepSlot = InterruptedWeapon;
|
if (fixedWeapon < WEAPONTYPE_TOTALWEAPONS) {
|
||||||
CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoTotal = AmmoInterruptedWeapon;
|
player->m_nSelectedWepSlot = InterruptedWeapon;
|
||||||
|
player->GetWeapon(player->GetWeaponSlot(fixedWeapon)).m_nAmmoTotal = CDarkel::AmmoInterruptedWeapon;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FindPlayerVehicle()) {
|
if (FindPlayerVehicle()) {
|
||||||
FindPlayerPed()->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(FindPlayerPed()->GetWeapon()->m_eWeaponType)->m_nModelId);
|
player->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(player->GetWeapon()->m_eWeaponType)->m_nModelId);
|
||||||
FindPlayerPed()->m_currentWeapon = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_eWeaponType;
|
player->m_currentWeapon = player->m_nSelectedWepSlot;
|
||||||
FindPlayerPed()->MakeChangesForNewWeapon(FindPlayerPed()->m_currentWeapon);
|
player->MakeChangesForNewWeapon(player->m_currentWeapon);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
CPopulation::m_AllRandomPedsThisType = -1;
|
|
||||||
Status = KILLFRENZY_FAILED;
|
|
||||||
TimeOfFrenzyStart = CTimer::GetTimeInMilliseconds();
|
|
||||||
|
|
||||||
if (WeaponType == WEAPONTYPE_UZI_DRIVEBY)
|
|
||||||
WeaponType = WEAPONTYPE_UZI;
|
|
||||||
|
|
||||||
if (WeaponType < WEAPONTYPE_TOTALWEAPONS) {
|
|
||||||
FindPlayerPed()->m_nSelectedWepSlot = InterruptedWeapon;
|
|
||||||
CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoTotal = AmmoInterruptedWeapon;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FindPlayerVehicle()) {
|
|
||||||
FindPlayerPed()->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(FindPlayerPed()->GetWeapon()->m_eWeaponType)->m_nModelId);
|
|
||||||
FindPlayerPed()->m_currentWeapon = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_eWeaponType;
|
|
||||||
FindPlayerPed()->MakeChangesForNewWeapon(FindPlayerPed()->m_currentWeapon);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
WRAPPER void CDarkel::StartFrenzy(eWeaponType weaponType, int32 time, int16 kill, int32 modelId0, wchar *text, int32 modelId2, int32 modelId3, int32 modelId4, bool standardSound, bool needHeadShot) { EAXJMP(0x4210E0); }
|
WRAPPER void CDarkel::StartFrenzy(eWeaponType weaponType, int32 time, uint16 kill, int32 modelId0, wchar *text, int32 modelId2, int32 modelId3, int32 modelId4, bool standardSound, bool needHeadShot) { EAXJMP(0x4210E0); }
|
||||||
#else
|
#else
|
||||||
void CDarkel::StartFrenzy(eWeaponType weaponType, int32 time, int16 kill, int32 modelId0, wchar *text, int32 modelId2, int32 modelId3, int32 modelId4, bool standardSound, bool needHeadShot)
|
void
|
||||||
|
CDarkel::StartFrenzy(eWeaponType weaponType, int32 time, uint16 kill, int32 modelId0, wchar *text, int32 modelId2, int32 modelId3, int32 modelId4, bool standardSound, bool needHeadShot)
|
||||||
{
|
{
|
||||||
|
eWeaponType fixedWeapon;
|
||||||
if (weaponType == WEAPONTYPE_UZI_DRIVEBY)
|
if (weaponType == WEAPONTYPE_UZI_DRIVEBY)
|
||||||
weaponType = WEAPONTYPE_UZI;
|
fixedWeapon = WEAPONTYPE_UZI;
|
||||||
|
else
|
||||||
|
fixedWeapon = weaponType;
|
||||||
|
|
||||||
WeaponType = weaponType;
|
WeaponType = weaponType;
|
||||||
Status = KILLFRENZY_ONGOING;
|
Status = KILLFRENZY_ONGOING;
|
||||||
@ -219,8 +246,7 @@ void CDarkel::StartFrenzy(eWeaponType weaponType, int32 time, int16 kill, int32
|
|||||||
if (text == TheText.Get("PAGE_00")) {
|
if (text == TheText.Get("PAGE_00")) {
|
||||||
CDarkel::bProperKillFrenzy = 1;
|
CDarkel::bProperKillFrenzy = 1;
|
||||||
CDarkel::pStartMessage = 0;
|
CDarkel::pStartMessage = 0;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
bProperKillFrenzy = 0;
|
bProperKillFrenzy = 0;
|
||||||
|
|
||||||
bStandardSoundAndMessages = standardSound;
|
bStandardSoundAndMessages = standardSound;
|
||||||
@ -229,20 +255,19 @@ void CDarkel::StartFrenzy(eWeaponType weaponType, int32 time, int16 kill, int32
|
|||||||
TimeLimit = time;
|
TimeLimit = time;
|
||||||
PreviousTime = time / 1000;
|
PreviousTime = time / 1000;
|
||||||
|
|
||||||
if (weaponType < WEAPONTYPE_TOTALWEAPONS) {
|
CPlayerPed *player = FindPlayerPed();
|
||||||
InterruptedWeapon = FindPlayerPed()->m_currentWeapon;
|
if (fixedWeapon < WEAPONTYPE_TOTALWEAPONS) {
|
||||||
FindPlayerPed()->GiveWeapon(weaponType, 0);
|
InterruptedWeapon = player->m_currentWeapon;
|
||||||
AmmoInterruptedWeapon = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoTotal;
|
player->GiveWeapon(fixedWeapon, 0);
|
||||||
FindPlayerPed()->GiveWeapon(weaponType, 30000);
|
AmmoInterruptedWeapon = player->GetWeapon(player->GetWeaponSlot(fixedWeapon)).m_nAmmoTotal;
|
||||||
FindPlayerPed()->m_nSelectedWepSlot = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_eWeaponType;
|
player->GiveWeapon(fixedWeapon, 30000);
|
||||||
FindPlayerPed()->MakeChangesForNewWeapon(FindPlayerPed()->m_nSelectedWepSlot);
|
player->m_nSelectedWepSlot = player->GetWeaponSlot(fixedWeapon);
|
||||||
|
player->MakeChangesForNewWeapon(player->m_nSelectedWepSlot);
|
||||||
|
|
||||||
if (FindPlayerVehicle()) {
|
if (FindPlayerVehicle()) {
|
||||||
FindPlayerPed()->m_currentWeapon = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_eWeaponType;
|
player->m_currentWeapon = player->m_nSelectedWepSlot;
|
||||||
if (CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoTotal <= CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoInClip)
|
player->GetWeapon()->m_nAmmoInClip = min(player->GetWeapon()->m_nAmmoTotal, CWeaponInfo::GetWeaponInfo(player->GetWeapon()->m_eWeaponType)->m_nAmountofAmmunition);
|
||||||
CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoInClip = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoTotal;
|
player->ClearWeaponTarget();
|
||||||
|
|
||||||
FindPlayerPed()->ClearWeaponTarget();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CDarkel::bStandardSoundAndMessages)
|
if (CDarkel::bStandardSoundAndMessages)
|
||||||
@ -250,13 +275,15 @@ void CDarkel::StartFrenzy(eWeaponType weaponType, int32 time, int16 kill, int32
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void CDarkel::Update()
|
void
|
||||||
|
CDarkel::Update()
|
||||||
{
|
{
|
||||||
if (Status != KILLFRENZY_ONGOING)
|
if (Status != KILLFRENZY_ONGOING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int32 FrameTime = TimeLimit - (CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart);
|
int32 FrameTime = TimeLimit - (CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart);
|
||||||
if ((TimeLimit - (CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart)) > 0 || TimeLimit < 0) {
|
if ((TimeLimit - (CTimer::GetTimeInMilliseconds() - TimeOfFrenzyStart)) > 0 || TimeLimit < 0) {
|
||||||
|
|
||||||
DMAudio.PlayFrontEndSound(SOUND_RAMPAGE_ONGOING, FrameTime);
|
DMAudio.PlayFrontEndSound(SOUND_RAMPAGE_ONGOING, FrameTime);
|
||||||
|
|
||||||
int32 PrevTime = FrameTime / 1000;
|
int32 PrevTime = FrameTime / 1000;
|
||||||
@ -267,24 +294,27 @@ void CDarkel::Update()
|
|||||||
PreviousTime = PrevTime;
|
PreviousTime = PrevTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
CPopulation::m_AllRandomPedsThisType = -1;
|
CPopulation::m_AllRandomPedsThisType = -1;
|
||||||
Status = KILLFRENZY_FAILED;
|
Status = KILLFRENZY_FAILED;
|
||||||
TimeOfFrenzyStart = CTimer::GetTimeInMilliseconds();
|
TimeOfFrenzyStart = CTimer::GetTimeInMilliseconds();
|
||||||
|
|
||||||
|
eWeaponType fixedWeapon;
|
||||||
if (WeaponType == WEAPONTYPE_UZI_DRIVEBY)
|
if (WeaponType == WEAPONTYPE_UZI_DRIVEBY)
|
||||||
WeaponType = WEAPONTYPE_UZI;
|
fixedWeapon = WEAPONTYPE_UZI;
|
||||||
|
else
|
||||||
|
fixedWeapon = (eWeaponType)WeaponType;
|
||||||
|
|
||||||
if (WeaponType < WEAPONTYPE_TOTALWEAPONS) {
|
CPlayerPed *player = FindPlayerPed();
|
||||||
FindPlayerPed()->m_nSelectedWepSlot = InterruptedWeapon;
|
if (fixedWeapon < WEAPONTYPE_TOTALWEAPONS) {
|
||||||
CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoTotal = AmmoInterruptedWeapon;
|
player->m_nSelectedWepSlot = InterruptedWeapon;
|
||||||
|
player->GetWeapon(player->GetWeaponSlot(fixedWeapon)).m_nAmmoTotal = CDarkel::AmmoInterruptedWeapon;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FindPlayerVehicle()) {
|
if (FindPlayerVehicle()) {
|
||||||
FindPlayerPed()->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(FindPlayerPed()->GetWeapon()->m_eWeaponType)->m_nModelId);
|
player->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(player->GetWeapon()->m_eWeaponType)->m_nModelId);
|
||||||
FindPlayerPed()->m_currentWeapon = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_eWeaponType;
|
player->m_currentWeapon = player->m_nSelectedWepSlot;
|
||||||
FindPlayerPed()->MakeChangesForNewWeapon(FindPlayerPed()->m_currentWeapon);
|
player->MakeChangesForNewWeapon(player->m_currentWeapon);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bStandardSoundAndMessages)
|
if (bStandardSoundAndMessages)
|
||||||
@ -302,18 +332,22 @@ void CDarkel::Update()
|
|||||||
|
|
||||||
FindPlayerPed()->m_pWanted->SetWantedLevel(0);
|
FindPlayerPed()->m_pWanted->SetWantedLevel(0);
|
||||||
|
|
||||||
|
eWeaponType fixedWeapon;
|
||||||
if (WeaponType == WEAPONTYPE_UZI_DRIVEBY)
|
if (WeaponType == WEAPONTYPE_UZI_DRIVEBY)
|
||||||
WeaponType = WEAPONTYPE_UZI;
|
fixedWeapon = WEAPONTYPE_UZI;
|
||||||
|
else
|
||||||
|
fixedWeapon = (eWeaponType)WeaponType;
|
||||||
|
|
||||||
if (WeaponType < WEAPONTYPE_TOTALWEAPONS) {
|
CPlayerPed* player = FindPlayerPed();
|
||||||
FindPlayerPed()->m_nSelectedWepSlot = InterruptedWeapon;
|
if (fixedWeapon < WEAPONTYPE_TOTALWEAPONS) {
|
||||||
CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoTotal = AmmoInterruptedWeapon;
|
player->m_nSelectedWepSlot = InterruptedWeapon;
|
||||||
|
player->GetWeapon(player->GetWeaponSlot(fixedWeapon)).m_nAmmoTotal = CDarkel::AmmoInterruptedWeapon;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FindPlayerVehicle()) {
|
if (FindPlayerVehicle()) {
|
||||||
FindPlayerPed()->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(FindPlayerPed()->GetWeapon()->m_eWeaponType)->m_nModelId);
|
player->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(player->GetWeapon()->m_eWeaponType)->m_nModelId);
|
||||||
FindPlayerPed()->m_currentWeapon = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_eWeaponType;
|
player->m_currentWeapon = player->m_nSelectedWepSlot;
|
||||||
FindPlayerPed()->MakeChangesForNewWeapon(FindPlayerPed()->m_currentWeapon);
|
player->MakeChangesForNewWeapon(player->m_currentWeapon);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bStandardSoundAndMessages)
|
if (bStandardSoundAndMessages)
|
||||||
@ -322,17 +356,17 @@ void CDarkel::Update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
STARTPATCHES
|
STARTPATCHES
|
||||||
/*InjectHook(0x421380, CDarkel::CalcFade, PATCH_JUMP);
|
InjectHook(0x421380, CDarkel::CalcFade, PATCH_JUMP);
|
||||||
InjectHook(0x420920, CDarkel::DrawMessages, PATCH_JUMP);
|
|
||||||
InjectHook(0x420E60, CDarkel::FrenzyOnGoing, PATCH_JUMP);
|
|
||||||
InjectHook(0x420650, CDarkel::Init, PATCH_JUMP);
|
InjectHook(0x420650, CDarkel::Init, PATCH_JUMP);
|
||||||
InjectHook(0x421370, CDarkel::QueryModelsKilledByPlayer, PATCH_JUMP);
|
InjectHook(0x420660, CDarkel::Update, PATCH_JUMP);
|
||||||
|
InjectHook(0x420E60, CDarkel::FrenzyOnGoing, PATCH_JUMP);
|
||||||
InjectHook(0x420E50, CDarkel::ReadStatus, PATCH_JUMP);
|
InjectHook(0x420E50, CDarkel::ReadStatus, PATCH_JUMP);
|
||||||
InjectHook(0x421070, CDarkel::RegisterCarBlownUpByPlayer, PATCH_JUMP);
|
|
||||||
InjectHook(0x420F60, CDarkel::RegisterKillByPlayer, PATCH_JUMP);
|
|
||||||
InjectHook(0x421060, CDarkel::RegisterKillNotByPlayer, PATCH_JUMP);
|
|
||||||
InjectHook(0x421310, CDarkel::ResetModelsKilledByPlayer, PATCH_JUMP);
|
|
||||||
InjectHook(0x420E70, CDarkel::ResetOnPlayerDeath, PATCH_JUMP);
|
InjectHook(0x420E70, CDarkel::ResetOnPlayerDeath, PATCH_JUMP);
|
||||||
InjectHook(0x4210E0, CDarkel::StartFrenzy, PATCH_JUMP);
|
InjectHook(0x4210E0, CDarkel::StartFrenzy, PATCH_JUMP);
|
||||||
InjectHook(0x420660, CDarkel::Update, PATCH_JUMP);*/
|
InjectHook(0x421370, CDarkel::QueryModelsKilledByPlayer, PATCH_JUMP);
|
||||||
|
InjectHook(0x421060, CDarkel::RegisterKillNotByPlayer, PATCH_JUMP);
|
||||||
|
InjectHook(0x421310, CDarkel::ResetModelsKilledByPlayer, PATCH_JUMP);
|
||||||
|
InjectHook(0x420920, CDarkel::DrawMessages, PATCH_JUMP);
|
||||||
|
//InjectHook(0x421070, CDarkel::RegisterCarBlownUpByPlayer, PATCH_JUMP);
|
||||||
|
//InjectHook(0x420F60, CDarkel::RegisterKillByPlayer, PATCH_JUMP);
|
||||||
ENDPATCHES
|
ENDPATCHES
|
@ -26,7 +26,7 @@ private:
|
|||||||
static int8 &bNeedHeadShot;
|
static int8 &bNeedHeadShot;
|
||||||
static int8 &bProperKillFrenzy;
|
static int8 &bProperKillFrenzy;
|
||||||
static eKillFrenzyStatus &Status;
|
static eKillFrenzyStatus &Status;
|
||||||
static int16 *RegisteredKills;
|
static uint16 (&RegisteredKills)[NUMDEFAULTMODELS];
|
||||||
static int32 &ModelToKill;
|
static int32 &ModelToKill;
|
||||||
static int32 &ModelToKill2;
|
static int32 &ModelToKill2;
|
||||||
static int32 &ModelToKill3;
|
static int32 &ModelToKill3;
|
||||||
@ -34,18 +34,18 @@ private:
|
|||||||
static wchar *pStartMessage;
|
static wchar *pStartMessage;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static int32 CalcFade(uint32 time, int32 min, uint32 max);
|
static uint8 CalcFade(uint32 time, uint32 min, uint32 max);
|
||||||
static void DrawMessages(void);
|
static void DrawMessages(void);
|
||||||
static bool FrenzyOnGoing();
|
static bool FrenzyOnGoing();
|
||||||
static void Init();
|
static void Init();
|
||||||
static int16 QueryModelsKilledByPlayer(int32 modelId);
|
static uint16 QueryModelsKilledByPlayer(int32 modelId);
|
||||||
static eKillFrenzyStatus ReadStatus();
|
static uint16 ReadStatus();
|
||||||
static void RegisterCarBlownUpByPlayer(CVehicle *vehicle);
|
static void RegisterCarBlownUpByPlayer(CVehicle *vehicle);
|
||||||
static void RegisterKillByPlayer(CPed *victim, eWeaponType weapontype, bool headshot = false);
|
static void RegisterKillByPlayer(CPed *victim, eWeaponType weapontype, bool headshot = false);
|
||||||
static void RegisterKillNotByPlayer(CPed* victim, eWeaponType weapontype);
|
static void RegisterKillNotByPlayer(CPed* victim, eWeaponType weapontype);
|
||||||
static void ResetModelsKilledByPlayer();
|
static void ResetModelsKilledByPlayer();
|
||||||
static void ResetOnPlayerDeath();
|
static void ResetOnPlayerDeath();
|
||||||
static void StartFrenzy(eWeaponType weaponType, int32 time, int16 kill, int32 modelId0, wchar *text, int32 modelId2, int32 modelId3, int32 modelId4, bool standardSound, bool needHeadShot);
|
static void StartFrenzy(eWeaponType weaponType, int32 time, uint16 kill, int32 modelId0, wchar *text, int32 modelId2, int32 modelId3, int32 modelId4, bool standardSound, bool needHeadShot);
|
||||||
static void Update();
|
static void Update();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -69,7 +69,8 @@ bool CGarages::HasCarBeenCrushed(int32 handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
WRAPPER void CGarages::TriggerMessage(const char *text, int16, uint16 time, int16) { EAXJMP(0x426B20); }
|
WRAPPER void CGarages::TriggerMessage(const char *text, int16, uint16 time, int16) { EAXJMP(0x426B20); }
|
||||||
WRAPPER bool CGarages::IsPointWithinHideOutGarage(CVector*) { EAXJMP(0x428260); }
|
WRAPPER bool CGarages::IsPointWithinHideOutGarage(CVector&) { EAXJMP(0x428260); }
|
||||||
|
WRAPPER bool CGarages::IsPointWithinAnyGarage(CVector&) { EAXJMP(0x428320); }
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
WRAPPER void CGarages::PrintMessages(void) { EAXJMP(0x426310); }
|
WRAPPER void CGarages::PrintMessages(void) { EAXJMP(0x426310); }
|
||||||
|
@ -25,5 +25,6 @@ public:
|
|||||||
static void TriggerMessage(const char *text, int16, uint16 time, int16);
|
static void TriggerMessage(const char *text, int16, uint16 time, int16);
|
||||||
static void PrintMessages(void);
|
static void PrintMessages(void);
|
||||||
static bool HasCarBeenCrushed(int32);
|
static bool HasCarBeenCrushed(int32);
|
||||||
static bool IsPointWithinHideOutGarage(CVector*);
|
static bool IsPointWithinHideOutGarage(CVector&);
|
||||||
|
static bool IsPointWithinAnyGarage(CVector&);
|
||||||
};
|
};
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,56 +1,106 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Weapon.h"
|
#include "Weapon.h"
|
||||||
|
|
||||||
enum ePickupType
|
enum ePickupType : uint8
|
||||||
{
|
{
|
||||||
PICKUP_NONE = 0,
|
PICKUP_NONE = 0,
|
||||||
PICKUP_IN_SHOP = 1,
|
PICKUP_IN_SHOP,
|
||||||
PICKUP_ON_STREET = 2,
|
PICKUP_ON_STREET,
|
||||||
PICKUP_ONCE = 3,
|
PICKUP_ONCE,
|
||||||
PICKUP_ONCE_TIMEOUT = 4,
|
PICKUP_ONCE_TIMEOUT,
|
||||||
PICKUP_COLLECTABLE1 = 5,
|
PICKUP_COLLECTABLE1,
|
||||||
PICKUP_IN_SHOP_OUT_OF_STOCK = 6,
|
PICKUP_IN_SHOP_OUT_OF_STOCK,
|
||||||
PICKUP_MONEY = 7,
|
PICKUP_MONEY,
|
||||||
PICKUP_MINE_INACTIVE = 8,
|
PICKUP_MINE_INACTIVE,
|
||||||
PICKUP_MINE_ARMED = 9,
|
PICKUP_MINE_ARMED,
|
||||||
PICKUP_NAUTICAL_MINE_INACTIVE = 10,
|
PICKUP_NAUTICAL_MINE_INACTIVE,
|
||||||
PICKUP_NAUTICAL_MINE_ARMED = 11,
|
PICKUP_NAUTICAL_MINE_ARMED,
|
||||||
PICKUP_FLOATINGPACKAGE = 12,
|
PICKUP_FLOATINGPACKAGE,
|
||||||
PICKUP_FLOATINGPACKAGE_FLOATING = 13,
|
PICKUP_FLOATINGPACKAGE_FLOATING,
|
||||||
PICKUP_ON_STREET_SLOW = 14,
|
PICKUP_ON_STREET_SLOW,
|
||||||
|
PICKUP_NUMOFTYPES
|
||||||
};
|
};
|
||||||
|
|
||||||
class CEntity;
|
class CEntity;
|
||||||
class CObject;
|
class CObject;
|
||||||
|
class CVehicle;
|
||||||
|
class CPlayerPed;
|
||||||
|
|
||||||
class CPickup
|
class CPickup
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
ePickupType m_eType;
|
ePickupType m_eType;
|
||||||
uint16 m_wQuantity;
|
bool m_bRemoved;
|
||||||
|
uint16 m_nQuantity;
|
||||||
CObject *m_pObject;
|
CObject *m_pObject;
|
||||||
uint32 m_nTimer;
|
uint32 m_nTimer;
|
||||||
int16 m_eModelIndex;
|
int16 m_eModelIndex;
|
||||||
int16 m_wIndex;
|
uint16 m_nIndex;
|
||||||
CVector m_vecPos;
|
CVector m_vecPos;
|
||||||
|
|
||||||
|
CObject *GiveUsAPickUpObject(int32 handle);
|
||||||
|
bool Update(CPlayerPed *player, CVehicle *vehicle, int playerId);
|
||||||
|
private:
|
||||||
|
bool IsMine() { return m_eType >= PICKUP_MINE_INACTIVE && m_eType <= PICKUP_FLOATINGPACKAGE_FLOATING; }
|
||||||
|
inline bool CanBePickedUp(CPlayerPed *player);
|
||||||
|
void RemoveKeepType();
|
||||||
|
void Remove();
|
||||||
|
};
|
||||||
|
|
||||||
|
static_assert(sizeof(CPickup) == 0x1C, "CPickup: error");
|
||||||
|
|
||||||
|
struct tPickupMessage
|
||||||
|
{
|
||||||
|
CVector2D m_pos;
|
||||||
|
eWeaponType m_weaponType;
|
||||||
|
CVector2D m_dist;
|
||||||
|
CRGBA m_color;
|
||||||
|
uint8 m_bOutOfStock : 1;
|
||||||
|
uint8 m_quantity;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CPickups
|
class CPickups
|
||||||
{
|
{
|
||||||
|
static int32 aPickUpsCollected[NUMCOLLECTEDPICKUPS];
|
||||||
|
static int16 CollectedPickUpIndex;
|
||||||
|
static int16 NumMessages;
|
||||||
|
static tPickupMessage aMessages[NUMPICKUPMESSAGES];
|
||||||
public:
|
public:
|
||||||
static void RenderPickUpText(void);
|
static void Init();
|
||||||
|
static void Update();
|
||||||
|
static void RenderPickUpText();
|
||||||
static void DoCollectableEffects(CEntity *ent);
|
static void DoCollectableEffects(CEntity *ent);
|
||||||
static void DoMoneyEffects(CEntity *ent);
|
static void DoMoneyEffects(CEntity *ent);
|
||||||
static void DoMineEffects(CEntity *ent);
|
static void DoMineEffects(CEntity *ent);
|
||||||
static void DoPickUpEffects(CEntity *ent);
|
static void DoPickUpEffects(CEntity *ent);
|
||||||
|
static int32 GenerateNewOne(CVector pos, uint32 modelIndex, uint8 type, uint32 quantity);
|
||||||
|
static int32 GenerateNewOne_WeaponType(CVector pos, eWeaponType weaponType, uint8 type, uint32 quantity);
|
||||||
|
static void RemovePickUp(int32 pickupIndex);
|
||||||
static void RemoveAllFloatingPickups();
|
static void RemoveAllFloatingPickups();
|
||||||
static int32 GenerateNewOne(CVector, uint32, uint8, uint32);
|
static void AddToCollectedPickupsArray(int32 index);
|
||||||
static int32 GenerateNewOne_WeaponType(CVector, eWeaponType, uint8, uint32);
|
static bool IsPickUpPickedUp(int32 pickupId);
|
||||||
|
static int32 ModelForWeapon(eWeaponType weaponType);
|
||||||
|
static enum eWeaponType WeaponForModel(int32 model);
|
||||||
|
static int32 FindColourIndexForWeaponMI(int32 model);
|
||||||
|
static int32 GetActualPickupIndex(int32 index);
|
||||||
|
static int32 GetNewUniquePickupIndex(int32 slot);
|
||||||
|
static void PassTime(uint32 time);
|
||||||
|
static bool GivePlayerGoodiesWithPickUpMI(int16 modelIndex, int playerIndex);
|
||||||
|
static void Load(uint8 *buffer, uint32 size);
|
||||||
|
static void Save(uint8 *buffer, uint32 *size);
|
||||||
|
|
||||||
static CPickup(&aPickUps)[NUMPICKUPS];
|
static CPickup(&aPickUps)[NUMPICKUPS];
|
||||||
|
|
||||||
|
// unused
|
||||||
|
static bool &bPickUpcamActivated;
|
||||||
|
static CVehicle *&pPlayerVehicle;
|
||||||
|
static CVector &StaticCamCoors;
|
||||||
|
static uint32 &StaticCamStartTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern uint16 AmmoForWeapon[20];
|
extern uint16 AmmoForWeapon[20];
|
||||||
extern uint16 AmmoForWeapon_OnStreet[20];
|
extern uint16 AmmoForWeapon_OnStreet[20];
|
||||||
|
extern uint16 CostOfWeapon[20];
|
||||||
|
|
||||||
class CPacManPickups
|
class CPacManPickups
|
||||||
{
|
{
|
||||||
|
@ -130,7 +130,7 @@ void CMissionCleanup::Process()
|
|||||||
CCarCtrl::CarDensityMultiplier = 1.0;
|
CCarCtrl::CarDensityMultiplier = 1.0;
|
||||||
FindPlayerPed()->m_pWanted->m_fCrimeSensitivity = 1.0f;
|
FindPlayerPed()->m_pWanted->m_fCrimeSensitivity = 1.0f;
|
||||||
TheCamera.Restore();
|
TheCamera.Restore();
|
||||||
TheCamera.SetWidescreenOff();
|
TheCamera.SetWideScreenOff();
|
||||||
DMAudio.ClearMissionAudio();
|
DMAudio.ClearMissionAudio();
|
||||||
CWeather::ReleaseWeather();
|
CWeather::ReleaseWeather();
|
||||||
for (int i = 0; i < NUM_OF_SPECIAL_CHARS; i++)
|
for (int i = 0; i < NUM_OF_SPECIAL_CHARS; i++)
|
||||||
@ -1707,7 +1707,7 @@ int8 CRunningScript::ProcessCommandsFrom100To199(int32 command)
|
|||||||
ped->SetOrientation(0.0f, 0.0f, 0.0f);
|
ped->SetOrientation(0.0f, 0.0f, 0.0f);
|
||||||
CTheScripts::ClearSpaceForMissionEntity(pos, ped);
|
CTheScripts::ClearSpaceForMissionEntity(pos, ped);
|
||||||
CWorld::Add(ped);
|
CWorld::Add(ped);
|
||||||
ped->m_level = CTheZones::GetLevelFromPosition(pos);
|
ped->m_nZoneLevel = CTheZones::GetLevelFromPosition(pos);
|
||||||
CPopulation::ms_nTotalMissionPeds++;
|
CPopulation::ms_nTotalMissionPeds++;
|
||||||
ScriptParams[0] = CPools::GetPedPool()->GetIndex(ped);
|
ScriptParams[0] = CPools::GetPedPool()->GetIndex(ped);
|
||||||
StoreParameters(&m_nIp, 1);
|
StoreParameters(&m_nIp, 1);
|
||||||
@ -1948,7 +1948,7 @@ int8 CRunningScript::ProcessCommandsFrom100To199(int32 command)
|
|||||||
car->AutoPilot.m_nCruiseSpeed = car->AutoPilot.m_fMaxTrafficSpeed = 9.0f;
|
car->AutoPilot.m_nCruiseSpeed = car->AutoPilot.m_fMaxTrafficSpeed = 9.0f;
|
||||||
car->AutoPilot.m_nCurrentLane = car->AutoPilot.m_nNextLane = 0;
|
car->AutoPilot.m_nCurrentLane = car->AutoPilot.m_nNextLane = 0;
|
||||||
car->bEngineOn = false;
|
car->bEngineOn = false;
|
||||||
car->m_level = CTheZones::GetLevelFromPosition(pos);
|
car->m_nZoneLevel = CTheZones::GetLevelFromPosition(pos);
|
||||||
car->bHasBeenOwnedByPlayer = true;
|
car->bHasBeenOwnedByPlayer = true;
|
||||||
CWorld::Add(car);
|
CWorld::Add(car);
|
||||||
handle = CPools::GetVehiclePool()->GetIndex(car);
|
handle = CPools::GetVehiclePool()->GetIndex(car);
|
||||||
@ -2748,7 +2748,7 @@ int8 CRunningScript::ProcessCommandsFrom200To299(int32 command)
|
|||||||
AnimationId anim = pVehicle->bLowVehicle ? ANIM_CAR_LSIT : ANIM_CAR_SIT;
|
AnimationId anim = pVehicle->bLowVehicle ? ANIM_CAR_LSIT : ANIM_CAR_SIT;
|
||||||
pPed->m_pVehicleAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, anim, 100.0f);
|
pPed->m_pVehicleAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, anim, 100.0f);
|
||||||
pPed->StopNonPartialAnims();
|
pPed->StopNonPartialAnims();
|
||||||
pPed->m_level = CTheZones::GetLevelFromPosition(pPed->GetPosition());
|
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(pPed->GetPosition());
|
||||||
CWorld::Add(pPed);
|
CWorld::Add(pPed);
|
||||||
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPed);
|
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPed);
|
||||||
StoreParameters(&m_nIp, 1);
|
StoreParameters(&m_nIp, 1);
|
||||||
|
@ -22,7 +22,6 @@ WRAPPER void CCamera::CamShake(float strength, float x, float y, float z) { EAXJ
|
|||||||
WRAPPER void CCamera::DrawBordersForWideScreen(void) { EAXJMP(0x46B430); }
|
WRAPPER void CCamera::DrawBordersForWideScreen(void) { EAXJMP(0x46B430); }
|
||||||
WRAPPER void CCamera::CalculateDerivedValues(void) { EAXJMP(0x46EEA0); }
|
WRAPPER void CCamera::CalculateDerivedValues(void) { EAXJMP(0x46EEA0); }
|
||||||
WRAPPER void CCamera::Restore(void) { EAXJMP(0x46F990); }
|
WRAPPER void CCamera::Restore(void) { EAXJMP(0x46F990); }
|
||||||
WRAPPER void CCamera::SetWidescreenOff(void) { EAXJMP(0x46FF10); }
|
|
||||||
WRAPPER void CamShakeNoPos(CCamera*, float) { EAXJMP(0x46B100); }
|
WRAPPER void CamShakeNoPos(CCamera*, float) { EAXJMP(0x46B100); }
|
||||||
WRAPPER void CCamera::TakeControl(CEntity*, int16, int16, int32) { EAXJMP(0x471500); }
|
WRAPPER void CCamera::TakeControl(CEntity*, int16, int16, int32) { EAXJMP(0x471500); }
|
||||||
WRAPPER void CCamera::TakeControlNoEntity(const CVector&, int16, int32) { EAXJMP(0x4715B0); }
|
WRAPPER void CCamera::TakeControlNoEntity(const CVector&, int16, int32) { EAXJMP(0x4715B0); }
|
||||||
@ -30,6 +29,10 @@ WRAPPER void CCamera::SetCamPositionForFixedMode(const CVector&, const CVector&)
|
|||||||
WRAPPER void CCamera::Init(void) { EAXJMP(0x46BAD0); }
|
WRAPPER void CCamera::Init(void) { EAXJMP(0x46BAD0); }
|
||||||
WRAPPER void CCamera::SetRwCamera(RwCamera*) { EAXJMP(0x46FEC0); }
|
WRAPPER void CCamera::SetRwCamera(RwCamera*) { EAXJMP(0x46FEC0); }
|
||||||
WRAPPER void CCamera::Process(void) { EAXJMP(0x46D3F0); }
|
WRAPPER void CCamera::Process(void) { EAXJMP(0x46D3F0); }
|
||||||
|
WRAPPER void CCamera::LoadPathSplines(int file) { EAXJMP(0x46D1D0); }
|
||||||
|
WRAPPER uint32 CCamera::GetCutSceneFinishTime(void) { EAXJMP(0x46B920); }
|
||||||
|
WRAPPER void CCamera::FinishCutscene(void) { EAXJMP(0x46B560); }
|
||||||
|
WRAPPER void CCamera::RestoreWithJumpCut(void) { EAXJMP(0x46FAE0); };
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CCamera::GetFading()
|
CCamera::GetFading()
|
||||||
@ -1327,6 +1330,25 @@ CCamera::Find3rdPersonQuickAimPitch(void)
|
|||||||
return -(DEGTORAD(((0.5f - m_f3rdPersonCHairMultY) * 1.8f * 0.5f * Cams[ActiveCam].FOV)) + rot);
|
return -(DEGTORAD(((0.5f - m_f3rdPersonCHairMultY) * 1.8f * 0.5f * Cams[ActiveCam].FOV)) + rot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CCamera::SetCamCutSceneOffSet(const CVector &pos)
|
||||||
|
{
|
||||||
|
m_vecCutSceneOffset = pos;
|
||||||
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
CCamera::TakeControlWithSpline(short nSwitch)
|
||||||
|
{
|
||||||
|
m_iModeToGoTo = CCam::MODE_FLYBY;
|
||||||
|
m_bLookingAtPlayer = false;
|
||||||
|
m_bLookingAtVector = false;
|
||||||
|
m_bcutsceneFinished = false;
|
||||||
|
m_iTypeOfSwitch = nSwitch;
|
||||||
|
m_bStartInterScript = true;
|
||||||
|
|
||||||
|
//FindPlayerPed(); // unused
|
||||||
|
};
|
||||||
|
|
||||||
STARTPATCHES
|
STARTPATCHES
|
||||||
InjectHook(0x42C760, (bool (CCamera::*)(const CVector ¢er, float radius, const CMatrix *mat))&CCamera::IsSphereVisible, PATCH_JUMP);
|
InjectHook(0x42C760, (bool (CCamera::*)(const CVector ¢er, float radius, const CMatrix *mat))&CCamera::IsSphereVisible, PATCH_JUMP);
|
||||||
InjectHook(0x46FD00, &CCamera::SetFadeColour, PATCH_JUMP);
|
InjectHook(0x46FD00, &CCamera::SetFadeColour, PATCH_JUMP);
|
||||||
|
@ -380,11 +380,11 @@ uint32 unknown;
|
|||||||
CVector m_RealPreviousCameraPosition;
|
CVector m_RealPreviousCameraPosition;
|
||||||
CVector m_cvecAimingTargetCoors;
|
CVector m_cvecAimingTargetCoors;
|
||||||
CVector m_vecFixedModeVector;
|
CVector m_vecFixedModeVector;
|
||||||
|
|
||||||
// one of those has to go
|
|
||||||
CVector m_vecFixedModeSource;
|
CVector m_vecFixedModeSource;
|
||||||
CVector m_vecFixedModeUpOffSet;
|
CVector m_vecFixedModeUpOffSet;
|
||||||
// CVector m_vecCutSceneOffset;
|
CVector m_vecCutSceneOffset;
|
||||||
|
|
||||||
|
// one of those has to go
|
||||||
CVector m_cvecStartingSourceForInterPol;
|
CVector m_cvecStartingSourceForInterPol;
|
||||||
CVector m_cvecStartingTargetForInterPol;
|
CVector m_cvecStartingTargetForInterPol;
|
||||||
CVector m_cvecStartingUpForInterPol;
|
CVector m_cvecStartingUpForInterPol;
|
||||||
@ -394,7 +394,7 @@ uint32 unknown;
|
|||||||
CVector m_vecSourceWhenInterPol;
|
CVector m_vecSourceWhenInterPol;
|
||||||
CVector m_vecTargetWhenInterPol;
|
CVector m_vecTargetWhenInterPol;
|
||||||
CVector m_vecUpWhenInterPol;
|
CVector m_vecUpWhenInterPol;
|
||||||
CVector m_vecClearGeometryVec;
|
//CVector m_vecClearGeometryVec;
|
||||||
|
|
||||||
CVector m_vecGameCamPos;
|
CVector m_vecGameCamPos;
|
||||||
CVector SourceDuringInter;
|
CVector SourceDuringInter;
|
||||||
@ -444,6 +444,7 @@ int m_iModeObbeCamIsInForCar;
|
|||||||
bool Get_Just_Switched_Status() { return m_bJust_Switched; }
|
bool Get_Just_Switched_Status() { return m_bJust_Switched; }
|
||||||
inline const CMatrix& GetCameraMatrix(void) { return m_cameraMatrix; }
|
inline const CMatrix& GetCameraMatrix(void) { return m_cameraMatrix; }
|
||||||
CVector &GetGameCamPosition(void) { return m_vecGameCamPos; }
|
CVector &GetGameCamPosition(void) { return m_vecGameCamPos; }
|
||||||
|
float GetPositionAlongSpline(void) { return m_fPositionAlongSpline; }
|
||||||
bool IsPointVisible(const CVector ¢er, const CMatrix *mat);
|
bool IsPointVisible(const CVector ¢er, const CMatrix *mat);
|
||||||
bool IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat);
|
bool IsSphereVisible(const CVector ¢er, float radius, const CMatrix *mat);
|
||||||
bool IsSphereVisible(const CVector ¢er, float radius);
|
bool IsSphereVisible(const CVector ¢er, float radius);
|
||||||
@ -467,7 +468,8 @@ int m_iModeObbeCamIsInForCar;
|
|||||||
|
|
||||||
void DrawBordersForWideScreen(void);
|
void DrawBordersForWideScreen(void);
|
||||||
void Restore(void);
|
void Restore(void);
|
||||||
void SetWidescreenOff(void);
|
void SetWideScreenOn(void) { m_WideScreenOn = true; }
|
||||||
|
void SetWideScreenOff(void) { m_WideScreenOn = false; }
|
||||||
|
|
||||||
float Find3rdPersonQuickAimPitch(void);
|
float Find3rdPersonQuickAimPitch(void);
|
||||||
|
|
||||||
@ -480,6 +482,14 @@ int m_iModeObbeCamIsInForCar;
|
|||||||
void SetRwCamera(RwCamera*);
|
void SetRwCamera(RwCamera*);
|
||||||
void Process();
|
void Process();
|
||||||
|
|
||||||
|
void LoadPathSplines(int file);
|
||||||
|
uint32 GetCutSceneFinishTime(void);
|
||||||
|
void FinishCutscene(void);
|
||||||
|
|
||||||
|
void SetCamCutSceneOffSet(const CVector&);
|
||||||
|
void TakeControlWithSpline(short);
|
||||||
|
void RestoreWithJumpCut(void);
|
||||||
|
|
||||||
void dtor(void) { this->CCamera::~CCamera(); }
|
void dtor(void) { this->CCamera::~CCamera(); }
|
||||||
};
|
};
|
||||||
static_assert(offsetof(CCamera, m_WideScreenOn) == 0x70, "CCamera: error");
|
static_assert(offsetof(CCamera, m_WideScreenOn) == 0x70, "CCamera: error");
|
||||||
@ -489,6 +499,7 @@ static_assert(offsetof(CCamera, m_uiTransitionState) == 0x89, "CCamera: error");
|
|||||||
static_assert(offsetof(CCamera, m_uiTimeTransitionStart) == 0x94, "CCamera: error");
|
static_assert(offsetof(CCamera, m_uiTimeTransitionStart) == 0x94, "CCamera: error");
|
||||||
static_assert(offsetof(CCamera, m_BlurBlue) == 0x9C, "CCamera: error");
|
static_assert(offsetof(CCamera, m_BlurBlue) == 0x9C, "CCamera: error");
|
||||||
static_assert(offsetof(CCamera, Cams) == 0x1A4, "CCamera: error");
|
static_assert(offsetof(CCamera, Cams) == 0x1A4, "CCamera: error");
|
||||||
|
static_assert(offsetof(CCamera, m_vecCutSceneOffset) == 0x6F8, "CCamera: error");
|
||||||
static_assert(sizeof(CCamera) == 0xE9D8, "CCamera: wrong size");
|
static_assert(sizeof(CCamera) == 0xE9D8, "CCamera: wrong size");
|
||||||
extern CCamera &TheCamera;
|
extern CCamera &TheCamera;
|
||||||
|
|
||||||
|
@ -1,8 +1,425 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "patcher.h"
|
#include "patcher.h"
|
||||||
#include "CutsceneMgr.h"
|
#include "CutsceneMgr.h"
|
||||||
|
#include "Directory.h"
|
||||||
|
#include "Camera.h"
|
||||||
|
#include "Streaming.h"
|
||||||
|
#include "FileMgr.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "AnimManager.h"
|
||||||
|
#include "AnimBlendAssocGroup.h"
|
||||||
|
#include "AnimBlendClumpData.h"
|
||||||
|
#include "Pad.h"
|
||||||
|
#include "DMAudio.h"
|
||||||
|
#include "World.h"
|
||||||
|
#include "PlayerPed.h"
|
||||||
|
#include "CutsceneHead.h"
|
||||||
|
#include "RpAnimBlend.h"
|
||||||
|
#include "ModelIndices.h"
|
||||||
|
#include "TempColModels.h"
|
||||||
|
#include "MusicManager.h"
|
||||||
|
|
||||||
|
const struct {
|
||||||
|
const char *szTrackName;
|
||||||
|
int iTrackId;
|
||||||
|
} musicNameIdAssoc[] = {
|
||||||
|
{ "JB", STREAMED_SOUND_NEWS_INTRO },
|
||||||
|
{ "BET", STREAMED_SOUND_BANK_INTRO },
|
||||||
|
{ "L1_LG", STREAMED_SOUND_CUTSCENE_LUIGI1_LG },
|
||||||
|
{ "L2_DSB", STREAMED_SOUND_CUTSCENE_LUIGI2_DSB },
|
||||||
|
{ "L3_DM", STREAMED_SOUND_CUTSCENE_LUIGI3_DM },
|
||||||
|
{ "L4_PAP", STREAMED_SOUND_CUTSCENE_LUIGI4_PAP },
|
||||||
|
{ "L5_TFB", STREAMED_SOUND_CUTSCENE_LUIGI5_TFB },
|
||||||
|
{ "J0_DM2", STREAMED_SOUND_CUTSCENE_JOEY0_DM2 },
|
||||||
|
{ "J1_LFL", STREAMED_SOUND_CUTSCENE_JOEY1_LFL },
|
||||||
|
{ "J2_KCL", STREAMED_SOUND_CUTSCENE_JOEY2_KCL },
|
||||||
|
{ "J3_VH", STREAMED_SOUND_CUTSCENE_JOEY3_VH },
|
||||||
|
{ "J4_ETH", STREAMED_SOUND_CUTSCENE_JOEY4_ETH },
|
||||||
|
{ "J5_DST", STREAMED_SOUND_CUTSCENE_JOEY5_DST },
|
||||||
|
{ "J6_TBJ", STREAMED_SOUND_CUTSCENE_JOEY6_TBJ },
|
||||||
|
{ "T1_TOL", STREAMED_SOUND_CUTSCENE_TONI1_TOL },
|
||||||
|
{ "T2_TPU", STREAMED_SOUND_CUTSCENE_TONI2_TPU },
|
||||||
|
{ "T3_MAS", STREAMED_SOUND_CUTSCENE_TONI3_MAS },
|
||||||
|
{ "T4_TAT", STREAMED_SOUND_CUTSCENE_TONI4_TAT },
|
||||||
|
{ "T5_BF", STREAMED_SOUND_CUTSCENE_TONI5_BF },
|
||||||
|
{ "S0_MAS", STREAMED_SOUND_CUTSCENE_SAL0_MAS },
|
||||||
|
{ "S1_PF", STREAMED_SOUND_CUTSCENE_SAL1_PF },
|
||||||
|
{ "S2_CTG", STREAMED_SOUND_CUTSCENE_SAL2_CTG },
|
||||||
|
{ "S3_RTC", STREAMED_SOUND_CUTSCENE_SAL3_RTC },
|
||||||
|
{ "S5_LRQ", STREAMED_SOUND_CUTSCENE_SAL5_LRQ },
|
||||||
|
{ "S4_BDBA", STREAMED_SOUND_CUTSCENE_SAL4_BDBA },
|
||||||
|
{ "S4_BDBB", STREAMED_SOUND_CUTSCENE_SAL4_BDBB },
|
||||||
|
{ "S2_CTG2", STREAMED_SOUND_CUTSCENE_SAL2_CTG2 },
|
||||||
|
{ "S4_BDBD", STREAMED_SOUND_CUTSCENE_SAL4_BDBD },
|
||||||
|
{ "S5_LRQB", STREAMED_SOUND_CUTSCENE_SAL5_LRQB },
|
||||||
|
{ "S5_LRQC", STREAMED_SOUND_CUTSCENE_SAL5_LRQC },
|
||||||
|
{ "A1_SS0", STREAMED_SOUND_CUTSCENE_ASUKA_1_SSO },
|
||||||
|
{ "A2_PP", STREAMED_SOUND_CUTSCENE_ASUKA_2_PP },
|
||||||
|
{ "A3_SS", STREAMED_SOUND_CUTSCENE_ASUKA_3_SS },
|
||||||
|
{ "A4_PDR", STREAMED_SOUND_CUTSCENE_ASUKA_4_PDR },
|
||||||
|
{ "A5_K2FT", STREAMED_SOUND_CUTSCENE_ASUKA_5_K2FT},
|
||||||
|
{ "K1_KBO", STREAMED_SOUND_CUTSCENE_KENJI1_KBO },
|
||||||
|
{ "K2_GIS", STREAMED_SOUND_CUTSCENE_KENJI2_GIS },
|
||||||
|
{ "K3_DS", STREAMED_SOUND_CUTSCENE_KENJI3_DS },
|
||||||
|
{ "K4_SHI", STREAMED_SOUND_CUTSCENE_KENJI4_SHI },
|
||||||
|
{ "K5_SD", STREAMED_SOUND_CUTSCENE_KENJI5_SD },
|
||||||
|
{ "R0_PDR2", STREAMED_SOUND_CUTSCENE_RAY0_PDR2 },
|
||||||
|
{ "R1_SW", STREAMED_SOUND_CUTSCENE_RAY1_SW },
|
||||||
|
{ "R2_AP", STREAMED_SOUND_CUTSCENE_RAY2_AP },
|
||||||
|
{ "R3_ED", STREAMED_SOUND_CUTSCENE_RAY3_ED },
|
||||||
|
{ "R4_GF", STREAMED_SOUND_CUTSCENE_RAY4_GF },
|
||||||
|
{ "R5_PB", STREAMED_SOUND_CUTSCENE_RAY5_PB },
|
||||||
|
{ "R6_MM", STREAMED_SOUND_CUTSCENE_RAY6_MM },
|
||||||
|
{ "D1_STOG", STREAMED_SOUND_CUTSCENE_DONALD1_STOG },
|
||||||
|
{ "D2_KK", STREAMED_SOUND_CUTSCENE_DONALD2_KK },
|
||||||
|
{ "D3_ADO", STREAMED_SOUND_CUTSCENE_DONALD3_ADO },
|
||||||
|
{ "D5_ES", STREAMED_SOUND_CUTSCENE_DONALD5_ES },
|
||||||
|
{ "D7_MLD", STREAMED_SOUND_CUTSCENE_DONALD7_MLD },
|
||||||
|
{ "D4_GTA", STREAMED_SOUND_CUTSCENE_DONALD4_GTA },
|
||||||
|
{ "D4_GTA2", STREAMED_SOUND_CUTSCENE_DONALD4_GTA2 },
|
||||||
|
{ "D6_STS", STREAMED_SOUND_CUTSCENE_DONALD6_STS },
|
||||||
|
{ "A6_BAIT", STREAMED_SOUND_CUTSCENE_ASUKA6_BAIT },
|
||||||
|
{ "A7_ETG", STREAMED_SOUND_CUTSCENE_ASUKA7_ETG },
|
||||||
|
{ "A8_PS", STREAMED_SOUND_CUTSCENE_ASUKA8_PS },
|
||||||
|
{ "A9_ASD", STREAMED_SOUND_CUTSCENE_ASUKA9_ASD },
|
||||||
|
{ "K4_SHI2", STREAMED_SOUND_CUTSCENE_KENJI4_SHI2 },
|
||||||
|
{ "C1_TEX", STREAMED_SOUND_CUTSCENE_CATALINA1_TEX },
|
||||||
|
{ "EL_PH1", STREAMED_SOUND_CUTSCENE_ELBURRO1_PH1 },
|
||||||
|
{ "EL_PH2", STREAMED_SOUND_CUTSCENE_ELBURRO2_PH2 },
|
||||||
|
{ "EL_PH3", STREAMED_SOUND_CUTSCENE_ELBURRO3_PH3 },
|
||||||
|
{ "EL_PH4", STREAMED_SOUND_CUTSCENE_ELBURRO4_PH4 },
|
||||||
|
{ "YD_PH1", STREAMED_SOUND_CUTSCENE_YARDIE_PH1 },
|
||||||
|
{ "YD_PH2", STREAMED_SOUND_CUTSCENE_YARDIE_PH2 },
|
||||||
|
{ "YD_PH3", STREAMED_SOUND_CUTSCENE_YARDIE_PH3 },
|
||||||
|
{ "YD_PH4", STREAMED_SOUND_CUTSCENE_YARDIE_PH4 },
|
||||||
|
{ "HD_PH1", STREAMED_SOUND_CUTSCENE_HOODS_PH1 },
|
||||||
|
{ "HD_PH2", STREAMED_SOUND_CUTSCENE_HOODS_PH2 },
|
||||||
|
{ "HD_PH3", STREAMED_SOUND_CUTSCENE_HOODS_PH3 },
|
||||||
|
{ "HD_PH4", STREAMED_SOUND_CUTSCENE_HOODS_PH4 },
|
||||||
|
{ "HD_PH5", STREAMED_SOUND_CUTSCENE_HOODS_PH5 },
|
||||||
|
{ "MT_PH1", STREAMED_SOUND_CUTSCENE_MARTY_PH1 },
|
||||||
|
{ "MT_PH2", STREAMED_SOUND_CUTSCENE_MARTY_PH2 },
|
||||||
|
{ "MT_PH3", STREAMED_SOUND_CUTSCENE_MARTY_PH3 },
|
||||||
|
{ "MT_PH4", STREAMED_SOUND_CUTSCENE_MARTY_PH4 },
|
||||||
|
{ NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
int
|
||||||
|
FindCutsceneAudioTrackId(const char *szCutsceneName)
|
||||||
|
{
|
||||||
|
for (int i = 0; musicNameIdAssoc[i].szTrackName; i++)
|
||||||
|
{
|
||||||
|
if (!strcmpi(musicNameIdAssoc[i].szTrackName, szCutsceneName))
|
||||||
|
return musicNameIdAssoc[i].iTrackId;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
bool &CCutsceneMgr::ms_running = *(bool*)0x95CCF5;
|
bool &CCutsceneMgr::ms_running = *(bool*)0x95CCF5;
|
||||||
bool &CCutsceneMgr::ms_cutsceneProcessing = *(bool*)0x95CD9F;
|
bool &CCutsceneMgr::ms_cutsceneProcessing = *(bool*)0x95CD9F;
|
||||||
CDirectory *&CCutsceneMgr::ms_pCutsceneDir = *(CDirectory**)0x8F5F88;
|
CDirectory *&CCutsceneMgr::ms_pCutsceneDir = *(CDirectory**)0x8F5F88;
|
||||||
CCutsceneObject *(&CCutsceneMgr::ms_pCutsceneObjects)[NUMCUTSCENEOBJECTS] = *(CCutsceneObject*(*)[NUMCUTSCENEOBJECTS]) *(uintptr*) 0x862170;
|
CCutsceneObject *(&CCutsceneMgr::ms_pCutsceneObjects)[NUMCUTSCENEOBJECTS] = *(CCutsceneObject*(*)[NUMCUTSCENEOBJECTS]) *(uintptr*) 0x862170;
|
||||||
|
int32 &CCutsceneMgr::ms_numCutsceneObjs = *(int32*)0x942FA4;
|
||||||
|
bool &CCutsceneMgr::ms_loaded = *(bool*)0x95CD95;
|
||||||
|
bool &CCutsceneMgr::ms_animLoaded = *(bool*)0x95CDA0;
|
||||||
|
bool &CCutsceneMgr::ms_useLodMultiplier = *(bool*)0x95CD74;
|
||||||
|
char(&CCutsceneMgr::ms_cutsceneName)[CUTSCENENAMESIZE] = *(char(*)[CUTSCENENAMESIZE]) *(uintptr*)0x70D9D0;
|
||||||
|
CAnimBlendAssocGroup &CCutsceneMgr::ms_cutsceneAssociations = *(CAnimBlendAssocGroup*)0x709C58;
|
||||||
|
CVector &CCutsceneMgr::ms_cutsceneOffset = *(CVector*)0x8F2C0C;
|
||||||
|
float &CCutsceneMgr::ms_cutsceneTimer = *(float*)0x941548;
|
||||||
|
uint32 &CCutsceneMgr::ms_cutsceneLoadStatus = *(uint32*)0x95CB40;
|
||||||
|
|
||||||
|
WRAPPER RpAtomic* CalculateBoundingSphereRadiusCB(RpAtomic * atomic, void *data) { EAXJMP(0x404B40); }
|
||||||
|
|
||||||
|
void
|
||||||
|
CCutsceneMgr::Initialise(void)
|
||||||
|
{
|
||||||
|
ms_numCutsceneObjs = 0;
|
||||||
|
ms_loaded = false;
|
||||||
|
ms_running = false;
|
||||||
|
ms_animLoaded = false;
|
||||||
|
ms_cutsceneProcessing = false;
|
||||||
|
ms_useLodMultiplier = false;
|
||||||
|
|
||||||
|
ms_pCutsceneDir = new CDirectory(CUTSCENEDIRSIZE);
|
||||||
|
ms_pCutsceneDir->ReadDirFile("ANIM\\CUTS.DIR");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CCutsceneMgr::Shutdown(void)
|
||||||
|
{
|
||||||
|
delete ms_pCutsceneDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CCutsceneMgr::LoadCutsceneData(const char *szCutsceneName)
|
||||||
|
{
|
||||||
|
int file;
|
||||||
|
uint32 size;
|
||||||
|
uint32 offset;
|
||||||
|
CPlayerPed *pPlayerPed;
|
||||||
|
|
||||||
|
ms_cutsceneProcessing = true;
|
||||||
|
if (!strcmpi(szCutsceneName, "jb"))
|
||||||
|
ms_useLodMultiplier = true;
|
||||||
|
CTimer::Stop();
|
||||||
|
|
||||||
|
ms_pCutsceneDir->numEntries = 0;
|
||||||
|
ms_pCutsceneDir->ReadDirFile("ANIM\\CUTS.DIR");
|
||||||
|
|
||||||
|
CStreaming::RemoveUnusedModelsInLoadedList();
|
||||||
|
CGame::DrasticTidyUpMemory();
|
||||||
|
|
||||||
|
strcpy(ms_cutsceneName, szCutsceneName);
|
||||||
|
file = CFileMgr::OpenFile("ANIM\\CUTS.IMG", "rb");
|
||||||
|
|
||||||
|
// Load animations
|
||||||
|
sprintf(gString, "%s.IFP", szCutsceneName);
|
||||||
|
if (ms_pCutsceneDir->FindItem(gString, offset, size)) {
|
||||||
|
CStreaming::MakeSpaceFor(size << 11);
|
||||||
|
CStreaming::ImGonnaUseStreamingMemory();
|
||||||
|
CFileMgr::Seek(file, offset << 11, SEEK_SET);
|
||||||
|
CAnimManager::LoadAnimFile(file, false);
|
||||||
|
ms_cutsceneAssociations.CreateAssociations(szCutsceneName);
|
||||||
|
CStreaming::IHaveUsedStreamingMemory();
|
||||||
|
ms_animLoaded = true;
|
||||||
|
} else {
|
||||||
|
ms_animLoaded = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load camera data
|
||||||
|
sprintf(gString, "%s.DAT", szCutsceneName);
|
||||||
|
if (ms_pCutsceneDir->FindItem(gString, offset, size)) {
|
||||||
|
CFileMgr::Seek(file, offset << 11, SEEK_SET);
|
||||||
|
TheCamera.LoadPathSplines(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
CFileMgr::CloseFile(file);
|
||||||
|
|
||||||
|
if (strcmpi(ms_cutsceneName, "end")) {
|
||||||
|
DMAudio.ChangeMusicMode(2);
|
||||||
|
int trackId = FindCutsceneAudioTrackId(szCutsceneName);
|
||||||
|
if (trackId != -1) {
|
||||||
|
printf("Start preload audio %s\n", szCutsceneName);
|
||||||
|
DMAudio.PreloadCutSceneMusic(trackId);
|
||||||
|
printf("End preload audio %s\n", szCutsceneName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ms_cutsceneTimer = 0.0f;
|
||||||
|
ms_loaded = true;
|
||||||
|
ms_cutsceneOffset = CVector(0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
|
pPlayerPed = FindPlayerPed();
|
||||||
|
CTimer::Update();
|
||||||
|
|
||||||
|
pPlayerPed->m_pWanted->ClearQdCrimes();
|
||||||
|
pPlayerPed->bIsVisible = false;
|
||||||
|
pPlayerPed->m_fCurrentStamina = pPlayerPed->m_fMaxStamina;
|
||||||
|
CPad::GetPad(0)->DisablePlayerControls |= PLAYERCONTROL_DISABLED_80;
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
CCutsceneMgr::ms_cutsceneTimer = TheCamera.GetCutSceneFinishTime() * 0.001f;
|
||||||
|
TheCamera.FinishCutscene();
|
||||||
|
|
||||||
|
FindPlayerPed()->bIsVisible = true;
|
||||||
|
CWorld::Players[CWorld::PlayerInFocus].MakePlayerSafe(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CCutsceneMgr::SetupCutsceneToStart(void)
|
||||||
|
{
|
||||||
|
TheCamera.SetCamCutSceneOffSet(ms_cutsceneOffset);
|
||||||
|
TheCamera.TakeControlWithSpline(2);
|
||||||
|
TheCamera.SetWideScreenOn();
|
||||||
|
|
||||||
|
ms_cutsceneOffset.z++;
|
||||||
|
|
||||||
|
for (int i = ms_numCutsceneObjs - 1; i >= 0; i--) {
|
||||||
|
assert(RwObjectGetType(ms_pCutsceneObjects[i]->m_rwObject) == rpCLUMP);
|
||||||
|
if (CAnimBlendAssociation *pAnimBlendAssoc = RpAnimBlendClumpGetFirstAssociation((RpClump*)ms_pCutsceneObjects[i]->m_rwObject)) {
|
||||||
|
assert(pAnimBlendAssoc->hierarchy->sequences[0].HasTranslation());
|
||||||
|
ms_pCutsceneObjects[i]->GetPosition() = ms_cutsceneOffset + ((KeyFrameTrans*)pAnimBlendAssoc->hierarchy->sequences[0].GetKeyFrame(0))->translation;
|
||||||
|
CWorld::Add(ms_pCutsceneObjects[i]);
|
||||||
|
pAnimBlendAssoc->SetRun();
|
||||||
|
} else {
|
||||||
|
ms_pCutsceneObjects[i]->GetPosition() = ms_cutsceneOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CTimer::Update();
|
||||||
|
CTimer::Update();
|
||||||
|
ms_running = true;
|
||||||
|
ms_cutsceneTimer = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CCutsceneMgr::SetCutsceneAnim(const char *animName, CObject *pObject)
|
||||||
|
{
|
||||||
|
CAnimBlendAssociation *pNewAnim;
|
||||||
|
CAnimBlendClumpData *pAnimBlendClumpData;
|
||||||
|
|
||||||
|
assert(RwObjectGetType(pObject->m_rwObject) == rpCLUMP);
|
||||||
|
RpAnimBlendClumpRemoveAllAssociations((RpClump*)pObject->m_rwObject);
|
||||||
|
|
||||||
|
pNewAnim = ms_cutsceneAssociations.CopyAnimation(animName);
|
||||||
|
pNewAnim->SetCurrentTime(0.0f);
|
||||||
|
pNewAnim->flags |= ASSOC_HAS_TRANSLATION;
|
||||||
|
pNewAnim->flags &= ~ASSOC_RUNNING;
|
||||||
|
|
||||||
|
pAnimBlendClumpData = *RPANIMBLENDCLUMPDATA(pObject->m_rwObject);
|
||||||
|
pAnimBlendClumpData->link.Prepend(&pNewAnim->link);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
CCutsceneObject *
|
||||||
|
CCutsceneMgr::CreateCutsceneObject(int modelId)
|
||||||
|
{
|
||||||
|
CBaseModelInfo *pModelInfo;
|
||||||
|
CColModel *pColModel;
|
||||||
|
float radius;
|
||||||
|
RpClump *clump;
|
||||||
|
CCutsceneObject *pCutsceneObject;
|
||||||
|
|
||||||
|
if (modelId >= MI_CUTOBJ01 && modelId <= MI_CUTOBJ05) {
|
||||||
|
pModelInfo = CModelInfo::GetModelInfo(modelId);
|
||||||
|
pColModel = &CTempColModels::ms_colModelCutObj[modelId - MI_CUTOBJ01];
|
||||||
|
radius = 0.0f;
|
||||||
|
|
||||||
|
pModelInfo->SetColModel(pColModel);
|
||||||
|
clump = (RpClump*)pModelInfo->GetRwObject();
|
||||||
|
assert(RwObjectGetType(clump) == rpCLUMP);
|
||||||
|
RpClumpForAllAtomics(clump, (RpAtomicCallBack)CalculateBoundingSphereRadiusCB, &radius);
|
||||||
|
|
||||||
|
pColModel->boundingSphere.radius = radius;
|
||||||
|
pColModel->boundingBox.min = CVector(-radius, -radius, -radius);
|
||||||
|
pColModel->boundingBox.max = CVector(radius, radius, radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
pCutsceneObject = new CCutsceneObject();
|
||||||
|
pCutsceneObject->SetModelIndex(modelId);
|
||||||
|
ms_pCutsceneObjects[ms_numCutsceneObjs++] = pCutsceneObject;
|
||||||
|
return pCutsceneObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CCutsceneMgr::DeleteCutsceneData(void)
|
||||||
|
{
|
||||||
|
if (!ms_loaded) return;
|
||||||
|
|
||||||
|
ms_cutsceneProcessing = false;
|
||||||
|
ms_useLodMultiplier = false;
|
||||||
|
|
||||||
|
for (--ms_numCutsceneObjs; ms_numCutsceneObjs >= 0; ms_numCutsceneObjs--) {
|
||||||
|
CWorld::Remove(ms_pCutsceneObjects[ms_numCutsceneObjs]);
|
||||||
|
ms_pCutsceneObjects[ms_numCutsceneObjs]->DeleteRwObject();
|
||||||
|
delete ms_pCutsceneObjects[ms_numCutsceneObjs];
|
||||||
|
}
|
||||||
|
ms_numCutsceneObjs = 0;
|
||||||
|
|
||||||
|
if (ms_animLoaded)
|
||||||
|
CAnimManager::RemoveLastAnimFile();
|
||||||
|
|
||||||
|
ms_animLoaded = false;
|
||||||
|
TheCamera.RestoreWithJumpCut();
|
||||||
|
TheCamera.SetWideScreenOff();
|
||||||
|
ms_running = false;
|
||||||
|
ms_loaded = false;
|
||||||
|
|
||||||
|
FindPlayerPed()->bIsVisible = true;
|
||||||
|
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_DISABLED_80;
|
||||||
|
CWorld::Players[CWorld::PlayerInFocus].MakePlayerSafe(false);
|
||||||
|
|
||||||
|
if (strcmpi(ms_cutsceneName, "end")) {
|
||||||
|
DMAudio.StopCutSceneMusic();
|
||||||
|
if (strcmpi(ms_cutsceneName, "bet"))
|
||||||
|
DMAudio.ChangeMusicMode(1);
|
||||||
|
}
|
||||||
|
CTimer::Stop();
|
||||||
|
//TheCamera.GetScreenFadeStatus() == 2; // what for??
|
||||||
|
CGame::DrasticTidyUpMemory();
|
||||||
|
CTimer::Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CCutsceneMgr::Update(void)
|
||||||
|
{
|
||||||
|
enum {
|
||||||
|
CUTSCENE_LOADING_0 = 0,
|
||||||
|
CUTSCENE_LOADING_AUDIO,
|
||||||
|
CUTSCENE_LOADING_2,
|
||||||
|
CUTSCENE_LOADING_3,
|
||||||
|
CUTSCENE_LOADING_4
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (ms_cutsceneLoadStatus) {
|
||||||
|
case CUTSCENE_LOADING_AUDIO:
|
||||||
|
SetupCutsceneToStart();
|
||||||
|
if (strcmpi(ms_cutsceneName, "end"))
|
||||||
|
DMAudio.PlayPreloadedCutSceneMusic();
|
||||||
|
ms_cutsceneLoadStatus++;
|
||||||
|
break;
|
||||||
|
case CUTSCENE_LOADING_2:
|
||||||
|
case CUTSCENE_LOADING_3:
|
||||||
|
ms_cutsceneLoadStatus++;
|
||||||
|
break;
|
||||||
|
case CUTSCENE_LOADING_4:
|
||||||
|
ms_cutsceneLoadStatus = CUTSCENE_LOADING_0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ms_running) return;
|
||||||
|
|
||||||
|
ms_cutsceneTimer += CTimer::GetTimeStepNonClipped() * 0.02f;
|
||||||
|
if (strcmpi(ms_cutsceneName, "end") && TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_FLYBY && ms_cutsceneLoadStatus == CUTSCENE_LOADING_0) {
|
||||||
|
if (CPad::GetPad(0)->GetCrossJustDown()
|
||||||
|
|| (CGame::playingIntro && CPad::GetPad(0)->GetStartJustDown())
|
||||||
|
|| CPad::GetPad(0)->GetLeftMouseJustDown()
|
||||||
|
|| CPad::GetPad(0)->GetPadEnterJustDown() || CPad::GetPad(0)->GetEnterJustDown() // NOTE: In original code it's a single CPad method
|
||||||
|
|| CPad::GetPad(0)->GetCharJustDown(VK_SPACE))
|
||||||
|
FinishCutscene();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCutsceneMgr::HasCutsceneFinished(void) { return TheCamera.GetPositionAlongSpline() == 1.0f; }
|
||||||
|
|
||||||
|
STARTPATCHES
|
||||||
|
InjectHook(0x4045D0, &CCutsceneMgr::Initialise, PATCH_JUMP);
|
||||||
|
InjectHook(0x404630, &CCutsceneMgr::Shutdown, PATCH_JUMP);
|
||||||
|
InjectHook(0x404650, &CCutsceneMgr::LoadCutsceneData, PATCH_JUMP);
|
||||||
|
InjectHook(0x405140, &CCutsceneMgr::FinishCutscene, PATCH_JUMP);
|
||||||
|
InjectHook(0x404D80, &CCutsceneMgr::SetHeadAnim, PATCH_JUMP);
|
||||||
|
InjectHook(0x404DC0, &CCutsceneMgr::SetupCutsceneToStart, PATCH_JUMP);
|
||||||
|
InjectHook(0x404D20, &CCutsceneMgr::SetCutsceneAnim, PATCH_JUMP);
|
||||||
|
InjectHook(0x404CD0, &CCutsceneMgr::AddCutsceneHead, PATCH_JUMP);
|
||||||
|
InjectHook(0x404BE0, &CCutsceneMgr::CreateCutsceneObject, PATCH_JUMP);
|
||||||
|
InjectHook(0x4048E0, &CCutsceneMgr::DeleteCutsceneData, PATCH_JUMP);
|
||||||
|
InjectHook(0x404EE0, &CCutsceneMgr::Update, PATCH_JUMP);
|
||||||
|
InjectHook(0x4051B0, &CCutsceneMgr::GetCutsceneTimeInMilleseconds, PATCH_JUMP);
|
||||||
|
InjectHook(0x4051F0, &CCutsceneMgr::HasCutsceneFinished, PATCH_JUMP);
|
||||||
|
ENDPATCHES
|
@ -1,7 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "CutsceneObject.h"
|
#include "CutsceneObject.h"
|
||||||
|
|
||||||
|
#define CUTSCENENAMESIZE 8
|
||||||
|
|
||||||
class CDirectory;
|
class CDirectory;
|
||||||
|
class CAnimBlendAssocGroup;
|
||||||
|
class CCutsceneHead;
|
||||||
|
|
||||||
class CCutsceneMgr
|
class CCutsceneMgr
|
||||||
{
|
{
|
||||||
@ -9,10 +13,35 @@ class CCutsceneMgr
|
|||||||
static bool &ms_cutsceneProcessing;
|
static bool &ms_cutsceneProcessing;
|
||||||
static CCutsceneObject *(&ms_pCutsceneObjects)[NUMCUTSCENEOBJECTS];
|
static CCutsceneObject *(&ms_pCutsceneObjects)[NUMCUTSCENEOBJECTS];
|
||||||
|
|
||||||
|
static int32 &ms_numCutsceneObjs;
|
||||||
|
static bool &ms_loaded;
|
||||||
|
static bool &ms_animLoaded;
|
||||||
|
static bool &ms_useLodMultiplier;
|
||||||
|
|
||||||
|
static char(&ms_cutsceneName)[CUTSCENENAMESIZE];
|
||||||
|
static CAnimBlendAssocGroup &ms_cutsceneAssociations;
|
||||||
|
static CVector &ms_cutsceneOffset;
|
||||||
|
static float &ms_cutsceneTimer;
|
||||||
public:
|
public:
|
||||||
static CDirectory *&ms_pCutsceneDir;
|
static CDirectory *&ms_pCutsceneDir;
|
||||||
|
static uint32 &ms_cutsceneLoadStatus;
|
||||||
|
|
||||||
static bool IsRunning(void) { return ms_running; }
|
static bool IsRunning(void) { return ms_running; }
|
||||||
static bool IsCutsceneProcessing(void) { return ms_cutsceneProcessing; }
|
static bool IsCutsceneProcessing(void) { return ms_cutsceneProcessing; }
|
||||||
static CCutsceneObject* GetCutsceneObject(int id) { return ms_pCutsceneObjects[id]; }
|
static CCutsceneObject* GetCutsceneObject(int id) { return ms_pCutsceneObjects[id]; }
|
||||||
|
static int GetCutsceneTimeInMilleseconds(void) { return 1000.0f * ms_cutsceneTimer; }
|
||||||
|
static char *GetCutsceneName(void) { return ms_cutsceneName; }
|
||||||
|
static bool HasCutsceneFinished(void);
|
||||||
|
|
||||||
|
static void Initialise(void);
|
||||||
|
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);
|
||||||
|
static CCutsceneObject *CreateCutsceneObject(int modelId);
|
||||||
|
static void DeleteCutsceneData(void);
|
||||||
|
static void Update(void);
|
||||||
};
|
};
|
||||||
|
@ -2383,7 +2383,7 @@ void CMenuManager::SwitchToNewScreen(int32 screen)
|
|||||||
|
|
||||||
// Set player skin.
|
// Set player skin.
|
||||||
if (m_nCurrScreen == MENUPAGE_SKIN_SELECT) {
|
if (m_nCurrScreen == MENUPAGE_SKIN_SELECT) {
|
||||||
CPlayerSkin::BeginFrontEndSkinEdit();
|
CPlayerSkin::BeginFrontendSkinEdit();
|
||||||
m_bSkinsFound = false;
|
m_bSkinsFound = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,14 +54,7 @@ public:
|
|||||||
|
|
||||||
static float LimitRadianAngle(float angle)
|
static float LimitRadianAngle(float angle)
|
||||||
{
|
{
|
||||||
float result;
|
float result = clamp(angle, -25.0f, 25.0f);
|
||||||
|
|
||||||
if (angle < -25.0f)
|
|
||||||
result = -25.0f;
|
|
||||||
else if (angle > 25.0f)
|
|
||||||
result = 25.0f;
|
|
||||||
else
|
|
||||||
result = angle;
|
|
||||||
|
|
||||||
while (result >= PI) {
|
while (result >= PI) {
|
||||||
result -= 2 * PI;
|
result -= 2 * PI;
|
||||||
|
@ -368,6 +368,7 @@ public:
|
|||||||
bool GetLeftShoulder2JustDown() { return !!(NewState.LeftShoulder2 && !OldState.LeftShoulder2); }
|
bool GetLeftShoulder2JustDown() { return !!(NewState.LeftShoulder2 && !OldState.LeftShoulder2); }
|
||||||
bool GetRightShoulder1JustDown() { return !!(NewState.RightShoulder1 && !OldState.RightShoulder1); }
|
bool GetRightShoulder1JustDown() { return !!(NewState.RightShoulder1 && !OldState.RightShoulder1); }
|
||||||
bool GetRightShoulder2JustDown() { return !!(NewState.RightShoulder2 && !OldState.RightShoulder2); }
|
bool GetRightShoulder2JustDown() { return !!(NewState.RightShoulder2 && !OldState.RightShoulder2); }
|
||||||
|
bool GetStartJustDown() { return !!(NewState.Start && !OldState.Start); }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
int32 GetLeftShoulder1(void) { return NewState.LeftShoulder1; }
|
int32 GetLeftShoulder1(void) { return NewState.LeftShoulder1; }
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
#include "PlayerInfo.h"
|
#include "PlayerInfo.h"
|
||||||
#include "Frontend.h"
|
#include "Frontend.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
|
#include "PlayerSkin.h"
|
||||||
|
|
||||||
WRAPPER void CPlayerInfo::MakePlayerSafe(bool) { EAXJMP(0x4A1400); }
|
WRAPPER void CPlayerInfo::MakePlayerSafe(bool) { EAXJMP(0x4A1400); }
|
||||||
WRAPPER void CPlayerInfo::LoadPlayerSkin() { EAXJMP(0x4A1700); }
|
|
||||||
WRAPPER void CPlayerInfo::AwardMoneyForExplosion(CVehicle *vehicle) { EAXJMP(0x4A15F0); }
|
WRAPPER void CPlayerInfo::AwardMoneyForExplosion(CVehicle *vehicle) { EAXJMP(0x4A15F0); }
|
||||||
WRAPPER void CPlayerInfo::Process(void) { EAXJMP(0x49FD30); }
|
WRAPPER void CPlayerInfo::Process(void) { EAXJMP(0x49FD30); }
|
||||||
|
|
||||||
@ -22,3 +22,25 @@ CVector& CPlayerInfo::GetPos()
|
|||||||
return m_pPed->m_pMyVehicle->GetPosition();
|
return m_pPed->m_pMyVehicle->GetPosition();
|
||||||
return m_pPed->GetPosition();
|
return m_pPed->GetPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPlayerInfo::LoadPlayerSkin()
|
||||||
|
{
|
||||||
|
DeletePlayerSkin();
|
||||||
|
|
||||||
|
m_pSkinTexture = CPlayerSkin::GetSkinTexture(m_aSkinName);
|
||||||
|
if (!m_pSkinTexture)
|
||||||
|
m_pSkinTexture = CPlayerSkin::GetSkinTexture(DEFAULT_SKIN_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayerInfo::DeletePlayerSkin()
|
||||||
|
{
|
||||||
|
if (m_pSkinTexture) {
|
||||||
|
RwTextureDestroy(m_pSkinTexture);
|
||||||
|
m_pSkinTexture = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
STARTPATCHES
|
||||||
|
InjectHook(0x4A1700, &CPlayerInfo::LoadPlayerSkin, PATCH_JUMP);
|
||||||
|
InjectHook(0x4A1750, &CPlayerInfo::DeletePlayerSkin, PATCH_JUMP);
|
||||||
|
ENDPATCHES
|
||||||
|
@ -68,6 +68,7 @@ public:
|
|||||||
|
|
||||||
void MakePlayerSafe(bool);
|
void MakePlayerSafe(bool);
|
||||||
void LoadPlayerSkin();
|
void LoadPlayerSkin();
|
||||||
|
void DeletePlayerSkin();
|
||||||
void AwardMoneyForExplosion(CVehicle *vehicle);
|
void AwardMoneyForExplosion(CVehicle *vehicle);
|
||||||
void SetPlayerSkin(char* skin);
|
void SetPlayerSkin(char* skin);
|
||||||
CVector& GetPos();
|
CVector& GetPos();
|
||||||
|
@ -1,5 +1,169 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "patcher.h"
|
#include "patcher.h"
|
||||||
|
#include "main.h"
|
||||||
#include "PlayerSkin.h"
|
#include "PlayerSkin.h"
|
||||||
|
#include "TxdStore.h"
|
||||||
|
#include "rtbmp.h"
|
||||||
|
#include "ClumpModelInfo.h"
|
||||||
|
#include "VisibilityPlugins.h"
|
||||||
|
#include "World.h"
|
||||||
|
#include "PlayerInfo.h"
|
||||||
|
#include "CdStream.h"
|
||||||
|
#include "FileMgr.h"
|
||||||
|
#include "Directory.h"
|
||||||
|
#include "RwHelper.h"
|
||||||
|
#include "Timer.h"
|
||||||
|
#include "Lights.h"
|
||||||
|
|
||||||
WRAPPER void CPlayerSkin::BeginFrontEndSkinEdit() { EAXJMP(0x59BC70); }
|
int CPlayerSkin::m_txdSlot;
|
||||||
|
|
||||||
|
void
|
||||||
|
FindPlayerDff(uint32 &offset, uint32 &size)
|
||||||
|
{
|
||||||
|
int file;
|
||||||
|
CDirectory::DirectoryInfo info;
|
||||||
|
|
||||||
|
file = CFileMgr::OpenFile("models\\gta3.dir", "rb");
|
||||||
|
|
||||||
|
do {
|
||||||
|
if (!CFileMgr::Read(file, (char*)&info, sizeof(CDirectory::DirectoryInfo)))
|
||||||
|
return;
|
||||||
|
} while (strcmpi("player.dff", info.name));
|
||||||
|
|
||||||
|
offset = info.offset;
|
||||||
|
size = info.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LoadPlayerDff(void)
|
||||||
|
{
|
||||||
|
RwStream *stream;
|
||||||
|
RwMemory mem;
|
||||||
|
uint32 offset, size;
|
||||||
|
uint8 *buffer;
|
||||||
|
bool streamWasAdded = false;
|
||||||
|
|
||||||
|
if (CdStreamGetNumImages() == 0) {
|
||||||
|
CdStreamAddImage("models\\gta3.img");
|
||||||
|
streamWasAdded = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
FindPlayerDff(offset, size);
|
||||||
|
buffer = (uint8*)RwMallocAlign(size << 11, 2048);
|
||||||
|
CdStreamRead(0, buffer, offset, size);
|
||||||
|
CdStreamSync(0);
|
||||||
|
|
||||||
|
mem.start = buffer;
|
||||||
|
mem.length = size << 11;
|
||||||
|
stream = RwStreamOpen(rwSTREAMMEMORY, rwSTREAMREAD, &mem);
|
||||||
|
|
||||||
|
if (RwStreamFindChunk(stream, rwID_CLUMP, nil, nil))
|
||||||
|
gpPlayerClump = RpClumpStreamRead(stream);
|
||||||
|
|
||||||
|
RwStreamClose(stream, &mem);
|
||||||
|
RwFreeAlign(buffer);
|
||||||
|
|
||||||
|
if (streamWasAdded)
|
||||||
|
CdStreamRemoveImages();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CPlayerSkin::Initialise(void)
|
||||||
|
{
|
||||||
|
m_txdSlot = CTxdStore::AddTxdSlot("skin");
|
||||||
|
CTxdStore::Create(m_txdSlot);
|
||||||
|
CTxdStore::AddRef(m_txdSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CPlayerSkin::Shutdown(void)
|
||||||
|
{
|
||||||
|
CTxdStore::RemoveTxdSlot(m_txdSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
RwTexture *
|
||||||
|
CPlayerSkin::GetSkinTexture(const char *texName)
|
||||||
|
{
|
||||||
|
RwTexture *tex;
|
||||||
|
RwRaster *raster;
|
||||||
|
int32 width, height, depth, format;
|
||||||
|
|
||||||
|
CTxdStore::PushCurrentTxd();
|
||||||
|
CTxdStore::SetCurrentTxd(m_txdSlot);
|
||||||
|
tex = RwTextureRead(texName, NULL);
|
||||||
|
CTxdStore::PopCurrentTxd();
|
||||||
|
if (tex) return tex;
|
||||||
|
|
||||||
|
if (!strcmp(DEFAULT_SKIN_NAME, texName))
|
||||||
|
sprintf(gString, "models\\generic\\player.bmp");
|
||||||
|
else
|
||||||
|
sprintf(gString, "skins\\%s.bmp", texName);
|
||||||
|
|
||||||
|
if (RwImage *image = RtBMPImageRead(gString)) {
|
||||||
|
RwImageFindRasterFormat(image, rwRASTERTYPETEXTURE, &width, &height, &depth, &format);
|
||||||
|
raster = RwRasterCreate(width, height, depth, format);
|
||||||
|
RwRasterSetFromImage(raster, image);
|
||||||
|
|
||||||
|
tex = RwTextureCreate(raster);
|
||||||
|
RwTextureSetName(tex, texName);
|
||||||
|
RwTextureSetFilterMode(tex, rwFILTERLINEAR); // filtering bugfix from VC
|
||||||
|
RwTexDictionaryAddTexture(CTxdStore::GetSlot(m_txdSlot)->texDict, tex);
|
||||||
|
|
||||||
|
RwImageDestroy(image);
|
||||||
|
}
|
||||||
|
return tex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CPlayerSkin::BeginFrontendSkinEdit(void)
|
||||||
|
{
|
||||||
|
LoadPlayerDff();
|
||||||
|
RpClumpForAllAtomics(gpPlayerClump, CClumpModelInfo::SetAtomicRendererCB, CVisibilityPlugins::RenderPlayerCB);
|
||||||
|
CWorld::Players[0].LoadPlayerSkin();
|
||||||
|
gOldFov = CDraw::GetFOV();
|
||||||
|
CDraw::SetFOV(30.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CPlayerSkin::EndFrontendSkinEdit(void)
|
||||||
|
{
|
||||||
|
RpClumpDestroy(gpPlayerClump);
|
||||||
|
gpPlayerClump = NULL;
|
||||||
|
CDraw::SetFOV(gOldFov);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CPlayerSkin::RenderFrontendSkinEdit(void)
|
||||||
|
{
|
||||||
|
static float rotation = 0.0f;
|
||||||
|
RwRGBAReal AmbientColor = { 0.65f, 0.65f, 0.65f, 1.0f };
|
||||||
|
const RwV3d pos = { 1.35f, 0.35f, 7.725f };
|
||||||
|
const RwV3d axis1 = { 1.0f, 0.0f, 0.0f };
|
||||||
|
const RwV3d axis2 = { 0.0f, 0.0f, 1.0f };
|
||||||
|
static uint32 LastFlash = 0;
|
||||||
|
|
||||||
|
RwFrame *frame = RpClumpGetFrame(gpPlayerClump);
|
||||||
|
|
||||||
|
if (CTimer::GetTimeInMillisecondsPauseMode() - LastFlash > 7) {
|
||||||
|
rotation += 2.0f;
|
||||||
|
if (rotation > 360.0f)
|
||||||
|
rotation -= 360.0f;
|
||||||
|
LastFlash = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
|
}
|
||||||
|
RwFrameTransform(frame, RwFrameGetMatrix(RwCameraGetFrame(Scene.camera)), rwCOMBINEREPLACE);
|
||||||
|
RwFrameTranslate(frame, &pos, rwCOMBINEPRECONCAT);
|
||||||
|
RwFrameRotate(frame, &axis1, -90.0f, rwCOMBINEPRECONCAT);
|
||||||
|
RwFrameRotate(frame, &axis2, rotation, rwCOMBINEPRECONCAT);
|
||||||
|
RwFrameUpdateObjects(frame);
|
||||||
|
SetAmbientColours(&AmbientColor);
|
||||||
|
RpClumpRender(gpPlayerClump);
|
||||||
|
}
|
||||||
|
|
||||||
|
STARTPATCHES
|
||||||
|
InjectHook(0x59B9B0, &CPlayerSkin::Initialise, PATCH_JUMP);
|
||||||
|
InjectHook(0x59B9E0, &CPlayerSkin::Shutdown, PATCH_JUMP);
|
||||||
|
InjectHook(0x59B9F0, &CPlayerSkin::GetSkinTexture, PATCH_JUMP);
|
||||||
|
InjectHook(0x59BC70, &CPlayerSkin::BeginFrontendSkinEdit, PATCH_JUMP);
|
||||||
|
InjectHook(0x59BCB0, &CPlayerSkin::EndFrontendSkinEdit, PATCH_JUMP);
|
||||||
|
InjectHook(0x59BCE0, &CPlayerSkin::RenderFrontendSkinEdit, PATCH_JUMP);
|
||||||
|
ENDPATCHES
|
@ -1,7 +1,21 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#define DEFAULT_SKIN_NAME "$$\"\""
|
||||||
|
|
||||||
|
static RpClump *gpPlayerClump;// = *(RpClump**)0x660FF8;
|
||||||
|
static float gOldFov;// = *(float*)0x660FFC;
|
||||||
|
|
||||||
|
void LoadPlayerDff(void);
|
||||||
|
void FindPlayerDff(uint32 &offset, uint32 &size);
|
||||||
|
|
||||||
class CPlayerSkin
|
class CPlayerSkin
|
||||||
{
|
{
|
||||||
|
static int m_txdSlot;
|
||||||
public:
|
public:
|
||||||
static void BeginFrontEndSkinEdit();
|
static void Initialise();
|
||||||
|
static void Shutdown();
|
||||||
|
static RwTexture *GetSkinTexture(const char *texName);
|
||||||
|
static void BeginFrontendSkinEdit();
|
||||||
|
static void EndFrontendSkinEdit();
|
||||||
|
static void RenderFrontendSkinEdit();
|
||||||
};
|
};
|
@ -13,6 +13,7 @@ CDummyPool *&CPools::ms_pDummyPool = *(CDummyPool**)0x8F2C18;
|
|||||||
CAudioScriptObjectPool *&CPools::ms_pAudioScriptObjectPool = *(CAudioScriptObjectPool**)0x8F1B6C;
|
CAudioScriptObjectPool *&CPools::ms_pAudioScriptObjectPool = *(CAudioScriptObjectPool**)0x8F1B6C;
|
||||||
|
|
||||||
WRAPPER void CPools::Initialise(void) { EAXJMP(0x4A1770); }
|
WRAPPER void CPools::Initialise(void) { EAXJMP(0x4A1770); }
|
||||||
|
WRAPPER void CPools::MakeSureSlotInObjectPoolIsEmpty(int32 handle) { EAXJMP(0x4A2DB0); }
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
void
|
void
|
||||||
|
@ -49,4 +49,5 @@ public:
|
|||||||
static CVehicle *GetVehicle(int32 handle);
|
static CVehicle *GetVehicle(int32 handle);
|
||||||
static int32 GetObjectRef(CObject *object);
|
static int32 GetObjectRef(CObject *object);
|
||||||
static CObject *GetObject(int32 handle);
|
static CObject *GetObject(int32 handle);
|
||||||
|
static void MakeSureSlotInObjectPoolIsEmpty(int32 handle);
|
||||||
};
|
};
|
||||||
|
@ -16,8 +16,7 @@
|
|||||||
#include "Streaming.h"
|
#include "Streaming.h"
|
||||||
|
|
||||||
float &CRadar::m_RadarRange = *(float*)0x8E281C;
|
float &CRadar::m_RadarRange = *(float*)0x8E281C;
|
||||||
CBlip *CRadar::ms_RadarTrace = (CBlip*)0x6ED5E0;
|
CBlip (&CRadar::ms_RadarTrace)[NUMRADARBLIPS] = *(CBlip(*)[NUMRADARBLIPS]) * (uintptr*)0x6ED5E0;
|
||||||
|
|
||||||
CVector2D &vec2DRadarOrigin = *(CVector2D*)0x6299B8;
|
CVector2D &vec2DRadarOrigin = *(CVector2D*)0x6299B8;
|
||||||
int *gRadarTxdIds = (int*)0x6299C0;
|
int *gRadarTxdIds = (int*)0x6299C0;
|
||||||
|
|
||||||
@ -78,13 +77,13 @@ static_assert(RADAR_TILE_SIZE == (WORLD_SIZE_Y / RADAR_NUM_TILES), "CRadar: not
|
|||||||
#if 0
|
#if 0
|
||||||
WRAPPER void CRadar::CalculateBlipAlpha(float) { EAXJMP(0x4A4F90); }
|
WRAPPER void CRadar::CalculateBlipAlpha(float) { EAXJMP(0x4A4F90); }
|
||||||
#else
|
#else
|
||||||
int CRadar::CalculateBlipAlpha(float dist)
|
uint8 CRadar::CalculateBlipAlpha(float dist)
|
||||||
{
|
{
|
||||||
if (dist <= 1.0f)
|
if (dist <= 1.0f)
|
||||||
return 255;
|
return 255;
|
||||||
|
|
||||||
if (dist <= 5.0f)
|
if (dist <= 5.0f)
|
||||||
return (((1.0f - ((dist * 0.25f) - 0.25f)) * 255.0f) + (((dist * 0.25f) - 0.25f) * 128.0f));
|
return (128.0f * ((dist - 1.0f) / 4.0f)) + ((1.0f - (dist - 1.0f) / 4.0f) * 255.0f);
|
||||||
|
|
||||||
return 128;
|
return 128;
|
||||||
}
|
}
|
||||||
@ -109,18 +108,18 @@ void CRadar::ChangeBlipColour(int32 i, int32)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
WRAPPER void CRadar::ChangeBlipDisplay(int32, int16) { EAXJMP(0x4A5810); }
|
WRAPPER void CRadar::ChangeBlipDisplay(int32, eBlipDisplay) { EAXJMP(0x4A5810); }
|
||||||
#else
|
#else
|
||||||
void CRadar::ChangeBlipDisplay(int32 i, int16 flag)
|
void CRadar::ChangeBlipDisplay(int32 i, eBlipDisplay display)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
WRAPPER void CRadar::ChangeBlipScale(int32, int16) { EAXJMP(0x4A57E0); }
|
WRAPPER void CRadar::ChangeBlipScale(int32, int32) { EAXJMP(0x4A57E0); }
|
||||||
#else
|
#else
|
||||||
void CRadar::ChangeBlipScale(int32 i, int16 scale)
|
void CRadar::ChangeBlipScale(int32 i, int32 scale)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -136,17 +135,17 @@ void CRadar::ClearBlip(int32 i)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
WRAPPER void CRadar::ClearBlipForEntity(int16, int32) { EAXJMP(0x4A56C0); }
|
WRAPPER void CRadar::ClearBlipForEntity(eBlipType, int32) { EAXJMP(0x4A56C0); }
|
||||||
#else
|
#else
|
||||||
void CRadar::ClearBlipForEntity(int16 type, int32 id)
|
void CRadar::ClearBlipForEntity(eBlipType type, int32 id)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NUMRADARBLIPS; i++) {
|
for (int i = 0; i < NUMRADARBLIPS; i++) {
|
||||||
if (type == ms_RadarTrace[i].m_eBlipType && id == ms_RadarTrace[i].m_nEntityHandle) {
|
if (type == ms_RadarTrace[i].m_eBlipType && id == ms_RadarTrace[i].m_nEntityHandle) {
|
||||||
SetRadarMarkerState(i, 0);
|
SetRadarMarkerState(i, false);
|
||||||
ms_RadarTrace[i].m_bInUse = 0;
|
ms_RadarTrace[i].m_bInUse = false;
|
||||||
ms_RadarTrace[i].m_eBlipType = 0;
|
ms_RadarTrace[i].m_eBlipType = BLIP_NONE;
|
||||||
ms_RadarTrace[i].m_eBlipDisplay = 0;
|
ms_RadarTrace[i].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
||||||
ms_RadarTrace[i].m_IconID = 0;
|
ms_RadarTrace[i].m_IconID = RADAR_SPRITE_NONE;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -278,6 +277,10 @@ void CRadar::DrawBlips()
|
|||||||
float angle;
|
float angle;
|
||||||
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1)
|
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1)
|
||||||
angle = PI + FindPlayerHeading();
|
angle = PI + FindPlayerHeading();
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
else if (TheCamera.GetLookDirection() != LOOKING_FORWARD)
|
||||||
|
angle = FindPlayerHeading() - (PI + (TheCamera.Cams[TheCamera.ActiveCam].CamTargetEntity->GetPosition() - TheCamera.Cams[TheCamera.ActiveCam].SourceBeforeLookBehind).Heading());
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
angle = FindPlayerHeading() - (PI + TheCamera.GetForward().Heading());
|
angle = FindPlayerHeading() - (PI + TheCamera.GetForward().Heading());
|
||||||
|
|
||||||
@ -291,82 +294,224 @@ void CRadar::DrawBlips()
|
|||||||
TransformRadarPointToScreenSpace(out, in);
|
TransformRadarPointToScreenSpace(out, in);
|
||||||
DrawRadarSprite(RADAR_SPRITE_NORTH, out.x, out.y, 255);
|
DrawRadarSprite(RADAR_SPRITE_NORTH, out.x, out.y, 255);
|
||||||
|
|
||||||
/*
|
CEntity *blipEntity = nil;
|
||||||
DrawEntityBlip
|
for(int blipId = 0; blipId < NUMRADARBLIPS; blipId++) {
|
||||||
*/
|
if (!ms_RadarTrace[blipId].m_bInUse)
|
||||||
for (int i = 0; i < NUMRADARBLIPS; i++) {
|
continue;
|
||||||
if (ms_RadarTrace[i].m_bInUse) {
|
|
||||||
if (ms_RadarTrace[i].m_eBlipType <= BLIP_OBJECT) {
|
switch (ms_RadarTrace[blipId].m_eBlipType) {
|
||||||
CEntity *e = nil;
|
|
||||||
switch (ms_RadarTrace[i].m_eBlipType) {
|
|
||||||
case BLIP_CAR:
|
case BLIP_CAR:
|
||||||
e = CPools::GetVehiclePool()->GetAt(ms_RadarTrace[i].m_nEntityHandle);
|
case BLIP_CHAR:
|
||||||
|
case BLIP_OBJECT:
|
||||||
|
if (ms_RadarTrace[blipId].m_IconID == RADAR_SPRITE_BOMB || ms_RadarTrace[blipId].m_IconID == RADAR_SPRITE_SAVE
|
||||||
|
|| ms_RadarTrace[blipId].m_IconID == RADAR_SPRITE_SPRAY || ms_RadarTrace[blipId].m_IconID == RADAR_SPRITE_WEAPON) {
|
||||||
|
|
||||||
|
switch (ms_RadarTrace[blipId].m_eBlipType) {
|
||||||
|
case BLIP_CAR:
|
||||||
|
blipEntity = CPools::GetVehiclePool()->GetAt(ms_RadarTrace[blipId].m_nEntityHandle);
|
||||||
break;
|
break;
|
||||||
case BLIP_CHAR:
|
case BLIP_CHAR:
|
||||||
e = CPools::GetPedPool()->GetAt(ms_RadarTrace[i].m_nEntityHandle);
|
blipEntity = CPools::GetPedPool()->GetAt(ms_RadarTrace[blipId].m_nEntityHandle);
|
||||||
|
if (blipEntity && ((CPed*)blipEntity)->bInVehicle && ((CPed*)blipEntity)->m_pMyVehicle) {
|
||||||
|
blipEntity = ((CPed*)blipEntity)->m_pMyVehicle;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case BLIP_OBJECT:
|
case BLIP_OBJECT:
|
||||||
e = CPools::GetObjectPool()->GetAt(ms_RadarTrace[i].m_nEntityHandle);
|
blipEntity = CPools::GetObjectPool()->GetAt(ms_RadarTrace[blipId].m_nEntityHandle);
|
||||||
break;
|
break;
|
||||||
};
|
default:
|
||||||
|
break;
|
||||||
if (e) {
|
}
|
||||||
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
|
if (blipEntity) {
|
||||||
|
uint32 color = GetRadarTraceColour(ms_RadarTrace[blipId].m_nColor, ms_RadarTrace[blipId].m_bDim);
|
||||||
|
if (ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
|
||||||
if (CTheScripts::DbgFlag) {
|
if (CTheScripts::DbgFlag) {
|
||||||
ShowRadarMarker(e->GetPosition(), GetRadarTraceColour(ms_RadarTrace[i].m_nColor, ms_RadarTrace[i].m_bDim), ms_RadarTrace->m_Radius);
|
ShowRadarMarker(blipEntity->GetPosition(), color, ms_RadarTrace[blipId].m_Radius);
|
||||||
|
ms_RadarTrace[blipId].m_Radius = ms_RadarTrace[blipId].m_Radius - 0.1f;
|
||||||
ms_RadarTrace[i].m_Radius = ms_RadarTrace[i].m_Radius - 0.1f;
|
if (ms_RadarTrace[blipId].m_Radius < 1.0f)
|
||||||
if (ms_RadarTrace[i].m_Radius >= 1.0f)
|
ms_RadarTrace[blipId].m_Radius = 5.0f;
|
||||||
ms_RadarTrace[i].m_Radius = 5.0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BLIP_ONLY) {
|
if (ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BLIP_ONLY) {
|
||||||
vec2d = e->GetPosition();
|
TransformRealWorldPointToRadarSpace(in, blipEntity->GetPosition());
|
||||||
TransformRealWorldPointToRadarSpace(in, vec2d);
|
|
||||||
float dist = LimitRadarPoint(in);
|
float dist = LimitRadarPoint(in);
|
||||||
int a = CalculateBlipAlpha(dist);
|
|
||||||
TransformRadarPointToScreenSpace(out, in);
|
TransformRadarPointToScreenSpace(out, in);
|
||||||
|
if (ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_NONE) {
|
||||||
int32 col = GetRadarTraceColour(ms_RadarTrace[i].m_nColor, ms_RadarTrace[i].m_bDim);
|
DrawRadarSprite(ms_RadarTrace[blipId].m_IconID, out.x, out.y, CalculateBlipAlpha(dist));
|
||||||
|
} else {
|
||||||
if (ms_RadarTrace[i].m_IconID)
|
#ifdef TRIANGULAR_BLIPS
|
||||||
DrawRadarSprite(ms_RadarTrace[i].m_IconID, out.x, out.y, a);
|
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||||
else
|
CVector &blipPos = blipEntity->GetPosition();
|
||||||
ShowRadarTrace(out.x, out.y, ms_RadarTrace[i].m_wScale, ((col >> 24)), ((col >> 16) & 0xFF), ((col >> 8)), 255);
|
uint8 mode = BLIP_MODE_TRIANGULAR_UP;
|
||||||
|
if (blipPos.z - pos.z <= 2.0f) {
|
||||||
|
if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
|
||||||
|
else mode = BLIP_MODE_SQUARE;
|
||||||
|
}
|
||||||
|
ShowRadarTraceWithHeight(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255, mode);
|
||||||
|
#else
|
||||||
|
ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case BLIP_COORD:
|
||||||
|
case BLIP_CONTACT_POINT:
|
||||||
|
if ((ms_RadarTrace[blipId].m_IconID == RADAR_SPRITE_BOMB || ms_RadarTrace[blipId].m_IconID == RADAR_SPRITE_SAVE
|
||||||
|
|| ms_RadarTrace[blipId].m_IconID == RADAR_SPRITE_SPRAY || ms_RadarTrace[blipId].m_IconID == RADAR_SPRITE_WEAPON)
|
||||||
|
&& (ms_RadarTrace[blipId].m_eBlipType != BLIP_CONTACT_POINT || !CTheScripts::IsPlayerOnAMission())) {
|
||||||
|
|
||||||
/*
|
uint32 color = GetRadarTraceColour(ms_RadarTrace[blipId].m_nColor, ms_RadarTrace[blipId].m_bDim);
|
||||||
DrawCoordBlip
|
if (ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
|
||||||
*/
|
|
||||||
if (ms_RadarTrace[i].m_eBlipType >= BLIP_COORD) {
|
|
||||||
if (ms_RadarTrace[i].m_eBlipType != BLIP_CONTACT_POINT || ms_RadarTrace[i].m_eBlipType == BLIP_CONTACT_POINT && DisplayThisBlip(i) || !CTheScripts::IsPlayerOnAMission()) {
|
|
||||||
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
|
|
||||||
if (CTheScripts::DbgFlag) {
|
if (CTheScripts::DbgFlag) {
|
||||||
ShowRadarMarker(ms_RadarTrace[i].m_vecPos, GetRadarTraceColour(ms_RadarTrace[i].m_nColor, ms_RadarTrace[i].m_bDim), ms_RadarTrace->m_Radius);
|
ShowRadarMarker(ms_RadarTrace[blipId].m_vecPos, color, ms_RadarTrace[blipId].m_Radius);
|
||||||
ms_RadarTrace[i].m_Radius = ms_RadarTrace[i].m_Radius - 0.1f;
|
ms_RadarTrace[blipId].m_Radius = ms_RadarTrace[blipId].m_Radius - 0.1f;
|
||||||
if (ms_RadarTrace[i].m_Radius >= 1.0f)
|
if (ms_RadarTrace[blipId].m_Radius < 1.0f)
|
||||||
ms_RadarTrace[i].m_Radius = 5.0f;
|
ms_RadarTrace[blipId].m_Radius = 5.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BLIP_ONLY) {
|
||||||
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BLIP_ONLY) {
|
TransformRealWorldPointToRadarSpace(in, ms_RadarTrace[blipId].m_vec2DPos);
|
||||||
TransformRealWorldPointToRadarSpace(in, ms_RadarTrace[i].m_vec2DPos);
|
|
||||||
float dist = LimitRadarPoint(in);
|
float dist = LimitRadarPoint(in);
|
||||||
int a = CalculateBlipAlpha(dist);
|
|
||||||
TransformRadarPointToScreenSpace(out, in);
|
TransformRadarPointToScreenSpace(out, in);
|
||||||
|
if (ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_NONE) {
|
||||||
|
DrawRadarSprite(ms_RadarTrace[blipId].m_IconID, out.x, out.y, CalculateBlipAlpha(dist));
|
||||||
|
} else {
|
||||||
|
#ifdef TRIANGULAR_BLIPS
|
||||||
|
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||||
|
CVector &blipPos = ms_RadarTrace[blipId].m_vecPos;
|
||||||
|
uint8 mode = BLIP_MODE_TRIANGULAR_UP;
|
||||||
|
if (blipPos.z - pos.z <= 2.0f) {
|
||||||
|
if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
|
||||||
|
else mode = BLIP_MODE_SQUARE;
|
||||||
|
}
|
||||||
|
ShowRadarTraceWithHeight(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255, mode);
|
||||||
|
#else
|
||||||
|
ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(int blipId = 0; blipId < NUMRADARBLIPS; blipId++) {
|
||||||
|
if (!ms_RadarTrace[blipId].m_bInUse)
|
||||||
|
continue;
|
||||||
|
|
||||||
int32 col = GetRadarTraceColour(ms_RadarTrace[i].m_nColor, ms_RadarTrace[i].m_bDim);
|
switch (ms_RadarTrace[blipId].m_eBlipType) {
|
||||||
|
case BLIP_CAR:
|
||||||
|
case BLIP_CHAR:
|
||||||
|
case BLIP_OBJECT:
|
||||||
|
if (ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_BOMB && ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_SAVE
|
||||||
|
&& ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_SPRAY && ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_WEAPON) {
|
||||||
|
|
||||||
if (ms_RadarTrace[i].m_IconID)
|
switch (ms_RadarTrace[blipId].m_eBlipType) {
|
||||||
DrawRadarSprite(ms_RadarTrace[i].m_IconID, out.x, out.y, a);
|
case BLIP_CAR:
|
||||||
|
blipEntity = CPools::GetVehiclePool()->GetAt(ms_RadarTrace[blipId].m_nEntityHandle);
|
||||||
|
break;
|
||||||
|
case BLIP_CHAR:
|
||||||
|
blipEntity = CPools::GetPedPool()->GetAt(ms_RadarTrace[blipId].m_nEntityHandle);
|
||||||
|
if (blipEntity && ((CPed*)blipEntity)->bInVehicle && ((CPed*)blipEntity)->m_pMyVehicle) {
|
||||||
|
blipEntity = ((CPed*)blipEntity)->m_pMyVehicle;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case BLIP_OBJECT:
|
||||||
|
blipEntity = CPools::GetObjectPool()->GetAt(ms_RadarTrace[blipId].m_nEntityHandle);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (blipEntity) {
|
||||||
|
uint32 color = GetRadarTraceColour(ms_RadarTrace[blipId].m_nColor, ms_RadarTrace[blipId].m_bDim);
|
||||||
|
if (ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
|
||||||
|
if (CTheScripts::DbgFlag) {
|
||||||
|
ShowRadarMarker(blipEntity->GetPosition(), color, ms_RadarTrace[blipId].m_Radius);
|
||||||
|
ms_RadarTrace[blipId].m_Radius = ms_RadarTrace[blipId].m_Radius - 0.1f;
|
||||||
|
if (ms_RadarTrace[blipId].m_Radius < 1.0f)
|
||||||
|
ms_RadarTrace[blipId].m_Radius = 5.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BLIP_ONLY) {
|
||||||
|
TransformRealWorldPointToRadarSpace(in, blipEntity->GetPosition());
|
||||||
|
float dist = LimitRadarPoint(in);
|
||||||
|
TransformRadarPointToScreenSpace(out, in);
|
||||||
|
if (ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_NONE)
|
||||||
|
DrawRadarSprite(ms_RadarTrace[blipId].m_IconID, out.x, out.y, CalculateBlipAlpha(dist));
|
||||||
else
|
else
|
||||||
ShowRadarTrace(out.x, out.y, ms_RadarTrace[i].m_wScale, ((col >> 24)), ((col >> 16) & 0xFF), ((col >> 8)), 255);
|
#ifdef TRIANGULAR_BLIPS
|
||||||
|
{
|
||||||
|
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||||
|
CVector &blipPos = blipEntity->GetPosition();
|
||||||
|
uint8 mode = BLIP_MODE_TRIANGULAR_UP;
|
||||||
|
if (blipPos.z - pos.z <= 2.0f) {
|
||||||
|
if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
|
||||||
|
else mode = BLIP_MODE_SQUARE;
|
||||||
|
}
|
||||||
|
ShowRadarTraceWithHeight(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255, mode);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int blipId = 0; blipId < NUMRADARBLIPS; blipId++) {
|
||||||
|
if (!ms_RadarTrace[blipId].m_bInUse)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
switch (ms_RadarTrace[blipId].m_eBlipType) {
|
||||||
|
case BLIP_COORD:
|
||||||
|
case BLIP_CONTACT_POINT:
|
||||||
|
if (ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_BOMB && ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_SAVE
|
||||||
|
&& ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_SPRAY && ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_WEAPON
|
||||||
|
&& (ms_RadarTrace[blipId].m_eBlipType != BLIP_CONTACT_POINT || !CTheScripts::IsPlayerOnAMission())) {
|
||||||
|
|
||||||
|
uint32 color = GetRadarTraceColour(ms_RadarTrace[blipId].m_nColor, ms_RadarTrace[blipId].m_bDim);
|
||||||
|
if (ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
|
||||||
|
if (CTheScripts::DbgFlag) {
|
||||||
|
ShowRadarMarker(ms_RadarTrace[blipId].m_vecPos, color, ms_RadarTrace[blipId].m_Radius);
|
||||||
|
ms_RadarTrace[blipId].m_Radius = ms_RadarTrace[blipId].m_Radius - 0.1f;
|
||||||
|
if (ms_RadarTrace[blipId].m_Radius < 1.0f)
|
||||||
|
ms_RadarTrace[blipId].m_Radius = 5.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[blipId].m_eBlipDisplay == BLIP_DISPLAY_BLIP_ONLY) {
|
||||||
|
TransformRealWorldPointToRadarSpace(in, ms_RadarTrace[blipId].m_vec2DPos);
|
||||||
|
float dist = LimitRadarPoint(in);
|
||||||
|
TransformRadarPointToScreenSpace(out, in);
|
||||||
|
if (ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_NONE)
|
||||||
|
DrawRadarSprite(ms_RadarTrace[blipId].m_IconID, out.x, out.y, CalculateBlipAlpha(dist));
|
||||||
|
else
|
||||||
|
#ifdef TRIANGULAR_BLIPS
|
||||||
|
{
|
||||||
|
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||||
|
CVector &blipPos = ms_RadarTrace[blipId].m_vecPos;
|
||||||
|
uint8 mode = BLIP_MODE_TRIANGULAR_UP;
|
||||||
|
if (blipPos.z - pos.z <= 2.0f) {
|
||||||
|
if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
|
||||||
|
else mode = BLIP_MODE_SQUARE;
|
||||||
|
}
|
||||||
|
ShowRadarTraceWithHeight(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255, mode);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -531,9 +676,9 @@ void CRadar::DrawRadarSection(int32 x, int32 y)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
WRAPPER void CRadar::DrawRadarSprite(int32 sprite, float x, float y, int32 alpha) { EAXJMP(0x4A5EF0); }
|
WRAPPER void CRadar::DrawRadarSprite(uint16 sprite, float x, float y, uint8 alpha) { EAXJMP(0x4A5EF0); }
|
||||||
#else
|
#else
|
||||||
void CRadar::DrawRadarSprite(int32 sprite, float x, float y, int32 alpha)
|
void CRadar::DrawRadarSprite(uint16 sprite, float x, float y, uint8 alpha)
|
||||||
{
|
{
|
||||||
RadarSprites[sprite]->Draw(CRect(x - SCREEN_SCALE_X(8.0f), y - SCREEN_SCALE_Y(8.0f), x + SCREEN_SCALE_X(8.0f), y + SCREEN_SCALE_Y(8.0f)), CRGBA(255, 255, 255, alpha));
|
RadarSprites[sprite]->Draw(CRect(x - SCREEN_SCALE_X(8.0f), y - SCREEN_SCALE_Y(8.0f), x + SCREEN_SCALE_X(8.0f), y + SCREEN_SCALE_Y(8.0f)), CRGBA(255, 255, 255, alpha));
|
||||||
}
|
}
|
||||||
@ -570,12 +715,17 @@ void CRadar::DrawRotatingRadarSprite(CSprite2d* sprite, float x, float y, float
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 0
|
||||||
WRAPPER int32 CRadar::GetActualBlipArrayIndex(int32) { EAXJMP(0x4A41C0); }
|
WRAPPER int32 CRadar::GetActualBlipArrayIndex(int32) { EAXJMP(0x4A41C0); }
|
||||||
#else
|
#else
|
||||||
int32 CRadar::GetActualBlipArrayIndex(int32 i)
|
int32 CRadar::GetActualBlipArrayIndex(int32 i)
|
||||||
{
|
{
|
||||||
return int32();
|
if (i == -1)
|
||||||
|
return -1;
|
||||||
|
else if ((i & 0xFFFF0000) >> 16 != ms_RadarTrace[(uint16)i].m_BlipIndex)
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
|
return (uint16)i;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -589,9 +739,9 @@ int32 CRadar::GetNewUniqueBlipIndex(int32 i)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
WRAPPER int32 CRadar::GetRadarTraceColour(int32 color, bool bright) { EAXJMP(0x4A5BB0); }
|
WRAPPER uint32 CRadar::GetRadarTraceColour(uint32 color, bool bright) { EAXJMP(0x4A5BB0); }
|
||||||
#else
|
#else
|
||||||
int32 CRadar::GetRadarTraceColour(int32 color, bool bright)
|
uint32 CRadar::GetRadarTraceColour(uint32 color, bool bright)
|
||||||
{
|
{
|
||||||
int32 c;
|
int32 c;
|
||||||
switch (color) {
|
switch (color) {
|
||||||
@ -605,13 +755,13 @@ int32 CRadar::GetRadarTraceColour(int32 color, bool bright)
|
|||||||
if (bright)
|
if (bright)
|
||||||
c = 0x5FA06AFF;
|
c = 0x5FA06AFF;
|
||||||
else
|
else
|
||||||
c = 0x7F00FF;
|
c = 0x007F00FF;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (bright)
|
if (bright)
|
||||||
c = 0x80A7F3FF;
|
c = 0x80A7F3FF;
|
||||||
else
|
else
|
||||||
c = 0x007FFF;
|
c = 0x00007FFF;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (bright)
|
if (bright)
|
||||||
@ -633,9 +783,9 @@ int32 CRadar::GetRadarTraceColour(int32 color, bool bright)
|
|||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (bright)
|
if (bright)
|
||||||
c = 0xFFFFFF;
|
c = 0x00FFFFFF;
|
||||||
else
|
else
|
||||||
c = 0x7F7FFF;
|
c = 0x007F7FFF;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
c = color;
|
c = color;
|
||||||
@ -727,37 +877,70 @@ void CRadar::SaveAllRadarBlips(int32)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 0
|
||||||
WRAPPER void CRadar::SetBlipSprite(int32, int32) { EAXJMP(0x4A5840); }
|
WRAPPER void CRadar::SetBlipSprite(int32, int32) { EAXJMP(0x4A5840); }
|
||||||
#else
|
#else
|
||||||
void CRadar::SetBlipSprite(int32 i, int32 icon)
|
void CRadar::SetBlipSprite(int32 i, int32 icon)
|
||||||
{
|
{
|
||||||
|
int index = CRadar::GetActualBlipArrayIndex(i);
|
||||||
|
if (index != -1) {
|
||||||
|
ms_RadarTrace[index].m_IconID = icon;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
WRAPPER int32 CRadar::SetCoordBlip(eBlipType, CVector, int32, eBlipDisplay) { EAXJMP(0x4A5590); }
|
|
||||||
#else
|
|
||||||
int CRadar::SetCoordBlip(eBlipType type, CVector pos, int32 flag, eBlipDisplay)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
WRAPPER int CRadar::SetEntityBlip(eBlipType type, int32, int32, eBlipDisplay) { EAXJMP(0x4A5640); }
|
|
||||||
#else
|
|
||||||
int CRadar::SetEntityBlip(eBlipType type, int32, int32, eBlipDisplay)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
WRAPPER void CRadar::SetRadarMarkerState(int32, int32) { EAXJMP(0x4A5C60); }
|
WRAPPER int32 CRadar::SetCoordBlip(eBlipType, CVector, int32, eBlipDisplay display) { EAXJMP(0x4A5590); }
|
||||||
#else
|
#else
|
||||||
void CRadar::SetRadarMarkerState(int32 counter, int32 flag)
|
int CRadar::SetCoordBlip(eBlipType type, CVector pos, int32 color, eBlipDisplay display)
|
||||||
|
{
|
||||||
|
int nextBlip;
|
||||||
|
for (nextBlip = 0; nextBlip < NUMRADARBLIPS; nextBlip++) {
|
||||||
|
if (!ms_RadarTrace[nextBlip].m_bInUse)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ms_RadarTrace[nextBlip].m_eBlipType = type;
|
||||||
|
ms_RadarTrace[nextBlip].m_nColor = color;
|
||||||
|
ms_RadarTrace[nextBlip].m_bDim = 1;
|
||||||
|
ms_RadarTrace[nextBlip].m_bInUse = 1;
|
||||||
|
ms_RadarTrace[nextBlip].m_Radius = 1.0f;
|
||||||
|
ms_RadarTrace[nextBlip].m_vec2DPos = pos;
|
||||||
|
ms_RadarTrace[nextBlip].m_vecPos = pos;
|
||||||
|
ms_RadarTrace[nextBlip].m_nEntityHandle = 0;
|
||||||
|
ms_RadarTrace[nextBlip].m_wScale = 1;
|
||||||
|
ms_RadarTrace[nextBlip].m_eBlipDisplay = display;
|
||||||
|
ms_RadarTrace[nextBlip].m_IconID = RADAR_SPRITE_NONE;
|
||||||
|
return CRadar::GetNewUniqueBlipIndex(nextBlip);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
WRAPPER int CRadar::SetEntityBlip(eBlipType type, int32, int32, eBlipDisplay) { EAXJMP(0x4A5640); }
|
||||||
|
#else
|
||||||
|
int CRadar::SetEntityBlip(eBlipType type, int32 handle, int32 color, eBlipDisplay display)
|
||||||
|
{
|
||||||
|
int nextBlip;
|
||||||
|
for (nextBlip = 0; nextBlip < NUMRADARBLIPS; nextBlip++) {
|
||||||
|
if (!ms_RadarTrace[nextBlip].m_bInUse)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ms_RadarTrace[nextBlip].m_eBlipType = type;
|
||||||
|
ms_RadarTrace[nextBlip].m_nColor = color;
|
||||||
|
ms_RadarTrace[nextBlip].m_bDim = 1;
|
||||||
|
ms_RadarTrace[nextBlip].m_bInUse = 1;
|
||||||
|
ms_RadarTrace[nextBlip].m_Radius = 1.0f;
|
||||||
|
ms_RadarTrace[nextBlip].m_nEntityHandle = handle;
|
||||||
|
ms_RadarTrace[nextBlip].m_wScale = 1;
|
||||||
|
ms_RadarTrace[nextBlip].m_eBlipDisplay = display;
|
||||||
|
ms_RadarTrace[nextBlip].m_IconID = RADAR_SPRITE_NONE;
|
||||||
|
return CRadar::GetNewUniqueBlipIndex(nextBlip);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
WRAPPER void CRadar::SetRadarMarkerState(int32, bool) { EAXJMP(0x4A5C60); }
|
||||||
|
#else
|
||||||
|
void CRadar::SetRadarMarkerState(int32 counter, bool flag)
|
||||||
{
|
{
|
||||||
CEntity *e;
|
CEntity *e;
|
||||||
switch (ms_RadarTrace[counter].m_eBlipType) {
|
switch (ms_RadarTrace[counter].m_eBlipType) {
|
||||||
@ -780,11 +963,11 @@ void CRadar::SetRadarMarkerState(int32 counter, int32 flag)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
WRAPPER void CRadar::ShowRadarMarker(CVector pos, int16 color, float radius) { EAXJMP(0x4A59C0); }
|
WRAPPER void CRadar::ShowRadarMarker(CVector pos, uint32 color, float radius) { EAXJMP(0x4A59C0); }
|
||||||
#else
|
#else
|
||||||
void CRadar::ShowRadarMarker(CVector pos, int16 color, float radius) {
|
void CRadar::ShowRadarMarker(CVector pos, uint32 color, float radius) {
|
||||||
float f1 = radius * 0.5f;
|
float f1 = radius * 1.4f;
|
||||||
float f2 = radius * 1.4f;
|
float f2 = radius * 0.5f;
|
||||||
CVector p1, p2;
|
CVector p1, p2;
|
||||||
|
|
||||||
p1 = pos + TheCamera.GetUp()*f1;
|
p1 = pos + TheCamera.GetUp()*f1;
|
||||||
@ -806,15 +989,42 @@ void CRadar::ShowRadarMarker(CVector pos, int16 color, float radius) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
WRAPPER void CRadar::ShowRadarTrace(float x, float y, uint32 size, uint32 red, uint32 green, uint32 blue, uint32 alpha) { EAXJMP(0x4A5870); }
|
WRAPPER void CRadar::ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha) { EAXJMP(0x4A5870); }
|
||||||
#else
|
#else
|
||||||
void CRadar::ShowRadarTrace(float x, float y, uint32 size, uint32 red, uint32 green, uint32 blue, uint32 alpha)
|
void CRadar::ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha)
|
||||||
{
|
{
|
||||||
|
if (!CHud::m_Wants_To_Draw_Hud || TheCamera.m_WideScreenOn)
|
||||||
|
return;
|
||||||
|
|
||||||
CSprite2d::DrawRect(CRect(x - SCREEN_SCALE_X(size + 1.0f), y - SCREEN_SCALE_Y(size + 1.0f), SCREEN_SCALE_X(size + 1.0f) + x, SCREEN_SCALE_Y(size + 1.0f) + y), CRGBA(0, 0, 0, alpha));
|
CSprite2d::DrawRect(CRect(x - SCREEN_SCALE_X(size + 1.0f), y - SCREEN_SCALE_Y(size + 1.0f), SCREEN_SCALE_X(size + 1.0f) + x, SCREEN_SCALE_Y(size + 1.0f) + y), CRGBA(0, 0, 0, alpha));
|
||||||
CSprite2d::DrawRect(CRect(x - SCREEN_SCALE_X(size), y - SCREEN_SCALE_Y(size), SCREEN_SCALE_X(size) + x, SCREEN_SCALE_Y(size) + y), CRGBA(red, green, blue, alpha));
|
CSprite2d::DrawRect(CRect(x - SCREEN_SCALE_X(size), y - SCREEN_SCALE_Y(size), SCREEN_SCALE_X(size) + x, SCREEN_SCALE_Y(size) + y), CRGBA(red, green, blue, alpha));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void CRadar::ShowRadarTraceWithHeight(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha, uint8 mode)
|
||||||
|
{
|
||||||
|
if (!CHud::m_Wants_To_Draw_Hud || TheCamera.m_WideScreenOn)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
case BLIP_MODE_TRIANGULAR_UP:
|
||||||
|
// size++; // VC does size + 1 for triangles
|
||||||
|
CSprite2d::Draw2DPolygon(x + SCREEN_SCALE_X(size + 3.0f), y + SCREEN_SCALE_Y(size + 2.0f), x - (SCREEN_SCALE_X(size + 3.0f)), y + SCREEN_SCALE_Y(size + 2.0f), x, y - (SCREEN_SCALE_Y(size + 3.0f)), x, y - (SCREEN_SCALE_Y(size + 3.0f)), CRGBA(0, 0, 0, alpha));
|
||||||
|
CSprite2d::Draw2DPolygon(x + SCREEN_SCALE_X(size + 1.0f), y + SCREEN_SCALE_Y(size + 1.0f), x - (SCREEN_SCALE_X(size + 1.0f)), y + SCREEN_SCALE_Y(size + 1.0f), x, y - (SCREEN_SCALE_Y(size + 1.0f)), x, y - (SCREEN_SCALE_Y(size + 1.0f)), CRGBA(red, green, blue, alpha));
|
||||||
|
break;
|
||||||
|
case BLIP_MODE_TRIANGULAR_DOWN:
|
||||||
|
// size++; // VC does size + 1 for triangles
|
||||||
|
CSprite2d::Draw2DPolygon(x, y + SCREEN_SCALE_Y(size + 2.0f), x, y + SCREEN_SCALE_Y(size + 3.0f), x + SCREEN_SCALE_X(size + 3.0f), y - (SCREEN_SCALE_Y(size + 2.0f)), x - (SCREEN_SCALE_X(size + 3.0f)), y - (SCREEN_SCALE_Y(size + 2.0f)), CRGBA(0, 0, 0, alpha));
|
||||||
|
CSprite2d::Draw2DPolygon(x, y + SCREEN_SCALE_Y(size + 1.0f), x, y + SCREEN_SCALE_Y(size + 1.0f), x + SCREEN_SCALE_X(size + 1.0f), y - (SCREEN_SCALE_Y(size + 1.0f)), x - (SCREEN_SCALE_X(size + 1.0f)), y - (SCREEN_SCALE_Y(size + 1.0f)), CRGBA(red, green, blue, alpha));
|
||||||
|
break;
|
||||||
|
case BLIP_MODE_SQUARE:
|
||||||
|
CSprite2d::DrawRect(CRect(x - SCREEN_SCALE_X(size + 1.0f), y - SCREEN_SCALE_Y(size + 1.0f), SCREEN_SCALE_X(size + 1.0f) + x, SCREEN_SCALE_Y(size + 1.0f) + y), CRGBA(0, 0, 0, alpha));
|
||||||
|
CSprite2d::DrawRect(CRect(x - SCREEN_SCALE_X(size), y - SCREEN_SCALE_Y(size), SCREEN_SCALE_X(size) + x, SCREEN_SCALE_Y(size) + y), CRGBA(red, green, blue, alpha));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
WRAPPER void CRadar::Shutdown() { EAXJMP(0x4A3F60); }
|
WRAPPER void CRadar::Shutdown() { EAXJMP(0x4A3F60); }
|
||||||
#else
|
#else
|
||||||
@ -1076,7 +1286,7 @@ STARTPATCHES
|
|||||||
// InjectHook(0x4A3F60, CRadar::Shutdown, PATCH_JUMP);
|
// InjectHook(0x4A3F60, CRadar::Shutdown, PATCH_JUMP);
|
||||||
// InjectHook(0x4A4030, CRadar::LoadTextures, PATCH_JUMP);
|
// InjectHook(0x4A4030, CRadar::LoadTextures, PATCH_JUMP);
|
||||||
// InjectHook(0x4A4180, CRadar::GetNewUniqueBlipIndex, PATCH_JUMP);
|
// InjectHook(0x4A4180, CRadar::GetNewUniqueBlipIndex, PATCH_JUMP);
|
||||||
// InjectHook(0x4A41C0, CRadar::GetActualBlipArrayIndex, PATCH_JUMP);
|
InjectHook(0x4A41C0, CRadar::GetActualBlipArrayIndex, PATCH_JUMP);
|
||||||
InjectHook(0x4A4200, CRadar::DrawMap, PATCH_JUMP);
|
InjectHook(0x4A4200, CRadar::DrawMap, PATCH_JUMP);
|
||||||
InjectHook(0x4A42F0, CRadar::DrawBlips, PATCH_JUMP);
|
InjectHook(0x4A42F0, CRadar::DrawBlips, PATCH_JUMP);
|
||||||
// InjectHook(0x4A4C70, CRadar::Draw3dMarkers, PATCH_JUMP);
|
// InjectHook(0x4A4C70, CRadar::Draw3dMarkers, PATCH_JUMP);
|
||||||
@ -1086,18 +1296,18 @@ STARTPATCHES
|
|||||||
InjectHook(0x4A50D0, CRadar::TransformRealWorldPointToRadarSpace, PATCH_JUMP);
|
InjectHook(0x4A50D0, CRadar::TransformRealWorldPointToRadarSpace, PATCH_JUMP);
|
||||||
InjectHook(0x4A5300, CRadar::TransformRadarPointToRealWorldSpace, PATCH_JUMP);
|
InjectHook(0x4A5300, CRadar::TransformRadarPointToRealWorldSpace, PATCH_JUMP);
|
||||||
InjectHook(0x4A5530, CRadar::TransformRealWorldToTexCoordSpace, PATCH_JUMP);
|
InjectHook(0x4A5530, CRadar::TransformRealWorldToTexCoordSpace, PATCH_JUMP);
|
||||||
// InjectHook(0x4A5590, CRadar::SetCoordBlip, PATCH_JUMP);
|
InjectHook(0x4A5590, CRadar::SetCoordBlip, PATCH_JUMP);
|
||||||
// InjectHook(0x4A5640, CRadar::SetEntityBlip, PATCH_JUMP);
|
InjectHook(0x4A5640, CRadar::SetEntityBlip, PATCH_JUMP);
|
||||||
InjectHook(0x4A56C0, CRadar::ClearBlipForEntity, PATCH_JUMP);
|
InjectHook(0x4A56C0, CRadar::ClearBlipForEntity, PATCH_JUMP);
|
||||||
// InjectHook(0x4A5720, CRadar::ClearBlip, PATCH_JUMP);
|
// InjectHook(0x4A5720, CRadar::ClearBlip, PATCH_JUMP);
|
||||||
// InjectHook(0x4A5770, CRadar::ChangeBlipColour, PATCH_JUMP);
|
// InjectHook(0x4A5770, CRadar::ChangeBlipColour, PATCH_JUMP);
|
||||||
// InjectHook(0x4A57A0, CRadar::ChangeBlipBrightness, PATCH_JUMP);
|
// InjectHook(0x4A57A0, CRadar::ChangeBlipBrightness, PATCH_JUMP);
|
||||||
// InjectHook(0x4A57E0, CRadar::ChangeBlipScale, PATCH_JUMP);
|
// InjectHook(0x4A57E0, CRadar::ChangeBlipScale, PATCH_JUMP);
|
||||||
// InjectHook(0x4A5810, CRadar::ChangeBlipDisplay, PATCH_JUMP);
|
// InjectHook(0x4A5810, CRadar::ChangeBlipDisplay, PATCH_JUMP);
|
||||||
// InjectHook(0x4A5840, CRadar::SetBlipSprite, PATCH_JUMP);
|
InjectHook(0x4A5840, CRadar::SetBlipSprite, PATCH_JUMP);
|
||||||
InjectHook(0x4A5870, CRadar::ShowRadarTrace, PATCH_JUMP);
|
InjectHook(0x4A5870, CRadar::ShowRadarTrace, PATCH_JUMP);
|
||||||
InjectHook(0x4A59C0, CRadar::ShowRadarMarker, PATCH_JUMP);
|
InjectHook(0x4A59C0, CRadar::ShowRadarMarker, PATCH_JUMP);
|
||||||
//InjectHook(0x4A5BB0, CRadar::GetRadarTraceColour, PATCH_JUMP);
|
InjectHook(0x4A5BB0, CRadar::GetRadarTraceColour, PATCH_JUMP);
|
||||||
InjectHook(0x4A5C60, CRadar::SetRadarMarkerState, PATCH_JUMP);
|
InjectHook(0x4A5C60, CRadar::SetRadarMarkerState, PATCH_JUMP);
|
||||||
InjectHook(0x4A5D10, CRadar::DrawRotatingRadarSprite, PATCH_JUMP);
|
InjectHook(0x4A5D10, CRadar::DrawRotatingRadarSprite, PATCH_JUMP);
|
||||||
InjectHook(0x4A5EF0, CRadar::DrawRadarSprite, PATCH_JUMP);
|
InjectHook(0x4A5EF0, CRadar::DrawRadarSprite, PATCH_JUMP);
|
||||||
|
@ -45,10 +45,17 @@ enum eRadarSprite
|
|||||||
RADAR_SPRITE_COUNT = 21,
|
RADAR_SPRITE_COUNT = 21,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
BLIP_MODE_TRIANGULAR_UP = 0,
|
||||||
|
BLIP_MODE_TRIANGULAR_DOWN,
|
||||||
|
BLIP_MODE_SQUARE,
|
||||||
|
};
|
||||||
|
|
||||||
struct CBlip
|
struct CBlip
|
||||||
{
|
{
|
||||||
int32 m_nColor;
|
uint32 m_nColor;
|
||||||
int16 m_eBlipType; // eBlipType
|
uint16 m_eBlipType; // eBlipType
|
||||||
int32 m_nEntityHandle;
|
int32 m_nEntityHandle;
|
||||||
CVector2D m_vec2DPos;
|
CVector2D m_vec2DPos;
|
||||||
CVector m_vecPos;
|
CVector m_vecPos;
|
||||||
@ -57,8 +64,8 @@ struct CBlip
|
|||||||
bool m_bInUse;
|
bool m_bInUse;
|
||||||
float m_Radius;
|
float m_Radius;
|
||||||
int16 m_wScale;
|
int16 m_wScale;
|
||||||
int16 m_eBlipDisplay; // eBlipDisplay
|
uint16 m_eBlipDisplay; // eBlipDisplay
|
||||||
int16 m_IconID; // eRadarSprite
|
uint16 m_IconID; // eRadarSprite
|
||||||
};
|
};
|
||||||
static_assert(sizeof(CBlip) == 0x30, "CBlip: error");
|
static_assert(sizeof(CBlip) == 0x30, "CBlip: error");
|
||||||
|
|
||||||
@ -72,7 +79,7 @@ class CRadar
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static float &m_RadarRange;
|
static float &m_RadarRange;
|
||||||
static CBlip *ms_RadarTrace; //[NUMRADARBLIPS]
|
static CBlip (&ms_RadarTrace)[NUMRADARBLIPS];
|
||||||
static CSprite2d *AsukaSprite;
|
static CSprite2d *AsukaSprite;
|
||||||
static CSprite2d *BombSprite;
|
static CSprite2d *BombSprite;
|
||||||
static CSprite2d *CatSprite;
|
static CSprite2d *CatSprite;
|
||||||
@ -96,13 +103,13 @@ public:
|
|||||||
static CSprite2d *RadarSprites[21];
|
static CSprite2d *RadarSprites[21];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static int CalculateBlipAlpha(float dist);
|
static uint8 CalculateBlipAlpha(float dist);
|
||||||
static void ChangeBlipBrightness(int32 i, int32 bright);
|
static void ChangeBlipBrightness(int32 i, int32 bright);
|
||||||
static void ChangeBlipColour(int32 i, int32);
|
static void ChangeBlipColour(int32 i, int32);
|
||||||
static void ChangeBlipDisplay(int32 i, int16 flag);
|
static void ChangeBlipDisplay(int32 i, eBlipDisplay display);
|
||||||
static void ChangeBlipScale(int32 i, int16 scale);
|
static void ChangeBlipScale(int32 i, int32 scale);
|
||||||
static void ClearBlip(int32 i);
|
static void ClearBlip(int32 i);
|
||||||
static void ClearBlipForEntity(int16 type, int32 id);
|
static void ClearBlipForEntity(eBlipType type, int32 id);
|
||||||
static int ClipRadarPoly(CVector2D *out, const CVector2D *in);
|
static int ClipRadarPoly(CVector2D *out, const CVector2D *in);
|
||||||
static bool DisplayThisBlip(int32 i);
|
static bool DisplayThisBlip(int32 i);
|
||||||
static void Draw3dMarkers();
|
static void Draw3dMarkers();
|
||||||
@ -111,11 +118,11 @@ public:
|
|||||||
static void DrawRadarMap();
|
static void DrawRadarMap();
|
||||||
static void DrawRadarMask();
|
static void DrawRadarMask();
|
||||||
static void DrawRadarSection(int32 x, int32 y);
|
static void DrawRadarSection(int32 x, int32 y);
|
||||||
static void DrawRadarSprite(int32 sprite, float x, float y, int32 alpha);
|
static void DrawRadarSprite(uint16 sprite, float x, float y, uint8 alpha);
|
||||||
static void DrawRotatingRadarSprite(CSprite2d* sprite, float x, float y, float angle, int32 alpha);
|
static void DrawRotatingRadarSprite(CSprite2d* sprite, float x, float y, float angle, int32 alpha);
|
||||||
static int32 GetActualBlipArrayIndex(int32 i);
|
static int32 GetActualBlipArrayIndex(int32 i);
|
||||||
static int32 GetNewUniqueBlipIndex(int32 i);
|
static int32 GetNewUniqueBlipIndex(int32 i);
|
||||||
static int32 GetRadarTraceColour(int32 color, bool bright);
|
static uint32 GetRadarTraceColour(uint32 color, bool bright);
|
||||||
static void Initialise();
|
static void Initialise();
|
||||||
static float LimitRadarPoint(CVector2D &point);
|
static float LimitRadarPoint(CVector2D &point);
|
||||||
static void LoadAllRadarBlips(int32);
|
static void LoadAllRadarBlips(int32);
|
||||||
@ -125,11 +132,12 @@ public:
|
|||||||
static void RequestMapSection(int32 x, int32 y);
|
static void RequestMapSection(int32 x, int32 y);
|
||||||
static void SaveAllRadarBlips(int32);
|
static void SaveAllRadarBlips(int32);
|
||||||
static void SetBlipSprite(int32 i, int32 icon);
|
static void SetBlipSprite(int32 i, int32 icon);
|
||||||
static int32 SetCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay flag);
|
static int32 SetCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay);
|
||||||
static int32 SetEntityBlip(eBlipType type, int32, int32, eBlipDisplay);
|
static int32 SetEntityBlip(eBlipType type, int32, int32, eBlipDisplay);
|
||||||
static void SetRadarMarkerState(int32 i, int32 flag);
|
static void SetRadarMarkerState(int32 i, bool flag);
|
||||||
static void ShowRadarMarker(CVector pos, int16 color, float radius);
|
static void ShowRadarMarker(CVector pos, uint32 color, float radius);
|
||||||
static void ShowRadarTrace(float x, float y, uint32 size, uint32 red, uint32 green, uint32 blue, uint32 alpha);
|
static void ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha);
|
||||||
|
static void ShowRadarTraceWithHeight(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha, uint8 mode);
|
||||||
static void Shutdown();
|
static void Shutdown();
|
||||||
static void StreamRadarSections(const CVector &posn);
|
static void StreamRadarSections(const CVector &posn);
|
||||||
static void StreamRadarSections(int32 x, int32 y);
|
static void StreamRadarSections(int32 x, int32 y);
|
||||||
|
@ -1021,7 +1021,7 @@ CStreaming::RemoveAllUnusedModels(void)
|
|||||||
for(i = 0; i < MAXVEHICLESLOADED; i++)
|
for(i = 0; i < MAXVEHICLESLOADED; i++)
|
||||||
RemoveLoadedVehicle();
|
RemoveLoadedVehicle();
|
||||||
|
|
||||||
for(i = NUM_DEFAULT_MODELS; i < MODELINFOSIZE; i++){
|
for(i = NUMDEFAULTMODELS; i < MODELINFOSIZE; i++){
|
||||||
if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED &&
|
if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED &&
|
||||||
ms_aInfoForModel[i].m_flags & STREAMFLAGS_DONT_REMOVE &&
|
ms_aInfoForModel[i].m_flags & STREAMFLAGS_DONT_REMOVE &&
|
||||||
CModelInfo::GetModelInfo(i)->m_refCount == 0){
|
CModelInfo::GetModelInfo(i)->m_refCount == 0){
|
||||||
@ -1719,8 +1719,10 @@ CStreaming::RetryLoadFile(int32 ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch(ms_channel[ch].state){
|
switch(ms_channel[ch].state){
|
||||||
|
case CHANNELSTATE_ERROR:
|
||||||
|
ms_channel[ch].numTries++;
|
||||||
|
if (CdStreamGetStatus(ch) == STREAM_READING || CdStreamGetStatus(ch) == STREAM_WAITING) break;
|
||||||
case CHANNELSTATE_IDLE:
|
case CHANNELSTATE_IDLE:
|
||||||
streamread:
|
|
||||||
CdStreamRead(ch, ms_pStreamingBuffer[ch], ms_channel[ch].position, ms_channel[ch].size);
|
CdStreamRead(ch, ms_pStreamingBuffer[ch], ms_channel[ch].position, ms_channel[ch].size);
|
||||||
ms_channel[ch].state = CHANNELSTATE_READING;
|
ms_channel[ch].state = CHANNELSTATE_READING;
|
||||||
ms_channel[ch].field24 = -600;
|
ms_channel[ch].field24 = -600;
|
||||||
@ -1731,11 +1733,6 @@ streamread:
|
|||||||
CTimer::SetCodePause(false);
|
CTimer::SetCodePause(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CHANNELSTATE_ERROR:
|
|
||||||
ms_channel[ch].numTries++;
|
|
||||||
if(CdStreamGetStatus(ch) != STREAM_READING && CdStreamGetStatus(ch) != STREAM_WAITING)
|
|
||||||
goto streamread;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2408,8 +2405,8 @@ CStreaming::MemoryCardSave(uint8 *buffer, uint32 *length)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
*length = NUM_DEFAULT_MODELS;
|
*length = NUMDEFAULTMODELS;
|
||||||
for(i = 0; i < NUM_DEFAULT_MODELS; i++)
|
for(i = 0; i < NUMDEFAULTMODELS; i++)
|
||||||
if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED)
|
if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED)
|
||||||
buffer[i] = ms_aInfoForModel[i].m_flags;
|
buffer[i] = ms_aInfoForModel[i].m_flags;
|
||||||
else
|
else
|
||||||
@ -2421,7 +2418,7 @@ CStreaming::MemoryCardLoad(uint8 *buffer, uint32 length)
|
|||||||
{
|
{
|
||||||
uint32 i;
|
uint32 i;
|
||||||
|
|
||||||
assert(length == NUM_DEFAULT_MODELS);
|
assert(length == NUMDEFAULTMODELS);
|
||||||
for(i = 0; i < length; i++)
|
for(i = 0; i < length; i++)
|
||||||
if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED)
|
if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED)
|
||||||
if(buffer[i] != 0xFF)
|
if(buffer[i] != 0xFF)
|
||||||
|
@ -10,7 +10,7 @@ CColModel &CTempColModels::ms_colModelWheel1 = *(CColModel*)0x878C40;
|
|||||||
CColModel &CTempColModels::ms_colModelPanel1 = *(CColModel*)0x87BDD8;
|
CColModel &CTempColModels::ms_colModelPanel1 = *(CColModel*)0x87BDD8;
|
||||||
CColModel &CTempColModels::ms_colModelBodyPart2 = *(CColModel*)0x87BE30;
|
CColModel &CTempColModels::ms_colModelBodyPart2 = *(CColModel*)0x87BE30;
|
||||||
CColModel &CTempColModels::ms_colModelBodyPart1 = *(CColModel*)0x87BE88;
|
CColModel &CTempColModels::ms_colModelBodyPart1 = *(CColModel*)0x87BE88;
|
||||||
CColModel &CTempColModels::ms_colModelCutObj = *(CColModel*)0x87C960;
|
CColModel (&CTempColModels::ms_colModelCutObj)[5] = *(CColModel(*)[5]) *(uintptr*)0x87C960;
|
||||||
CColModel &CTempColModels::ms_colModelPedGroundHit = *(CColModel*)0x880480;
|
CColModel &CTempColModels::ms_colModelPedGroundHit = *(CColModel*)0x880480;
|
||||||
CColModel &CTempColModels::ms_colModelBoot1 = *(CColModel*)0x880670;
|
CColModel &CTempColModels::ms_colModelBoot1 = *(CColModel*)0x880670;
|
||||||
CColModel &CTempColModels::ms_colModelDoor1 = *(CColModel*)0x880850;
|
CColModel &CTempColModels::ms_colModelDoor1 = *(CColModel*)0x880850;
|
||||||
|
@ -13,7 +13,7 @@ public:
|
|||||||
static CColModel &ms_colModelPanel1;
|
static CColModel &ms_colModelPanel1;
|
||||||
static CColModel &ms_colModelBodyPart2;
|
static CColModel &ms_colModelBodyPart2;
|
||||||
static CColModel &ms_colModelBodyPart1;
|
static CColModel &ms_colModelBodyPart1;
|
||||||
static CColModel &ms_colModelCutObj;
|
static CColModel (&ms_colModelCutObj)[5];
|
||||||
static CColModel &ms_colModelPedGroundHit;
|
static CColModel &ms_colModelPedGroundHit;
|
||||||
static CColModel &ms_colModelBoot1;
|
static CColModel &ms_colModelBoot1;
|
||||||
static CColModel &ms_colModelDoor1;
|
static CColModel &ms_colModelDoor1;
|
||||||
|
@ -56,9 +56,10 @@ class CWorld
|
|||||||
static CPtrList &ms_listMovingEntityPtrs;
|
static CPtrList &ms_listMovingEntityPtrs;
|
||||||
static CSector (*ms_aSectors)[NUMSECTORS_X]; // [NUMSECTORS_Y][NUMSECTORS_X];
|
static CSector (*ms_aSectors)[NUMSECTORS_X]; // [NUMSECTORS_Y][NUMSECTORS_X];
|
||||||
static uint16 &ms_nCurrentScanCode;
|
static uint16 &ms_nCurrentScanCode;
|
||||||
static CColPoint &ms_testSpherePoint;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
static CColPoint& ms_testSpherePoint;
|
||||||
|
|
||||||
static uint8 &PlayerInFocus;
|
static uint8 &PlayerInFocus;
|
||||||
static CPlayerInfo *Players;
|
static CPlayerInfo *Players;
|
||||||
static CEntity *&pIgnoreEntity;
|
static CEntity *&pIgnoreEntity;
|
||||||
|
@ -92,9 +92,11 @@ extern void **rwengine;
|
|||||||
#define SCREEN_SCALE_FROM_BOTTOM(a) (SCREEN_HEIGHT - SCREEN_SCALE_Y(a))
|
#define SCREEN_SCALE_FROM_BOTTOM(a) (SCREEN_HEIGHT - SCREEN_SCALE_Y(a))
|
||||||
|
|
||||||
#ifdef ASPECT_RATIO_SCALE
|
#ifdef ASPECT_RATIO_SCALE
|
||||||
#define SCREEN_SCALE_AR(a) ((a) * (4.0f / 3.0f) / SCREEN_ASPECT_RATIO)
|
#define SCREEN_SCALE_AR(a) ((a) * DEFAULT_ASPECT_RATIO / SCREEN_ASPECT_RATIO)
|
||||||
|
#define SCREEN_SCALE_AR2(a) ((a) / (DEFAULT_ASPECT_RATIO / SCREEN_ASPECT_RATIO))
|
||||||
#else
|
#else
|
||||||
#define SCREEN_SCALE_AR(a) (a)
|
#define SCREEN_SCALE_AR(a) (a)
|
||||||
|
#define SCREEN_SCALE_AR2(a) (a)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "maths.h"
|
#include "maths.h"
|
||||||
|
@ -8,6 +8,7 @@ enum Config {
|
|||||||
MODELINFOSIZE = 5500,
|
MODELINFOSIZE = 5500,
|
||||||
TXDSTORESIZE = 850,
|
TXDSTORESIZE = 850,
|
||||||
EXTRADIRSIZE = 128,
|
EXTRADIRSIZE = 128,
|
||||||
|
CUTSCENEDIRSIZE = 512,
|
||||||
|
|
||||||
SIMPLEMODELSIZE = 5000,
|
SIMPLEMODELSIZE = 5000,
|
||||||
TIMEMODELSIZE = 30,
|
TIMEMODELSIZE = 30,
|
||||||
@ -31,6 +32,7 @@ enum Config {
|
|||||||
NUMDUMMIES = 2802, // 2368 on PS2
|
NUMDUMMIES = 2802, // 2368 on PS2
|
||||||
NUMAUDIOSCRIPTOBJECTS = 256,
|
NUMAUDIOSCRIPTOBJECTS = 256,
|
||||||
NUMCUTSCENEOBJECTS = 50,
|
NUMCUTSCENEOBJECTS = 50,
|
||||||
|
NUMDEFAULTMODELS = 200,
|
||||||
|
|
||||||
NUMTEMPOBJECTS = 30,
|
NUMTEMPOBJECTS = 30,
|
||||||
|
|
||||||
@ -66,10 +68,15 @@ enum Config {
|
|||||||
NUMANTENNAS = 8,
|
NUMANTENNAS = 8,
|
||||||
NUMCORONAS = 56,
|
NUMCORONAS = 56,
|
||||||
NUMPOINTLIGHTS = 32,
|
NUMPOINTLIGHTS = 32,
|
||||||
|
NUMMONEYMESSAGES = 16,
|
||||||
|
NUMPICKUPMESSAGES = 16,
|
||||||
|
|
||||||
NUMONSCREENTIMERENTRIES = 1,
|
NUMONSCREENTIMERENTRIES = 1,
|
||||||
NUMRADARBLIPS = 32,
|
NUMRADARBLIPS = 32,
|
||||||
NUMPICKUPS = 336,
|
NUMGENERALPICKUPS = 320,
|
||||||
|
NUMSCRIPTEDPICKUPS = 16,
|
||||||
|
NUMPICKUPS = NUMGENERALPICKUPS + NUMSCRIPTEDPICKUPS,
|
||||||
|
NUMCOLLECTEDPICKUPS = 20,
|
||||||
NUMEVENTS = 64,
|
NUMEVENTS = 64,
|
||||||
|
|
||||||
NUM_CARGENS = 160,
|
NUM_CARGENS = 160,
|
||||||
@ -132,10 +139,26 @@ enum Config {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FIX_BUGS // fix bugs in the game, TODO: use this more
|
#define FIX_BUGS // fix bugs in the game, TODO: use this more
|
||||||
|
|
||||||
|
// Pad
|
||||||
#define KANGAROO_CHEAT
|
#define KANGAROO_CHEAT
|
||||||
|
|
||||||
|
// Hud & radar
|
||||||
#define ASPECT_RATIO_SCALE
|
#define ASPECT_RATIO_SCALE
|
||||||
|
#define TRIANGULAR_BLIPS
|
||||||
|
|
||||||
|
// Script
|
||||||
#define USE_DEBUG_SCRIPT_LOADER
|
#define USE_DEBUG_SCRIPT_LOADER
|
||||||
|
|
||||||
|
// Vehicles
|
||||||
#define EXPLODING_AIRTRAIN // can blow up jumbo jet with rocket launcher
|
#define EXPLODING_AIRTRAIN // can blow up jumbo jet with rocket launcher
|
||||||
#define ANIMATE_PED_COL_MODEL
|
|
||||||
#define CANCELLABLE_CAR_ENTER
|
|
||||||
//#define REMOVE_TREADABLE_PATHFIND
|
//#define REMOVE_TREADABLE_PATHFIND
|
||||||
|
|
||||||
|
// Pickups
|
||||||
|
//#define MONEY_MESSAGES
|
||||||
|
|
||||||
|
// Peds
|
||||||
|
#define ANIMATE_PED_COL_MODEL
|
||||||
|
#define VC_PED_PORTS
|
||||||
|
#define NEW_WALK_AROUND_ALGORITHM
|
||||||
|
#define CANCELLABLE_CAR_ENTER
|
||||||
|
@ -1459,7 +1459,7 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists)
|
|||||||
A->m_phy_flagA80 = true;
|
A->m_phy_flagA80 = true;
|
||||||
}else if(A->IsPed() && Aped->m_pCollidingEntity == B){
|
}else if(A->IsPed() && Aped->m_pCollidingEntity == B){
|
||||||
skipCollision = true;
|
skipCollision = true;
|
||||||
if(!Aped->bKnockedUpIntoAir)
|
if(!Aped->m_ped_flagH1)
|
||||||
A->m_phy_flagA80 = true;
|
A->m_phy_flagA80 = true;
|
||||||
}else if(B->IsPed() && Bped->m_pCollidingEntity == A){
|
}else if(B->IsPed() && Bped->m_pCollidingEntity == A){
|
||||||
skipCollision = true;
|
skipCollision = true;
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
uint8 m_phy_flagA80 : 1;
|
uint8 m_phy_flagA80 : 1;
|
||||||
|
|
||||||
uint8 m_nSurfaceTouched;
|
uint8 m_nSurfaceTouched;
|
||||||
uint8 m_nZoneLevel;
|
int8 m_nZoneLevel;
|
||||||
|
|
||||||
CPhysical(void);
|
CPhysical(void);
|
||||||
~CPhysical(void);
|
~CPhysical(void);
|
||||||
|
@ -204,6 +204,22 @@ public:
|
|||||||
m_matrix.at.y = 0.0f;
|
m_matrix.at.y = 0.0f;
|
||||||
m_matrix.at.z = 1.0f;
|
m_matrix.at.z = 1.0f;
|
||||||
}
|
}
|
||||||
|
void SetRotateZOnlyScaled(float angle, float scale) {
|
||||||
|
float c = Cos(angle);
|
||||||
|
float s = Sin(angle);
|
||||||
|
|
||||||
|
m_matrix.right.x = c * scale;
|
||||||
|
m_matrix.right.y = s * scale;
|
||||||
|
m_matrix.right.z = 0.0f;
|
||||||
|
|
||||||
|
m_matrix.up.x = -s * scale;
|
||||||
|
m_matrix.up.y = c * scale;
|
||||||
|
m_matrix.up.z = 0.0f;
|
||||||
|
|
||||||
|
m_matrix.at.x = 0.0f;
|
||||||
|
m_matrix.at.y = 0.0f;
|
||||||
|
m_matrix.at.z = scale;
|
||||||
|
}
|
||||||
void SetRotateZ(float angle){
|
void SetRotateZ(float angle){
|
||||||
SetRotateZOnly(angle);
|
SetRotateZOnly(angle);
|
||||||
m_matrix.pos.x = 0.0f;
|
m_matrix.pos.x = 0.0f;
|
||||||
@ -213,6 +229,7 @@ public:
|
|||||||
void SetRotate(float xAngle, float yAngle, float zAngle);
|
void SetRotate(float xAngle, float yAngle, float zAngle);
|
||||||
void Rotate(float x, float y, float z);
|
void Rotate(float x, float y, float z);
|
||||||
void RotateX(float x);
|
void RotateX(float x);
|
||||||
|
void RotateZ(float z);
|
||||||
|
|
||||||
void Reorthogonalise(void);
|
void Reorthogonalise(void);
|
||||||
void CopyOnlyMatrix(CMatrix *other){
|
void CopyOnlyMatrix(CMatrix *other){
|
||||||
|
@ -46,6 +46,12 @@ CMatrix::RotateX(float x)
|
|||||||
Rotate(x, 0.0f, 0.0f);
|
Rotate(x, 0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CMatrix::RotateZ(float z)
|
||||||
|
{
|
||||||
|
Rotate(0.0f, 0.0f, z);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CMatrix::Reorthogonalise(void)
|
CMatrix::Reorthogonalise(void)
|
||||||
{
|
{
|
||||||
|
@ -352,8 +352,6 @@ enum
|
|||||||
|
|
||||||
MI_AIRTRAIN_VLO = 198,
|
MI_AIRTRAIN_VLO = 198,
|
||||||
MI_LOPOLYGUY,
|
MI_LOPOLYGUY,
|
||||||
|
|
||||||
NUM_DEFAULT_MODELS,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum{
|
enum{
|
||||||
|
@ -14,7 +14,9 @@ int16 &CObject::nNoTempObjects = *(int16*)0x95CCA2;
|
|||||||
int16 &CObject::nBodyCastHealth = *(int16*)0x5F7D4C; // 1000
|
int16 &CObject::nBodyCastHealth = *(int16*)0x5F7D4C; // 1000
|
||||||
|
|
||||||
void *CObject::operator new(size_t sz) { return CPools::GetObjectPool()->New(); }
|
void *CObject::operator new(size_t sz) { return CPools::GetObjectPool()->New(); }
|
||||||
|
void *CObject::operator new(size_t sz, int handle) { return CPools::GetObjectPool()->New(handle);};
|
||||||
void CObject::operator delete(void *p, size_t sz) { CPools::GetObjectPool()->Delete((CObject*)p); }
|
void CObject::operator delete(void *p, size_t sz) { CPools::GetObjectPool()->Delete((CObject*)p); }
|
||||||
|
void CObject::operator delete(void *p, int handle) { CPools::GetObjectPool()->Delete((CObject*)p); }
|
||||||
|
|
||||||
CObject::CObject(void)
|
CObject::CObject(void)
|
||||||
{
|
{
|
||||||
@ -32,7 +34,7 @@ CObject::CObject(void)
|
|||||||
field_172 = 0;
|
field_172 = 0;
|
||||||
bIsPickup = false;
|
bIsPickup = false;
|
||||||
m_obj_flag2 = false;
|
m_obj_flag2 = false;
|
||||||
m_obj_flag4 = false;
|
bOutOfStock = false;
|
||||||
m_obj_flag8 = false;
|
m_obj_flag8 = false;
|
||||||
m_obj_flag10 = false;
|
m_obj_flag10 = false;
|
||||||
bHasBeenDamaged = false;
|
bHasBeenDamaged = false;
|
||||||
|
@ -34,13 +34,13 @@ public:
|
|||||||
int8 ObjectCreatedBy;
|
int8 ObjectCreatedBy;
|
||||||
int8 bIsPickup : 1;
|
int8 bIsPickup : 1;
|
||||||
int8 m_obj_flag2 : 1;
|
int8 m_obj_flag2 : 1;
|
||||||
int8 m_obj_flag4 : 1;
|
int8 bOutOfStock : 1;
|
||||||
int8 m_obj_flag8 : 1;
|
int8 m_obj_flag8 : 1;
|
||||||
int8 m_obj_flag10 : 1;
|
int8 m_obj_flag10 : 1;
|
||||||
int8 bHasBeenDamaged : 1;
|
int8 bHasBeenDamaged : 1;
|
||||||
int8 bUseVehicleColours : 1;
|
int8 bUseVehicleColours : 1;
|
||||||
int8 m_obj_flag80 : 1;
|
int8 m_obj_flag80 : 1;
|
||||||
int8 field_172;
|
int8 field_172; // car for a bonus pickup?
|
||||||
int8 field_173;
|
int8 field_173;
|
||||||
float m_fCollisionDamageMultiplier;
|
float m_fCollisionDamageMultiplier;
|
||||||
uint8 m_nCollisionDamageEffect;
|
uint8 m_nCollisionDamageEffect;
|
||||||
@ -63,7 +63,9 @@ public:
|
|||||||
static int16 &nBodyCastHealth;
|
static int16 &nBodyCastHealth;
|
||||||
|
|
||||||
static void *operator new(size_t);
|
static void *operator new(size_t);
|
||||||
|
static void *operator new(size_t, int);
|
||||||
static void operator delete(void*, size_t);
|
static void operator delete(void*, size_t);
|
||||||
|
static void operator delete(void*, int);
|
||||||
|
|
||||||
CObject(void);
|
CObject(void);
|
||||||
CObject(int32, bool);
|
CObject(int32, bool);
|
||||||
|
@ -8,34 +8,11 @@ WRAPPER void CCivilianPed::ProcessControl(void) { EAXJMP(0x4BFFE0); }
|
|||||||
CCivilianPed::CCivilianPed(int pedtype, int mi) : CPed(pedtype)
|
CCivilianPed::CCivilianPed(int pedtype, int mi) : CPed(pedtype)
|
||||||
{
|
{
|
||||||
SetModelIndex(mi);
|
SetModelIndex(mi);
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++) {
|
||||||
{
|
|
||||||
m_nearPeds[i] = nil;
|
m_nearPeds[i] = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
CCivilianPed::ProcessNearestFreePhone(int unused)
|
|
||||||
{
|
|
||||||
if (m_nPedState == PED_SEEK_POS)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
int phoneId = gPhoneInfo.FindNearestFreePhone(&GetPosition());
|
|
||||||
|
|
||||||
if (phoneId == -1)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (gPhoneInfo.m_aPhones[phoneId].m_nState != PHONE_STATE_FREE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
bRunningToPhone = true;
|
|
||||||
SetMoveState(PEDMOVE_RUN);
|
|
||||||
SetSeek(gPhoneInfo.m_aPhones[phoneId].m_vecPos, 0.3f);
|
|
||||||
m_phoneId = phoneId;
|
|
||||||
m_lookingForPhone = unused;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
class CCivilianPed_ : public CCivilianPed
|
class CCivilianPed_ : public CCivilianPed
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -46,5 +23,4 @@ public:
|
|||||||
STARTPATCHES
|
STARTPATCHES
|
||||||
InjectHook(0x4BFF30, &CCivilianPed_::ctor, PATCH_JUMP);
|
InjectHook(0x4BFF30, &CCivilianPed_::ctor, PATCH_JUMP);
|
||||||
InjectHook(0x4BFFC0, &CCivilianPed_::dtor, PATCH_JUMP);
|
InjectHook(0x4BFFC0, &CCivilianPed_::dtor, PATCH_JUMP);
|
||||||
InjectHook(0x4C10C0, &CCivilianPed::ProcessNearestFreePhone, PATCH_JUMP);
|
|
||||||
ENDPATCHES
|
ENDPATCHES
|
||||||
|
@ -9,6 +9,5 @@ public:
|
|||||||
~CCivilianPed(void) { }
|
~CCivilianPed(void) { }
|
||||||
|
|
||||||
void ProcessControl(void);
|
void ProcessControl(void);
|
||||||
bool ProcessNearestFreePhone(int);
|
|
||||||
};
|
};
|
||||||
static_assert(sizeof(CCivilianPed) == 0x53C, "CCivilianPed: error");
|
static_assert(sizeof(CCivilianPed) == 0x53C, "CCivilianPed: error");
|
||||||
|
3931
src/peds/Ped.cpp
3931
src/peds/Ped.cpp
File diff suppressed because it is too large
Load Diff
@ -14,6 +14,7 @@
|
|||||||
#include "EventList.h"
|
#include "EventList.h"
|
||||||
|
|
||||||
struct CPathNode;
|
struct CPathNode;
|
||||||
|
class CAccident;
|
||||||
|
|
||||||
struct CPedAudioData
|
struct CPedAudioData
|
||||||
{
|
{
|
||||||
@ -57,6 +58,7 @@ struct FightMove
|
|||||||
};
|
};
|
||||||
static_assert(sizeof(FightMove) == 0x18, "FightMove: error");
|
static_assert(sizeof(FightMove) == 0x18, "FightMove: error");
|
||||||
|
|
||||||
|
// TO-DO: This is eFightState on mobile.
|
||||||
enum PedFightMoves
|
enum PedFightMoves
|
||||||
{
|
{
|
||||||
FIGHTMOVE_NULL,
|
FIGHTMOVE_NULL,
|
||||||
@ -127,7 +129,7 @@ enum eObjective : uint32 {
|
|||||||
OBJECTIVE_IDLE,
|
OBJECTIVE_IDLE,
|
||||||
OBJECTIVE_FLEE_TILL_SAFE,
|
OBJECTIVE_FLEE_TILL_SAFE,
|
||||||
OBJECTIVE_GUARD_SPOT,
|
OBJECTIVE_GUARD_SPOT,
|
||||||
OBJECTIVE_GUARD_AREA,
|
OBJECTIVE_GUARD_AREA, // not implemented
|
||||||
OBJECTIVE_WAIT_IN_CAR,
|
OBJECTIVE_WAIT_IN_CAR,
|
||||||
OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT,
|
OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT,
|
||||||
OBJECTIVE_KILL_CHAR_ON_FOOT,
|
OBJECTIVE_KILL_CHAR_ON_FOOT,
|
||||||
@ -139,15 +141,15 @@ enum eObjective : uint32 {
|
|||||||
OBJECTIVE_LEAVE_VEHICLE,
|
OBJECTIVE_LEAVE_VEHICLE,
|
||||||
OBJECTIVE_ENTER_CAR_AS_PASSENGER,
|
OBJECTIVE_ENTER_CAR_AS_PASSENGER,
|
||||||
OBJECTIVE_ENTER_CAR_AS_DRIVER,
|
OBJECTIVE_ENTER_CAR_AS_DRIVER,
|
||||||
OBJECTIVE_FOLLOW_CAR_IN_CAR,
|
OBJECTIVE_FOLLOW_CAR_IN_CAR, // seems not implemented so far
|
||||||
OBJECTIVE_FIRE_AT_OBJ_FROM_VEHICLE,
|
OBJECTIVE_FIRE_AT_OBJ_FROM_VEHICLE, // not implemented
|
||||||
OBJECTIVE_DESTROY_OBJ,
|
OBJECTIVE_DESTROY_OBJ, // not implemented
|
||||||
OBJECTIVE_DESTROY_CAR,
|
OBJECTIVE_DESTROY_CAR,
|
||||||
OBJECTIVE_GOTO_AREA_ANY_MEANS,
|
OBJECTIVE_GOTO_AREA_ANY_MEANS,
|
||||||
OBJECTIVE_GOTO_AREA_ON_FOOT,
|
OBJECTIVE_GOTO_AREA_ON_FOOT,
|
||||||
OBJECTIVE_RUN_TO_AREA,
|
OBJECTIVE_RUN_TO_AREA,
|
||||||
OBJECTIVE_23,
|
OBJECTIVE_23, // not implemented
|
||||||
OBJECTIVE_24,
|
OBJECTIVE_24, // not implemented
|
||||||
OBJECTIVE_FIGHT_CHAR,
|
OBJECTIVE_FIGHT_CHAR,
|
||||||
OBJECTIVE_SET_LEADER,
|
OBJECTIVE_SET_LEADER,
|
||||||
OBJECTIVE_FOLLOW_ROUTE,
|
OBJECTIVE_FOLLOW_ROUTE,
|
||||||
@ -158,7 +160,9 @@ enum eObjective : uint32 {
|
|||||||
OBJECTIVE_STEAL_ANY_CAR,
|
OBJECTIVE_STEAL_ANY_CAR,
|
||||||
OBJECTIVE_MUG_CHAR,
|
OBJECTIVE_MUG_CHAR,
|
||||||
OBJECTIVE_FLEE_CAR,
|
OBJECTIVE_FLEE_CAR,
|
||||||
OBJECTIVE_35
|
#ifdef VC_PED_PORTS
|
||||||
|
OBJECTIVE_LEAVE_CAR_AND_DIE
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -169,7 +173,7 @@ enum {
|
|||||||
enum PedLineUpPhase {
|
enum PedLineUpPhase {
|
||||||
LINE_UP_TO_CAR_START,
|
LINE_UP_TO_CAR_START,
|
||||||
LINE_UP_TO_CAR_END,
|
LINE_UP_TO_CAR_END,
|
||||||
LINE_UP_TO_CAR_2
|
LINE_UP_TO_CAR_2 // Buggy. Used for cops arresting you from passenger door
|
||||||
};
|
};
|
||||||
|
|
||||||
enum PedOnGroundState {
|
enum PedOnGroundState {
|
||||||
@ -262,7 +266,7 @@ public:
|
|||||||
|
|
||||||
// cf. https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/CPed.h from R*
|
// cf. https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/CPed.h from R*
|
||||||
uint8 bIsStanding : 1;
|
uint8 bIsStanding : 1;
|
||||||
uint8 m_ped_flagA2 : 1;
|
uint8 m_ped_flagA2 : 1; // bWasStanding?
|
||||||
uint8 bIsAttacking : 1; // doesn't reset after fist fight
|
uint8 bIsAttacking : 1; // doesn't reset after fist fight
|
||||||
uint8 bIsPointingGunAt : 1;
|
uint8 bIsPointingGunAt : 1;
|
||||||
uint8 bIsLooking : 1;
|
uint8 bIsLooking : 1;
|
||||||
@ -277,9 +281,9 @@ public:
|
|||||||
uint8 bIsLanding : 1;
|
uint8 bIsLanding : 1;
|
||||||
uint8 bIsRunning : 1; // on some conditions
|
uint8 bIsRunning : 1; // on some conditions
|
||||||
uint8 bHitSomethingLastFrame : 1;
|
uint8 bHitSomethingLastFrame : 1;
|
||||||
uint8 m_ped_flagB80 : 1; // bIsNearCar? something related with reaction to colliding vehicle
|
uint8 m_ped_flagB80 : 1; // bIsNearCar? it's sure that it's related with cars and used for deciding whether we should move
|
||||||
|
|
||||||
uint8 m_ped_flagC1 : 1;
|
uint8 m_ped_flagC1 : 1; // bCanPedEnterSeekedCar?
|
||||||
uint8 bRespondsToThreats : 1;
|
uint8 bRespondsToThreats : 1;
|
||||||
uint8 bRenderPedInCar : 1;
|
uint8 bRenderPedInCar : 1;
|
||||||
uint8 bChangedSeat : 1;
|
uint8 bChangedSeat : 1;
|
||||||
@ -290,15 +294,15 @@ public:
|
|||||||
|
|
||||||
uint8 bHasACamera : 1; // does ped possess a camera to document accidents involves fire/explosion
|
uint8 bHasACamera : 1; // does ped possess a camera to document accidents involves fire/explosion
|
||||||
uint8 m_ped_flagD2 : 1; // set when ped witnessed an event
|
uint8 m_ped_flagD2 : 1; // set when ped witnessed an event
|
||||||
uint8 m_ped_flagD4 : 1; // bPedIsBleeding? so far only creates blood pool in hands up state
|
uint8 bPedIsBleeding : 1;
|
||||||
uint8 m_ped_flagD8 : 1;
|
uint8 bStopAndShoot : 1; // Ped cannot reach target to attack with fist, need to use gun
|
||||||
uint8 bIsPedDieAnimPlaying : 1;
|
uint8 bIsPedDieAnimPlaying : 1;
|
||||||
uint8 bUsePedNodeSeek : 1;
|
uint8 bUsePedNodeSeek : 1;
|
||||||
uint8 m_ped_flagD40 : 1; // reset when objective changes
|
uint8 bObjectiveCompleted : 1;
|
||||||
uint8 bScriptObjectiveCompleted : 1;
|
uint8 bScriptObjectiveCompleted : 1;
|
||||||
|
|
||||||
uint8 bKindaStayInSamePlace : 1;
|
uint8 bKindaStayInSamePlace : 1;
|
||||||
uint8 m_ped_flagE2 : 1;
|
uint8 m_ped_flagE2 : 1; // bBeingChasedByPolice?
|
||||||
uint8 bNotAllowedToDuck : 1;
|
uint8 bNotAllowedToDuck : 1;
|
||||||
uint8 bCrouchWhenShooting : 1;
|
uint8 bCrouchWhenShooting : 1;
|
||||||
uint8 bIsDucking : 1;
|
uint8 bIsDucking : 1;
|
||||||
@ -312,33 +316,37 @@ public:
|
|||||||
uint8 m_ped_flagF8 : 1;
|
uint8 m_ped_flagF8 : 1;
|
||||||
uint8 bWillBeQuickJacked : 1;
|
uint8 bWillBeQuickJacked : 1;
|
||||||
uint8 bCancelEnteringCar : 1; // after door is opened or couldn't be opened due to it's locked
|
uint8 bCancelEnteringCar : 1; // after door is opened or couldn't be opened due to it's locked
|
||||||
uint8 m_ped_flagF40 : 1;
|
uint8 bObstacleShowedUpDuringKillObjective : 1;
|
||||||
uint8 bDuckAndCover : 1;
|
uint8 bDuckAndCover : 1;
|
||||||
|
|
||||||
uint8 m_ped_flagG1 : 1;
|
uint8 bStillOnValidPoly : 1;
|
||||||
uint8 m_ped_flagG2 : 1;
|
uint8 m_ped_flagG2 : 1;
|
||||||
uint8 m_ped_flagG4 : 1; // bStillOnValidPoly?
|
uint8 m_ped_flagG4 : 1; // bResetWalkAnims?
|
||||||
uint8 bStartWanderPathOnFoot : 1; // exits the car if he's in it, reset after path found
|
uint8 bStartWanderPathOnFoot : 1; // exits the car if he's in it, reset after path found
|
||||||
uint8 m_ped_flagG10 : 1; // bOnBoat? (but not in the sense of driving)
|
uint8 bOnBoat : 1; // not just driver, may be just standing
|
||||||
uint8 bBusJacked : 1;
|
uint8 bBusJacked : 1;
|
||||||
uint8 bGonnaKillTheCarJacker : 1; // only set when car is jacked from right door
|
uint8 bGonnaKillTheCarJacker : 1; // only set when car is jacked from right door
|
||||||
uint8 bFadeOut : 1;
|
uint8 bFadeOut : 1;
|
||||||
|
|
||||||
uint8 bKnockedUpIntoAir : 1; // has ped been knocked up into the air by a car collision
|
uint8 m_ped_flagH1 : 1;
|
||||||
uint8 m_ped_flagH2 : 1;
|
uint8 bHitSteepSlope : 1; // has ped collided/is standing on a steep slope (surface type)
|
||||||
uint8 m_ped_flagH4 : 1;
|
uint8 m_ped_flagH4 : 1;
|
||||||
uint8 bClearObjective : 1;
|
uint8 bClearObjective : 1;
|
||||||
uint8 m_ped_flagH10 : 1;
|
uint8 m_ped_flagH10 : 1; // bTryingToReachDryLand? reset when we landed on something not vehicle and object
|
||||||
uint8 bCollidedWithMyVehicle : 1;
|
uint8 bCollidedWithMyVehicle : 1;
|
||||||
uint8 m_ped_flagH40 : 1;
|
uint8 bRichFromMugging : 1; // ped has lots of cash from mugging people - will drop money if someone points gun to him
|
||||||
uint8 m_ped_flagH80 : 1;
|
uint8 m_ped_flagH80 : 1;
|
||||||
|
|
||||||
uint8 bShakeFist : 1; // test shake hand at look entity
|
uint8 bShakeFist : 1; // test shake hand at look entity
|
||||||
uint8 bNoCriticalHits : 1; // if set, limbs won't came off
|
uint8 bNoCriticalHits : 1; // if set, limbs won't came off
|
||||||
uint8 m_ped_flagI4 : 1;
|
uint8 m_ped_flagI4 : 1; // seems like related with cars
|
||||||
uint8 bHasAlreadyBeenRecorded : 1;
|
uint8 bHasAlreadyBeenRecorded : 1;
|
||||||
uint8 bFallenDown : 1;
|
uint8 bFallenDown : 1;
|
||||||
|
#ifdef VC_PED_PORTS
|
||||||
|
uint8 bKnockedUpIntoAir : 1; // has ped been knocked up into the air by a car collision
|
||||||
|
#else
|
||||||
uint8 m_ped_flagI20 : 1;
|
uint8 m_ped_flagI20 : 1;
|
||||||
|
#endif
|
||||||
uint8 m_ped_flagI40 : 1;
|
uint8 m_ped_flagI40 : 1;
|
||||||
uint8 m_ped_flagI80 : 1;
|
uint8 m_ped_flagI80 : 1;
|
||||||
|
|
||||||
@ -398,7 +406,7 @@ public:
|
|||||||
float m_fRotationDest;
|
float m_fRotationDest;
|
||||||
float m_headingRate;
|
float m_headingRate;
|
||||||
uint16 m_vehEnterType; // TODO: this is more like a door, not a type
|
uint16 m_vehEnterType; // TODO: this is more like a door, not a type
|
||||||
uint16 m_walkAroundType;
|
int16 m_walkAroundType;
|
||||||
CEntity *m_pCurrentPhysSurface;
|
CEntity *m_pCurrentPhysSurface;
|
||||||
CVector m_vecOffsetFromPhysSurface;
|
CVector m_vecOffsetFromPhysSurface;
|
||||||
CEntity *m_pCurSurface;
|
CEntity *m_pCurSurface;
|
||||||
@ -411,9 +419,9 @@ public:
|
|||||||
bool bRunningToPhone;
|
bool bRunningToPhone;
|
||||||
uint8 field_31D;
|
uint8 field_31D;
|
||||||
int16 m_phoneId;
|
int16 m_phoneId;
|
||||||
uint32 m_lookingForPhone; // unused
|
eCrimeType m_crimeToReportOnPhone;
|
||||||
uint32 m_phoneTalkTimer;
|
uint32 m_phoneTalkTimer;
|
||||||
void *m_lastAccident;
|
CAccident *m_lastAccident;
|
||||||
int32 m_nPedType;
|
int32 m_nPedType;
|
||||||
CPedStats *m_pedStats;
|
CPedStats *m_pedStats;
|
||||||
float m_fleeFromPosX;
|
float m_fleeFromPosX;
|
||||||
@ -467,8 +475,8 @@ public:
|
|||||||
uint32 m_soundStart;
|
uint32 m_soundStart;
|
||||||
uint16 m_lastQueuedSound;
|
uint16 m_lastQueuedSound;
|
||||||
uint16 m_queuedSound;
|
uint16 m_queuedSound;
|
||||||
CVector m_vecSeekPosEx;
|
CVector m_vecSeekPosEx; // used in objectives
|
||||||
float m_seekExAngle;
|
float m_distanceToCountSeekDoneEx; // used in objectives
|
||||||
|
|
||||||
static void *operator new(size_t);
|
static void *operator new(size_t);
|
||||||
static void *operator new(size_t, int);
|
static void *operator new(size_t, int);
|
||||||
@ -526,7 +534,6 @@ public:
|
|||||||
void CalculateNewOrientation(void);
|
void CalculateNewOrientation(void);
|
||||||
float WorkOutHeadingForMovingFirstPerson(float);
|
float WorkOutHeadingForMovingFirstPerson(float);
|
||||||
void CalculateNewVelocity(void);
|
void CalculateNewVelocity(void);
|
||||||
bool CanPedJumpThis(CEntity*);
|
|
||||||
bool CanSeeEntity(CEntity*, float);
|
bool CanSeeEntity(CEntity*, float);
|
||||||
void RestorePreviousObjective(void);
|
void RestorePreviousObjective(void);
|
||||||
void SetIdle(void);
|
void SetIdle(void);
|
||||||
@ -646,6 +653,14 @@ public:
|
|||||||
void SeekCar(void);
|
void SeekCar(void);
|
||||||
void SeekBoatPosition(void);
|
void SeekBoatPosition(void);
|
||||||
bool PositionPedOutOfCollision(void);
|
bool PositionPedOutOfCollision(void);
|
||||||
|
bool RunToReportCrime(eCrimeType);
|
||||||
|
bool PlacePedOnDryLand(void);
|
||||||
|
bool PossiblyFindBetterPosToSeekCar(CVector*, CVehicle*);
|
||||||
|
void UpdateFromLeader(void);
|
||||||
|
int ScanForThreats(void);
|
||||||
|
void SetEnterCar(CVehicle*, uint32);
|
||||||
|
bool WarpPedToNearEntityOffScreen(CEntity*);
|
||||||
|
void SetExitCar(CVehicle*, uint32);
|
||||||
|
|
||||||
// Static methods
|
// Static methods
|
||||||
static CVector GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float offset);
|
static CVector GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float offset);
|
||||||
@ -656,8 +671,6 @@ public:
|
|||||||
static void LoadFightData(void);
|
static void LoadFightData(void);
|
||||||
|
|
||||||
// Callbacks
|
// Callbacks
|
||||||
static RwObject *SetPedAtomicVisibilityCB(RwObject *object, void *data);
|
|
||||||
static RwFrame *RecurseFrameChildrenVisibilityCB(RwFrame *frame, void *data);
|
|
||||||
static void PedGetupCB(CAnimBlendAssociation *assoc, void *arg);
|
static void PedGetupCB(CAnimBlendAssociation *assoc, void *arg);
|
||||||
static void PedStaggerCB(CAnimBlendAssociation *assoc, void *arg);
|
static void PedStaggerCB(CAnimBlendAssociation *assoc, void *arg);
|
||||||
static void PedEvadeCB(CAnimBlendAssociation *assoc, void *arg);
|
static void PedEvadeCB(CAnimBlendAssociation *assoc, void *arg);
|
||||||
@ -716,6 +729,15 @@ public:
|
|||||||
void PointGunAt(void);
|
void PointGunAt(void);
|
||||||
bool ServiceTalkingWhenDead(void);
|
bool ServiceTalkingWhenDead(void);
|
||||||
void SetPedPositionInTrain(void);
|
void SetPedPositionInTrain(void);
|
||||||
|
void SetShootTimer(uint32);
|
||||||
|
void SetSeekCar(CVehicle*, uint32);
|
||||||
|
void SetSeekBoatPosition(CVehicle*);
|
||||||
|
void SetExitTrain(CVehicle*);
|
||||||
|
#ifdef VC_PED_PORTS
|
||||||
|
bool CanPedJumpThis(CEntity*, CVector*);
|
||||||
|
#else
|
||||||
|
bool CanPedJumpThis(CEntity*);
|
||||||
|
#endif
|
||||||
|
|
||||||
bool HasWeapon(uint8 weaponType) { return m_weapons[weaponType].m_eWeaponType == weaponType; }
|
bool HasWeapon(uint8 weaponType) { return m_weapons[weaponType].m_eWeaponType == weaponType; }
|
||||||
CWeapon &GetWeapon(uint8 weaponType) { return m_weapons[weaponType]; }
|
CWeapon &GetWeapon(uint8 weaponType) { return m_weapons[weaponType]; }
|
||||||
@ -724,10 +746,14 @@ public:
|
|||||||
PedState GetPedState(void) { return m_nPedState; }
|
PedState GetPedState(void) { return m_nPedState; }
|
||||||
void SetPedState(PedState state) { m_nPedState = state; }
|
void SetPedState(PedState state) { m_nPedState = state; }
|
||||||
bool DyingOrDead(void) { return m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }
|
bool DyingOrDead(void) { return m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }
|
||||||
|
void ReplaceWeaponWhenExitingVehicle(void);
|
||||||
|
|
||||||
// set by 0482:set_threat_reaction_range_multiplier opcode
|
// set by 0482:set_threat_reaction_range_multiplier opcode
|
||||||
static uint16 &nThreatReactionRangeMultiplier;
|
static uint16 &nThreatReactionRangeMultiplier;
|
||||||
|
|
||||||
|
// set by 0481:set_enter_car_range_multiplier opcode
|
||||||
|
static uint16 &nEnterCarRangeMultiplier;
|
||||||
|
|
||||||
static bool &bNastyLimbsCheat;
|
static bool &bNastyLimbsCheat;
|
||||||
static bool &bPedCheat2;
|
static bool &bPedCheat2;
|
||||||
static bool &bPedCheat3;
|
static bool &bPedCheat3;
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
#include "PedRoutes.h"
|
#include "PedRoutes.h"
|
||||||
|
|
||||||
WRAPPER int16 CRouteNode::GetRouteThisPointIsOn(int16) { EAXJMP(0x4EE7A0); }
|
WRAPPER int16 CRouteNode::GetRouteThisPointIsOn(int16) { EAXJMP(0x4EE7A0); }
|
||||||
|
WRAPPER CVector CRouteNode::GetPointPosition(int16) { EAXJMP(0x4EE780); }
|
@ -3,5 +3,6 @@
|
|||||||
class CRouteNode
|
class CRouteNode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static int16 GetRouteThisPointIsOn(int16 point);
|
static int16 GetRouteThisPointIsOn(int16);
|
||||||
|
static CVector GetPointPosition(int16);
|
||||||
};
|
};
|
@ -51,7 +51,7 @@ CPlayerPed::CPlayerPed(void) : CPed(PEDTYPE_PLAYER1)
|
|||||||
field_1413 = 0;
|
field_1413 = 0;
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
m_vecSafePos[i] = CVector(0.0f, 0.0f, 0.0f);
|
m_vecSafePos[i] = CVector(0.0f, 0.0f, 0.0f);
|
||||||
field_1488[i] = 0;
|
m_pPedAtSafePos[i] = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
int8 field_1414;
|
int8 field_1414;
|
||||||
int8 field_1415;
|
int8 field_1415;
|
||||||
CVector m_vecSafePos[6]; // safe places from the player, for example behind a tree
|
CVector m_vecSafePos[6]; // safe places from the player, for example behind a tree
|
||||||
int32 field_1488[6]; // m_pPedAtSafePos?
|
CPed *m_pPedAtSafePos[6];
|
||||||
float m_fWalkAngle;
|
float m_fWalkAngle;
|
||||||
float m_fFPSMoveHeading;
|
float m_fFPSMoveHeading;
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ CCoronas::Render(void)
|
|||||||
|
|
||||||
CSprite::RenderOneXLUSprite(spriteCoors.x, spriteCoors.y, spriteCoors.z,
|
CSprite::RenderOneXLUSprite(spriteCoors.x, spriteCoors.y, spriteCoors.z,
|
||||||
spritew * aCoronas[i].size * wscale,
|
spritew * aCoronas[i].size * wscale,
|
||||||
spriteh * aCoronas[i].size * fogscale * hscale,
|
spriteh * SCREEN_SCALE_AR2(aCoronas[i].size * fogscale * hscale),
|
||||||
CCoronas::aCoronas[i].red / fogscale,
|
CCoronas::aCoronas[i].red / fogscale,
|
||||||
CCoronas::aCoronas[i].green / fogscale,
|
CCoronas::aCoronas[i].green / fogscale,
|
||||||
CCoronas::aCoronas[i].blue / fogscale,
|
CCoronas::aCoronas[i].blue / fogscale,
|
||||||
@ -335,7 +335,7 @@ CCoronas::Render(void)
|
|||||||
CSprite::RenderOneXLUSprite_Rotate_Aspect(
|
CSprite::RenderOneXLUSprite_Rotate_Aspect(
|
||||||
spriteCoors.x, spriteCoors.y, spriteCoors.z,
|
spriteCoors.x, spriteCoors.y, spriteCoors.z,
|
||||||
spritew * aCoronas[i].size * fogscale,
|
spritew * aCoronas[i].size * fogscale,
|
||||||
spriteh * aCoronas[i].size * fogscale,
|
spriteh * SCREEN_SCALE_AR2(aCoronas[i].size * fogscale),
|
||||||
CCoronas::aCoronas[i].red / fogscale,
|
CCoronas::aCoronas[i].red / fogscale,
|
||||||
CCoronas::aCoronas[i].green / fogscale,
|
CCoronas::aCoronas[i].green / fogscale,
|
||||||
CCoronas::aCoronas[i].blue / fogscale,
|
CCoronas::aCoronas[i].blue / fogscale,
|
||||||
|
@ -134,10 +134,10 @@ CFont::PrintChar(float x, float y, uint16 c)
|
|||||||
if(Details.style == 0 || Details.style == 2){
|
if(Details.style == 0 || Details.style == 2){
|
||||||
if(Details.dropShadowPosition != 0){
|
if(Details.dropShadowPosition != 0){
|
||||||
CSprite2d::AddSpriteToBank(Details.bank + Details.style, // BUG: game doesn't add bank
|
CSprite2d::AddSpriteToBank(Details.bank + Details.style, // BUG: game doesn't add bank
|
||||||
CRect(x + Details.dropShadowPosition,
|
CRect(x + SCREEN_SCALE_X(Details.dropShadowPosition),
|
||||||
y + Details.dropShadowPosition,
|
y + SCREEN_SCALE_Y(Details.dropShadowPosition),
|
||||||
x + Details.dropShadowPosition + 32.0f * Details.scaleX * 1.0f,
|
x + SCREEN_SCALE_X(Details.dropShadowPosition) + 32.0f * Details.scaleX * 1.0f,
|
||||||
y + Details.dropShadowPosition + 40.0f * Details.scaleY * 0.5f),
|
y + SCREEN_SCALE_Y(Details.dropShadowPosition) + 40.0f * Details.scaleY * 0.5f),
|
||||||
Details.dropColor,
|
Details.dropColor,
|
||||||
xoff/16.0f, yoff/12.8f,
|
xoff/16.0f, yoff/12.8f,
|
||||||
(xoff+1.0f)/16.0f - 0.001f, yoff/12.8f,
|
(xoff+1.0f)/16.0f - 0.001f, yoff/12.8f,
|
||||||
|
@ -46,7 +46,7 @@ wchar *CHud::m_Message = (wchar*)0x72E318;
|
|||||||
wchar *CHud::m_PagerMessage = (wchar*)0x878840;
|
wchar *CHud::m_PagerMessage = (wchar*)0x878840;
|
||||||
bool &CHud::m_Wants_To_Draw_Hud = *(bool*)0x95CD89;
|
bool &CHud::m_Wants_To_Draw_Hud = *(bool*)0x95CD89;
|
||||||
bool &CHud::m_Wants_To_Draw_3dMarkers = *(bool*)0x95CD62;
|
bool &CHud::m_Wants_To_Draw_3dMarkers = *(bool*)0x95CD62;
|
||||||
wchar(*CHud::m_BigMessage)[128] = (wchar(*)[128])0x664CE0;
|
wchar(&CHud::m_BigMessage)[6][128] = *(wchar(*)[6][128])*(uintptr*)0x664CE0;
|
||||||
int16 &CHud::m_ItemToFlash = *(int16*)0x95CC82;
|
int16 &CHud::m_ItemToFlash = *(int16*)0x95CC82;
|
||||||
|
|
||||||
// These aren't really in CHud
|
// These aren't really in CHud
|
||||||
@ -68,53 +68,35 @@ int16 &CHud::PagerTimer = *(int16*)0x95CC3A;
|
|||||||
int16 &CHud::PagerOn = *(int16*)0x95CCA0;
|
int16 &CHud::PagerOn = *(int16*)0x95CCA0;
|
||||||
|
|
||||||
CSprite2d *CHud::Sprites = (CSprite2d*)0x95CB9C;
|
CSprite2d *CHud::Sprites = (CSprite2d*)0x95CB9C;
|
||||||
char *WeaponFilenames[] = {
|
|
||||||
"fist",
|
struct
|
||||||
"fistm",
|
{
|
||||||
"bat",
|
const char *name;
|
||||||
"batm",
|
const char *mask;
|
||||||
"pistol",
|
} WeaponFilenames[] = {
|
||||||
"pistolm",
|
{"fist", "fistm"},
|
||||||
"uzi",
|
{"bat", "batm"},
|
||||||
"uzim",
|
{"pistol", "pistolm" },
|
||||||
"shotgun",
|
{"uzi", "uzim"},
|
||||||
"shotgunm",
|
{"shotgun", "shotgunm"},
|
||||||
"ak47",
|
{"ak47", "ak47m"},
|
||||||
"ak47m",
|
{"m16", "m16m"},
|
||||||
"m16",
|
{"sniper", "sniperm"},
|
||||||
"m16m",
|
{"rocket", "rocketm"},
|
||||||
"sniper",
|
{"flame", "flamem"},
|
||||||
"sniperm",
|
{"molotov", "molotovm"},
|
||||||
"rocket",
|
{"grenade", "grenadem"},
|
||||||
"rocketm",
|
{"detonator", "detonator_mask"},
|
||||||
"flame",
|
{"", ""},
|
||||||
"flamem",
|
{"", ""},
|
||||||
"molotov",
|
{"radardisc", "radardiscm"},
|
||||||
"molotovm",
|
{"pager", "pagerm"},
|
||||||
"grenade",
|
{"", ""},
|
||||||
"grenadem",
|
{"", ""},
|
||||||
"detonator",
|
{"bleeder", ""},
|
||||||
"detonator_mask",
|
{"sitesniper", "sitesniperm"},
|
||||||
"",
|
{"siteM16", "siteM16m"},
|
||||||
"",
|
{"siterocket", "siterocketm"}
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"radardisc",
|
|
||||||
"radardiscm",
|
|
||||||
"pager",
|
|
||||||
"pagerm",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"bleeder",
|
|
||||||
"",
|
|
||||||
"sitesniper",
|
|
||||||
"sitesniperm",
|
|
||||||
"siteM16",
|
|
||||||
"siteM16m",
|
|
||||||
"siterocket",
|
|
||||||
"siterocketm"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
RwTexture *&gpSniperSightTex = *(RwTexture**)0x8F5834;
|
RwTexture *&gpSniperSightTex = *(RwTexture**)0x8F5834;
|
||||||
@ -336,23 +318,6 @@ void CHud::Draw()
|
|||||||
|
|
||||||
AsciiToUnicode(sTemp, sPrint);
|
AsciiToUnicode(sTemp, sPrint);
|
||||||
|
|
||||||
CFont::SetBackgroundOff();
|
|
||||||
CFont::SetScale(SCREEN_SCALE_X(0.4f), SCREEN_SCALE_Y(0.6f));
|
|
||||||
CFont::SetJustifyOff();
|
|
||||||
CFont::SetCentreOn();
|
|
||||||
CFont::SetCentreSize(SCREEN_SCALE_X(640.0f));
|
|
||||||
CFont::SetPropOn();
|
|
||||||
CFont::SetFontStyle(FONT_BANK);
|
|
||||||
|
|
||||||
if (!CDarkel::FrenzyOnGoing()) {
|
|
||||||
if (WeaponType) {
|
|
||||||
if (WeaponType != WEAPONTYPE_BASEBALLBAT) {
|
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(66.0f), SCREEN_SCALE_Y(73.0f), sPrint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
DrawWeaponIcon
|
DrawWeaponIcon
|
||||||
*/
|
*/
|
||||||
@ -368,6 +333,19 @@ void CHud::Draw()
|
|||||||
1.0f,
|
1.0f,
|
||||||
1.0f);
|
1.0f);
|
||||||
|
|
||||||
|
CFont::SetBackgroundOff();
|
||||||
|
CFont::SetScale(SCREEN_SCALE_X(0.4f), SCREEN_SCALE_Y(0.6f));
|
||||||
|
CFont::SetJustifyOff();
|
||||||
|
CFont::SetCentreOn();
|
||||||
|
CFont::SetCentreSize(SCREEN_SCALE_X(640.0f));
|
||||||
|
CFont::SetPropOn();
|
||||||
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
|
|
||||||
|
if (!CDarkel::FrenzyOnGoing() && WeaponType != WEAPONTYPE_UNARMED && WeaponType != WEAPONTYPE_BASEBALLBAT) {
|
||||||
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(66.0f), SCREEN_SCALE_Y(73.0f), sPrint);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
DrawHealth
|
DrawHealth
|
||||||
*/
|
*/
|
||||||
@ -896,15 +874,17 @@ void CHud::Draw()
|
|||||||
CFont::SetPropOn();
|
CFont::SetPropOn();
|
||||||
CFont::SetFontStyle(FONT_BANK);
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
|
|
||||||
if (TheCamera.m_WideScreenOn)
|
float offsetX = SCREEN_SCALE_X(40.0f) + SCREEN_SCALE_X(8.0f);
|
||||||
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(120.0f));
|
float center = SCREEN_SCALE_FROM_RIGHT(50.0f) - SCREEN_SCALE_X(8.0f) - offsetX;
|
||||||
else
|
CFont::SetCentreSize(center);
|
||||||
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(280.0f));
|
|
||||||
|
|
||||||
CFont::SetDropShadowPosition(1);
|
const int16 shadow = 1;
|
||||||
|
CFont::SetDropShadowPosition(shadow);
|
||||||
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
|
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::SetColor(CRGBA(235, 235, 235, 255));
|
CFont::SetColor(CRGBA(235, 235, 235, 255));
|
||||||
CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_SCALE_FROM_BOTTOM(64.0f), m_Message);
|
|
||||||
|
// I'm not sure shadow substaction was intentional here, might be a leftover if CFont::PrintString was used for a shadow draw call
|
||||||
|
CFont::PrintString(center / 2.0f + offsetX - SCREEN_SCALE_X(shadow), SCREEN_SCALE_Y(4.0f) + SCREEN_SCALE_FROM_BOTTOM(68.0f) - SCREEN_SCALE_Y(shadow), m_Message);
|
||||||
CFont::SetDropShadowPosition(0);
|
CFont::SetDropShadowPosition(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -924,11 +904,11 @@ void CHud::Draw()
|
|||||||
CFont::SetFontStyle(FONT_HEADING);
|
CFont::SetFontStyle(FONT_HEADING);
|
||||||
|
|
||||||
if (BigMessageX[0] >= (SCREEN_WIDTH - 20)) {
|
if (BigMessageX[0] >= (SCREEN_WIDTH - 20)) {
|
||||||
BigMessageInUse[0] += (CTimer::GetTimeStepInSeconds() * 120.0f);
|
BigMessageInUse[0] += CTimer::GetTimeStep();
|
||||||
|
|
||||||
if (BigMessageInUse[0] >= 120.0f) {
|
if (BigMessageInUse[0] >= 120.0f) {
|
||||||
BigMessageInUse[0] = 120.0;
|
BigMessageInUse[0] = 120.0;
|
||||||
BigMessageAlpha[0] += (CTimer::GetTimeStepInSeconds() * -255.0f);
|
BigMessageAlpha[0] -= (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BigMessageAlpha[0] <= 0.0f) {
|
if (BigMessageAlpha[0] <= 0.0f) {
|
||||||
@ -937,18 +917,22 @@ void CHud::Draw()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BigMessageX[0] += (CTimer::GetTimeStepInSeconds() * 255.0f);
|
BigMessageX[0] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||||
BigMessageAlpha[0] += (CTimer::GetTimeStepInSeconds() * 255.0f);
|
BigMessageAlpha[0] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||||
|
|
||||||
if (BigMessageAlpha[0] >= 255.0f)
|
if (BigMessageAlpha[0] >= 255.0f)
|
||||||
BigMessageAlpha[0] = 255.0f;
|
BigMessageAlpha[0] = 255.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[0]));
|
CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[0]));
|
||||||
CFont::PrintString(SCREEN_WIDTH / 2, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(20.0f - 2.0f), m_BigMessage[0]);
|
#ifdef FIX_BUGS
|
||||||
|
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(18.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[0]);
|
||||||
|
#else
|
||||||
|
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[0]);
|
||||||
|
#endif
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(85, 119, 133, BigMessageAlpha[0]));
|
CFont::SetColor(CRGBA(85, 119, 133, BigMessageAlpha[0]));
|
||||||
CFont::PrintString(SCREEN_WIDTH / 2, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(20.0f), m_BigMessage[0]);
|
CFont::PrintString(SCREEN_WIDTH / 2, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(18.0f), m_BigMessage[0]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BigMessageAlpha[0] = 0.0f;
|
BigMessageAlpha[0] = 0.0f;
|
||||||
@ -1103,7 +1087,7 @@ void CHud::DrawAfterFade()
|
|||||||
DrawBigMessage2
|
DrawBigMessage2
|
||||||
*/
|
*/
|
||||||
// Oddjob
|
// Oddjob
|
||||||
if (m_BigMessage[4][0]) {
|
if (m_BigMessage[3][0]) {
|
||||||
CFont::SetJustifyOff();
|
CFont::SetJustifyOff();
|
||||||
CFont::SetBackgroundOff();
|
CFont::SetBackgroundOff();
|
||||||
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f));
|
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f));
|
||||||
@ -1113,18 +1097,35 @@ void CHud::DrawAfterFade()
|
|||||||
CFont::SetFontStyle(FONT_BANK);
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::PrintString(SCREEN_SCALE_X(2.0f) + (SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f), m_BigMessage[4]);
|
CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[3]);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(89, 115, 150, 255));
|
CFont::SetColor(CRGBA(89, 115, 150, 255));
|
||||||
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f), m_BigMessage[4]);
|
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f), m_BigMessage[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_BigMessage[1][0] && m_BigMessage[4][0]) {
|
||||||
|
CFont::SetJustifyOff();
|
||||||
|
CFont::SetBackgroundOff();
|
||||||
|
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f));
|
||||||
|
CFont::SetCentreOn();
|
||||||
|
CFont::SetPropOn();
|
||||||
|
CFont::SetCentreSize(SCREEN_SCALE_X(620.0f));
|
||||||
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
|
|
||||||
|
CFont::PrintString((SCREEN_WIDTH / 2) - SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f) - SCREEN_SCALE_Y(2.0f), m_BigMessage[3]);
|
||||||
|
|
||||||
|
CFont::SetColor(CRGBA(89, 115, 150, 255));
|
||||||
|
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f), m_BigMessage[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Oddjob result
|
// Oddjob result
|
||||||
if (OddJob2OffTimer > 0)
|
if (OddJob2OffTimer > 0)
|
||||||
OddJob2OffTimer = OddJob2OffTimer - CTimer::GetTimeStepInMilliseconds();
|
OddJob2OffTimer -= CTimer::GetTimeStepInMilliseconds();
|
||||||
|
|
||||||
static float fStep;
|
static float fStep;
|
||||||
if (!m_BigMessage[1][0] && m_BigMessage[4][0] && m_BigMessage[5][0] && OddJob2OffTimer <= 0.0f) {
|
if (m_BigMessage[5][0] && OddJob2OffTimer <= 0.0f) {
|
||||||
|
if (OddJob2On <= 3) {
|
||||||
switch (OddJob2On) {
|
switch (OddJob2On) {
|
||||||
case 0:
|
case 0:
|
||||||
OddJob2On = 1;
|
OddJob2On = 1;
|
||||||
@ -1137,8 +1138,8 @@ void CHud::DrawAfterFade()
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fStep = 40.0f;
|
fStep = 40.0f;
|
||||||
if ((OddJob2XOffset * 0.16667f) <= 40.0f)
|
if ((OddJob2XOffset / 6.0f) <= 40.0f)
|
||||||
fStep = OddJob2XOffset * 0.16667f;
|
fStep = OddJob2XOffset / 6.0f;
|
||||||
OddJob2XOffset = OddJob2XOffset - fStep;
|
OddJob2XOffset = OddJob2XOffset - fStep;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1150,8 +1151,8 @@ void CHud::DrawAfterFade()
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
fStep = 30.0f;
|
fStep = 30.0f;
|
||||||
if ((OddJob2XOffset * 0.2f) >= 30.0f)
|
if ((OddJob2XOffset / 5.0f) >= 30.0f)
|
||||||
fStep = OddJob2XOffset * 0.2f;
|
fStep = OddJob2XOffset / 5.0f;
|
||||||
|
|
||||||
OddJob2XOffset = OddJob2XOffset - fStep;
|
OddJob2XOffset = OddJob2XOffset - fStep;
|
||||||
|
|
||||||
@ -1163,20 +1164,23 @@ void CHud::DrawAfterFade()
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_BigMessage[1][0]) {
|
||||||
CFont::SetJustifyOff();
|
CFont::SetJustifyOff();
|
||||||
CFont::SetBackgroundOff();
|
CFont::SetBackgroundOff();
|
||||||
CFont::SetScale(SCREEN_SCALE_X(1.0f), SCREEN_SCALE_Y(1.2f));
|
CFont::SetScale(SCREEN_SCALE_X(1.0f), SCREEN_SCALE_Y(1.2f));
|
||||||
CFont::SetCentreOn();
|
CFont::SetCentreOn();
|
||||||
CFont::SetPropOn();
|
CFont::SetPropOn();
|
||||||
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(20.0f));
|
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(20.0f));
|
||||||
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
||||||
CFont::SetFontStyle(FONT_BANK);
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[5]);
|
||||||
CFont::PrintString(SCREEN_SCALE_X(2.0f) + (SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(20.0f + 2.0f), m_BigMessage[5]);
|
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(156, 91, 40, 255));
|
CFont::SetColor(CRGBA(156, 91, 40, 255));
|
||||||
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(20.0f + 2.0f), m_BigMessage[5]);
|
CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1193,15 +1197,15 @@ void CHud::DrawAfterFade()
|
|||||||
CFont::SetScale(SCREEN_SCALE_X(1.04f), SCREEN_SCALE_Y(1.6f));
|
CFont::SetScale(SCREEN_SCALE_X(1.04f), SCREEN_SCALE_Y(1.6f));
|
||||||
|
|
||||||
CFont::SetPropOn();
|
CFont::SetPropOn();
|
||||||
CFont::SetRightJustifyWrap(-500);
|
CFont::SetRightJustifyWrap(-500.0f);
|
||||||
CFont::SetRightJustifyOn();
|
CFont::SetRightJustifyOn();
|
||||||
CFont::SetFontStyle(FONT_HEADING);
|
CFont::SetFontStyle(FONT_HEADING);
|
||||||
if (BigMessageX[1] >= (SCREEN_WIDTH - 20)) {
|
if (BigMessageX[1] >= (SCREEN_WIDTH - 20)) {
|
||||||
BigMessageInUse[1] += (CTimer::GetTimeStepInSeconds() * 120.0f);
|
BigMessageInUse[1] += CTimer::GetTimeStep();
|
||||||
|
|
||||||
if (BigMessageInUse[1] >= 120.0f) {
|
if (BigMessageInUse[1] >= 120.0f) {
|
||||||
BigMessageInUse[1] = 120.0;
|
BigMessageInUse[1] = 120.0;
|
||||||
BigMessageAlpha[1] += (CTimer::GetTimeStepInSeconds() * -255.0f);
|
BigMessageAlpha[1] -= (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||||
}
|
}
|
||||||
if (BigMessageAlpha[1] <= 0) {
|
if (BigMessageAlpha[1] <= 0) {
|
||||||
m_BigMessage[1][0] = 0;
|
m_BigMessage[1][0] = 0;
|
||||||
@ -1209,15 +1213,15 @@ void CHud::DrawAfterFade()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BigMessageX[1] += (CTimer::GetTimeStepInSeconds() * 255.0f);
|
BigMessageX[1] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||||
BigMessageAlpha[1] += (CTimer::GetTimeStepInSeconds() * 255.0f);
|
BigMessageAlpha[1] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
||||||
|
|
||||||
if (BigMessageAlpha[1] >= 255.0f)
|
if (BigMessageAlpha[1] >= 255.0f)
|
||||||
BigMessageAlpha[1] = 255.0f;
|
BigMessageAlpha[1] = 255.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(40, 40, 40, BigMessageAlpha[1]));
|
CFont::SetColor(CRGBA(40, 40, 40, BigMessageAlpha[1]));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f - 2.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
|
||||||
|
|
||||||
CFont::SetColor(CRGBA(220, 172, 2, BigMessageAlpha[1]));
|
CFont::SetColor(CRGBA(220, 172, 2, BigMessageAlpha[1]));
|
||||||
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
|
||||||
@ -1276,9 +1280,8 @@ void CHud::GetRidOfAllHudMessages()
|
|||||||
|
|
||||||
void CHud::Initialise()
|
void CHud::Initialise()
|
||||||
{
|
{
|
||||||
debug("Init CHud");
|
m_Wants_To_Draw_Hud = true;
|
||||||
|
m_Wants_To_Draw_3dMarkers = true;
|
||||||
ReInitialise();
|
|
||||||
|
|
||||||
int HudTXD = CTxdStore::AddTxdSlot("hud");
|
int HudTXD = CTxdStore::AddTxdSlot("hud");
|
||||||
CTxdStore::LoadTxd(HudTXD, "MODELS/HUD.TXD");
|
CTxdStore::LoadTxd(HudTXD, "MODELS/HUD.TXD");
|
||||||
@ -1286,13 +1289,32 @@ void CHud::Initialise()
|
|||||||
CTxdStore::PopCurrentTxd();
|
CTxdStore::PopCurrentTxd();
|
||||||
CTxdStore::SetCurrentTxd(HudTXD);
|
CTxdStore::SetCurrentTxd(HudTXD);
|
||||||
|
|
||||||
for (int i = 0; i < ARRAY_SIZE(WeaponFilenames) / 2; i++) {
|
for (int i = 0; i < ARRAY_SIZE(WeaponFilenames); i++) {
|
||||||
Sprites[i].SetTexture(WeaponFilenames[i * 2]);
|
Sprites[i].SetTexture(WeaponFilenames[i].name, WeaponFilenames[i].mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GetRidOfAllHudMessages();
|
||||||
|
|
||||||
|
if (gpSniperSightTex == nil)
|
||||||
gpSniperSightTex = RwTextureRead("sitesniper", nil);
|
gpSniperSightTex = RwTextureRead("sitesniper", nil);
|
||||||
|
if (gpRocketSightTex == nil)
|
||||||
gpRocketSightTex = RwTextureRead("siterocket", nil);
|
gpRocketSightTex = RwTextureRead("siterocket", nil);
|
||||||
|
|
||||||
|
CounterOnLastFrame = 0;
|
||||||
|
m_ItemToFlash = ITEM_NONE;
|
||||||
|
OddJob2Timer = 0;
|
||||||
|
OddJob2OffTimer = 0.0f;
|
||||||
|
OddJob2On = 0;
|
||||||
|
OddJob2XOffset = 0.0f;
|
||||||
|
CounterFlashTimer = 0;
|
||||||
|
TimerOnLastFrame = 0;
|
||||||
|
TimerFlashTimer = 0;
|
||||||
|
SpriteBrightness = 0;
|
||||||
|
PagerOn = 0;
|
||||||
|
PagerTimer = 0;
|
||||||
|
PagerSoundPlayed = 0;
|
||||||
|
PagerXOffset = 150.0f;
|
||||||
|
|
||||||
CTxdStore::PopCurrentTxd();
|
CTxdStore::PopCurrentTxd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1328,7 +1350,7 @@ WRAPPER void CHud::SetBigMessage(wchar *message, int16 style) { EAXJMP(0x50A250)
|
|||||||
#else
|
#else
|
||||||
void CHud::SetBigMessage(wchar *message, int16 style)
|
void CHud::SetBigMessage(wchar *message, int16 style)
|
||||||
{
|
{
|
||||||
int i;
|
int i = 0;
|
||||||
|
|
||||||
if (style == 5) {
|
if (style == 5) {
|
||||||
for (i = 0; i < 128; i++) {
|
for (i = 0; i < 128; i++) {
|
||||||
@ -1379,7 +1401,7 @@ WRAPPER void CHud::SetMessage(wchar *message) { EAXJMP(0x50A210); }
|
|||||||
#else
|
#else
|
||||||
void CHud::SetMessage(wchar *message)
|
void CHud::SetMessage(wchar *message)
|
||||||
{
|
{
|
||||||
int i;
|
int i = 0;
|
||||||
for (i = 0; i < 256; i++) {
|
for (i = 0; i < 256; i++) {
|
||||||
if (message[i] == 0)
|
if (message[i] == 0)
|
||||||
break;
|
break;
|
||||||
@ -1395,7 +1417,7 @@ WRAPPER void CHud::SetPagerMessage(wchar *message) { EAXJMP(0x50A320); }
|
|||||||
#else
|
#else
|
||||||
void CHud::SetPagerMessage(wchar *message)
|
void CHud::SetPagerMessage(wchar *message)
|
||||||
{
|
{
|
||||||
int i;
|
int i = 0;
|
||||||
for (i = 0; i < 256; i++) {
|
for (i = 0; i < 256; i++) {
|
||||||
if (message[i] == 0)
|
if (message[i] == 0)
|
||||||
break;
|
break;
|
||||||
@ -1428,7 +1450,7 @@ void CHud::Shutdown()
|
|||||||
{
|
{
|
||||||
debug("Shutdown CHud");
|
debug("Shutdown CHud");
|
||||||
|
|
||||||
for (int i = 0; i < ARRAY_SIZE(WeaponFilenames) / 2; ++i) {
|
for (int i = 0; i < ARRAY_SIZE(WeaponFilenames); ++i) {
|
||||||
Sprites[i].Delete();
|
Sprites[i].Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
static wchar *m_PagerMessage;
|
static wchar *m_PagerMessage;
|
||||||
static bool &m_Wants_To_Draw_Hud;
|
static bool &m_Wants_To_Draw_Hud;
|
||||||
static bool &m_Wants_To_Draw_3dMarkers;
|
static bool &m_Wants_To_Draw_3dMarkers;
|
||||||
static wchar(*m_BigMessage)[128];
|
static wchar(&m_BigMessage)[6][128];
|
||||||
static int16 &m_ItemToFlash;
|
static int16 &m_ItemToFlash;
|
||||||
|
|
||||||
// These aren't really in CHud
|
// These aren't really in CHud
|
||||||
|
86
src/render/MoneyMessages.cpp
Normal file
86
src/render/MoneyMessages.cpp
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
#include "common.h"
|
||||||
|
#include "patcher.h"
|
||||||
|
#include "MoneyMessages.h"
|
||||||
|
#include "Timer.h"
|
||||||
|
#include "Sprite.h"
|
||||||
|
#include "Font.h"
|
||||||
|
#include "Text.h"
|
||||||
|
|
||||||
|
#define MONEY_MESSAGE_LIFETIME_MS 2000
|
||||||
|
|
||||||
|
CMoneyMessage CMoneyMessages::aMoneyMessages[NUMMONEYMESSAGES];
|
||||||
|
|
||||||
|
void
|
||||||
|
CMoneyMessage::Render()
|
||||||
|
{
|
||||||
|
const float MAX_SCALE = 4.0f;
|
||||||
|
uint32 nLifeTime = CTimer::GetTimeInMilliseconds() - m_nTimeRegistered;
|
||||||
|
if (nLifeTime >= MONEY_MESSAGE_LIFETIME_MS) m_nTimeRegistered = 0;
|
||||||
|
else {
|
||||||
|
float fLifeTime = (float)nLifeTime / MONEY_MESSAGE_LIFETIME_MS;
|
||||||
|
RwV3d vecOut;
|
||||||
|
float fDistX, fDistY;
|
||||||
|
if (CSprite::CalcScreenCoors(m_vecPosition + CVector(0.0f, 0.0f, fLifeTime), &vecOut, &fDistX, &fDistY, true)) {
|
||||||
|
fDistX *= (0.7 * fLifeTime + 2.0) * m_fSize;
|
||||||
|
fDistY *= (0.7 * fLifeTime + 2.0) * m_fSize;
|
||||||
|
CFont::SetPropOn();
|
||||||
|
CFont::SetBackgroundOff();
|
||||||
|
|
||||||
|
float fScaleY = fDistY / 100.0f;
|
||||||
|
if (fScaleY > MAX_SCALE) fScaleY = MAX_SCALE;
|
||||||
|
|
||||||
|
float fScaleX = fDistX / 100.0f;
|
||||||
|
if (fScaleX > MAX_SCALE) fScaleX = MAX_SCALE;
|
||||||
|
|
||||||
|
CFont::SetScale(fScaleX, fScaleY); // maybe use SCREEN_SCALE_X and SCREEN_SCALE_Y here?
|
||||||
|
CFont::SetCentreOn();
|
||||||
|
CFont::SetCentreSize(SCREEN_WIDTH);
|
||||||
|
CFont::SetJustifyOff();
|
||||||
|
CFont::SetColor(CRGBA(m_Colour.r, m_Colour.g, m_Colour.b, (255.0f - 255.0f * fLifeTime) * m_fOpacity));
|
||||||
|
CFont::SetBackGroundOnlyTextOff();
|
||||||
|
CFont::SetFontStyle(FONT_BANK);
|
||||||
|
CFont::PrintString(vecOut.x, vecOut.y, m_aText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CMoneyMessages::Init()
|
||||||
|
{
|
||||||
|
for (int32 i = 0; i < NUMMONEYMESSAGES; i++)
|
||||||
|
aMoneyMessages[i].m_nTimeRegistered = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CMoneyMessages::Render()
|
||||||
|
{
|
||||||
|
for (int32 i = 0; i < NUMMONEYMESSAGES; i++) {
|
||||||
|
if (aMoneyMessages[i].m_nTimeRegistered != 0)
|
||||||
|
aMoneyMessages[i].Render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CMoneyMessages::RegisterOne(CVector vecPos, const char *pText, uint8 bRed, uint8 bGreen, uint8 bBlue, float fSize, float fOpacity)
|
||||||
|
{
|
||||||
|
uint32 nIndex = 0;
|
||||||
|
while (aMoneyMessages[nIndex].m_nTimeRegistered != 0) {
|
||||||
|
if (++nIndex >= NUMMONEYMESSAGES) return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add data of this money message to the array
|
||||||
|
AsciiToUnicode(pText, aMoneyMessages[nIndex].m_aText);
|
||||||
|
|
||||||
|
aMoneyMessages[nIndex].m_nTimeRegistered = CTimer::GetTimeInMilliseconds();
|
||||||
|
aMoneyMessages[nIndex].m_vecPosition = vecPos;
|
||||||
|
aMoneyMessages[nIndex].m_Colour.red = bRed;
|
||||||
|
aMoneyMessages[nIndex].m_Colour.green = bGreen;
|
||||||
|
aMoneyMessages[nIndex].m_Colour.blue = bBlue;
|
||||||
|
aMoneyMessages[nIndex].m_fSize = fSize;
|
||||||
|
aMoneyMessages[nIndex].m_fOpacity = fOpacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
STARTPATCHES
|
||||||
|
InjectHook(0x51AF70, CMoneyMessages::Init, PATCH_JUMP);
|
||||||
|
InjectHook(0x51B030, CMoneyMessages::Render, PATCH_JUMP);
|
||||||
|
ENDPATCHES
|
24
src/render/MoneyMessages.h
Normal file
24
src/render/MoneyMessages.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
class CMoneyMessage
|
||||||
|
{
|
||||||
|
friend class CMoneyMessages;
|
||||||
|
|
||||||
|
uint32 m_nTimeRegistered;
|
||||||
|
CVector m_vecPosition;
|
||||||
|
wchar m_aText[16];
|
||||||
|
CRGBA m_Colour;
|
||||||
|
float m_fSize;
|
||||||
|
float m_fOpacity;
|
||||||
|
public:
|
||||||
|
void Render();
|
||||||
|
};
|
||||||
|
|
||||||
|
class CMoneyMessages
|
||||||
|
{
|
||||||
|
static CMoneyMessage aMoneyMessages[NUMMONEYMESSAGES];
|
||||||
|
public:
|
||||||
|
static void Init();
|
||||||
|
static void Render();
|
||||||
|
static void RegisterOne(CVector vecPos, const char *pText, uint8 bRed, uint8 bGreen, uint8 bBlue, float fSize, float fOpacity);
|
||||||
|
};
|
@ -457,6 +457,20 @@ CSprite2d::DrawRectXLU(const CRect &r, const CRGBA &c0, const CRGBA &c1, const C
|
|||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSprite2d::Draw2DPolygon(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, const CRGBA &color)
|
||||||
|
{
|
||||||
|
SetVertices(x1, y1, x2, y2, x3, y3, x4, y4, color, color, color, color);
|
||||||
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, 0);
|
||||||
|
RwRenderStateSet(rwRENDERSTATESHADEMODE, (void*)rwSHADEMODEFLAT);
|
||||||
|
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
|
||||||
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
||||||
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)(color.a != 255));
|
||||||
|
RwIm2DRenderPrimitive(rwPRIMTYPETRIFAN, CSprite2d::maVertices, 4);
|
||||||
|
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
|
||||||
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
||||||
|
RwRenderStateSet(rwRENDERSTATESHADEMODE, (void*)rwSHADEMODEGOURAUD);
|
||||||
|
}
|
||||||
|
|
||||||
STARTPATCHES
|
STARTPATCHES
|
||||||
#define C4 const CRGBA&, const CRGBA&, const CRGBA&, const CRGBA&
|
#define C4 const CRGBA&, const CRGBA&, const CRGBA&, const CRGBA&
|
||||||
#define F8 float, float, float, float, float, float, float, float
|
#define F8 float, float, float, float, float, float, float, float
|
||||||
|
@ -47,5 +47,7 @@ public:
|
|||||||
static void DrawRect(const CRect &r, const CRGBA &col);
|
static void DrawRect(const CRect &r, const CRGBA &col);
|
||||||
static void DrawRectXLU(const CRect &r, const CRGBA &c0, const CRGBA &c1, const CRGBA &c2, const CRGBA &c3);
|
static void DrawRectXLU(const CRect &r, const CRGBA &c0, const CRGBA &c1, const CRGBA &c2, const CRGBA &c3);
|
||||||
|
|
||||||
|
static void Draw2DPolygon(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, const CRGBA &color);
|
||||||
|
|
||||||
static RwIm2DVertex* GetVertices() { return maVertices; };
|
static RwIm2DVertex* GetVertices() { return maVertices; };
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user