Permalink
Browse files

Abolish camera rotation at the start of every game for original maps.

Patch by Forgon.
Closes ticket:4642
  • Loading branch information...
perim committed Oct 24, 2017
1 parent c64a9a3 commit c83236b788f3decae8843d3480f64ed91f14316e
Showing with 10 additions and 23 deletions.
  1. +1 −1 src/display.h
  2. +5 −7 src/display3d.cpp
  3. +1 −1 src/display3d.h
  4. +3 −14 src/game.cpp
View
@@ -205,7 +205,7 @@ void setDesiredPitch(SDWORD pitch);
#define CAMERA_PIVOT_HEIGHT (500)
#define INITIAL_STARTING_PITCH (-40)
#define INITIAL_DESIRED_ROTATION (-45)
#define OLD_INITIAL_ROTATION (-45) // only used in savegames <= 10
#define HIDDEN_FRONTEND_WIDTH (640)
#define HIDDEN_FRONTEND_HEIGHT (480)
View
@@ -1112,7 +1112,9 @@ bool init3DView()
// distance is not saved, so initialise it now
distance = START_DISTANCE; // distance
disp3d_resetView(); // clear player view variables
player.r.z = 0; // roll
player.r.y = 0; // rotation
player.r.x = DEG(360 + INITIAL_STARTING_PITCH); // angle
if (!initTerrain())
{
@@ -1133,13 +1135,9 @@ void disp3d_setView(iView *newView)
}
/// reset the camera rotation (used for save games <= 10)
void disp3d_resetView()
void disp3d_oldView()
{
player.r.z = 0; // roll
player.r.y = INITIAL_DESIRED_ROTATION; // rotation
player.r.x = DEG(360 + INITIAL_STARTING_PITCH); // angle
// and set the camera position
player.r.y = OLD_INITIAL_ROTATION; // rotation
player.p.y = START_HEIGHT; // height
}
View
@@ -66,7 +66,7 @@ void setViewPos(UDWORD x, UDWORD y, bool Pan);
Vector2i getPlayerPos();
void setPlayerPos(SDWORD x, SDWORD y);
void disp3d_setView(iView *newView);
void disp3d_resetView();
void disp3d_oldView(); // for save games <= 10
void disp3d_getView(iView *newView);
void draw3DScene();
View
@@ -1869,21 +1869,10 @@ bool loadGame(const char *pGameToLoad, bool keepObjects, bool freeMem, bool User
}
mission.apsOilList[0] = nullptr;
mission.apsSensorList[0] = nullptr;
}
if (saveGameVersion >= VERSION_11)
{
//camera position
disp3d_setView(&(saveGameData.currentPlayerPos));
}
else
{
disp3d_resetView();
}
// Stuff added after level load to avoid being reset or initialised during load
// always !keepObjects
//Stuff added after level load to avoid being reset or initialised during load
if (UserSaveGame)//always !keepObjects
{
if (saveGameVersion >= VERSION_12)
{
mission.startTime = saveGameData.missionTime;
@@ -3625,7 +3614,7 @@ bool gameLoadV(PHYSFS_file *fileHandle, unsigned int version)
}
else
{
disp3d_resetView();
disp3d_oldView();
}
//load mission data from save game these values reloaded after load game

0 comments on commit c83236b

Please sign in to comment.