Now you can zoom out to your heart's content

This commit is contained in:
mathusummut
2018-09-04 16:09:11 +02:00
parent 87912ff56c
commit b03ad32cdd
3 changed files with 10 additions and 9 deletions

View File

@@ -60,8 +60,6 @@ namespace Glest {
// ===================== PUBLIC ======================== // ===================== PUBLIC ========================
const float PHOTO_MODE_MAXHEIGHT = 500.0;
const int CREATE_NEW_TEAM = -100; const int CREATE_NEW_TEAM = -100;
const int CANCEL_SWITCH_TEAM = -1; const int CANCEL_SWITCH_TEAM = -1;
@@ -6302,7 +6300,7 @@ namespace Glest {
this->gameSettings.isNetworkGame() == false) { this->gameSettings.isNetworkGame() == false) {
gameCamera.setMaxHeight(PHOTO_MODE_MAXHEIGHT); gameCamera.setMaxHeight(PHOTO_MODE_MAXHEIGHT);
} else if (photoModeEnabled == false) { } else if (photoModeEnabled == false) {
gameCamera.setMaxHeight(-1); gameCamera.setMaxHeight(/*-1*/PHOTO_MODE_MAXHEIGHT);
} }
} }

View File

@@ -94,7 +94,7 @@ namespace
shakeOffset = Vec2f(0.f); shakeOffset = Vec2f(0.f);
//maxRenderDistance = Config::getInstance().getFloat("RenderDistanceMax","64"); //maxRenderDistance = Config::getInstance().getFloat("RenderDistanceMax","64");
maxHeight = Config::getInstance().getFloat("CameraMaxDistance", "20"); setMaxHeight(-1);
minHeight = Config::getInstance().getFloat("CameraMinDistance", "7"); minHeight = Config::getInstance().getFloat("CameraMinDistance", "7");
//maxCameraDist = maxHeight; //maxCameraDist = maxHeight;
//minCameraDist = minHeight; //minCameraDist = minHeight;
@@ -126,8 +126,9 @@ namespace
void void
GameCamera::setMaxHeight(float value) { GameCamera::setMaxHeight(float value) {
if (value < 0) { if (value < 0) {
maxHeight = maxHeight = Config::getInstance().getFloat("CameraMaxDistance", "0");
Config::getInstance().getFloat("CameraMaxDistance", "20"); if (maxHeight == 0.0f)
maxHeight = PHOTO_MODE_MAXHEIGHT;
} else { } else {
maxHeight = value; maxHeight = value;
} }
@@ -136,9 +137,9 @@ namespace
void void
GameCamera::setCalculatedDefault(float calculatedDefault) { GameCamera::setCalculatedDefault(float calculatedDefault) {
this->calculatedDefault = calculatedDefault; this->calculatedDefault = calculatedDefault;
if (maxHeight > 0 && maxHeight < calculatedDefault) { //if (maxHeight > 0 && maxHeight < calculatedDefault) {
setMaxHeight(calculatedDefault); setMaxHeight(PHOTO_MODE_MAXHEIGHT);
} //}
resetPosition(); resetPosition();
} }

View File

@@ -39,6 +39,8 @@ namespace Glest {
class Config; class Config;
const float PHOTO_MODE_MAXHEIGHT = 200.0;
// ===================================================== // =====================================================
// class GameCamera // class GameCamera
// //