Removed CAM_TYPE_INFO

master
krzys-h 2016-05-28 18:52:30 +02:00
parent 646e5104f6
commit 0e101debe0
4 changed files with 18 additions and 43 deletions

View File

@ -265,8 +265,7 @@ void CCamera::SetType(CameraType type)
} }
} }
if (type == CAM_TYPE_INFO || if (type == CAM_TYPE_VISIT) // *** -> visit ?
type == CAM_TYPE_VISIT) // xx -> info ?
{ {
m_prevEye = m_engine->GetEyePt(); m_prevEye = m_engine->GetEyePt();
m_prevLookat = m_engine->GetLookatPt(); m_prevLookat = m_engine->GetLookatPt();
@ -276,8 +275,7 @@ void CCamera::SetType(CameraType type)
return; return;
} }
if (m_type == CAM_TYPE_INFO || if (m_type == CAM_TYPE_VISIT) // visit -> *** ?
m_type == CAM_TYPE_VISIT) // info -> xx ?
{ {
m_engine->SetFocus(m_focus); // gives initial focus m_engine->SetFocus(m_focus); // gives initial focus
m_type = type; m_type = type;
@ -453,8 +451,7 @@ bool CCamera::StopCentering(CObject *object, float time)
void CCamera::AbortCentering() void CCamera::AbortCentering()
{ {
if (m_type == CAM_TYPE_INFO || if (m_type == CAM_TYPE_VISIT )
m_type == CAM_TYPE_VISIT )
return; return;
if (m_centeringPhase == CAM_PHASE_NULL) 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) void CCamera::EffectFrame(const Event &event)
{ {
if (m_type == CAM_TYPE_INFO || if (m_type == CAM_TYPE_VISIT)
m_type == CAM_TYPE_VISIT)
return; return;
if (m_effectType == CAM_EFFECT_NULL) 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) void CCamera::OverFrame(const Event &event)
{ {
if (m_type == CAM_TYPE_INFO || if (m_type == CAM_TYPE_VISIT)
m_type == CAM_TYPE_VISIT)
return; return;
if (m_overType == CAM_OVER_EFFECT_NULL) if (m_overType == CAM_OVER_EFFECT_NULL)
@ -1065,9 +1060,6 @@ bool CCamera::EventProcess(const Event &event)
if (m_type == CAM_TYPE_SCRIPT) if (m_type == CAM_TYPE_SCRIPT)
return EventFrameScript(event); return EventFrameScript(event);
if (m_type == CAM_TYPE_INFO)
return EventFrameInfo(event);
if (m_type == CAM_TYPE_VISIT) if (m_type == CAM_TYPE_VISIT)
return EventFrameVisit(event); return EventFrameVisit(event);
} }
@ -1345,13 +1337,6 @@ bool CCamera::EventFrameOnBoard(const Event &event)
return true; 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) bool CCamera::EventFrameVisit(const Event &event)
{ {
m_visitTime += event.rTime; 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); m_engine->SetViewParams(eye, lookat, up);
bool under = (eye.y < m_water->GetLevel()); // Is it underwater? bool under = (eye.y < m_water->GetLevel()); // Is it underwater?
if (m_type == CAM_TYPE_INFO)
under = false;
m_engine->SetRankView(under ? 1 : 0); m_engine->SetRankView(under ? 1 : 0);
} }

View File

@ -44,27 +44,25 @@ namespace Gfx
enum CameraType enum CameraType
{ {
//! Undefined //! Undefined
CAM_TYPE_NULL = 0, CAM_TYPE_NULL = 0,
//! Free camera //! Free camera
CAM_TYPE_FREE = 1, CAM_TYPE_FREE,
//! Camera while editing a program //! Camera while editing a program
CAM_TYPE_EDIT = 2, CAM_TYPE_EDIT,
//! Camera on board a robot //! Camera on board a robot
CAM_TYPE_ONBOARD = 3, CAM_TYPE_ONBOARD,
//! Camera behind a robot //! Camera behind a robot
CAM_TYPE_BACK = 4, CAM_TYPE_BACK,
//! Static camera following robot //! Static camera following robot
CAM_TYPE_FIX = 5, CAM_TYPE_FIX,
//! Camera steady after explosion //! Camera steady after explosion
CAM_TYPE_EXPLO = 6, CAM_TYPE_EXPLO,
//! Camera during a cutscene //! Camera during a cutscene
CAM_TYPE_SCRIPT = 7, CAM_TYPE_SCRIPT,
//! Camera for displaying SatCom (???)
CAM_TYPE_INFO = 8,
//! Visit camera, rotates around given position //! Visit camera, rotates around given position
CAM_TYPE_VISIT = 9, CAM_TYPE_VISIT,
//! Static camera height //! Static camera height
CAM_TYPE_PLANE = 11, CAM_TYPE_PLANE,
}; };
enum CameraSmooth enum CameraSmooth
@ -242,7 +240,6 @@ protected:
bool EventFrameFix(const Event &event); bool EventFrameFix(const Event &event);
bool EventFrameExplo(const Event &event); bool EventFrameExplo(const Event &event);
bool EventFrameOnBoard(const Event &event); bool EventFrameOnBoard(const Event &event);
bool EventFrameInfo(const Event &event);
bool EventFrameVisit(const Event &event); bool EventFrameVisit(const Event &event);
bool EventFrameScript(const Event &event); bool EventFrameScript(const Event &event);

View File

@ -80,7 +80,6 @@ CDisplayInfo::CDisplayInfo()
m_toto = nullptr; m_toto = nullptr;
m_bSoluce = false; m_bSoluce = false;
m_bEditLock = false; m_bEditLock = false;
m_infoCamera = Gfx::CAM_TYPE_NULL;
m_index = -1; m_index = -1;
} }
@ -362,9 +361,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
m_main->SetEditLock(true, false); m_main->SetEditLock(true, false);
m_main->SetEditFull(false); m_main->SetEditFull(false);
m_satcomPause = m_pause->ActivatePause(PAUSE_ENGINE|PAUSE_HIDE_SHORTCUTS|PAUSE_MUTE_SOUND, PAUSE_MUSIC_SATCOM); m_satcomPause = m_pause->ActivatePause(PAUSE_ENGINE|PAUSE_HIDE_SHORTCUTS|PAUSE_MUTE_SOUND|PAUSE_CAMERA, PAUSE_MUSIC_SATCOM);
m_infoCamera = m_camera->GetType();
m_camera->SetType(Gfx::CAM_TYPE_INFO);
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6)); pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
if (pw != nullptr) pw->ClearState(STATE_VISIBLE | STATE_ENABLE); if (pw != nullptr) pw->ClearState(STATE_VISIBLE | STATE_ENABLE);
@ -833,7 +830,6 @@ void CDisplayInfo::StopDisplayInfo()
} }
m_pause->DeactivatePause(m_satcomPause); m_pause->DeactivatePause(m_satcomPause);
m_satcomPause = nullptr; m_satcomPause = nullptr;
m_camera->SetType(m_infoCamera);
m_engine->SetDrawWorld(true); // draws all on the interface m_engine->SetDrawWorld(true); // draws all on the interface
m_engine->SetDrawFront(false); // draws nothing on the interface m_engine->SetDrawFront(false); // draws nothing on the interface

View File

@ -19,7 +19,7 @@
#pragma once #pragma once
#include "graphics/engine/camera.h" #include "math/point.h"
#include <string> #include <string>
@ -32,6 +32,7 @@ struct Event;
namespace Gfx namespace Gfx
{ {
class CCamera;
class CEngine; class CEngine;
class CParticle; class CParticle;
class CLightManager; class CLightManager;
@ -80,7 +81,6 @@ protected:
bool m_bInfoMinimized; bool m_bInfoMinimized;
int m_index; int m_index;
Gfx::CameraType m_infoCamera;
Math::Point m_infoNormalPos; Math::Point m_infoNormalPos;
Math::Point m_infoNormalDim; Math::Point m_infoNormalDim;
Math::Point m_infoActualPos; Math::Point m_infoActualPos;