brain.* mainmovie.* : Partially rewritten
The remaining part will be revised and rewritten after merge with dev and dev-ui branchesdev-ui
parent
9bfdcacc52
commit
8b9954fff4
File diff suppressed because it is too large
Load Diff
|
@ -21,8 +21,9 @@
|
|||
|
||||
// #include <stdio.h>
|
||||
|
||||
#include "common/misc.h"
|
||||
#include "common/event.h"
|
||||
#include "common/misc.h"
|
||||
|
||||
#include "object/object.h"
|
||||
#include "object/task/taskmanip.h"
|
||||
#include "object/task/taskflag.h"
|
||||
|
@ -34,23 +35,23 @@ class CObject;
|
|||
class CPhysics;
|
||||
class CMotion;
|
||||
class CTaskManager;
|
||||
class CScript;
|
||||
class CRobotMain;
|
||||
class CSoundInterface;
|
||||
|
||||
namespace Ui {
|
||||
class CStudio;
|
||||
class CInterface;
|
||||
class CWindow;
|
||||
class CDisplayText;
|
||||
class CScript;
|
||||
class CRobotMain;
|
||||
class CStudio;
|
||||
class CSoundInterface;
|
||||
class CParticle;
|
||||
|
||||
namespace Gfx
|
||||
{
|
||||
}
|
||||
|
||||
namespace Gfx {
|
||||
class CEngine;
|
||||
class CTerrain;
|
||||
class CWater;
|
||||
class CCamera;
|
||||
|
||||
class CParticle;
|
||||
} /* Gfx */
|
||||
|
||||
|
||||
|
@ -149,14 +150,14 @@ protected:
|
|||
void GroundFlat();
|
||||
void ColorFlag(int color);
|
||||
|
||||
void UpdateScript(CWindow *pw);
|
||||
void UpdateScript(Ui::CWindow *pw);
|
||||
int GetSelScript();
|
||||
void BlinkScript(bool bEnable);
|
||||
|
||||
void CheckInterface(CWindow *pw, EventType event, bool bState);
|
||||
void EnableInterface(CWindow *pw, EventType event, bool bState);
|
||||
void DeadInterface(CWindow *pw, EventType event, bool bState);
|
||||
void DefaultEnter(CWindow *pw, EventType event, bool bState=true);
|
||||
void CheckInterface(Ui::CWindow *pw, EventType event, bool bState);
|
||||
void EnableInterface(Ui::CWindow *pw, EventType event, bool bState);
|
||||
void DeadInterface(Ui::CWindow *pw, EventType event, bool bState);
|
||||
void DefaultEnter(Ui::CWindow *pw, EventType event, bool bState=true);
|
||||
|
||||
void TraceRecordStart();
|
||||
void TraceRecordFrame();
|
||||
|
@ -170,15 +171,16 @@ protected:
|
|||
Gfx::CTerrain* m_terrain;
|
||||
Gfx::CWater* m_water;
|
||||
Gfx::CCamera* m_camera;
|
||||
Gfx::CParticle* m_particle;
|
||||
CObject* m_object;
|
||||
CPhysics* m_physics;
|
||||
CMotion* m_motion;
|
||||
CInterface* m_interface;
|
||||
CDisplayText* m_displayText;
|
||||
Ui::CInterface* m_interface;
|
||||
Ui::CDisplayText* m_displayText;
|
||||
CRobotMain* m_main;
|
||||
CStudio* m_studio;
|
||||
CSoundInterface* m_sound;
|
||||
CParticle* m_particle;
|
||||
|
||||
CTaskManager* m_primaryTask;
|
||||
CTaskManager* m_secondaryTask;
|
||||
|
||||
|
|
|
@ -37,12 +37,12 @@ CMainMovie::CMainMovie(CInstanceManager* iMan)
|
|||
m_iMan = iMan;
|
||||
m_iMan->AddInstance(CLASS_SHORT, this);
|
||||
|
||||
m_interface = (CInterface*)m_iMan->SearchInstance(CLASS_INTERFACE);
|
||||
m_event = (CEvent*)m_iMan->SearchInstance(CLASS_EVENT);
|
||||
m_engine = (CD3DEngine*)m_iMan->SearchInstance(CLASS_ENGINE);
|
||||
m_main = (CRobotMain*)m_iMan->SearchInstance(CLASS_MAIN);
|
||||
m_camera = (CCamera*)m_iMan->SearchInstance(CLASS_CAMERA);
|
||||
m_sound = (CSound*)m_iMan->SearchInstance(CLASS_SOUND);
|
||||
m_interface = static_cast< CInterface* >(m_iMan->SearchInstance(CLASS_INTERFACE));
|
||||
m_event = static_cast< CEvent* >(m_iMan->SearchInstance(CLASS_EVENT));
|
||||
m_engine = static_cast< Gfx::CEngine* >(m_iMan->SearchInstance(CLASS_ENGINE));
|
||||
m_main = static_cast< CRobotMain* >(m_iMan->SearchInstance(CLASS_MAIN));
|
||||
m_camera = static_cast< Gfx::CCamera* >(m_iMan->SearchInstance(CLASS_CAMERA));
|
||||
m_sound = static_cast< CSoundInterface* >(m_iMan->SearchInstance(CLASS_SOUND));
|
||||
|
||||
Flush();
|
||||
}
|
||||
|
@ -84,20 +84,20 @@ bool CMainMovie::Start(MainMovieType type, float time)
|
|||
return true;
|
||||
}
|
||||
|
||||
motion = pObj->RetMotion();
|
||||
motion = pObj->GetMotion();
|
||||
if ( motion != 0 )
|
||||
{
|
||||
motion->SetAction(MHS_SATCOM, 0.5f); // reads the SatCom
|
||||
}
|
||||
|
||||
m_camera->RetCamera(m_initialEye, m_initialLookat);
|
||||
m_camera->SetType(CAMERA_SCRIPT);
|
||||
m_camera->SetSmooth(CS_HARD);
|
||||
m_camera->GetCamera(m_initialEye, m_initialLookat);
|
||||
m_camera->SetType(Gfx::CAM_TYPE_SCRIPT);
|
||||
m_camera->SetSmooth(Gfx::CAM_SMOOTH_HARD);
|
||||
m_camera->SetScriptEye(m_initialEye);
|
||||
m_camera->SetScriptLookat(m_initialLookat);
|
||||
m_camera->FixCamera();
|
||||
|
||||
mat = pObj->RetWorldMatrix(0);
|
||||
mat = pObj->GetWorldMatrix(0);
|
||||
m_finalLookat[0] = Math::Transform(*mat, Math::Vector( 1.6f, 1.0f, 1.2f));
|
||||
m_finalEye[0] = Math::Transform(*mat, Math::Vector(-1.5f, 5.0f, 3.0f));
|
||||
m_finalLookat[1] = Math::Transform(*mat, Math::Vector( 1.6f, 1.0f, 1.2f));
|
||||
|
@ -109,14 +109,14 @@ bool CMainMovie::Start(MainMovieType type, float time)
|
|||
pObj = m_main->SearchHuman();
|
||||
if ( pObj != 0 )
|
||||
{
|
||||
motion = pObj->RetMotion();
|
||||
motion = pObj->GetMotion();
|
||||
if ( motion != 0 )
|
||||
{
|
||||
motion->SetAction(-1); // finishes reading SatCom
|
||||
}
|
||||
}
|
||||
|
||||
m_camera->SetType(CAMERA_BACK);
|
||||
m_camera->SetType(Gfx::CAM_TYPE_BACK);
|
||||
m_type = MM_NONE; // it's already over!
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ bool CMainMovie::Stop()
|
|||
pObj = m_main->SearchHuman();
|
||||
if ( pObj != 0 )
|
||||
{
|
||||
motion = pObj->RetMotion();
|
||||
motion = pObj->GetMotion();
|
||||
if ( motion != 0 )
|
||||
{
|
||||
motion->SetAction(-1); // finishes reading SatCom
|
||||
|
@ -221,16 +221,16 @@ bool CMainMovie::EventProcess(const Event &event)
|
|||
}
|
||||
|
||||
|
||||
// Returns the type of the current movie.
|
||||
// Geturns the type of the current movie.
|
||||
|
||||
MainMovieType CMainMovie::RetType()
|
||||
MainMovieType CMainMovie::GetType()
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
// Returns the type of movie stop.
|
||||
// Geturns the type of movie stop.
|
||||
|
||||
MainMovieType CMainMovie::RetStopType()
|
||||
MainMovieType CMainMovie::GetStopType()
|
||||
{
|
||||
return m_stopType;
|
||||
}
|
||||
|
|
|
@ -27,11 +27,11 @@ class CInstanceManager;
|
|||
class CEvent;
|
||||
class CInterface;
|
||||
class CRobotMain;
|
||||
class CCamera;
|
||||
class CSoundInterface;
|
||||
|
||||
namespace Gfx
|
||||
{
|
||||
class CCamera;
|
||||
class CEngine;
|
||||
} /* Gfx */
|
||||
|
||||
|
@ -56,8 +56,8 @@ public:
|
|||
bool Stop();
|
||||
bool IsExist();
|
||||
bool EventProcess(const Event &event);
|
||||
MainMovieType RetType();
|
||||
MainMovieType RetStopType();
|
||||
MainMovieType GetType();
|
||||
MainMovieType GetStopType();
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -67,7 +67,7 @@ protected:
|
|||
Gfx::CEngine* m_engine;
|
||||
CInterface* m_interface;
|
||||
CRobotMain* m_main;
|
||||
CCamera* m_camera;
|
||||
Gfx::CCamera* m_camera;
|
||||
CSoundInterface* m_sound;
|
||||
|
||||
MainMovieType m_type;
|
||||
|
|
Loading…
Reference in New Issue