mirror of
https://github.com/halpz/re3.git
synced 2025-07-15 23:38:12 +00:00
Merge remote-tracking branch 'origin/master' into miami
# Conflicts: # src/audio/AudioLogic.cpp # src/audio/soundlist.h # src/control/Script.cpp # src/control/ScriptCommands.h # src/core/Cam.cpp # src/core/Camera.cpp # src/core/Camera.h # src/core/Frontend.cpp # src/core/Frontend.h # src/core/Game.cpp # src/core/MenuScreens.cpp # src/core/Pad.cpp # src/core/Pad.h # src/core/config.h # src/entities/Entity.cpp # src/render/Credits.cpp # src/render/Fluff.cpp # src/render/Hud.cpp # src/render/MBlur.cpp # src/render/Timecycle.cpp # src/skel/glfw/glfw.cpp # src/skel/win/win.cpp # src/text/Text.cpp
This commit is contained in:
@ -1366,7 +1366,7 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient
|
||||
TargetCoors.z += fTranslateCamUp;
|
||||
|
||||
float AlphaOffset, BetaOffset;
|
||||
if(CPad::GetPad(0)->IsPlayerControlsDisabledBy(PLAYERCONTROL_DISABLED_20)){
|
||||
if(CPad::GetPad(0)->IsPlayerControlsDisabledBy(PLAYERCONTROL_PLAYERINFO)){
|
||||
CVector ToCam = Source - TargetCoors;
|
||||
ToCam.Normalise();
|
||||
if(ToCam.z < -0.9f)
|
||||
@ -1400,7 +1400,7 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient
|
||||
|
||||
if(TheCamera.GetFading() && TheCamera.GetFadingDirection() == FADE_IN && nFadeControlThreshhold < CDraw::FadeValue ||
|
||||
CDraw::FadeValue > 200 ||
|
||||
CPad::GetPad(0)->IsPlayerControlsDisabledBy(PLAYERCONTROL_DISABLED_20)){
|
||||
CPad::GetPad(0)->IsPlayerControlsDisabledBy(PLAYERCONTROL_PLAYERINFO)){
|
||||
if(Alpha < fDefaultAlphaOrient-0.05f)
|
||||
AlphaOffset = 0.05f;
|
||||
else if(Alpha < fDefaultAlphaOrient)
|
||||
@ -1525,7 +1525,7 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient
|
||||
|
||||
if(((CPed*)CamTargetEntity)->CanStrafeOrMouseControl() && CDraw::FadeValue < 250 &&
|
||||
(TheCamera.GetFadingDirection() != FADE_OUT || CDraw::FadeValue <= 100) &&
|
||||
!CPad::GetPad(0)->IsPlayerControlsDisabledBy(PLAYERCONTROL_DISABLED_20)){
|
||||
!CPad::GetPad(0)->IsPlayerControlsDisabledBy(PLAYERCONTROL_PLAYERINFO)){
|
||||
float Heading = Front.Heading();
|
||||
((CPed*)TheCamera.pTargetEntity)->m_fRotationCur = Heading;
|
||||
((CPed*)TheCamera.pTargetEntity)->m_fRotationDest = Heading;
|
||||
@ -1534,6 +1534,8 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient
|
||||
}
|
||||
}
|
||||
|
||||
float fBillsBetaOffset; // made up name, actually in CCam
|
||||
|
||||
void
|
||||
CCam::Process_BehindCar(const CVector &CameraTarget, float TargetOrientation, float, float)
|
||||
{
|
||||
@ -1553,6 +1555,15 @@ CCam::Process_BehindCar(const CVector &CameraTarget, float TargetOrientation, fl
|
||||
if(Length < 0.002f)
|
||||
Length = 0.002f;
|
||||
Beta = CGeneral::GetATanOfXY(TargetCoors.x - Source.x, TargetCoors.y - Source.y);
|
||||
#ifdef TOGGLEABLE_BETA_FEATURES
|
||||
// This is completely made up but Bill's cam manipulates an angle before calling this
|
||||
// and otherwise calculating Beta doesn't make much sense.
|
||||
Beta += fBillsBetaOffset;
|
||||
fBillsBetaOffset = 0.0f;
|
||||
Dist.x = -Length*Cos(Beta);
|
||||
Dist.y = -Length*Sin(Beta);
|
||||
Source = TargetCoors + Dist;
|
||||
#endif
|
||||
if(Length > CA_MAX_DISTANCE){
|
||||
Source.x = TargetCoors.x + Dist.x/Length * CA_MAX_DISTANCE;
|
||||
Source.y = TargetCoors.y + Dist.y/Length * CA_MAX_DISTANCE;
|
||||
@ -2815,7 +2826,7 @@ CCam::Process_1rstPersonPedOnPC(const CVector&, float TargetOrientation, float,
|
||||
FOV /= (255.0f*CTimer::GetTimeStep() + 10000.0f) / 10000.0f;
|
||||
}
|
||||
|
||||
TheCamera.SetMotionBlur(180, 255, 180, 120, MBLUR_SNIPER);
|
||||
TheCamera.SetMotionBlur(180, 255, 180, 120, MOTION_BLUR_SNIPER);
|
||||
|
||||
if(FOV > DefaultFOV)
|
||||
FOV = DefaultFOV;
|
||||
@ -2939,7 +2950,7 @@ CCam::Process_Sniper(const CVector &CameraTarget, float TargetOrientation, float
|
||||
FOVSpeed = 0.0f;
|
||||
}
|
||||
|
||||
TheCamera.SetMotionBlur(180, 255, 180, 120, MBLUR_SNIPER);
|
||||
TheCamera.SetMotionBlur(180, 255, 180, 120, MOTION_BLUR_SNIPER);
|
||||
|
||||
if(FOV > DefaultFOV)
|
||||
FOV = DefaultFOV;
|
||||
@ -3715,11 +3726,11 @@ CCam::Process_Fixed(const CVector &CameraTarget, float, float, float)
|
||||
float f = BOAT_UNDERWATER_CAM_COLORMAG_LIMIT/WaterLum;
|
||||
TheCamera.SetMotionBlur(CTimeCycle::GetWaterRed()*f,
|
||||
CTimeCycle::GetWaterGreen()*f,
|
||||
CTimeCycle::GetWaterBlue()*f, BOAT_UNDERWATER_CAM_BLUR, MBLUR_NORMAL);
|
||||
CTimeCycle::GetWaterBlue()*f, BOAT_UNDERWATER_CAM_BLUR, MOTION_BLUR_LIGHT_SCENE);
|
||||
}else{
|
||||
TheCamera.SetMotionBlur(CTimeCycle::GetWaterRed(),
|
||||
CTimeCycle::GetWaterGreen(),
|
||||
CTimeCycle::GetWaterBlue(), BOAT_UNDERWATER_CAM_BLUR, MBLUR_NORMAL);
|
||||
CTimeCycle::GetWaterBlue(), BOAT_UNDERWATER_CAM_BLUR, MOTION_BLUR_LIGHT_SCENE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3938,7 +3949,11 @@ CCam::Process_Debug(const CVector&, float, float, float)
|
||||
Source.y += 1.0f;
|
||||
GetVectorsReadyForRW();
|
||||
|
||||
CPad::GetPad(0)->DisablePlayerControls = PLAYERCONTROL_DISABLED_1;
|
||||
#ifdef FIX_BUGS
|
||||
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_CAMERA);
|
||||
#else
|
||||
CPad::GetPad(0)->DisablePlayerControls = PLAYERCONTROL_CAMERA;
|
||||
#endif
|
||||
|
||||
if(CPad::GetPad(1)->GetLeftShockJustDown() && gbBigWhiteDebugLightSwitchedOn)
|
||||
CShadows::StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &Source,
|
||||
|
@ -549,15 +549,15 @@ CCamera::Process(void)
|
||||
GetMatrix().GetPosition().y += shakeOffset * (((shakeRand & 0xF0) >> 4) - 7);
|
||||
GetMatrix().GetPosition().z += shakeOffset * (((shakeRand & 0xF00) >> 8) - 7);
|
||||
|
||||
if(shakeOffset > 0.0f && m_BlurType != MBLUR_SNIPER)
|
||||
if(shakeOffset > 0.0f && m_BlurType != MOTION_BLUR_SNIPER)
|
||||
SetMotionBlurAlpha(Min((int)(shakeStrength*255.0f) + 25, 150));
|
||||
|
||||
static bool bExtra1stPrsBlur = false;
|
||||
if(Cams[ActiveCam].Mode == CCam::MODE_1STPERSON && FindPlayerVehicle() && FindPlayerVehicle()->GetUp().z < 0.2f){
|
||||
SetMotionBlur(230, 230, 230, 215, MBLUR_NORMAL);
|
||||
SetMotionBlur(230, 230, 230, 215, MOTION_BLUR_LIGHT_SCENE);
|
||||
bExtra1stPrsBlur = true;
|
||||
}else if(bExtra1stPrsBlur){
|
||||
SetMotionBlur(CTimeCycle::GetBlurRed(), CTimeCycle::GetBlurGreen(), CTimeCycle::GetBlurBlue(), m_motionBlur, MBLUR_NORMAL);
|
||||
SetMotionBlur(CTimeCycle::GetBlurRed(), CTimeCycle::GetBlurGreen(), CTimeCycle::GetBlurBlue(), m_motionBlur, MOTION_BLUR_LIGHT_SCENE);
|
||||
bExtra1stPrsBlur = false;
|
||||
}
|
||||
|
||||
@ -694,7 +694,7 @@ CCamera::CamControl(void)
|
||||
m_bFailedCullZoneTestPreviously = CCullZones::CamCloseInForPlayer();
|
||||
|
||||
if(m_bLookingAtPlayer){
|
||||
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_DISABLED_1;
|
||||
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_CAMERA;
|
||||
FindPlayerPed()->bIsVisible = true;
|
||||
}
|
||||
|
||||
@ -1029,7 +1029,7 @@ CCamera::CamControl(void)
|
||||
m_bFirstPersonBeingUsed = false;
|
||||
if(m_bFirstPersonBeingUsed){
|
||||
ReqMode = CCam::MODE_1STPERSON;
|
||||
CPad::GetPad(0)->DisablePlayerControls |= PLAYERCONTROL_DISABLED_1;
|
||||
CPad::GetPad(0)->DisablePlayerControls |= PLAYERCONTROL_CAMERA;
|
||||
}
|
||||
|
||||
// Zoom value
|
||||
@ -1679,7 +1679,7 @@ CCamera::CamControl(void)
|
||||
}else if(Cams[ActiveCam].Mode != m_iModeToGoTo){
|
||||
m_bStartInterScript = true;
|
||||
m_iTypeOfSwitch = JUMP_CUT;
|
||||
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_DISABLED_1;
|
||||
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_CAMERA;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2548,7 +2548,7 @@ CCamera::DrawBordersForWideScreen(void)
|
||||
bottom = SCREEN_HEIGHT;
|
||||
}
|
||||
|
||||
if(m_BlurType == MBLUR_NONE || m_BlurType == MBLUR_NORMAL)
|
||||
if(m_BlurType == MOTION_BLUR_NONE || m_BlurType == MOTION_BLUR_LIGHT_SCENE)
|
||||
SetMotionBlurAlpha(80);
|
||||
|
||||
// top border
|
||||
@ -3913,7 +3913,7 @@ CCamera::SetCameraDirectlyInFrontForFollowPed_CamOnAString(void)
|
||||
void
|
||||
CCamera::SetNewPlayerWeaponMode(int16 mode, int16 minZoom, int16 maxZoom)
|
||||
{
|
||||
SetMotionBlur(CTimeCycle::GetBlurRed(), CTimeCycle::GetBlurGreen(), CTimeCycle::GetBlurBlue(), m_motionBlur, MBLUR_NORMAL);
|
||||
SetMotionBlur(CTimeCycle::GetBlurRed(), CTimeCycle::GetBlurGreen(), CTimeCycle::GetBlurBlue(), m_motionBlur, MOTION_BLUR_LIGHT_SCENE);
|
||||
PlayerWeaponMode.Mode = mode;
|
||||
PlayerWeaponMode.MaxZoom = maxZoom;
|
||||
PlayerWeaponMode.MinZoom = minZoom;
|
||||
@ -3923,7 +3923,7 @@ CCamera::SetNewPlayerWeaponMode(int16 mode, int16 minZoom, int16 maxZoom)
|
||||
void
|
||||
CCamera::ClearPlayerWeaponMode(void)
|
||||
{
|
||||
SetMotionBlur(CTimeCycle::GetBlurRed(), CTimeCycle::GetBlurGreen(), CTimeCycle::GetBlurBlue(), m_motionBlur, MBLUR_NORMAL);
|
||||
SetMotionBlur(CTimeCycle::GetBlurRed(), CTimeCycle::GetBlurGreen(), CTimeCycle::GetBlurBlue(), m_motionBlur, MOTION_BLUR_LIGHT_SCENE);
|
||||
PlayerWeaponMode.Mode = 0;
|
||||
PlayerWeaponMode.MaxZoom = 1;
|
||||
PlayerWeaponMode.MinZoom = -1;
|
||||
|
@ -186,7 +186,6 @@ public:
|
||||
CPed *m_pLastPedLookedAt;// So interpolation works
|
||||
bool m_bFirstPersonRunAboutActive;
|
||||
|
||||
|
||||
CCam(void) { Init(); }
|
||||
void Init(void);
|
||||
void Process(void);
|
||||
@ -295,16 +294,16 @@ enum
|
||||
|
||||
enum
|
||||
{
|
||||
MBLUR_NONE,
|
||||
MBLUR_SNIPER,
|
||||
MBLUR_NORMAL,
|
||||
MBLUR_INTRO1, // green camera
|
||||
MBLUR_INTRO2, // unused
|
||||
MBLUR_INTRO3, // bank scene
|
||||
MBLUR_INTRO4, // jail break scene
|
||||
MBLUR_INTRO5, // explosion
|
||||
MBLUR_INTRO6, // player shot
|
||||
MBLUR_UNUSED, // pinkish
|
||||
MOTION_BLUR_NONE = 0,
|
||||
MOTION_BLUR_SNIPER,
|
||||
MOTION_BLUR_LIGHT_SCENE,
|
||||
MOTION_BLUR_SECURITY_CAM,
|
||||
MOTION_BLUR_CUT_SCENE,
|
||||
MOTION_BLUR_INTRO,
|
||||
MOTION_BLUR_INTRO2,
|
||||
MOTION_BLUR_SNIPER_ZOOM,
|
||||
MOTION_BLUR_INTRO3,
|
||||
MOTION_BLUR_INTRO4,
|
||||
};
|
||||
|
||||
enum
|
||||
@ -414,9 +413,12 @@ public:
|
||||
float CarZoomValueSmooth;
|
||||
|
||||
float DistanceToWater;
|
||||
#ifndef PS2_CAM_TRANSITION
|
||||
float FOVDuringInter;
|
||||
#endif
|
||||
float LODDistMultiplier;
|
||||
float GenerationDistMultiplier;
|
||||
#ifndef PS2_CAM_TRANSITION
|
||||
float m_fAlphaSpeedAtStartInter;
|
||||
float m_fAlphaWhenInterPol;
|
||||
float m_fAlphaDuringInterPol;
|
||||
@ -427,6 +429,7 @@ public:
|
||||
float m_fFOVSpeedAtStartInter;
|
||||
float m_fStartingBetaForInterPol;
|
||||
float m_fStartingAlphaForInterPol;
|
||||
#endif
|
||||
float m_PedOrientForBehindOrInFront;
|
||||
float m_CameraAverageSpeed;
|
||||
float m_CameraSpeedSoFar;
|
||||
@ -489,9 +492,11 @@ public:
|
||||
CVector m_vecUpWhenInterPol;
|
||||
CVector m_vecClearGeometryVec;
|
||||
CVector m_vecGameCamPos;
|
||||
#ifndef PS2_CAM_TRANSITION
|
||||
CVector SourceDuringInter;
|
||||
CVector TargetDuringInter;
|
||||
CVector UpDuringInter;
|
||||
#endif
|
||||
RwCamera *m_pRwCamera;
|
||||
CEntity *pTargetEntity;
|
||||
CCamPathSplines m_arrPathArray[MAX_NUM_OF_SPLINETYPES];
|
||||
@ -509,7 +514,6 @@ public:
|
||||
CVector m_vecOldSourceForInter;
|
||||
CVector m_vecOldFrontForInter;
|
||||
CVector m_vecOldUpForInter;
|
||||
|
||||
float m_vecOldFOVForInter;
|
||||
float m_fFLOATingFade;
|
||||
float m_fFLOATingFadeMusic;
|
||||
|
@ -11,6 +11,7 @@ public:
|
||||
static void SetDirMyDocuments(void);
|
||||
static int LoadFile(const char *file, uint8 *buf, int unused, const char *mode);
|
||||
static int OpenFile(const char *file, const char *mode);
|
||||
static int OpenFile(const char *file) { return OpenFile(file, "rb"); }
|
||||
static int OpenFileForWriting(const char *file);
|
||||
static int Read(int fd, const char *buf, int len);
|
||||
static int Write(int fd, const char *buf, int len);
|
||||
|
@ -1,15 +1,13 @@
|
||||
#include "common.h"
|
||||
#include "main.h"
|
||||
#include "Timer.h"
|
||||
#include "Pad.h"
|
||||
#include "ControllerConfig.h"
|
||||
#include "VisibilityPlugins.h"
|
||||
#include "Sprite2d.h"
|
||||
#include "Text.h"
|
||||
#include "Font.h"
|
||||
#include "Frontend.h"
|
||||
#include "FrontEndControls.h"
|
||||
|
||||
#define X SCREEN_SCALE_X
|
||||
#define Y(x) SCREEN_SCALE_Y(float(x)*(float(DEFAULT_SCREEN_HEIGHT)/float(DEFAULT_SCREEN_HEIGHT_PAL)))
|
||||
|
||||
void
|
||||
CPlaceableShText::Draw(float x, float y)
|
||||
@ -490,7 +488,7 @@ void
|
||||
CMenuMultiChoiceTriggered::SelectCurrentOptionUnderCursor(void)
|
||||
{
|
||||
CMenuMultiChoice::SelectCurrentOptionUnderCursor();
|
||||
if(m_cursor != -1)
|
||||
if(m_cursor != -1 && m_triggers[m_cursor] != nil )
|
||||
m_triggers[m_cursor](this);
|
||||
}
|
||||
|
||||
@ -581,7 +579,10 @@ CMenuMultiChoicePictured::Draw(const CRGBA &optionHighlight, const CRGBA &titleH
|
||||
for(i = 0; i < m_numOptions; i++)
|
||||
if(i == m_cursor){
|
||||
if(m_bHasSprite[i])
|
||||
m_sprites[i].Draw(CRGBA(255, 255, 255, 255), m_position.x+x, m_position.y+y);
|
||||
{
|
||||
uint8 color = Max(Max(optionHighlight.r, optionHighlight.g), optionHighlight.b);
|
||||
m_sprites[i].Draw(CRGBA(color, color, color, optionHighlight.a), m_position.x+x, m_position.y+y);
|
||||
}
|
||||
}else{
|
||||
if(m_bHasSprite[i]){
|
||||
if(m_options[i].m_bSelected)
|
||||
@ -1210,10 +1211,10 @@ CMenuSlider::Draw(const CRGBA &optionHighlight, const CRGBA &titleHighlight, flo
|
||||
{
|
||||
if(m_bActive){
|
||||
CRGBA selectionCol = m_colors[0];
|
||||
if(selectionCol.red == SELECTED_TEXT_COLOR_0.red &&
|
||||
selectionCol.green == SELECTED_TEXT_COLOR_0.green &&
|
||||
selectionCol.blue == SELECTED_TEXT_COLOR_0.blue &&
|
||||
selectionCol.alpha == SELECTED_TEXT_COLOR_0.alpha)
|
||||
if(optionHighlight.red == SELECTED_TEXT_COLOR_0.red &&
|
||||
optionHighlight.green == SELECTED_TEXT_COLOR_0.green &&
|
||||
optionHighlight.blue == SELECTED_TEXT_COLOR_0.blue &&
|
||||
optionHighlight.alpha == SELECTED_TEXT_COLOR_0.alpha)
|
||||
selectionCol = m_colors[1];
|
||||
|
||||
if(m_style == 1){
|
||||
@ -1223,10 +1224,10 @@ CMenuSlider::Draw(const CRGBA &optionHighlight, const CRGBA &titleHighlight, flo
|
||||
CVector2D boxPos = m_box.m_position + m_position + CVector2D(x,y);
|
||||
if(m_box.m_bDropShadow)
|
||||
CSprite2d::DrawRect(
|
||||
CRect(boxPos.x + m_box.m_shadowOffset.x,
|
||||
boxPos.y + m_box.m_shadowOffset.y,
|
||||
boxPos.x + m_box.m_shadowOffset.x + m_size[0].x,
|
||||
boxPos.y + m_box.m_shadowOffset.y + m_size[0].y),
|
||||
CRect(boxPos.x + X(m_box.m_shadowOffset.x),
|
||||
boxPos.y + Y(m_box.m_shadowOffset.y),
|
||||
boxPos.x + X(m_box.m_shadowOffset.x) + m_size[0].x,
|
||||
boxPos.y + Y(m_box.m_shadowOffset.y) + m_size[0].y),
|
||||
shadowCol);
|
||||
CSprite2d::DrawRect(
|
||||
CRect(boxPos.x, boxPos.y,
|
||||
@ -1266,10 +1267,10 @@ CMenuSlider::DrawNormal(float x, float y)
|
||||
CVector2D boxPos = m_box.m_position + m_position + CVector2D(x,y);
|
||||
if(m_box.m_bDropShadow)
|
||||
CSprite2d::DrawRect(
|
||||
CRect(boxPos.x + m_box.m_shadowOffset.x,
|
||||
boxPos.y + m_box.m_shadowOffset.y,
|
||||
boxPos.x + m_box.m_shadowOffset.x + m_size[0].x,
|
||||
boxPos.y + m_box.m_shadowOffset.y + m_size[0].y),
|
||||
CRect(boxPos.x + X(m_box.m_shadowOffset.x),
|
||||
boxPos.y + Y(m_box.m_shadowOffset.y),
|
||||
boxPos.x + X(m_box.m_shadowOffset.x) + m_size[0].x,
|
||||
boxPos.y + Y(m_box.m_shadowOffset.y) + m_size[0].y),
|
||||
shadowCol);
|
||||
CSprite2d::DrawRect(
|
||||
CRect(boxPos.x, boxPos.y,
|
||||
@ -1312,10 +1313,10 @@ CMenuSlider::DrawHighlighted(const CRGBA &titleHighlight, float x, float y)
|
||||
CVector2D boxPos = m_box.m_position + m_position + CVector2D(x,y);
|
||||
if(m_box.m_bDropShadow)
|
||||
CSprite2d::DrawRect(
|
||||
CRect(boxPos.x + m_box.m_shadowOffset.x,
|
||||
boxPos.y + m_box.m_shadowOffset.y,
|
||||
boxPos.x + m_box.m_shadowOffset.x + m_size[0].x,
|
||||
boxPos.y + m_box.m_shadowOffset.y + m_size[0].y),
|
||||
CRect(boxPos.x + X(m_box.m_shadowOffset.x),
|
||||
boxPos.y + Y(m_box.m_shadowOffset.y),
|
||||
boxPos.x + X(m_box.m_shadowOffset.x) + m_size[0].x,
|
||||
boxPos.y + Y(m_box.m_shadowOffset.y) + m_size[0].y),
|
||||
shadowCol);
|
||||
CSprite2d::DrawRect(
|
||||
CRect(boxPos.x, boxPos.y,
|
||||
@ -1345,20 +1346,20 @@ void
|
||||
CMenuSlider::DrawTicks(const CVector2D &position, const CVector2D &size, float heightRight, float level, const CRGBA &leftCol, const CRGBA &selCol, const CRGBA &rightCol, bool bShadow, const CVector2D &shadowOffset, const CRGBA &shadowColor)
|
||||
{
|
||||
int i;
|
||||
int numTicks = size.x / 8.0f;
|
||||
int numTicks = size.x / X(8.0f);
|
||||
float dy = heightRight - size.y;
|
||||
float stepy = dy / numTicks;
|
||||
int left = level*numTicks;
|
||||
int drewSelection = 0;
|
||||
for(i = 0; i < numTicks; i++){
|
||||
CRect rect(position.x + 8.0f*i, position.y + dy - stepy*i,
|
||||
position.x + 8.0f*i + 4.0f, position.y + dy + size.y);
|
||||
CRect rect(position.x + X(8.0f)*i, position.y + dy - stepy*i,
|
||||
position.x + X(8.0f)*i + X(4.0f), position.y + dy + size.y);
|
||||
if(bShadow){
|
||||
CRect shadowRect = rect;
|
||||
shadowRect.left += shadowOffset.x;
|
||||
shadowRect.right += shadowOffset.x;
|
||||
shadowRect.top += shadowOffset.y;
|
||||
shadowRect.bottom += shadowOffset.y;
|
||||
shadowRect.left += X(shadowOffset.x);
|
||||
shadowRect.right += X(shadowOffset.x);
|
||||
shadowRect.top += Y(shadowOffset.y);
|
||||
shadowRect.bottom += Y(shadowOffset.y);
|
||||
CSprite2d::DrawRect(shadowRect, shadowColor);
|
||||
}
|
||||
if(i < left)
|
||||
@ -1375,19 +1376,19 @@ void
|
||||
CMenuSlider::DrawTicks(const CVector2D &position, const CVector2D &size, float heightRight, float level, const CRGBA &leftCol, const CRGBA &rightCol, bool bShadow, const CVector2D &shadowOffset, const CRGBA &shadowColor)
|
||||
{
|
||||
int i;
|
||||
int numTicks = size.x / 8.0f;
|
||||
int numTicks = size.x / X(8.0f);
|
||||
float dy = heightRight - size.y;
|
||||
float stepy = dy / numTicks;
|
||||
int left = level*numTicks;
|
||||
for(i = 0; i < numTicks; i++){
|
||||
CRect rect(position.x + 8.0f*i, position.y + dy - stepy*i,
|
||||
position.x + 8.0f*i + 4.0f, position.y + dy + size.y);
|
||||
CRect rect(position.x + X(8.0f)*i, position.y + dy - stepy*i,
|
||||
position.x + X(8.0f)*i + X(4.0f), position.y + dy + size.y);
|
||||
if(bShadow){
|
||||
CRect shadowRect = rect;
|
||||
shadowRect.left += shadowOffset.x;
|
||||
shadowRect.right += shadowOffset.x;
|
||||
shadowRect.top += shadowOffset.y;
|
||||
shadowRect.bottom += shadowOffset.y;
|
||||
shadowRect.left += X(shadowOffset.x);
|
||||
shadowRect.right += X(shadowOffset.x);
|
||||
shadowRect.top += Y(shadowOffset.y);
|
||||
shadowRect.bottom += Y(shadowOffset.y);
|
||||
CSprite2d::DrawRect(shadowRect, shadowColor);
|
||||
}
|
||||
if(i < left)
|
||||
@ -1553,7 +1554,7 @@ CMenuLineLister::Draw(const CRGBA &optionHighlight, const CRGBA &titleHighlight,
|
||||
for(; i < n; i++){
|
||||
CVector2D linePos = m_linesLeft[i].m_position;
|
||||
|
||||
if(linePos.y+m_position.y - (m_scrollPosition+m_position.y) < 64.0f)
|
||||
if(linePos.y+m_position.y - (m_scrollPosition+m_position.y) < Y(64.0f))
|
||||
m_lineFade[i] = -4.0f*Abs(m_scrollSpeed);
|
||||
else
|
||||
m_lineFade[i] = 4.0f*Abs(m_scrollSpeed);
|
||||
@ -1652,7 +1653,12 @@ CMenuPage::ActiveMenuTwoState_SelectNextPosition(void)
|
||||
if(sel == 1)
|
||||
m_pCurrentControl->SelectCurrentOptionUnderCursor();
|
||||
else if(sel == 0){
|
||||
m_pCurrentControl->GoNext();
|
||||
if ( m_pCurrentControl )
|
||||
{
|
||||
if ( !m_pCurrentControl->GoNext() )
|
||||
m_pCurrentControl->GoFirst();
|
||||
}
|
||||
|
||||
m_pCurrentControl->SelectCurrentOptionUnderCursor();
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,41 @@ enum {
|
||||
NUM_PAGE_WIDGETS = 10,
|
||||
};
|
||||
|
||||
class CTriggerCaller
|
||||
{
|
||||
bool bHasTrigger;
|
||||
void *pTrigger;
|
||||
void (*pFunc)(void *);
|
||||
int field_C;
|
||||
public:
|
||||
|
||||
CTriggerCaller() : bHasTrigger(false), pFunc(nil)
|
||||
{}
|
||||
|
||||
void SetTrigger(void *func, void *trigger)
|
||||
{
|
||||
if ( !bHasTrigger )
|
||||
{
|
||||
pFunc = (void (*)(void *))func;
|
||||
pTrigger = trigger;
|
||||
bHasTrigger = true;
|
||||
}
|
||||
}
|
||||
|
||||
void CallTrigger(void)
|
||||
{
|
||||
if ( bHasTrigger && pFunc != nil )
|
||||
pFunc(pTrigger);
|
||||
|
||||
bHasTrigger = false;
|
||||
pFunc = nil;
|
||||
}
|
||||
|
||||
bool CanCall()
|
||||
{
|
||||
return bHasTrigger;
|
||||
}
|
||||
};
|
||||
|
||||
class CPlaceableText
|
||||
{
|
||||
@ -17,7 +52,7 @@ public:
|
||||
wchar *m_text;
|
||||
|
||||
CPlaceableText(void)
|
||||
: m_position(0.0f, 0.0f), m_color(255, 255, 255, 255) {}
|
||||
: m_position(0.0f, 0.0f), m_color(255, 255, 255, 255), m_text(nil) {}
|
||||
void SetPosition(float x, float y) { m_position.x = x; m_position.y = y; }
|
||||
void SetColor(const CRGBA &color) { m_color = color; }
|
||||
CRGBA GetColor(void) { return m_color; }
|
||||
@ -553,11 +588,14 @@ public:
|
||||
static wchar Buf16[8];
|
||||
|
||||
CMenuSlider(void)
|
||||
: m_value(0), m_bDrawPercentage(false), m_bActive(false), m_style(0) {}
|
||||
: m_value(0), m_bDrawPercentage(false), m_bActive(false), m_style(0)
|
||||
{
|
||||
AddTickBox(0.0f, 0.0f, 100.0f, 10.0f, 10.0f); //todo
|
||||
}
|
||||
|
||||
void SetColors(const CRGBA &title, const CRGBA &percentage, const CRGBA &left, const CRGBA &right);
|
||||
void DrawTicks(const CVector2D &position, const CVector2D &size, float heightRight, float level, const CRGBA &leftCol, const CRGBA &selCol, const CRGBA &rightCol, bool bShadow, const CVector2D &shadowOffset, const CRGBA &shadowColor);
|
||||
void DrawTicks(const CVector2D &position, const CVector2D &size, float heightRight, float level, const CRGBA &leftCol, const CRGBA &rightCol, bool bShadow, const CVector2D &shadowOffset, const CRGBA &shadowColor);
|
||||
void DrawTicks(const CVector2D &position, const CVector2D &size, float heightRight, float level, const CRGBA &leftCol, const CRGBA &rightCol, bool bShadow, const CVector2D &shadowOffset, const CRGBA &shadowColor);
|
||||
void AddTickBox(float positionX, float positionY, float width, float heigthLeft, float heightRight);
|
||||
void AddTitle(wchar *text, float positionX, float positionY);
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#define WITHWINDOWS
|
||||
#include "common.h"
|
||||
#ifndef PS2_MENU
|
||||
#include "crossplatform.h"
|
||||
#include "platform.h"
|
||||
#include "Frontend.h"
|
||||
@ -5580,3 +5581,5 @@ uint8 CMenuManager::GetNumberOfMenuOptions()
|
||||
|
||||
#undef GetBackJustUp
|
||||
#undef GetBackJustDown
|
||||
|
||||
#endif
|
@ -1,4 +1,7 @@
|
||||
#pragma once
|
||||
#ifdef PS2_MENU
|
||||
#include "Frontend_PS2.h"
|
||||
#else
|
||||
|
||||
#include "Sprite2d.h"
|
||||
|
||||
@ -94,20 +97,6 @@
|
||||
#define CONTSETUP_BACK_BOTTOM 122.0f
|
||||
#define CONTSETUP_BACK_HEIGHT 25.0f
|
||||
|
||||
enum eLanguages
|
||||
{
|
||||
LANGUAGE_AMERICAN,
|
||||
LANGUAGE_FRENCH,
|
||||
LANGUAGE_GERMAN,
|
||||
LANGUAGE_ITALIAN,
|
||||
LANGUAGE_SPANISH,
|
||||
#ifdef MORE_LANGUAGES
|
||||
LANGUAGE_POLISH,
|
||||
LANGUAGE_RUSSIAN,
|
||||
LANGUAGE_JAPANESE,
|
||||
#endif
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
MENUALIGN_LEFT = 1,
|
||||
@ -591,6 +580,19 @@ public:
|
||||
int32 m_nSelectedScreenMode;
|
||||
#endif
|
||||
|
||||
enum LANGUAGE
|
||||
{
|
||||
LANGUAGE_AMERICAN,
|
||||
LANGUAGE_FRENCH,
|
||||
LANGUAGE_GERMAN,
|
||||
LANGUAGE_ITALIAN,
|
||||
LANGUAGE_SPANISH,
|
||||
#ifdef MORE_LANGUAGES
|
||||
LANGUAGE_POLISH,
|
||||
LANGUAGE_RUSSIAN,
|
||||
LANGUAGE_JAPANESE,
|
||||
#endif
|
||||
};
|
||||
bool GetIsMenuActive() {return !!m_bMenuActive;}
|
||||
|
||||
static uint8 m_PrefsStereoMono;
|
||||
@ -666,3 +668,6 @@ VALIDATE_SIZE(CMenuManager, 0x688);
|
||||
#endif
|
||||
|
||||
extern CMenuManager FrontEndMenuManager;
|
||||
|
||||
|
||||
#endif
|
1393
src/core/FrontendTriggers.h
Normal file
1393
src/core/FrontendTriggers.h
Normal file
File diff suppressed because it is too large
Load Diff
3034
src/core/Frontend_PS2.cpp
Normal file
3034
src/core/Frontend_PS2.cpp
Normal file
File diff suppressed because it is too large
Load Diff
244
src/core/Frontend_PS2.h
Normal file
244
src/core/Frontend_PS2.h
Normal file
@ -0,0 +1,244 @@
|
||||
#pragma once
|
||||
#include "Sprite2d.h"
|
||||
|
||||
enum
|
||||
{
|
||||
PAGE_STATS,
|
||||
PAGE_LOAD,
|
||||
PAGE_BRIEFS,
|
||||
PAGE_CONTROLS,
|
||||
PAGE_AUDIO,
|
||||
PAGE_DISPLAY,
|
||||
PAGE_LANGUAGE,
|
||||
|
||||
NUM_PAGES,
|
||||
PAGE_FIRST = PAGE_STATS,
|
||||
PAGE_LAST = PAGE_LANGUAGE,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PAGESTATE_NORMAL = 0,
|
||||
PAGESTATE_HIGHLIGHTED,
|
||||
PAGESTATE_SELECTED
|
||||
};
|
||||
|
||||
|
||||
enum eFrontendSprites
|
||||
{
|
||||
FE2_MAINPANEL_UL,
|
||||
FE2_MAINPANEL_UR,
|
||||
FE2_MAINPANEL_DL,
|
||||
FE2_MAINPANEL_DR,
|
||||
FE2_MAINPANEL_DR2,
|
||||
FE2_TABACTIVE,
|
||||
FE_ICONBRIEF,
|
||||
FE_ICONSTATS,
|
||||
FE_ICONCONTROLS,
|
||||
FE_ICONSAVE,
|
||||
FE_ICONAUDIO,
|
||||
FE_ICONDISPLAY,
|
||||
FE_ICONLANGUAGE,
|
||||
FE_CONTROLLER,
|
||||
FE_CONTROLLERSH,
|
||||
FE_ARROWS1,
|
||||
FE_ARROWS2,
|
||||
FE_ARROWS3,
|
||||
FE_ARROWS4,
|
||||
FE_RADIO1,
|
||||
FE_RADIO2,
|
||||
FE_RADIO3,
|
||||
FE_RADIO4,
|
||||
FE_RADIO5,
|
||||
FE_RADIO6,
|
||||
FE_RADIO7,
|
||||
FE_RADIO8,
|
||||
FE_RADIO9,
|
||||
|
||||
NUM_FE_SPRITES
|
||||
};
|
||||
|
||||
|
||||
class CSprite2d;
|
||||
class CVector2D;
|
||||
|
||||
#ifdef GTA_PC
|
||||
enum eControlMethod
|
||||
{
|
||||
CONTROL_STANDARD = 0,
|
||||
CONTROL_CLASSIC,
|
||||
};
|
||||
#endif
|
||||
|
||||
class CMenuManager
|
||||
{
|
||||
public:
|
||||
enum LANGUAGE
|
||||
{
|
||||
LANGUAGE_AMERICAN,
|
||||
LANGUAGE_FRENCH,
|
||||
LANGUAGE_GERMAN,
|
||||
LANGUAGE_ITALIAN,
|
||||
LANGUAGE_SPANISH,
|
||||
#ifdef MORE_LANGUAGES
|
||||
LANGUAGE_POLISH,
|
||||
LANGUAGE_RUSSIAN,
|
||||
LANGUAGE_JAPANESE,
|
||||
#endif
|
||||
};
|
||||
|
||||
enum CONTRCONFIG
|
||||
{
|
||||
CONFIG_1 = 0,
|
||||
CONFIG_2,
|
||||
CONFIG_3,
|
||||
CONFIG_4,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
NUM_SPRIRES = 28,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PAGESTATE_NORMAL = 0,
|
||||
PAGESTATE_HIGHLIGHTED = 1,
|
||||
PAGESTATE_SELELECTED = 2,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SLIDE_TO_BOTTOM = 0,
|
||||
SLIDE_TO_RIGHT,
|
||||
SLIDE_TO_TOP,
|
||||
SLIDE_TO_LEFT,
|
||||
SLIDE_MAX
|
||||
};
|
||||
|
||||
int32 m_currentPage;
|
||||
int32 m_newPage;
|
||||
int32 m_pageState;
|
||||
uint32 m_nPageLeftTimer;
|
||||
uint32 m_nPageRightTimer;
|
||||
uint32 m_nChangePageTimer;
|
||||
int field_18;
|
||||
uint8 m_fade;
|
||||
uint8 m_someAlpha;
|
||||
//char field_1E; // unused ?
|
||||
//char field_1F; // unused ?
|
||||
uint32 m_nStartPauseTimer;
|
||||
uint32 m_nEndPauseTimer;
|
||||
CVector2D m_position;
|
||||
uint8 m_nSlidingDir;
|
||||
//char field_31; // unused ?
|
||||
//char field_32; // unused ?
|
||||
//char field_33; // unused ?
|
||||
bool m_bInitialised;
|
||||
bool m_bWantToUpdateContent;
|
||||
bool m_bMenuActive;
|
||||
bool m_bWantToRestart;
|
||||
//char field_38; //unused ?
|
||||
bool m_bRenderGameInMenu;
|
||||
bool m_bSaveMenuActive;
|
||||
bool m_bInSaveZone;
|
||||
char field_3C;
|
||||
bool m_bTexturesLoaded;
|
||||
//char field_3E; //unused ?
|
||||
//char field_3F; //unused ?
|
||||
CSprite2d m_sprites[NUM_SPRIRES];
|
||||
|
||||
static int32 m_PrefsSfxVolume;
|
||||
static int32 m_PrefsMusicVolume;
|
||||
static int32 m_PrefsBrightness;
|
||||
static bool m_PrefsShowTrails;
|
||||
static bool m_PrefsShowSubtitles;
|
||||
static bool m_PrefsAllowNastyGame;
|
||||
static int32 m_PrefsRadioStation;
|
||||
static int32 m_PrefsStereoMono;
|
||||
static int8 m_PrefsUseWideScreen;
|
||||
static int32 m_PrefsLanguage;
|
||||
static CONTRCONFIG m_PrefsControllerConfig;
|
||||
static bool m_PrefsUseVibration;
|
||||
|
||||
|
||||
#ifdef GTA_PC
|
||||
bool m_bQuitGameNoCD;
|
||||
|
||||
int32 m_nMouseTempPosX;
|
||||
int32 m_nMouseTempPosY;
|
||||
int32 m_nPrefsVideoMode;
|
||||
int32 m_nDisplayVideoMode;
|
||||
int8 m_nPrefsAudio3DProviderIndex;
|
||||
|
||||
static int32 OS_Language;
|
||||
static int8 m_PrefsVsync;
|
||||
static int8 m_PrefsVsyncDisp;
|
||||
static int8 m_PrefsFrameLimiter;
|
||||
static int8 m_PrefsSpeakers;
|
||||
static int32 m_ControlMethod;
|
||||
static int8 m_PrefsDMA;
|
||||
static float m_PrefsLOD;
|
||||
static char m_PrefsSkinFile[256];
|
||||
|
||||
#ifndef MASTER
|
||||
static bool m_PrefsMarketing;
|
||||
static bool m_PrefsDisableTutorials;
|
||||
#endif // !MASTER
|
||||
|
||||
#ifdef MENU_MAP
|
||||
static bool bMenuMapActive;
|
||||
static float fMapSize;
|
||||
static float fMapCenterY;
|
||||
static float fMapCenterX;
|
||||
#endif
|
||||
|
||||
#ifdef IMPROVED_VIDEOMODE
|
||||
int32 m_nPrefsWidth = 640;
|
||||
int32 m_nPrefsHeight = 480;
|
||||
int32 m_nPrefsDepth = 32;
|
||||
int32 m_nPrefsWindowed = 1;
|
||||
int32 m_nPrefsSubsystem;
|
||||
int32 m_nSelectedScreenMode;
|
||||
#endif
|
||||
|
||||
void WaitForUserCD() { }
|
||||
#endif
|
||||
|
||||
bool GetIsMenuActive() {return !!m_bMenuActive;}
|
||||
|
||||
CMenuManager(void);
|
||||
#ifdef FIX_BUGS
|
||||
~CMenuManager(void)
|
||||
{
|
||||
UnloadTextures();
|
||||
}
|
||||
#endif
|
||||
|
||||
void LoadAllTextures(void);
|
||||
void UnloadTextures(void);
|
||||
|
||||
void InitialiseMenusOnce(void);
|
||||
void InitialiseChangedLanguageSettings(void);
|
||||
void InitialiseMenuContents(void);
|
||||
void AnaliseMenuContents(void);
|
||||
void InitialiseMenuContentsAfterLoadingGame(void);
|
||||
void DrawFrontEnd(void);
|
||||
void DrawFrontEndNormal(void);
|
||||
void DrawFrontEndSaveZone(void);
|
||||
void DrawMemoryCardStartUpMenus(void);
|
||||
void Process(void);
|
||||
void WorkOutMenuState(uint8 bExit);
|
||||
void ProcessControllerInput(void);
|
||||
void ProcessDPadLeftJustDown(void);
|
||||
void ProcessDPadRightJustDown(void);
|
||||
void ProcessDPadUpJustDown(void);
|
||||
void ProcessDPadDownJustDown(void);
|
||||
void ProcessDPadTriangleJustDown(void);
|
||||
void ProcessDPadCrossJustDown(void);
|
||||
void DoHackingMenusAtPageBrowse(void);
|
||||
void SetSoundLevelsForMusicMenu(void);
|
||||
void FilterOutColorMarkersFromString(wchar *string, CRGBA &color);
|
||||
};
|
||||
|
||||
extern CMenuManager FrontEndMenuManager;
|
@ -43,6 +43,7 @@
|
||||
#include "Lights.h"
|
||||
#include "MBlur.h"
|
||||
#include "Messages.h"
|
||||
#include "MemoryCard.h"
|
||||
#include "Pad.h"
|
||||
#include "Particle.h"
|
||||
#include "ParticleObject.h"
|
||||
@ -104,6 +105,43 @@ bool CGame::japaneseGame = false;
|
||||
|
||||
int gameTxdSlot;
|
||||
|
||||
|
||||
bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha);
|
||||
void DoRWStuffEndOfFrame(void);
|
||||
void MessageScreen(char *msg)
|
||||
{
|
||||
//TODO: stretch_screen
|
||||
|
||||
CRect rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
CRGBA color(255, 255, 255, 255);
|
||||
|
||||
DoRWStuffStartOfFrame(50, 50, 50, 0, 0, 0, 255);
|
||||
|
||||
CSprite2d::InitPerFrame();
|
||||
CFont::InitPerFrame();
|
||||
DefinedState();
|
||||
|
||||
CSprite2d *splash = LoadSplash(NULL);
|
||||
splash->Draw(rect, color, color, color, color);
|
||||
splash->DrawRect(CRect(SCREEN_SCALE_X(20.0f), SCREEN_SCALE_Y(110.0f), SCREEN_SCALE_X(620.0f), SCREEN_SCALE_Y(300.0f)), CRGBA(50, 50, 50, 192));
|
||||
|
||||
CFont::SetFontStyle(FONT_BANK);
|
||||
CFont::SetBackgroundOff();
|
||||
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(190.0f)); // 450.0f
|
||||
CFont::SetScale(SCREEN_SCALE_X(1.0f), SCREEN_SCALE_Y(1.0f));
|
||||
CFont::SetCentreOn();
|
||||
CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(190.0f)); // 450.0f
|
||||
CFont::SetJustifyOff();
|
||||
CFont::SetColor(CRGBA(255, 255, 255, 255));
|
||||
CFont::SetDropColor(CRGBA(32, 32, 32, 255));
|
||||
CFont::SetDropShadowPosition(3);
|
||||
CFont::SetPropOn();
|
||||
CFont::PrintString(SCREEN_SCALE_X(320.0f), SCREEN_SCALE_Y(130.0f), TheText.Get(msg));
|
||||
CFont::DrawFonts();
|
||||
|
||||
DoRWStuffEndOfFrame();
|
||||
}
|
||||
|
||||
bool
|
||||
CGame::InitialiseOnceBeforeRW(void)
|
||||
{
|
||||
@ -278,6 +316,7 @@ bool CGame::Initialise(const char* datFile)
|
||||
COcclusion::Init();
|
||||
CCollision::Init();
|
||||
CSetPieces::Init();
|
||||
TheText.Load();
|
||||
CTheZones::Init();
|
||||
CUserDisplay::Init();
|
||||
CMessages::Init();
|
||||
@ -286,6 +325,11 @@ bool CGame::Initialise(const char* datFile)
|
||||
CRestart::Initialise();
|
||||
CWorld::Initialise();
|
||||
CParticle::Initialise();
|
||||
#ifdef PS2
|
||||
gStartX = -180.0f;
|
||||
gStartY = 180.0f;
|
||||
gStartZ = 14.0f;
|
||||
#endif
|
||||
CAnimManager::Initialise();
|
||||
CCutsceneMgr::Initialise();
|
||||
CCarCtrl::Init();
|
||||
@ -366,10 +410,16 @@ bool CGame::Initialise(const char* datFile)
|
||||
CCredits::Init();
|
||||
CRecordDataForChase::Init();
|
||||
CReplay::Init();
|
||||
LoadingScreen("Loading the Game", "Start script", nil);
|
||||
#ifdef PS2_MENU
|
||||
if ( !TheMemoryCard.m_bWantToLoad )
|
||||
{
|
||||
#endif
|
||||
CTheScripts::StartTestScript();
|
||||
CTheScripts::Process();
|
||||
TheCamera.Process();
|
||||
#ifdef PS2_MENU
|
||||
}
|
||||
#endif
|
||||
LoadingScreen("Loading the Game", "Load scene", nil);
|
||||
CCollision::ms_collisionInMemory = currLevel;
|
||||
for (int i = 0; i < MAX_PADS; i++)
|
||||
@ -433,8 +483,15 @@ bool CGame::ShutDown(void)
|
||||
void CGame::ReInitGameObjectVariables(void)
|
||||
{
|
||||
CGameLogic::InitAtStartOfGame();
|
||||
TheCamera.CCamera::Init();
|
||||
#ifdef PS2_MENU
|
||||
if ( !TheMemoryCard.m_bWantToLoad )
|
||||
{
|
||||
#endif
|
||||
TheCamera.Init();
|
||||
TheCamera.SetRwCamera(Scene.camera);
|
||||
#ifdef PS2_MENU
|
||||
}
|
||||
#endif
|
||||
CDebug::DebugInitTextBuffer();
|
||||
CWeather::Init();
|
||||
CUserDisplay::Init();
|
||||
@ -443,6 +500,11 @@ void CGame::ReInitGameObjectVariables(void)
|
||||
CWorld::bDoingCarCollisions = false;
|
||||
CHud::ReInitialise();
|
||||
CRadar::Initialise();
|
||||
#ifdef PS2
|
||||
gStartX = -180.0f;
|
||||
gStartY = 180.0f;
|
||||
gStartZ = 14.0f;
|
||||
#endif
|
||||
CCarCtrl::ReInit();
|
||||
CTimeCycle::Initialise();
|
||||
CDraw::SetFOV(120.0f);
|
||||
@ -458,6 +520,10 @@ void CGame::ReInitGameObjectVariables(void)
|
||||
CWorld::Players[i].Clear();
|
||||
|
||||
CWorld::PlayerInFocus = 0;
|
||||
#ifdef PS2
|
||||
CWeaponEffects::Init();
|
||||
CSkidmarks::Init();
|
||||
#endif
|
||||
CAntennas::Init();
|
||||
CGlass::Init();
|
||||
gPhoneInfo.Initialise();
|
||||
@ -473,11 +539,19 @@ void CGame::ReInitGameObjectVariables(void)
|
||||
CPickups::Init();
|
||||
CPacManPickups::Init();
|
||||
CGarages::Init();
|
||||
#ifdef PS2
|
||||
CClouds::Init();
|
||||
CRemote::Init();
|
||||
#endif
|
||||
CSpecialFX::Init();
|
||||
CWaterCannons::Init();
|
||||
CParticle::ReloadConfig();
|
||||
|
||||
#ifdef PS2_MENU
|
||||
if ( !TheMemoryCard.m_bWantToLoad )
|
||||
#else
|
||||
if ( !FrontEndMenuManager.m_bWantToLoad )
|
||||
#endif
|
||||
{
|
||||
CCranes::InitCranes();
|
||||
CTheScripts::StartTestScript();
|
||||
@ -589,8 +663,8 @@ void CGame::Process(void)
|
||||
ProcessTidyUpMemory();
|
||||
#endif
|
||||
TheCamera.SetMotionBlurAlpha(0);
|
||||
if (TheCamera.m_BlurType == MBLUR_NONE || TheCamera.m_BlurType == MBLUR_SNIPER || TheCamera.m_BlurType == MBLUR_NORMAL)
|
||||
TheCamera.SetMotionBlur(0, 0, 0, 0, MBLUR_NONE);
|
||||
if (TheCamera.m_BlurType == MOTION_BLUR_NONE || TheCamera.m_BlurType == MOTION_BLUR_SNIPER || TheCamera.m_BlurType == MOTION_BLUR_LIGHT_SCENE)
|
||||
TheCamera.SetMotionBlur(0, 0, 0, 0, MOTION_BLUR_NONE);
|
||||
#ifdef DEBUGMENU
|
||||
DebugMenuProcess();
|
||||
#endif
|
||||
|
880
src/core/Pad.cpp
880
src/core/Pad.cpp
File diff suppressed because it is too large
Load Diff
@ -2,14 +2,14 @@
|
||||
|
||||
enum {
|
||||
PLAYERCONTROL_ENABLED = 0,
|
||||
PLAYERCONTROL_DISABLED_1 = 1, // used by first person camera
|
||||
PLAYERCONTROL_DISABLED_2 = 2,
|
||||
PLAYERCONTROL_CAMERA = 1,
|
||||
PLAYERCONTROL_UNK2 = 2,
|
||||
PLAYERCONTROL_GARAGE = 4,
|
||||
PLAYERCONTROL_DISABLED_8 = 8,
|
||||
PLAYERCONTROL_DISABLED_10 = 16,
|
||||
PLAYERCONTROL_DISABLED_20 = 32, // used on CPlayerInfo::MakePlayerSafe
|
||||
PLAYERCONTROL_DISABLED_40 = 64, // used on phone calls
|
||||
PLAYERCONTROL_DISABLED_80 = 128,// used on cutscenes
|
||||
PLAYERCONTROL_UNK8 = 8,
|
||||
PLAYERCONTROL_UNK10 = 16,
|
||||
PLAYERCONTROL_PLAYERINFO = 32,
|
||||
PLAYERCONTROL_PHONE = 64,
|
||||
PLAYERCONTROL_CUTSCENE = 128,
|
||||
PLAYERCONTROL_SHORTCUT_TAXI = 256,
|
||||
};
|
||||
|
||||
@ -198,13 +198,13 @@ public:
|
||||
|
||||
static void UpdatePads(void);
|
||||
void ProcessPCSpecificStuff(void);
|
||||
void Update(int16 unk);
|
||||
void Update(int16 pad);
|
||||
|
||||
static void DoCheats(void);
|
||||
void DoCheats(int16 unk);
|
||||
|
||||
static void StopPadsShaking(void);
|
||||
void StopShaking(int16 unk);
|
||||
void StopShaking(int16 pad);
|
||||
|
||||
static CPad *GetPad(int32 pad);
|
||||
|
||||
@ -455,6 +455,11 @@ public:
|
||||
void SetDisablePlayerControls(uint16 who) { DisablePlayerControls |= who; }
|
||||
void SetEnablePlayerControls(uint16 who) { DisablePlayerControls &= ~who; }
|
||||
bool IsPlayerControlsDisabledBy(uint16 who) { return DisablePlayerControls & who; }
|
||||
|
||||
int16 GetMode() { return Mode; }
|
||||
void SetMode(int16 mode) { Mode = mode; }
|
||||
|
||||
static bool IsNoOrObsolete() { return bDisplayNoControllerMessage || bObsoleteControllerMessage; }
|
||||
};
|
||||
|
||||
VALIDATE_SIZE(CPad, 0xFC);
|
||||
|
@ -180,7 +180,7 @@ CPlayerInfo::MakePlayerSafe(bool toggle)
|
||||
if (toggle) {
|
||||
m_pPed->m_pWanted->m_bIgnoredByEveryone = true;
|
||||
CWorld::StopAllLawEnforcersInTheirTracks();
|
||||
CPad::GetPad(0)->DisablePlayerControls |= PLAYERCONTROL_DISABLED_20;
|
||||
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_PLAYERINFO);
|
||||
CPad::StopPadsShaking();
|
||||
m_pPed->bBulletProof = true;
|
||||
m_pPed->bFireProof = true;
|
||||
@ -201,7 +201,7 @@ CPlayerInfo::MakePlayerSafe(bool toggle)
|
||||
}
|
||||
else {
|
||||
m_pPed->m_pWanted->m_bIgnoredByEveryone = false;
|
||||
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_DISABLED_20;
|
||||
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_PLAYERINFO);
|
||||
m_pPed->bBulletProof = false;
|
||||
m_pPed->bFireProof = false;
|
||||
m_pPed->bCollisionProof = false;
|
||||
|
@ -62,6 +62,7 @@ public:
|
||||
|
||||
friend bool GenericLoad(void);
|
||||
friend bool GenericSave(int file);
|
||||
friend class CMemoryCard;
|
||||
|
||||
#ifdef FIX_BUGS
|
||||
static float GetDefaultTimeStep(void) { return 50.0f / 30.0f; }
|
||||
|
@ -103,6 +103,8 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
|
||||
|
||||
#define DEFAULT_SCREEN_WIDTH (640)
|
||||
#define DEFAULT_SCREEN_HEIGHT (448)
|
||||
#define DEFAULT_SCREEN_HEIGHT_PAL (512)
|
||||
#define DEFAULT_SCREEN_HEIGHT_NTSC (448)
|
||||
#define DEFAULT_ASPECT_RATIO (4.0f/3.0f)
|
||||
#define DEFAULT_VIEWWINDOW (0.7f)
|
||||
|
||||
@ -153,6 +155,16 @@ public:
|
||||
CRGBA(void) { }
|
||||
CRGBA(uint8 r, uint8 g, uint8 b, uint8 a) : r(r), g(g), b(b), a(a) { }
|
||||
|
||||
bool operator ==(const CRGBA &right)
|
||||
{
|
||||
return this->r == right.r && this->g == right.g && this->b == right.b && this->a == right.a;
|
||||
}
|
||||
|
||||
bool operator !=(const CRGBA &right)
|
||||
{
|
||||
return !(*this == right);
|
||||
}
|
||||
|
||||
CRGBA &operator =(const CRGBA &right)
|
||||
{
|
||||
this->r = right.r;
|
||||
|
@ -232,14 +232,20 @@ enum Config {
|
||||
#define REGISTER_START_BUTTON
|
||||
|
||||
// Hud, frontend and radar
|
||||
#define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC
|
||||
// #define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
|
||||
#define MENU_MAP // VC-like menu map. Make sure you have new menu.txd
|
||||
#define SCROLLABLE_STATS_PAGE // only draggable by mouse atm
|
||||
#define TRIANGLE_BACK_BUTTON
|
||||
// #define CIRCLE_BACK_BUTTON
|
||||
#define HUD_ENHANCEMENTS // Adjusts some aspects to make the HUD look/behave a little bit better.
|
||||
#define BETA_SLIDING_TEXT
|
||||
#define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC
|
||||
#define PC_MENU
|
||||
|
||||
#ifndef PC_MENU
|
||||
# define PS2_MENU
|
||||
//# define PS2_MENU_USEALLPAGEICONS
|
||||
#else
|
||||
//# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
|
||||
# define MENU_MAP // VC-like menu map. Make sure you have new menu.txd
|
||||
# define SCROLLABLE_STATS_PAGE // only draggable by mouse atm
|
||||
# define TRIANGLE_BACK_BUTTON
|
||||
//# define CIRCLE_BACK_BUTTON
|
||||
//#define CUSTOM_FRONTEND_OPTIONS
|
||||
#define LEGACY_MENU_OPTIONS
|
||||
#define MUCH_SHORTER_OUTRO_SCREEN
|
||||
@ -249,7 +255,14 @@ enum Config {
|
||||
#define USE_MEASUREMENTS_IN_METERS // makes game use meters instead of feet in script
|
||||
#define USE_PRECISE_MEASUREMENT_CONVERTION // makes game convert feet to meeters more precisely
|
||||
//#define MISSION_REPLAY // mobile feature
|
||||
#endif
|
||||
//#define SIMPLIER_MISSIONS // apply simplifications from mobile
|
||||
//#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
||||
#define SCRIPT_LOG_FILE_LEVEL 1 // 0 == no log, 1 == overwrite every frame, 2 == full log
|
||||
|
||||
#ifndef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
||||
#define USE_BASIC_SCRIPT_DEBUG_OUTPUT
|
||||
#endif
|
||||
|
||||
// Replay
|
||||
//#define DONT_FIX_REPLAY_BUGS // keeps various bugs in CReplay, some of which are fairly cool!
|
||||
@ -271,5 +284,6 @@ enum Config {
|
||||
#define CANCELLABLE_CAR_ENTER
|
||||
|
||||
// Camera
|
||||
//#define PS2_CAM_TRANSITION // old way of transitioning between cam modes
|
||||
#define IMPROVED_CAMERA // Better Debug cam, and maybe more in the future
|
||||
#define FREE_CAM // Rotating cam
|
||||
|
@ -58,6 +58,7 @@
|
||||
#include "Console.h"
|
||||
#include "timebars.h"
|
||||
#include "GenericGameStorage.h"
|
||||
#include "MemoryCard.h"
|
||||
#include "SceneEdit.h"
|
||||
#include "debugmenu.h"
|
||||
|
||||
@ -185,14 +186,27 @@ DoFade(void)
|
||||
if(CTimer::GetIsPaused())
|
||||
return;
|
||||
|
||||
#ifdef PS2_MENU
|
||||
if(TheMemoryCard.JustLoadedDontFadeInYet){
|
||||
TheMemoryCard.JustLoadedDontFadeInYet = false;
|
||||
TheMemoryCard.TimeStartedCountingForFade = CTimer::GetTimeInMilliseconds();
|
||||
}
|
||||
#else
|
||||
if(JustLoadedDontFadeInYet){
|
||||
JustLoadedDontFadeInYet = false;
|
||||
TimeStartedCountingForFade = CTimer::GetTimeInMilliseconds();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PS2_MENU
|
||||
if(TheMemoryCard.StillToFadeOut){
|
||||
if(CTimer::GetTimeInMilliseconds() - TheMemoryCard.TimeStartedCountingForFade > TheMemoryCard.TimeToStayFadedBeforeFadeOut){
|
||||
TheMemoryCard.StillToFadeOut = false;
|
||||
#else
|
||||
if(StillToFadeOut){
|
||||
if(CTimer::GetTimeInMilliseconds() - TimeStartedCountingForFade > TimeToStayFadedBeforeFadeOut){
|
||||
StillToFadeOut = false;
|
||||
#endif
|
||||
TheCamera.Fade(3.0f, FADE_IN);
|
||||
TheCamera.ProcessFade();
|
||||
TheCamera.ProcessMusicFade();
|
||||
@ -925,17 +939,16 @@ Render2dStuff(void)
|
||||
void
|
||||
RenderMenus(void)
|
||||
{
|
||||
#ifdef PS2
|
||||
if (FrontEndMenuManager.m_bWantToDraw)
|
||||
if (FrontEndMenuManager.m_bMenuActive)
|
||||
{
|
||||
#ifdef PS2
|
||||
gMainHeap.PushMemId(_TODOCONST(17));
|
||||
FrontEndMenuManager.DrawFrontEnd();
|
||||
gMainHeap.PopMemId();
|
||||
}
|
||||
#else
|
||||
if(FrontEndMenuManager.m_bMenuActive)
|
||||
FrontEndMenuManager.DrawFrontEnd();
|
||||
#endif
|
||||
FrontEndMenuManager.DrawFrontEnd();
|
||||
#ifdef PS2
|
||||
gMainHeap.PopMemId();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -979,14 +992,25 @@ Idle(void *arg)
|
||||
#endif
|
||||
|
||||
if(CGame::bDemoMode && CTimer::GetTimeInMilliseconds() > (3*60 + 30)*1000 && !CCutsceneMgr::IsCutsceneProcessing()){
|
||||
#ifdef PS2_MENU
|
||||
TheMemoryCard.m_bWantToLoad = false;
|
||||
FrontEndMenuManager.m_bWantToRestart = true;
|
||||
#else
|
||||
FrontEndMenuManager.m_bWantToRestart = true;
|
||||
FrontEndMenuManager.m_bWantToLoad = false;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef PS2_MENU
|
||||
if ( FrontEndMenuManager.m_bWantToRestart || TheMemoryCard.b_FoundRecentSavedGameWantToLoad )
|
||||
#else
|
||||
if(FrontEndMenuManager.m_bWantToRestart || b_FoundRecentSavedGameWantToLoad)
|
||||
#endif
|
||||
{
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
SetLightsWithTimeOfDayColour(Scene.world);
|
||||
|
||||
if(arg == nil)
|
||||
@ -1048,7 +1072,7 @@ Idle(void *arg)
|
||||
#ifdef TIMEBARS
|
||||
tbStartTimer(0, "RenderMotionBlur");
|
||||
#endif
|
||||
if((TheCamera.m_BlurType == MBLUR_NONE || TheCamera.m_BlurType == MBLUR_NORMAL) &&
|
||||
if((TheCamera.m_BlurType == MOTION_BLUR_NONE || TheCamera.m_BlurType == MOTION_BLUR_LIGHT_SCENE) &&
|
||||
TheCamera.m_ScreenReductionPercentage > 0.0f)
|
||||
TheCamera.SetMotionBlurAlpha(150);
|
||||
TheCamera.RenderMotionBlur();
|
||||
@ -1081,6 +1105,11 @@ Idle(void *arg)
|
||||
tbEndTimer("RenderMenus");
|
||||
tbStartTimer(0, "DoFade");
|
||||
#endif
|
||||
|
||||
#ifdef PS2_MENU
|
||||
if ( TheMemoryCard.m_bWantToLoad )
|
||||
return;
|
||||
#endif
|
||||
DoFade();
|
||||
#ifdef TIMEBARS
|
||||
tbEndTimer("DoFade");
|
||||
@ -1255,6 +1284,7 @@ TheModelViewer(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PS2
|
||||
void TheGame(void)
|
||||
{
|
||||
printf("Into TheGame!!!\n");
|
||||
@ -1276,12 +1306,12 @@ void TheGame(void)
|
||||
LoadingScreen("Starting Game", NULL, splash);
|
||||
|
||||
#ifdef GTA_PS2
|
||||
if ( TheMemoryCard.CheckCardInserted(_TODOCONST(0)) == _TODOCONST(26)
|
||||
&& TheMemoryCard.ChangeDirectory(_TODOCONST(0), TheMemoryCard.field154)
|
||||
&& TheMemoryCard.FindMostRecentFileName(_TODOCONST(0), TheMemoryCard.field37) == 1
|
||||
&& TheMemoryCard.CheckDataNotCorrupt(TheMemoryCard.field37))
|
||||
if ( TheMemoryCard.CheckCardInserted(CARD_ONE) == CMemoryCard::NO_ERR_SUCCESS
|
||||
&& TheMemoryCard.ChangeDirectory(CARD_ONE, TheMemoryCard.Cards[CARD_ONE].dir)
|
||||
&& TheMemoryCard.FindMostRecentFileName(CARD_ONE, TheMemoryCard.MostRecentFile) == true
|
||||
&& TheMemoryCard.CheckDataNotCorrupt(TheMemoryCard.MostRecentFile))
|
||||
{
|
||||
strcpy(TheMemoryCard.LoadFileName, TheMemoryCard.field37);
|
||||
strcpy(TheMemoryCard.LoadFileName, TheMemoryCard.MostRecentFile);
|
||||
TheMemoryCard.b_FoundRecentSavedGameWantToLoad = true;
|
||||
|
||||
if (FrontEndMenuManager.m_PrefsLanguage != TheMemoryCard.GetLanguageToLoad())
|
||||
@ -1385,7 +1415,7 @@ void TheGame(void)
|
||||
RenderDebugShit();
|
||||
RenderEffects();
|
||||
|
||||
if ((TheCamera.m_BlurType == MBLUR_NONE || TheCamera.m_BlurType == MBLUR_NORMAL) && TheCamera.m_ScreenReductionPercentage > 0.0f)
|
||||
if ((TheCamera.m_BlurType == MOTION_BLUR_NONE || TheCamera.m_BlurType == MOTION_BLUR_LIGHT_SCENE) && TheCamera.m_ScreenReductionPercentage > 0.0f)
|
||||
TheCamera.SetMotionBlurAlpha(150);
|
||||
TheCamera.RenderMotionBlur();
|
||||
|
||||
@ -1767,8 +1797,6 @@ void GameInit()
|
||||
}
|
||||
}
|
||||
|
||||
// Not used anyway. PS2 main() port
|
||||
#ifdef _WIN32
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
@ -1779,9 +1807,10 @@ main(int argc, char *argv[])
|
||||
SystemInit();
|
||||
|
||||
#ifdef PS2
|
||||
int32 state = TheMemoryCard.CheckCardStateAtGameStartUp(_TODOCONST(0));
|
||||
int32 r = TheMemoryCard.CheckCardStateAtGameStartUp(CARD_ONE);
|
||||
|
||||
if ( state == _TODOCONST(2) || state == _TODOCONST(1) && state != _TODOCONST(3) && state != _TODOCONST(0) )
|
||||
if ( r == CMemoryCard::ERR_DIRNOENTRY || r == CMemoryCard::ERR_NOFORMAT
|
||||
&& r != CMemoryCard::ERR_OPENNOENTRY && r != CMemoryCard::ERR_NONE )
|
||||
{
|
||||
GameInit();
|
||||
|
||||
|
@ -85,7 +85,7 @@ void ReloadFrontendOptions(void)
|
||||
void LangPolSelect(int8 action)
|
||||
{
|
||||
if (action == FEOPTION_ACTION_SELECT) {
|
||||
FrontEndMenuManager.m_PrefsLanguage = LANGUAGE_POLISH;
|
||||
FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_POLISH;
|
||||
FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
|
||||
FrontEndMenuManager.InitialiseChangedLanguageSettings();
|
||||
FrontEndMenuManager.SaveSettings();
|
||||
@ -95,7 +95,7 @@ void LangPolSelect(int8 action)
|
||||
void LangRusSelect(int8 action)
|
||||
{
|
||||
if (action == FEOPTION_ACTION_SELECT) {
|
||||
FrontEndMenuManager.m_PrefsLanguage = LANGUAGE_RUSSIAN;
|
||||
FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_RUSSIAN;
|
||||
FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
|
||||
FrontEndMenuManager.InitialiseChangedLanguageSettings();
|
||||
FrontEndMenuManager.SaveSettings();
|
||||
@ -105,7 +105,7 @@ void LangRusSelect(int8 action)
|
||||
void LangJapSelect(int8 action)
|
||||
{
|
||||
if (action == FEOPTION_ACTION_SELECT) {
|
||||
FrontEndMenuManager.m_PrefsLanguage = LANGUAGE_JAPANESE;
|
||||
FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_JAPANESE;
|
||||
FrontEndMenuManager.m_bFrontEnd_ReloadObrTxtGxt = true;
|
||||
FrontEndMenuManager.InitialiseChangedLanguageSettings();
|
||||
FrontEndMenuManager.SaveSettings();
|
||||
|
Reference in New Issue
Block a user