summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/animation/AnimBlendNode.cpp2
-rw-r--r--src/core/Camera.cpp10
-rw-r--r--src/core/FileLoader.cpp2
-rw-r--r--src/core/Pad.cpp2
-rw-r--r--src/core/Pad.h1
-rw-r--r--src/core/common.h2
-rw-r--r--src/peds/Ped.cpp6
-rw-r--r--src/render/2dEffect.h6
-rw-r--r--src/render/Draw.cpp6
-rw-r--r--src/render/Draw.h12
10 files changed, 28 insertions, 21 deletions
diff --git a/src/animation/AnimBlendNode.cpp b/src/animation/AnimBlendNode.cpp
index 4ef7d1c0..c54b5718 100644
--- a/src/animation/AnimBlendNode.cpp
+++ b/src/animation/AnimBlendNode.cpp
@@ -109,7 +109,7 @@ CAnimBlendNode::FindKeyFrame(float t)
}
frameA = 0;
}
- frameB = frameA;
+ frameB = frameA++;
}
remainingTime = sequence->GetKeyFrame(frameA)->deltaTime - t;
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index b1592d93..e67c68d2 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -2292,6 +2292,10 @@ CCamera::StartTransition(int16 newMode)
Cams[ActiveCam].BetaSpeed = 0.0f;
break;
+ case CCam::MODE_BEHINDBOAT:
+ Cams[ActiveCam].BetaSpeed = 0.0f;
+ break;
+
case CCam::MODE_FOLLOWPED:
// Getting out of vehicle normally
betaOffset = DEGTORAD(55.0f);
@@ -2386,10 +2390,6 @@ CCamera::StartTransition(int16 newMode)
Cams[ActiveCam].m_fTransitionBeta = CGeneral::GetATanOfXY(Cams[ActiveCam].Front.x, Cams[ActiveCam].Front.y);
break;
- case CCam::MODE_BEHINDBOAT:
- Cams[ActiveCam].BetaSpeed = 0.0f;
- break;
-
case CCam::MODE_PED_DEAD_BABY:
Cams[ActiveCam].Alpha = DEGTORAD(15.0f);
break;
@@ -3994,7 +3994,7 @@ CCamera::CalculateDerivedValues(void)
{
m_cameraMatrix = Invert(m_matrix);
- float hfov = DEGTORAD(CDraw::GetFOV()/2.0f);
+ float hfov = DEGTORAD(CDraw::GetScaledFOV()/2.0f);
float c = cos(hfov);
float s = sin(hfov);
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index 1463b4a5..6d810cf0 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -1032,7 +1032,7 @@ CFileLoader::Load2dEffect(const char *line)
&effect->attractor.dir.y,
&effect->attractor.dir.z,
&probability);
- effect->attractor.flags = flags;
+ effect->attractor.type = flags;
effect->attractor.probability = probability;
break;
case EFFECT_PED_ATTRACTOR:
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 67ae0c2f..56c05c71 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -1610,7 +1610,7 @@ int16 CPad::GetSteeringUpDown(void)
case 2:
{
int16 axis = NewState.LeftStickY;
- int16 dpad = (NewState.DPadUp - NewState.DPadDown) / 2;
+ int16 dpad = (NewState.DPadDown - NewState.DPadUp) / 2;
if ( Abs(axis) > Abs(dpad) )
return axis;
diff --git a/src/core/Pad.h b/src/core/Pad.h
index d0623a1e..2f50a164 100644
--- a/src/core/Pad.h
+++ b/src/core/Pad.h
@@ -445,6 +445,7 @@ public:
bool GetLeftShoulder2(void) { return !!NewState.LeftShoulder2; }
bool GetRightShoulder1(void) { return !!NewState.RightShoulder1; }
bool GetRightShoulder2(void) { return !!NewState.RightShoulder2; }
+ bool GetStart() { return !!NewState.Start; }
int16 GetLeftStickX(void) { return NewState.LeftStickX; }
int16 GetLeftStickY(void) { return NewState.LeftStickY; }
int16 GetRightStickX(void) { return NewState.RightStickX; }
diff --git a/src/core/common.h b/src/core/common.h
index eb43d8d5..d7c9a1f7 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -111,7 +111,7 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
#define SCREEN_WIDTH ((float)RsGlobal.width)
#define SCREEN_HEIGHT ((float)RsGlobal.height)
#define SCREEN_ASPECT_RATIO (CDraw::GetAspectRatio())
-#define SCREEN_VIEWWINDOW (Tan(DEGTORAD(CDraw::GetFOV() * 0.5f)))
+#define SCREEN_VIEWWINDOW (Tan(DEGTORAD(CDraw::GetScaledFOV() * 0.5f)))
// This scales from PS2 pixel coordinates to the real resolution
#define SCREEN_STRETCH_X(a) ((a) * (float) SCREEN_WIDTH / DEFAULT_SCREEN_WIDTH)
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index c559de1b..2fe2ce02 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -9844,11 +9844,11 @@ CPed::LookForInterestingNodes(void)
return false;
}
- switch (effect->attractor.flags) {
- case ATTRACTORFLAG_ICECREAM:
+ switch (effect->attractor.type) {
+ case ATTRACTORTYPE_ICECREAM:
SetInvestigateEvent(EVENT_ICECREAM, CVector2D(effectPos), 0.1f, 15000, angleToFace);
break;
- case ATTRACTORFLAG_STARE:
+ case ATTRACTORTYPE_STARE:
SetInvestigateEvent(EVENT_SHOPSTALL, CVector2D(effectPos), 1.0f,
CGeneral::GetRandomNumberInRange(8000, 10 * effect->attractor.probability + 8500),
angleToFace);
diff --git a/src/render/2dEffect.h b/src/render/2dEffect.h
index 504824c5..022cabcc 100644
--- a/src/render/2dEffect.h
+++ b/src/render/2dEffect.h
@@ -27,8 +27,8 @@ enum {
};
enum {
- ATTRACTORFLAG_ICECREAM,
- ATTRACTORFLAG_STARE
+ ATTRACTORTYPE_ICECREAM,
+ ATTRACTORTYPE_STARE
};
enum {
@@ -64,7 +64,7 @@ public:
};
struct Attractor {
CVector dir;
- uint8 flags;
+ int8 type;
uint8 probability;
};
struct PedAttractor {
diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp
index e2dfc8d9..3f7d89c7 100644
--- a/src/render/Draw.cpp
+++ b/src/render/Draw.cpp
@@ -6,6 +6,7 @@
#ifdef ASPECT_RATIO_SCALE
float CDraw::ms_fAspectRatio = DEFAULT_ASPECT_RATIO;
+float CDraw::ms_fScaledFOV = 45.0f;
#endif
float CDraw::ms_fNearClipZ;
@@ -60,8 +61,7 @@ void
CDraw::SetFOV(float fov)
{
#ifdef ASPECT_RATIO_SCALE
- ms_fFOV = ConvertFOV(fov);
-#else
- ms_fFOV = fov;
+ ms_fScaledFOV = ConvertFOV(fov);
#endif
+ ms_fFOV = fov;
}
diff --git a/src/render/Draw.h b/src/render/Draw.h
index 46e85e49..2976dc34 100644
--- a/src/render/Draw.h
+++ b/src/render/Draw.h
@@ -16,14 +16,15 @@ private:
static float ms_fNearClipZ;
static float ms_fFarClipZ;
static float ms_fFOV;
-public:
- static float ms_fLODDistance; // set but unused?
-
#ifdef ASPECT_RATIO_SCALE
// we use this variable to scale a lot of 2D elements
// so better cache it
static float ms_fAspectRatio;
+ // similar thing for 3D rendering
+ static float ms_fScaledFOV;
#endif
+public:
+ static float ms_fLODDistance; // set but unused?
static uint8 FadeValue;
static uint8 FadeRed;
@@ -37,6 +38,11 @@ public:
static void SetFOV(float fov);
static float GetFOV(void) { return ms_fFOV; }
+#ifdef ASPECT_RATIO_SCALE
+ static float GetScaledFOV(void) { return ms_fScaledFOV; }
+#else
+ static float GetScaledFOV(void) { return ms_fFOV; }
+#endif
static float CalculateAspectRatio(void);
#ifdef ASPECT_RATIO_SCALE