Credits & fixes

This commit is contained in:
eray orçunus 2020-09-27 02:36:49 +03:00
parent 4cfc61da14
commit a5d6c952a7
15 changed files with 858 additions and 483 deletions

View File

@ -1869,6 +1869,13 @@ CPathFind::TakeWidthIntoAccountForWandering(CPathNode* nextNode, uint16 random)
return CVector(newX, newY, pos.z);
}
void
CPathFind::TakeWidthIntoAccountForCoors(CPathNode* node1, CPathNode* node2, uint16 random, float* x, float* y)
{
*x += (Min(node1->width, node2->width) * ((random % 16) - 7));
*y += (Min(node1->width, node2->width) * (((random / 16) % 16) - 7));
}
CPathNode*
CPathFind::GetNode(int16 index)
{

View File

@ -255,6 +255,7 @@ public:
void Load(uint8 *buf, uint32 size);
static CVector TakeWidthIntoAccountForWandering(CPathNode*, uint16);
static void TakeWidthIntoAccountForCoors(CPathNode*, CPathNode*, uint16, float*, float*);
CPathNode *GetNode(int16 index);
int16 GetIndex(CPathNode *node);

View File

@ -92,9 +92,15 @@ CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType
pCopPed->SetIdle();
pCopPed->bKindaStayInSamePlace = true;
pCopPed->bNotAllowedToDuck = false;
pCopPed->bCrouchWhenShooting = roadBlockType != 2;
pCopPed->m_nExtendedRangeTimer = CTimer::GetTimeInMilliseconds() + 10000;
pCopPed->m_nRoadblockVeh = pVehicle;
pCopPed->m_nRoadblockVeh->RegisterReference((CEntity**)&pCopPed->m_nRoadblockVeh);
pCopPed->bCrouchWhenShooting = roadBlockType == 2 ? false : true;
if (pEntityToAttack) {
if (pCopPed->m_pPointGunAt)
pCopPed->m_pPointGunAt->CleanUpOldReference(&pCopPed->m_pPointGunAt);
pCopPed->m_pPointGunAt = pEntityToAttack;
if (pEntityToAttack)
pEntityToAttack->RegisterReference(&pCopPed->m_pPointGunAt);
pCopPed->SetAttack(pEntityToAttack);
}

View File

@ -812,7 +812,7 @@ CMenuManager::DoSettingsBeforeStartingAGame()
}
void
CMenuManager::DrawStandardMenus(bool drawCurrScreen)
CMenuManager::DrawStandardMenus(bool activeScreen)
{
float nextYToUse = 0.0f; // III leftover, set but unused in VC
#ifdef PS2_LIKE_MENU
@ -1182,7 +1182,7 @@ CMenuManager::DrawStandardMenus(bool drawCurrScreen)
}
// Highlight trapezoid
if (drawCurrScreen && i == m_nCurrOption && itemsAreSelectable && section == 0) {
if (activeScreen && i == m_nCurrOption && itemsAreSelectable && section == 0) {
int leftXMax, rightXMin;
@ -2460,16 +2460,16 @@ CMenuManager::DrawBackground(bool transitionCall)
m_nMenuFadeAlpha = 255 - m_nMenuFadeAlpha;
switch (m_nCurrScreen) {
case MENUPAGE_SKIN_SELECT:
CMenuManager::DrawPlayerSetupScreen();
DrawPlayerSetupScreen(false);
break;
case MENUPAGE_KEYBOARD_CONTROLS:
CMenuManager::DrawControllerSetupScreen();
DrawControllerSetupScreen();
break;
case MENUPAGE_OUTRO:
CMenuManager::DrawQuitGameScreen();
DrawQuitGameScreen();
break;
default:
CMenuManager::DrawStandardMenus(false);
DrawStandardMenus(false);
break;
}
m_nCurrScreen = actualScreen;
@ -2479,7 +2479,7 @@ CMenuManager::DrawBackground(bool transitionCall)
switch (m_nCurrScreen) {
case MENUPAGE_SKIN_SELECT:
DrawPlayerSetupScreen();
DrawPlayerSetupScreen(true);
break;
case MENUPAGE_KEYBOARD_CONTROLS:
DrawControllerSetupScreen();
@ -2530,7 +2530,7 @@ CMenuManager::DrawBackground(bool transitionCall)
#endif
void
CMenuManager::DrawPlayerSetupScreen()
CMenuManager::DrawPlayerSetupScreen(bool activeScreen)
{
CFont::SetBackgroundOff();
CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT), MENU_Y(MENUACTION_SCALE_MULT));
@ -2807,6 +2807,7 @@ CMenuManager::DrawPlayerSetupScreen()
#endif
}
if (activeScreen)
CPlayerSkin::RenderFrontendSkinEdit();
// Big apply button
@ -4112,6 +4113,9 @@ CMenuManager::ProcessButtonPresses(uint8 goDown, uint8 goUp, uint8 optionSelecte
int oldOption = m_nCurrOption;
if (goDown) {
if (m_nCurrScreen != MENUPAGE_MAP)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0);
m_nCurrOption++;
if (m_nCurrOption == NUM_MENUROWS || (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action == MENUACTION_NOTHING)) {
m_nCurrOption = 0;
@ -4120,6 +4124,9 @@ CMenuManager::ProcessButtonPresses(uint8 goDown, uint8 goUp, uint8 optionSelecte
m_nOptionHighlightTransitionBlend = 0;
}
if (goUp) {
if (m_nCurrScreen != MENUPAGE_MAP)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0);
if (m_nCurrOption == (aScreens[m_nCurrScreen].m_aEntries[0].m_Action == MENUACTION_LABEL)) {
while (m_nCurrOption != NUM_MENUROWS - 1
&& aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption + 1].m_Action != MENUACTION_NOTHING) {

View File

@ -663,7 +663,7 @@ public:
void DrawQuitGameScreen();
void DrawFrontEnd();
void DrawBackground(bool transitionCall);
void DrawPlayerSetupScreen();
void DrawPlayerSetupScreen(bool);
int FadeIn(int alpha);
void FilterOutColorMarkersFromString(wchar*);
int GetStartOptionsCntrlConfigScreens();

View File

@ -3105,10 +3105,11 @@ void CPad::PrintErrorMessage(void)
{
if ( bDisplayNoControllerMessage && !CGame::playingIntro && !FrontEndMenuManager.m_bMenuActive )
{
CFont::SetScale(0.85f, 1.0f);
CSprite2d::DrawRect(CRect(SCREEN_STRETCH_X(20.0f), SCREEN_SCALE_FROM_BOTTOM(130.0f), SCREEN_STRETCH_FROM_RIGHT(20.0f), SCREEN_SCALE_Y(140.0f)), CRGBA(50, 50, 50, 210));
CFont::SetScale(SCREEN_SCALE_X(0.85f), SCREEN_SCALE_Y(1.0f));
CFont::SetJustifyOff();
CFont::SetBackgroundOff();
CFont::SetCentreSize(SCREEN_WIDTH - 20);
CFont::SetCentreSize(SCREEN_STRETCH_FROM_RIGHT(50.0f));
CFont::SetCentreOn();
CFont::SetPropOn();
CFont::SetColor(CRGBA(255, 255, 200, 200));
@ -3116,16 +3117,17 @@ void CPad::PrintErrorMessage(void)
CFont::PrintString
(
SCREEN_WIDTH / 2,
SCREEN_HEIGHT / 2,
SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(40.0f),
TheText.Get("NOCONT") // Please reconnect an analog controller (DUALSHOCK@) or analog controller (DUALSHOCK@2). to controller port 1 to continue
);
}
else if ( bObsoleteControllerMessage )
{
CFont::SetScale(0.85f, 1.0f);
CSprite2d::DrawRect(CRect(SCREEN_STRETCH_X(20.0f), SCREEN_SCALE_FROM_BOTTOM(130.0f), SCREEN_STRETCH_FROM_RIGHT(20.0f), SCREEN_SCALE_Y(140.0f)), CRGBA(50, 50, 50, 210));
CFont::SetScale(SCREEN_SCALE_X(0.85f), SCREEN_SCALE_Y(1.0f));
CFont::SetJustifyOff();
CFont::SetBackgroundOff();
CFont::SetCentreSize(SCREEN_WIDTH - 20);
CFont::SetCentreSize(SCREEN_STRETCH_FROM_RIGHT(50.0f));
CFont::SetCentreOn();
CFont::SetPropOn();
CFont::SetColor(CRGBA(255, 255, 200, 200));
@ -3133,7 +3135,7 @@ void CPad::PrintErrorMessage(void)
CFont::PrintString
(
SCREEN_WIDTH / 2,
SCREEN_HEIGHT / 2,
SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(40.0f),
TheText.Get("WRCONT") // The controller connected to controller port 1 is an unsupported controller. Grand Theft Auto III requires an analog controller (DUALSHOCK@) or analog controller (DUALSHOCK@2).
);
}

View File

@ -200,7 +200,7 @@ enum
MI_WMYCR,
MI_WFYST,
MI_WFOST,
MI_WMIST,
MI_WMYST,
MI_WMOST,
MI_WFYRI,
MI_WFORI,
@ -214,6 +214,24 @@ enum
MI_WMYGO,
MI_WFOGO,
MI_WMOGO,
MI_WFYLG,
MI_WMYLG,
MI_WFYBU,
MI_WMYBU,
MI_WMOBU,
MI_WFYPR,
MI_WFOTR,
MI_WMOTR,
MI_WMYPI,
MI_WMOCA,
MI_WFYJG,
MI_WMYJG,
MI_WFYSK,
MI_WMYSK,
MI_WFYSH,
MI_WFOSH,
MI_JFOTO,
MI_JMOTO,
MI_CBA = 83,
MI_CBB,

View File

@ -18,7 +18,8 @@
#include <float.h>
#endif
// --MIAMI: Done
// --MIAMI: file done except TODOs
CCivilianPed::CCivilianPed(ePedType pedtype, uint32 mi) : CPed(pedtype)
{
SetModelIndex(mi);
@ -43,7 +44,6 @@ CCivilianPed::CCivilianPed(ePedType pedtype, uint32 mi) : CPed(pedtype)
m_bAttractorUnk = (CGeneral::GetRandomNumberInRange(0.0f, 1.0f) < 1.25f);
}
// --MIAMI: Done
void
CCivilianPed::CivilianAI(void)
{
@ -221,7 +221,6 @@ CCivilianPed::CivilianAI(void)
}
}
// --MIAMI: Done except comments
void
CCivilianPed::ProcessControl(void)
{
@ -504,7 +503,6 @@ bool CCivilianPed::IsAttractedTo(int8 type)
return false;
}
// --MIAMI: Done
void
CCivilianPed::EnterVacantNearbyCars(void)
{

View File

@ -20,6 +20,8 @@
#include "Ropes.h"
#include "Stinger.h"
// --MIAMI: file done except TODOs
CCopPed::CCopPed(eCopType copType, int32 modifier) : CPed(PEDTYPE_COP)
{
m_nCopType = copType;
@ -83,10 +85,10 @@ CCopPed::CCopPed(eCopType copType, int32 modifier) : CPed(PEDTYPE_COP)
m_attackTimer = 0;
m_bBeatingSuspect = false;
m_bStopAndShootDisabledZone = false;
field_601 = false;
m_bDragsPlayerFromCar = false;
m_bZoneDisabled = false;
field_628 = -1;
m_nRoadblockNode = -1; // TODO(Miami): this will be nil
m_nRoadblockVeh = nil;
m_bThrowsSpikeTrap = false;
m_pRopeEntity = nil;
m_fAbseilPos = 0.0f;
@ -106,7 +108,6 @@ CCopPed::~CCopPed()
delete m_pStinger;
}
// --MIAMI: Done
// Parameter should always be CPlayerPed, but it seems they considered making civilians arrestable at some point
void
CCopPed::SetArrestPlayer(CPed *player)
@ -155,7 +156,6 @@ CCopPed::SetArrestPlayer(CPed *player)
SetCurrentWeapon(WEAPONTYPE_COLT45);
}
// --MIAMI: Done
void
CCopPed::ClearPursuit(void)
{
@ -194,7 +194,7 @@ CCopPed::ClearPursuit(void)
bNotAllowedToDuck = false;
bKindaStayInSamePlace = false;
m_bStopAndShootDisabledZone = false;
field_601 = false;
m_bDragsPlayerFromCar = false;
m_bZoneDisabled = false;
ClearObjective();
if (IsPedInControl()) {
@ -212,7 +212,6 @@ CCopPed::ClearPursuit(void)
}
}
// --MIAMI: Done
// TODO: I don't know why they needed that parameter.
void
CCopPed::SetPursuit(bool ignoreCopLimit)
@ -245,7 +244,6 @@ CCopPed::SetPursuit(bool ignoreCopLimit)
}
}
// --MIAMI: Done
void
CCopPed::ArrestPlayer(void)
{
@ -311,7 +309,6 @@ CCopPed::ScanForCrimes(void)
}
}
// --MIAMI: Done
void
CCopPed::CopAI(void)
{
@ -465,17 +462,13 @@ CCopPed::CopAI(void)
bNotAllowedToDuck = false;
bDuckAndCover = false;
} else {
// TODO(Miami): Roadblock system is still III
float dotProd;
if (m_nRoadblockNode != -1) {
CPathNode *roadBlockNode = &ThePaths.m_pathNodes[CRoadBlocks::RoadBlockNodes[m_nRoadblockNode]];
dotProd = DotProduct2D(playerOrHisVeh->GetPosition() - roadBlockNode->GetPosition(), GetPosition() - roadBlockNode->GetPosition());
if (m_nRoadblockVeh) {
dotProd = DotProduct2D(playerOrHisVeh->GetPosition() - m_nRoadblockVeh->GetPosition(), GetPosition() - m_nRoadblockVeh->GetPosition());
} else
dotProd = -1.0f;
if(dotProd >= 0.0f) {
bIsPointingGunAt = true;
} else {
if(dotProd < 0.0f) {
if (bIsDucking)
ClearDuck();
m_bIsDisabledCop = false;
@ -484,6 +477,8 @@ CCopPed::CopAI(void)
bCrouchWhenShooting = false;
bDuckAndCover = false;
SetPursuit(false);
} else {
bIsPointingGunAt = true;
}
}
}
@ -601,7 +596,6 @@ CCopPed::CopAI(void)
}
}
// --MIAMI: Done
void
CCopPed::ProcessControl(void)
{
@ -822,7 +816,6 @@ CCopPed::ProcessControl(void)
field_624 = 0;
}
// --MIAMI: Done
void
CCopPed::ProcessHeliSwat(void)
{
@ -858,7 +851,6 @@ CCopPed::ProcessHeliSwat(void)
}
}
// --MIAMI: Done
void
CCopPed::ProcessStingerCop(void)
{

View File

@ -14,14 +14,14 @@ enum eCopType
class CCopPed : public CPed
{
public:
int16 m_nRoadblockNode;
CVehicle* m_nRoadblockVeh;
float m_fDistanceToTarget;
bool m_bIsInPursuit;
bool m_bIsDisabledCop;
int8 field_5FE;
bool m_bBeatingSuspect;
bool m_bStopAndShootDisabledZone;
bool field_601; // set when police dragging player from car
bool m_bDragsPlayerFromCar;
bool m_bZoneDisabled;
float m_fAbseilPos;
eCopType m_nCopType;

View File

@ -67,6 +67,8 @@
#include "CutsceneShadow.h"
#include "Clock.h"
// --MIAMI: file done except TODOs
#define CAN_SEE_ENTITY_ANGLE_THRESHOLD DEGTORAD(60.0f)
CPed *gapTempPedList[50];
@ -10945,7 +10947,7 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
pedToDragOut->RegisterThreatWithGangPeds(ped);
if (ped->m_nPedType == PEDTYPE_COP && pedToDragOut == FindPlayerPed() && veh->IsBike())
((CCopPed*)ped)->field_601 = 1;
((CCopPed*)ped)->m_bDragsPlayerFromCar = 1;
if (pedToDragOut == veh->pDriver) {
if (veh->pPassengers[0])
@ -20894,11 +20896,11 @@ CPed::KillCharOnFootMelee(CVector &ourPos, CVector &targetPos, CVector &distWith
}
if (m_nPedType == PEDTYPE_COP && m_pedInObjective->IsPlayer()) {
float maxArrestDist = 1.5f;
if (((CCopPed*)this)->field_601) {
if (((CCopPed*)this)->m_bDragsPlayerFromCar) {
if (m_nPedState == PED_FALL) {
maxArrestDist = 3.5f;
} else if (m_nPedState != PED_DRAG_FROM_CAR) {
((CCopPed*)this)->field_601 = 0;
((CCopPed*)this)->m_bDragsPlayerFromCar = 0;
}
}
@ -21139,11 +21141,11 @@ CPed::KillCharOnFootArmed(CVector &ourPos, CVector &targetPos, CVector &distWith
}
if (m_nPedType == PEDTYPE_COP && m_pedInObjective->IsPlayer()) {
float maxArrestDist = 1.5f;
if (((CCopPed*)this)->field_601) {
if (((CCopPed*)this)->m_bDragsPlayerFromCar) {
if (m_nPedState == PED_FALL) {
maxArrestDist = 3.5f;
} else if (m_nPedState != PED_DRAG_FROM_CAR) {
((CCopPed*)this)->field_601 = 0;
((CCopPed*)this)->m_bDragsPlayerFromCar = 0;
}
}

View File

@ -14,9 +14,9 @@ enum ePedType
PEDTYPE_GANG2,
PEDTYPE_GANG3,
PEDTYPE_GANG4,
PEDTYPE_GANG5,
PEDTYPE_GANG5, // Security - hardcoded
PEDTYPE_GANG6,
PEDTYPE_GANG7, // Vercetti gang
PEDTYPE_GANG7, // Vercetti gang - hardcoded
PEDTYPE_GANG8,
PEDTYPE_GANG9,
PEDTYPE_EMERGENCY,

File diff suppressed because it is too large Load Diff

View File

@ -84,7 +84,9 @@ enum eBeachToy
BEACHTOY_2,
BEACHTOY_3,
BEACHTOY_4,
BEACHTOY_LOUNGE = 5
BEACHTOY_LOUNGE = 5,
BEACHTOY_6,
BEACHTOY_11 = 11
};
extern RwRaster* gpWaterRaster;

View File

@ -826,6 +826,9 @@ void joysChangeCB(int jid, int event);
bool IsThisJoystickBlacklisted(int i)
{
if (glfwJoystickIsGamepad(i))
return false;
const char* joyname = glfwGetJoystickName(i);
// this is just a keyboard and mouse
@ -833,6 +836,19 @@ bool IsThisJoystickBlacklisted(int i)
// Microsoft Microsoft® 2.4GHz Transceiver v8.0 System Control
if (strstr(joyname, "2.4GHz Transceiver"))
return true;
// COMPANY USB Device System Control
// COMPANY USB Device Consumer Control
if (strstr(joyname, "COMPANY USB"))
return true;
// i.e. Synaptics TM2438-005
if (strstr(joyname, "Synaptics "))
return true;
// i.e. ELAN Touchscreen
if (strstr(joyname, "ELAN "))
return true;
// i.e. Primax Electronics, Ltd HP Wireless Keyboard Mouse Kit Consumer Control
if (strstr(joyname, "Keyboard"))
return true;
return false;
}
@ -2031,11 +2047,11 @@ void CapturePad(RwInt32 padID)
// Gamepad axes are guaranteed to return 0.0f if that particular gamepad doesn't have that axis.
if ( glfwPad != -1 ) {
leftStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[0] : numAxes >= 0 ? axes[0] : 0.0f;
leftStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[1] : numAxes >= 1 ? axes[1] : 0.0f;
leftStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[0] : numAxes >= 1 ? axes[0] : 0.0f;
leftStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[1] : numAxes >= 2 ? axes[1] : 0.0f;
rightStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[2] : numAxes >= 2 ? axes[2] : 0.0f;
rightStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[3] : numAxes >= 3 ? axes[3] : 0.0f;
rightStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[2] : numAxes >= 3 ? axes[2] : 0.0f;
rightStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[3] : numAxes >= 4 ? axes[3] : 0.0f;
}
{