summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/animation/AnimManager.cpp18
-rw-r--r--src/animation/AnimManager.h2
-rw-r--r--src/animation/AnimationId.h6
-rw-r--r--src/core/Cam.cpp4
-rw-r--r--src/core/Camera.cpp4
-rw-r--r--src/core/FileLoader.cpp2
-rw-r--r--src/core/Frontend.cpp6
-rw-r--r--src/core/Game.cpp4
-rw-r--r--src/core/Game.h4
-rw-r--r--src/core/MenuScreens.cpp2
-rw-r--r--src/core/MenuScreensCustom.cpp2
-rw-r--r--src/core/config.h3
-rw-r--r--src/core/main.cpp105
-rw-r--r--src/core/re3.cpp2
-rw-r--r--src/extras/screendroplets.cpp13
-rw-r--r--src/peds/Ped.cpp84
-rw-r--r--src/peds/PlayerPed.cpp6
-rw-r--r--src/rw/MemoryHeap.h23
18 files changed, 181 insertions, 109 deletions
diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp
index e701018e..8d442b72 100644
--- a/src/animation/AnimManager.cpp
+++ b/src/animation/AnimManager.cpp
@@ -57,6 +57,9 @@ AnimAssocDesc aStdAnimDescs[] = {
{ ANIM_HIT_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HIT_RIGHT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_FLOOR_HIT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+#if GTA_VERSION <= GTA3_PS2_160
+ { ANIM_HIT_BODY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+#endif
{ ANIM_HIT_BODYBLOW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HIT_CHEST, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_HIT_HEAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
@@ -78,6 +81,8 @@ AnimAssocDesc aStdAnimDescs[] = {
{ ANIM_BOMBER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
{ ANIM_HGUN_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
{ ANIM_AK_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
+#ifdef PC_PLAYER_CONTROLS
+ // maybe wrong define, but unused anyway
{ ANIM_FPS_PUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_FPS_BAT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_FPS_UZI, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
@@ -85,6 +90,7 @@ AnimAssocDesc aStdAnimDescs[] = {
{ ANIM_FPS_AK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_FPS_M16, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_FPS_ROCKET, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+#endif
{ ANIM_FIGHT_IDLE, ASSOC_REPEAT },
{ ANIM_FIGHT2_IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_FIGHT_SH_F, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
@@ -193,6 +199,7 @@ AnimAssocDesc aStdAnimDescs[] = {
{ ANIM_PHONE_OUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_PHONE_TALK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
};
+#ifdef PC_PLAYER_CONTROLS
AnimAssocDesc aStdAnimDescsSide[] = {
{ ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK | ASSOC_HAS_X_TRANSLATION },
{ ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK | ASSOC_HAS_X_TRANSLATION },
@@ -200,6 +207,7 @@ AnimAssocDesc aStdAnimDescsSide[] = {
{ ANIM_IDLE_STANCE, ASSOC_REPEAT },
{ ANIM_WALK_START, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
};
+#endif
char const *aStdAnimations[] = {
"walk_civi",
"run_civi",
@@ -239,6 +247,9 @@ char const *aStdAnimations[] = {
"HIT_back",
"HIT_R",
"FLOOR_hit",
+#if GTA_VERSION <= GTA3_PS2_160
+ "HIT_body",
+#endif
"HIT_bodyblow",
"HIT_chest",
"HIT_head",
@@ -260,6 +271,8 @@ char const *aStdAnimations[] = {
"bomber",
"WEAPON_hgun_rload",
"WEAPON_AK_rload",
+#ifdef PC_PLAYER_CONTROLS
+ // maybe wrong define, but unused anyway
"FPS_PUNCH",
"FPS_BAT",
"FPS_UZI",
@@ -267,6 +280,7 @@ char const *aStdAnimations[] = {
"FPS_AK",
"FPS_M16",
"FPS_ROCKET",
+#endif
"FIGHTIDLE",
"FIGHT2IDLE",
"FIGHTsh_F",
@@ -488,6 +502,7 @@ char const *aPanicChunkyAnimations[] = {
"woman_runpanic",
"idle_stance",
};
+#ifdef PC_PLAYER_CONTROLS
char const *aPlayerStrafeBackAnimations[] = {
"walk_player_back",
"run_player_back",
@@ -530,6 +545,7 @@ char const *aRocketStrafeRightAnimations[] = {
"idle_rocket",
"walkst_rocket_right",
};
+#endif
#define awc(a) ARRAY_SIZE(a), a
const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS] = {
@@ -552,12 +568,14 @@ const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_
{ "oldwoman", "ped", MI_COP, awc(aOldWomanAnimations), aStdAnimDescs },
{ "fatwoman", "ped", MI_COP, awc(aFatWomanAnimations), aStdAnimDescs },
{ "panicchunky", "ped", MI_COP, awc(aPanicChunkyAnimations), aStdAnimDescs },
+#ifdef PC_PLAYER_CONTROLS
{ "playerback", "ped", MI_COP, awc(aPlayerStrafeBackAnimations), aStdAnimDescs },
{ "playerleft", "ped", MI_COP, awc(aPlayerStrafeLeftAnimations), aStdAnimDescsSide },
{ "playerright", "ped", MI_COP, awc(aPlayerStrafeRightAnimations), aStdAnimDescsSide },
{ "rocketback", "ped", MI_COP, awc(aRocketStrafeBackAnimations), aStdAnimDescs },
{ "rocketleft", "ped", MI_COP, awc(aRocketStrafeLeftAnimations), aStdAnimDescsSide },
{ "rocketright", "ped", MI_COP, awc(aRocketStrafeRightAnimations), aStdAnimDescsSide },
+#endif
};
#undef awc
diff --git a/src/animation/AnimManager.h b/src/animation/AnimManager.h
index de15602c..92192c71 100644
--- a/src/animation/AnimManager.h
+++ b/src/animation/AnimManager.h
@@ -24,12 +24,14 @@ enum AssocGroupId
ASSOCGRP_OLDWOMAN,
ASSOCGRP_FATWOMAN,
ASSOCGRP_PANICCHUNKY,
+#ifdef PC_PLAYER_CONTROLS
ASSOCGRP_PLAYERBACK,
ASSOCGRP_PLAYERLEFT,
ASSOCGRP_PLAYERRIGHT,
ASSOCGRP_ROCKETBACK,
ASSOCGRP_ROCKETLEFT,
ASSOCGRP_ROCKETRIGHT,
+#endif
NUM_ANIM_ASSOC_GROUPS
};
diff --git a/src/animation/AnimationId.h b/src/animation/AnimationId.h
index 82fed8bd..4b3dd92d 100644
--- a/src/animation/AnimationId.h
+++ b/src/animation/AnimationId.h
@@ -40,6 +40,9 @@ enum AnimationId
ANIM_HIT_BACK,
ANIM_HIT_RIGHT,
ANIM_FLOOR_HIT,
+#if GTA_VERSION <= GTA3_PS2_160
+ ANIM_HIT_BODY,
+#endif
ANIM_HIT_BODYBLOW,
ANIM_HIT_CHEST,
ANIM_HIT_HEAD,
@@ -61,6 +64,8 @@ enum AnimationId
ANIM_BOMBER,
ANIM_HGUN_RELOAD,
ANIM_AK_RELOAD,
+#ifdef PC_PLAYER_CONTROLS
+ // maybe wrong define, but unused anyway
ANIM_FPS_PUNCH,
ANIM_FPS_BAT,
ANIM_FPS_UZI,
@@ -68,6 +73,7 @@ enum AnimationId
ANIM_FPS_AK,
ANIM_FPS_M16,
ANIM_FPS_ROCKET,
+#endif
ANIM_FIGHT_IDLE,
ANIM_FIGHT2_IDLE,
ANIM_FIGHT_SH_F,
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index 5906310b..1d73a272 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -144,9 +144,11 @@ CCam::Process(void)
Process_BehindCar(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar);
break;
case MODE_FOLLOWPED:
+#ifdef PC_PLAYER_CONTROLS
if(CCamera::m_bUseMouse3rdPerson)
Process_FollowPedWithMouse(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar);
else
+#endif
#ifdef FREE_CAM
if(CCamera::bFreeCam)
Process_FollowPed_Rotation(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar);
@@ -3673,6 +3675,7 @@ CCam::Process_Fixed(const CVector &CameraTarget, float, float, float)
if(TheCamera.m_bUseSpecialFovTrain)
FOV = TheCamera.m_fFovForTrain;
+#ifdef PC_PLAYER_CONTROLS
if(CMenuManager::m_ControlMethod == CONTROL_STANDARD && Using3rdPersonMouseCam()){
CPed *player = FindPlayerPed();
if(player && player->CanStrafeOrMouseControl()){
@@ -3683,6 +3686,7 @@ CCam::Process_Fixed(const CVector &CameraTarget, float, float, float)
TheCamera.pTargetEntity->GetMatrix().UpdateRW();
}
}
+#endif
}
void
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index 4551e36f..1f498102 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -60,7 +60,11 @@ enum
// NB: removed explicit TheCamera from all functions
CCamera TheCamera;
+#ifdef PC_PLAYER_CONTROLS
bool CCamera::m_bUseMouse3rdPerson = true;
+#else
+bool CCamera::m_bUseMouse3rdPerson = false;
+#endif
bool bDidWeProcessAnyCinemaCam;
#ifdef IMPROVED_CAMERA
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index 0ad03f61..ac488dc9 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -120,8 +120,10 @@ CFileLoader::LoadLevel(const char *filename)
#ifndef DISABLE_LOADING_SCREEN
LoadSplash(GetRandomSplashScreen());
#endif
+#ifndef GTA_PS2
}else if(strncmp(line, "CDIMAGE", 7) == 0){
CdStreamAddImage(line + 8);
+#endif
}
}
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 01820730..9c33c397 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -1023,7 +1023,9 @@ CMenuManager::DisplaySlider(float x, float y, float mostLeftBarSize, float mostR
void
CMenuManager::DoSettingsBeforeStartingAGame()
{
+#ifdef PC_PLAYER_CONTROLS
CCamera::m_bUseMouse3rdPerson = m_ControlMethod == CONTROL_STANDARD;
+#endif
if (m_PrefsVsyncDisp != m_PrefsVsync)
m_PrefsVsync = m_PrefsVsyncDisp;
@@ -3106,7 +3108,7 @@ CMenuManager::DrawPlayerSetupScreen()
strncpy(&m_pSelectedSkin->skinNameDisplayed[k], "(", 1);
if (!strncmp(&m_pSelectedSkin->skinNameDisplayed[k], "}", 1))
strncpy(&m_pSelectedSkin->skinNameDisplayed[k], ")", 1);
- if (!strncmp(&m_pSelectedSkin->skinNameDisplayed[k], "�", 1))
+ if (!strncmp(&m_pSelectedSkin->skinNameDisplayed[k], "£", 1))
strncpy(&m_pSelectedSkin->skinNameDisplayed[k], "$", 1);
}
@@ -4064,7 +4066,9 @@ CMenuManager::Process(void)
#ifdef USE_DEBUG_SCRIPT_LOADER
scriptToLoad = 0;
#endif
+#ifdef PC_PLAYER_CONTROLS
TheCamera.m_bUseMouse3rdPerson = m_ControlMethod == CONTROL_STANDARD;
+#endif
if (m_PrefsVsyncDisp != m_PrefsVsync)
m_PrefsVsync = m_PrefsVsyncDisp;
DMAudio.Service();
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index 0b9ef767..126f0341 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -371,7 +371,11 @@ CGame::FinalShutdown(void)
CdStreamShutdown();
}
+#if GTA_VERSION <= GTA3_PS2_160
+bool CGame::Initialise(void)
+#else
bool CGame::Initialise(const char* datFile)
+#endif
{
#ifdef GTA_PS2
// TODO: upload VU0 collision code here
diff --git a/src/core/Game.h b/src/core/Game.h
index b55793af..002033a0 100644
--- a/src/core/Game.h
+++ b/src/core/Game.h
@@ -30,7 +30,11 @@ public:
static void ShutdownRenderWare(void);
static bool InitialiseOnceAfterRW(void);
static void FinalShutdown(void);
+#if GTA_VERSION <= GTA3_PS2_160
+ static bool Initialise(void);
+#else
static bool Initialise(const char *datFile);
+#endif
static bool ShutDown(void);
static void ReInitGameObjectVariables(void);
static void ReloadIPLs(void);
diff --git a/src/core/MenuScreens.cpp b/src/core/MenuScreens.cpp
index 9eff09e6..7c90ea12 100644
--- a/src/core/MenuScreens.cpp
+++ b/src/core/MenuScreens.cpp
@@ -271,7 +271,9 @@ CMenuScreen aScreens[MENUPAGES] = {
// MENUPAGE_CONTROLLER_PC = 35
{ "FET_CTL", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0,
+#ifdef PC_PLAYER_CONTROLS
MENUACTION_CTRLMETHOD, "FET_CME", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
+#endif
MENUACTION_KEYBOARDCTRLS,"FET_RDK", SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS,
MENUACTION_CHANGEMENU, "FET_AMS", SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS,
MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp
index 3a6d9c8b..d9fc5065 100644
--- a/src/core/MenuScreensCustom.cpp
+++ b/src/core/MenuScreensCustom.cpp
@@ -635,7 +635,9 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
// MENUPAGE_CONTROLLER_PC = 35
{ "FET_CTL", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, nil, nil,
+#ifdef PC_PLAYER_CONTROLS
MENUACTION_CTRLMETHOD, "FET_CME", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC },
+#endif
MENUACTION_KEYBOARDCTRLS,"FET_RDK", { nil, SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS },
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
MENUACTION_CHANGEMENU, "FEC_JOD", { nil, SAVESLOT_NONE, MENUPAGE_DETECT_JOYSTICK },
diff --git a/src/core/config.h b/src/core/config.h
index 96268138..d1043c72 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -196,6 +196,7 @@ enum Config {
# define RANDOMSPLASH // use random splash as on PS2
# define PS2_MATFX
# endif
+# define PC_PLAYER_CONTROLS // mouse player/cam mode
# define GTA_REPLAY
# define GTA_SCENE_EDIT
#elif defined GTA_XBOX
@@ -280,7 +281,7 @@ enum Config {
#define BUTTON_ICONS // use textures to show controller buttons
// Hud, frontend and radar
-#define PS2_HUD
+//#define PS2_HUD
#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
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 14f1a055..3a855e20 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -85,7 +85,7 @@ bool gbModelViewer;
bool gbShowTimebars;
#endif
-int32 frameCount;
+volatile int32 frameCount;
RwRGBA gColourTop;
@@ -482,11 +482,11 @@ Initialise3D(void *param)
DebugMenuPopulate();
#endif // !DEBUGMENU
#ifdef CUSTOM_FRONTEND_OPTIONS
- // Apparently this func. can be run multiple times at the start.
- if (numCustomFrontendOptions == 0 && numCustomFrontendScreens == 0) {
- // needs stored language and TheText to be loaded, and last TheText reload is at the start of here
- CustomFrontendOptionsPopulate();
- }
+ // Apparently this func. can be run multiple times at the start.
+ if (numCustomFrontendOptions == 0 && numCustomFrontendScreens == 0) {
+ // needs stored language and TheText to be loaded, and last TheText reload is at the start of here
+ CustomFrontendOptionsPopulate();
+ }
#endif
bool ret = CGame::InitialiseRenderWare();
#ifdef EXTENDED_PIPELINES
@@ -1688,7 +1688,7 @@ void TheGame(void)
CTimer::Initialise();
-#ifdef GTA_PS2
+#if GTA_VERSION <= GTA3_PS2_160
CGame::Initialise();
#else
CGame::Initialise("DATA\\GTA3.DAT");
@@ -1758,7 +1758,7 @@ void TheGame(void)
PUSH_MEMID(MEMID_RENDER);
- if (!FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bRenderGameInMenu == true && TheCamera.GetScreenFadeStatus() != FADE_2 )
+ if ((!FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bRenderGameInMenu == true) && TheCamera.GetScreenFadeStatus() != FADE_2 )
{
PUSH_MEMID(MEMID_RENDERLIST);
@@ -1766,14 +1766,22 @@ void TheGame(void)
CRenderer::PreRender();
POP_MEMID();
+#ifdef FIX_BUGS
+ // This has to be done BEFORE RwCameraBeginUpdate
+ RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip());
+ RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart());
+#endif
+
if (CWeather::LightningFlash && !CCullZones::CamNoRain())
DoRWStuffStartOfFrame_Horizon(255, 255, 255, 255, 255, 255, 255);
else
DoRWStuffStartOfFrame_Horizon(CTimeCycle::GetSkyTopRed(), CTimeCycle::GetSkyTopGreen(), CTimeCycle::GetSkyTopBlue(), CTimeCycle::GetSkyBottomRed(), CTimeCycle::GetSkyBottomGreen(), CTimeCycle::GetSkyBottomBlue(), 255);
DefinedState();
+#ifndef FIX_BUGS
RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip());
RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart());
+#endif
RenderScene();
RenderDebugShit();
@@ -1794,8 +1802,7 @@ void TheGame(void)
#endif
CVisibilityPlugins::SetRenderWareCamera(Scene.camera);
RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ);
- if (!RsCameraBeginUpdate(Scene.camera))
- break;
+ RsCameraBeginUpdate(Scene.camera);
}
RenderMenus();
@@ -1981,6 +1988,20 @@ void SystemInit()
#endif
}
+int VBlankCounter(int ca)
+{
+ frameCount++;
+ ExitHandler();
+ return 0;
+}
+
+// linked against by RW!
+extern "C" void WaitVBlank(void)
+{
+ int32 startFrame = frameCount;
+ while(startFrame == frameCount);
+}
+
void GameInit()
{
if ( !gameAlreadyInitialised )
@@ -2024,11 +2045,16 @@ void GameInit()
"\\MODELS\\MISC.TXD;1",
"\\MODELS\\GENERIC.TXD;1",
"\\MODELS\\GTA3.DIR;1",
+ // TODO: japanese?
+#ifdef GTA_PAL
"\\TEXT\\ENGLISH.GXT;1",
"\\TEXT\\FRENCH.GXT;1",
"\\TEXT\\GERMAN.GXT;1",
"\\TEXT\\ITALIAN.GXT;1",
"\\TEXT\\SPANISH.GXT;1",
+#else
+ "\\TEXT\\AMERICAN.GXT;1",
+#endif
"\\TXD\\LOADSC0.TXD;1",
"\\TXD\\LOADSC1.TXD;1",
"\\TXD\\LOADSC2.TXD;1",
@@ -2142,6 +2168,36 @@ void GameInit()
}
}
+void PlayIntroMPEGs()
+{
+#ifdef GTA_PS2
+ if (gameAlreadyInitialised)
+ RpSkySuspend();
+
+ InitMPEGPlayer();
+
+#ifdef GTA_PAL
+ PlayMPEG("cdrom0:\\MOVIES\\DMAPAL.PSS;1", false);
+
+ if (CGame::frenchGame || CGame::germanGame)
+ PlayMPEG("cdrom0:\\MOVIES\\INTROPAF.PSS;1", true);
+ else
+ PlayMPEG("cdrom0:\\MOVIES\\INTROPAL.PSS;1", true);
+#else
+ PlayMPEG("cdrom0:\\MOVIES\\DMANTSC.PSS;1", false);
+
+ PlayMPEG("cdrom0:\\MOVIES\\INTRNTSC.PSS;1", true);
+#endif
+
+ ShutdownMPEGPlayer();
+
+ if ( gameAlreadyInitialised )
+ RpSkyResume();
+#else
+ //TODO
+#endif
+}
+
int
main(int argc, char *argv[])
{
@@ -2168,35 +2224,8 @@ main(int argc, char *argv[])
// eh?
}
#endif
-
-#ifdef GTA_PS2
- {
- if (gameAlreadyInitialised)
- RpSkySuspend();
-
- InitMPEGPlayer();
-
-#ifdef GTA_PAL
- PlayMPEG("cdrom0:\\MOVIES\\DMAPAL.PSS;1", false);
-
- if (CGame::frenchGame || CGame::germanGame)
- PlayMPEG("cdrom0:\\MOVIES\\INTROPAF.PSS;1", true);
- else
- PlayMPEG("cdrom0:\\MOVIES\\INTROPAL.PSS;1", true);
-#else
- PlayMPEG("cdrom0:\\MOVIES\\DMANTSC.PSS;1", false);
-
- PlayMPEG("cdrom0:\\MOVIES\\INTRNTSC.PSS;1", true);
-#endif
-
- ShutdownMPEGPlayer();
- if ( gameAlreadyInitialised )
- RpSkyResume();
- }
-#else
- //TODO
-#endif
+ PlayIntroMPEGs();
GameInit();
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 5974175a..acb6caa2 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -410,7 +410,7 @@ void CTweakVars::Add(CTweakVar *var)
TweakVarsListSize = 0;
}
if(TweakVarsListSize > 63)
- TweakVarsList = (CTweakVar**) realloc(TweakVarsList, (TweakVarsListSize + 1) * sizeof(var));
+ TweakVarsList = (CTweakVar**) realloc(TweakVarsList, (TweakVarsListSize + 1) * sizeof(*var));
TweakVarsList[TweakVarsListSize++] = var;
// TweakVarsList.push_back(var);
diff --git a/src/extras/screendroplets.cpp b/src/extras/screendroplets.cpp
index 3f91a754..54866bea 100644
--- a/src/extras/screendroplets.cpp
+++ b/src/extras/screendroplets.cpp
@@ -79,8 +79,10 @@ ScreenDroplets::Initialise(void)
void
ScreenDroplets::InitDraw(void)
{
- if(CustomPipes::neoTxd)
- ms_maskTex = CustomPipes::neoTxd->find("dropmask");
+ if(CustomPipes::neoTxd == nil)
+ return;
+
+ ms_maskTex = CustomPipes::neoTxd->find("dropmask");
ms_screenTex = RwTextureCreate(nil);
RwTextureSetFilterMode(ms_screenTex, rwFILTERLINEAR);
@@ -136,6 +138,10 @@ ScreenDroplets::Shutdown(void)
void
ScreenDroplets::Process(void)
{
+ // no need to do anything if we can't render
+ if(CustomPipes::neoTxd == nil)
+ return;
+
ProcessCameraMovement();
SprayDrops();
ProcessMoving();
@@ -173,6 +179,9 @@ ScreenDroplets::Render(void)
{
ScreenDrop *drop;
+ if(CustomPipes::neoTxd == nil)
+ return;
+
DefinedState();
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(ms_maskTex));
RwRenderStateSet(rwRENDERSTATEFOGENABLE, FALSE);
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index df78902f..ec56861e 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -2677,6 +2677,48 @@ CPed::ProcessControl(void)
}
}
+#ifdef CANCELLABLE_CAR_ENTER
+ static bool cancelJack = false;
+ if (IsPlayer()) {
+ if (EnteringCar() && m_pVehicleAnim) {
+ CPad *pad = CPad::GetPad(0);
+
+ if (!pad->ArePlayerControlsDisabled()) {
+ int vehAnim = m_pVehicleAnim->animId;
+
+ int16 padWalkX = pad->GetPedWalkLeftRight();
+ int16 padWalkY = pad->GetPedWalkUpDown();
+ if (Abs(padWalkX) > 0.0f || Abs(padWalkY) > 0.0f) {
+ if (vehAnim == ANIM_CAR_OPEN_LHS || vehAnim == ANIM_CAR_OPEN_RHS || vehAnim == ANIM_COACH_OPEN_L || vehAnim == ANIM_COACH_OPEN_R ||
+ vehAnim == ANIM_VAN_OPEN_L || vehAnim == ANIM_VAN_OPEN) {
+
+ if (!m_pMyVehicle->pDriver) {
+ cancelJack = false;
+ bCancelEnteringCar = true;
+ } else
+ cancelJack = true;
+ } else if (vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f) {
+ cancelJack = true;
+ } else if (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS) {
+ bCancelEnteringCar = true;
+ cancelJack = false;
+ }
+ }
+ if (cancelJack && vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f && m_pVehicleAnim->GetTimeLeft() < 0.78f) {
+ cancelJack = false;
+ QuitEnteringCar();
+ RestorePreviousObjective();
+ }
+ if (cancelJack && (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS)) {
+ cancelJack = false;
+ bCancelEnteringCar = true;
+ }
+ }
+ } else
+ cancelJack = false;
+ }
+#endif
+
switch (m_nPedState) {
case PED_IDLE:
Idle();
@@ -2694,49 +2736,7 @@ CPed::ProcessControl(void)
break;
case PED_ENTER_CAR:
case PED_CARJACK:
- {
-#ifdef CANCELLABLE_CAR_ENTER
- if (!IsPlayer() || !m_pVehicleAnim)
- break;
-
- CPad *pad = CPad::GetPad(0);
-
- if (pad->ArePlayerControlsDisabled())
- break;
-
- int vehAnim = m_pVehicleAnim->animId;
-
- static bool cancelJack = false;
- int16 padWalkX = pad->GetPedWalkLeftRight();
- int16 padWalkY = pad->GetPedWalkUpDown();
- if (Abs(padWalkX) > 0.0f || Abs(padWalkY) > 0.0f) {
- if (vehAnim == ANIM_CAR_OPEN_LHS || vehAnim == ANIM_CAR_OPEN_RHS || vehAnim == ANIM_COACH_OPEN_L || vehAnim == ANIM_COACH_OPEN_R ||
- vehAnim == ANIM_VAN_OPEN_L || vehAnim == ANIM_VAN_OPEN) {
-
- if (!m_pMyVehicle->pDriver) {
- cancelJack = false;
- bCancelEnteringCar = true;
- } else
- cancelJack = true;
- } else if (vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f) {
- cancelJack = true;
- } else if (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS) {
- bCancelEnteringCar = true;
- cancelJack = false;
- }
- }
- if (cancelJack && vehAnim == ANIM_CAR_QJACK && m_pVehicleAnim->GetTimeLeft() > 0.75f && m_pVehicleAnim->GetTimeLeft() < 0.78f) {
- cancelJack = false;
- QuitEnteringCar();
- RestorePreviousObjective();
- }
- if (cancelJack && (vehAnim == ANIM_CAR_PULLOUT_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_LHS || vehAnim == ANIM_CAR_PULLOUT_LOW_RHS || vehAnim == ANIM_CAR_PULLOUT_RHS)) {
- cancelJack = false;
- bCancelEnteringCar = true;
- }
-#endif
break;
- }
case PED_FLEE_POS:
ms_vec2DFleePosition.x = m_fleeFromPosX;
ms_vec2DFleePosition.y = m_fleeFromPosY;
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 8a6adbeb..330d209b 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -929,6 +929,8 @@ void
CPlayerPed::ProcessAnimGroups(void)
{
AssocGroupId groupToSet;
+
+#ifdef PC_PLAYER_CONTROLS
if ((m_fWalkAngle <= -DEGTORAD(50.0f) || m_fWalkAngle >= DEGTORAD(50.0f))
&& TheCamera.Cams[TheCamera.ActiveCam].Using3rdPersonMouseCam()
&& CanStrafeOrMouseControl()) {
@@ -951,7 +953,9 @@ CPlayerPed::ProcessAnimGroups(void)
else
groupToSet = ASSOCGRP_PLAYERBACK;
}
- } else {
+ } else
+#endif
+ {
if (GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER) {
groupToSet = ASSOCGRP_PLAYERROCKET;
} else {
diff --git a/src/rw/MemoryHeap.h b/src/rw/MemoryHeap.h
index 23163c1c..cd8cf22c 100644
--- a/src/rw/MemoryHeap.h
+++ b/src/rw/MemoryHeap.h
@@ -17,29 +17,6 @@
enum {
MEMID_FREE,
- // IDs from LCS:
-/*
- MEMID_GAME = 1, // "Game"
- MEMID_WORLD = 2, // "World"
- MEMID_ANIMATION = 3, // "Animation"
- MEMID_POOLS = 4, // "Pools"
- MEMID_DEF_MODELS = 5, // "Default Models"
- MEMID_STREAM = 6, // "Streaming"
- MEMID_STREAM_MODELS = 7, // "Streamed Models"
- MEMID_STREAM_LODS = 8, // "Streamed LODs"
- MEMID_STREAM_TEXUTRES = 9, // "Streamed Textures"
- MEMID_STREAM_COLLISION = 10, // "Streamed Collision"
- MEMID_STREAM_ANIMATION = 11, // "Streamed Animation"
- MEMID_TEXTURES = 12, // "Textures"
- MEMID_COLLISION = 13, // "Collision"
- MEMID_PRE_ALLOC = 14, // "PreAlloc"
- MEMID_GAME_PROCESS = 15, // "Game Process"
- MEMID_SCRIPT = 16, // "Script"
- MEMID_CARS = 17, // "Cars"
- MEMID_RENDER = 18, // "Render"
- MEMID_PED_ATTR = 19, // "Ped Attr"
-*/
- // III:
MEMID_GAME = 1, // "Game"
MEMID_WORLD = 2, // "World"
MEMID_ANIMATION = 3, // "Animation"