Movie lock refactoring
parent
6dcf4dffa6
commit
2b9811d225
|
@ -89,7 +89,6 @@ CEngine::CEngine(CApplication *app)
|
|||
m_waterAddColor = Color(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
m_render = true;
|
||||
m_movieLock = false;
|
||||
m_shadowVisible = true;
|
||||
m_groundSpotVisible = true;
|
||||
m_dirty = true;
|
||||
|
@ -488,17 +487,19 @@ void CEngine::FrameUpdate()
|
|||
bool CEngine::WriteScreenShot(const std::string& fileName, int width, int height)
|
||||
{
|
||||
void *pixels = m_device->GetFrameBufferPixels();
|
||||
CImage img({width,height});
|
||||
CImage img({width, height});
|
||||
|
||||
img.SetDataPixels(pixels);
|
||||
img.flipVertically();
|
||||
|
||||
if ( img.SavePNG(fileName.c_str()) ){
|
||||
GetLogger()->Info("Save SceenShot Saved Successfully!\n");
|
||||
if ( img.SavePNG(fileName.c_str()) )
|
||||
{
|
||||
GetLogger()->Debug("Save screenshot saved successfully\n");
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
GetLogger()->Error("%s!\n",img.GetError().c_str());
|
||||
else
|
||||
{
|
||||
GetLogger()->Error("%s!\n", img.GetError().c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -508,16 +509,6 @@ bool CEngine::GetPause()
|
|||
return m_pause->GetPause();
|
||||
}
|
||||
|
||||
void CEngine::SetMovieLock(bool lock)
|
||||
{
|
||||
m_movieLock = lock;
|
||||
}
|
||||
|
||||
bool CEngine::GetMovieLock()
|
||||
{
|
||||
return m_movieLock;
|
||||
}
|
||||
|
||||
void CEngine::SetShowStats(bool show)
|
||||
{
|
||||
m_showStats = show;
|
||||
|
@ -5135,4 +5126,3 @@ void CEngine::SetStaticMeshTransparency(int meshHandle, float value)
|
|||
}
|
||||
|
||||
} // namespace Gfx
|
||||
|
||||
|
|
|
@ -731,12 +731,6 @@ public:
|
|||
//! Get pause mode
|
||||
TEST_VIRTUAL bool GetPause();
|
||||
|
||||
//@{
|
||||
//! Management of lock for the duration of movie sequence
|
||||
void SetMovieLock(bool lock);
|
||||
bool GetMovieLock();
|
||||
//@}
|
||||
|
||||
//@{
|
||||
//! Management of displaying statistic information
|
||||
void SetShowStats(bool show);
|
||||
|
@ -1372,8 +1366,6 @@ protected:
|
|||
std::string m_fpsText;
|
||||
//! Rendering enabled?
|
||||
bool m_render;
|
||||
//! Lock for duration of movie?
|
||||
bool m_movieLock;
|
||||
|
||||
//! Projection matrix for 3D scene
|
||||
Math::Matrix m_matProj;
|
||||
|
@ -1544,4 +1536,3 @@ protected:
|
|||
|
||||
|
||||
} // namespace Gfx
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ bool CLightning::EventProcess(const Event &event)
|
|||
bool CLightning::EventFrame(const Event &event)
|
||||
{
|
||||
if (m_engine->GetPause()) return true;
|
||||
if (m_engine->GetMovieLock()) return true;
|
||||
if (CRobotMain::GetInstancePointer()->GetMovieLock()) return true;
|
||||
|
||||
m_progress += event.rTime*m_speed;
|
||||
|
||||
|
@ -417,4 +417,3 @@ CObject* CLightning::SearchObject(Math::Vector pos)
|
|||
|
||||
|
||||
} // namespace Gfx
|
||||
|
||||
|
|
|
@ -283,8 +283,6 @@ void CRobotMain::Create(bool loadProfile)
|
|||
|
||||
m_engine->SetTerrain(m_terrain);
|
||||
|
||||
m_engine->SetMovieLock(m_movieLock);
|
||||
|
||||
m_app->SetMouseMode(MOUSE_ENGINE);
|
||||
|
||||
m_movie->Flush();
|
||||
|
@ -472,7 +470,6 @@ void CRobotMain::ChangePhase(Phase phase)
|
|||
m_freePhoto = false;
|
||||
m_resetCreate = false;
|
||||
|
||||
m_engine->SetMovieLock(m_movieLock);
|
||||
ChangePause(PAUSE_NONE);
|
||||
FlushDisplayInfo();
|
||||
m_engine->SetRankView(0);
|
||||
|
@ -5827,7 +5824,6 @@ bool CRobotMain::GetShowMap()
|
|||
void CRobotMain::SetMovieLock(bool lock)
|
||||
{
|
||||
m_movieLock = lock;
|
||||
m_engine->SetMovieLock(m_movieLock);
|
||||
|
||||
CreateShortcuts();
|
||||
m_map->ShowMap(!m_movieLock && m_mapShow);
|
||||
|
|
Loading…
Reference in New Issue