diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp index 08994999..5f5c254c 100644 --- a/src/graphics/engine/camera.cpp +++ b/src/graphics/engine/camera.cpp @@ -265,8 +265,7 @@ void CCamera::SetType(CameraType type) } } - if (type == CAM_TYPE_INFO || - type == CAM_TYPE_VISIT) // xx -> info ? + if (type == CAM_TYPE_VISIT) // *** -> visit ? { m_prevEye = m_engine->GetEyePt(); m_prevLookat = m_engine->GetLookatPt(); @@ -276,8 +275,7 @@ void CCamera::SetType(CameraType type) return; } - if (m_type == CAM_TYPE_INFO || - m_type == CAM_TYPE_VISIT) // info -> xx ? + if (m_type == CAM_TYPE_VISIT) // visit -> *** ? { m_engine->SetFocus(m_focus); // gives initial focus m_type = type; @@ -453,8 +451,7 @@ bool CCamera::StopCentering(CObject *object, float time) void CCamera::AbortCentering() { - if (m_type == CAM_TYPE_INFO || - m_type == CAM_TYPE_VISIT ) + if (m_type == CAM_TYPE_VISIT ) return; if (m_centeringPhase == CAM_PHASE_NULL) @@ -491,8 +488,7 @@ void CCamera::StartEffect(CameraEffect effect, Math::Vector pos, float force) void CCamera::EffectFrame(const Event &event) { - if (m_type == CAM_TYPE_INFO || - m_type == CAM_TYPE_VISIT) + if (m_type == CAM_TYPE_VISIT) return; if (m_effectType == CAM_EFFECT_NULL) @@ -667,8 +663,7 @@ void CCamera::StartOver(CameraOverEffect effect, Math::Vector pos, float force) void CCamera::OverFrame(const Event &event) { - if (m_type == CAM_TYPE_INFO || - m_type == CAM_TYPE_VISIT) + if (m_type == CAM_TYPE_VISIT) return; if (m_overType == CAM_OVER_EFFECT_NULL) @@ -1065,9 +1060,6 @@ bool CCamera::EventProcess(const Event &event) if (m_type == CAM_TYPE_SCRIPT) return EventFrameScript(event); - if (m_type == CAM_TYPE_INFO) - return EventFrameInfo(event); - if (m_type == CAM_TYPE_VISIT) return EventFrameVisit(event); } @@ -1345,13 +1337,6 @@ bool CCamera::EventFrameOnBoard(const Event &event) return true; } -bool CCamera::EventFrameInfo(const Event &event) -{ - SetViewParams(Math::Vector(0.0f, 0.0f, 0.0f), - Math::Vector(0.0f, 0.0f, 1.0f)); - return true; -} - bool CCamera::EventFrameVisit(const Event &event) { m_visitTime += event.rTime; @@ -1414,9 +1399,6 @@ void CCamera::SetViewParams(const Math::Vector &eye, const Math::Vector &lookat, m_engine->SetViewParams(eye, lookat, up); bool under = (eye.y < m_water->GetLevel()); // Is it underwater? - if (m_type == CAM_TYPE_INFO) - under = false; - m_engine->SetRankView(under ? 1 : 0); } diff --git a/src/graphics/engine/camera.h b/src/graphics/engine/camera.h index 5d4126e5..83ac7afd 100644 --- a/src/graphics/engine/camera.h +++ b/src/graphics/engine/camera.h @@ -44,27 +44,25 @@ namespace Gfx enum CameraType { //! Undefined - CAM_TYPE_NULL = 0, + CAM_TYPE_NULL = 0, //! Free camera - CAM_TYPE_FREE = 1, + CAM_TYPE_FREE, //! Camera while editing a program - CAM_TYPE_EDIT = 2, + CAM_TYPE_EDIT, //! Camera on board a robot - CAM_TYPE_ONBOARD = 3, + CAM_TYPE_ONBOARD, //! Camera behind a robot - CAM_TYPE_BACK = 4, + CAM_TYPE_BACK, //! Static camera following robot - CAM_TYPE_FIX = 5, + CAM_TYPE_FIX, //! Camera steady after explosion - CAM_TYPE_EXPLO = 6, + CAM_TYPE_EXPLO, //! Camera during a cutscene - CAM_TYPE_SCRIPT = 7, - //! Camera for displaying SatCom (???) - CAM_TYPE_INFO = 8, + CAM_TYPE_SCRIPT, //! Visit camera, rotates around given position - CAM_TYPE_VISIT = 9, + CAM_TYPE_VISIT, //! Static camera height - CAM_TYPE_PLANE = 11, + CAM_TYPE_PLANE, }; enum CameraSmooth @@ -242,7 +240,6 @@ protected: bool EventFrameFix(const Event &event); bool EventFrameExplo(const Event &event); bool EventFrameOnBoard(const Event &event); - bool EventFrameInfo(const Event &event); bool EventFrameVisit(const Event &event); bool EventFrameScript(const Event &event); diff --git a/src/ui/displayinfo.cpp b/src/ui/displayinfo.cpp index 325a16aa..76aee701 100644 --- a/src/ui/displayinfo.cpp +++ b/src/ui/displayinfo.cpp @@ -80,7 +80,6 @@ CDisplayInfo::CDisplayInfo() m_toto = nullptr; m_bSoluce = false; m_bEditLock = false; - m_infoCamera = Gfx::CAM_TYPE_NULL; m_index = -1; } @@ -362,9 +361,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc m_main->SetEditLock(true, false); m_main->SetEditFull(false); - m_satcomPause = m_pause->ActivatePause(PAUSE_ENGINE|PAUSE_HIDE_SHORTCUTS|PAUSE_MUTE_SOUND, PAUSE_MUSIC_SATCOM); - m_infoCamera = m_camera->GetType(); - m_camera->SetType(Gfx::CAM_TYPE_INFO); + m_satcomPause = m_pause->ActivatePause(PAUSE_ENGINE|PAUSE_HIDE_SHORTCUTS|PAUSE_MUTE_SOUND|PAUSE_CAMERA, PAUSE_MUSIC_SATCOM); pw = static_cast(m_interface->SearchControl(EVENT_WINDOW6)); if (pw != nullptr) pw->ClearState(STATE_VISIBLE | STATE_ENABLE); @@ -833,7 +830,6 @@ void CDisplayInfo::StopDisplayInfo() } m_pause->DeactivatePause(m_satcomPause); m_satcomPause = nullptr; - m_camera->SetType(m_infoCamera); m_engine->SetDrawWorld(true); // draws all on the interface m_engine->SetDrawFront(false); // draws nothing on the interface diff --git a/src/ui/displayinfo.h b/src/ui/displayinfo.h index ff43b1eb..eea3b255 100644 --- a/src/ui/displayinfo.h +++ b/src/ui/displayinfo.h @@ -19,7 +19,7 @@ #pragma once -#include "graphics/engine/camera.h" +#include "math/point.h" #include @@ -32,6 +32,7 @@ struct Event; namespace Gfx { +class CCamera; class CEngine; class CParticle; class CLightManager; @@ -80,7 +81,6 @@ protected: bool m_bInfoMinimized; int m_index; - Gfx::CameraType m_infoCamera; Math::Point m_infoNormalPos; Math::Point m_infoNormalDim; Math::Point m_infoActualPos;