diff --git a/core/2d/CCCamera.cpp b/core/2d/CCCamera.cpp index 22e6c1a1fb..62ff1ea746 100644 --- a/core/2d/CCCamera.cpp +++ b/core/2d/CCCamera.cpp @@ -188,7 +188,6 @@ void Camera::initDefault() { case Director::Projection::_2D: { - _zoomFactor = 1.0F; _fieldOfView = 60.0F; _nearPlane = -1024.0F; _farPlane = 1024.0F; @@ -201,7 +200,6 @@ void Camera::initDefault() case Director::Projection::_3D: { float zeye = _director->getZEye(); - _zoomFactor = 1.0F; _fieldOfView = 60.0F; _nearPlane = 0.5F; _farPlane = zeye + size.height / 2.0f; @@ -216,6 +214,9 @@ void Camera::initDefault() } setDepth(0); + + if (_zoomFactor != 1.0F) + applyZoom(); } void Camera::updateTransform() diff --git a/core/2d/CCCamera.h b/core/2d/CCCamera.h index 8d08aaf96a..70135bed59 100644 --- a/core/2d/CCCamera.h +++ b/core/2d/CCCamera.h @@ -381,7 +381,7 @@ protected: // with larger depth is drawn on top of camera with smaller depth float _eyeZdistance; // Z eye projection distance for 2D in 3D projection. - float _zoomFactor; // The zoom factor of the camera. 3D = (cameraZDistance * _zoomFactor), 2D = (cameraScale * _zoomFactor) + float _zoomFactor = 1.0F; // The zoom factor of the camera. 3D = (cameraZDistance * _zoomFactor), 2D = (cameraScale * _zoomFactor) float _zoomFactorFarPlane; float _zoomFactorNearPlane;