From d0063a089ea60b1448f04440c37d8bd6a1e0d744 Mon Sep 17 00:00:00 2001 From: Gerard Krol Date: Mon, 17 Dec 2007 19:40:31 +0000 Subject: [PATCH] The camera tweaks caused the starting camera position to be "not so nice". This should be fixed now. git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3088 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/display.h | 6 +++++- src/display3d.c | 30 +----------------------------- src/display3d.h | 4 ---- 3 files changed, 6 insertions(+), 34 deletions(-) diff --git a/src/display.h b/src/display.h index 827fa595e..33c73570a 100644 --- a/src/display.h +++ b/src/display.h @@ -196,10 +196,14 @@ extern void setDesiredPitch(SDWORD pitch); #define MAXDISTANCE (3500) #define MINDISTANCE (500) -#define START_DISTANCE (1500) +#define START_DISTANCE (2000) #define CAMERA_PIVOT_HEIGHT (500) +#define INITIAL_DESIRED_PITCH (-40) +#define INITIAL_STARTING_PITCH (-40) +#define INITIAL_DESIRED_ROTATION (-45) + #define HIDDEN_FRONTEND_WIDTH (640) #define HIDDEN_FRONTEND_HEIGHT (480) diff --git a/src/display3d.c b/src/display3d.c index d5181c42f..d9462bb5e 100644 --- a/src/display3d.c +++ b/src/display3d.c @@ -4003,7 +4003,7 @@ static void trackHeight( float desiredHeight ) static float heightSpeed = 0.0f; /* What fraction of a second did last game loop take */ float fraction = frameTime2 / (float)GAME_TICKS_PER_SEC; - /* How far are we from desired hieght? */ + /* How far are we from desired height? */ float separation = desiredHeight - player.p.y; /* Work out accelertion... */ float acceleration = ACCEL_CONSTANT * separation - VELOCITY_CONSTANT * heightSpeed; @@ -4013,34 +4013,6 @@ static void trackHeight( float desiredHeight ) /* Adjust the height accordingly */ player.p.y += heightSpeed * fraction; - -#if 0 - /* Now do auto pitch as well, but only if we're not using mouselook and not tracking */ - if(!getWarCamStatus() && !getRotActive()) - { - /* Get the suggested pitch */ - UDWORD pitch = getSuggestedPitch(); - - /* What's the desired pitch from the player */ - UDWORD desPitch = 360 - getDesiredPitch(); - - /* Make sure this isn't negative or too much */ - player.r.x %= DEG(360); - - /* Only do something if we're not within 2 degrees of optimum */ - if ( abs(pitch - desPitch) > 2 ) - { - static float aSpeed = 0.0f; - /* Force adjust if too low - stops near z clip */ - /* Else, move towards player's last selected pitch */ - const SDWORD aSep = DEG(360 - MAX(pitch, desPitch)) - player.r.x; - const float aAccel = ROT_ACCEL_CONSTANT * aSep - ROT_VELOCITY_CONSTANT * aSpeed; - - aSpeed += aAccel * fraction; - player.r.x += aSpeed * fraction; - } - } -#endif } diff --git a/src/display3d.h b/src/display3d.h index 1ee45e551..e3523a545 100644 --- a/src/display3d.h +++ b/src/display3d.h @@ -111,10 +111,6 @@ extern SDWORD getCentreZ( void ); extern SDWORD mouseTileX, mouseTileY; -#define INITIAL_DESIRED_PITCH (325) -#define INITIAL_STARTING_PITCH (-75) -#define INITIAL_DESIRED_ROTATION (-45) - extern BOOL bRender3DOnly; extern const Vector2i visibleTiles;