Pyrogenesis  trunk
Namespaces | Macros | Functions
JSInterface_GameView.cpp File Reference
#include "precompiled.h"
#include "JSInterface_GameView.h"
#include "graphics/Camera.h"
#include "graphics/GameView.h"
#include "graphics/Terrain.h"
#include "maths/FixedVector3D.h"
#include "ps/Game.h"
#include "ps/World.h"
#include "ps/CLogger.h"
#include "scriptinterface/FunctionWrapper.h"
#include "simulation2/helpers/Position.h"
Include dependency graph for JSInterface_GameView.cpp:

Namespaces

 JSI_GameView
 

Macros

#define IMPLEMENT_BOOLEAN_SCRIPT_SETTING(NAME)
 
#define REGISTER_BOOLEAN_SCRIPT_SETTING(NAME)
 

Functions

 JSI_GameView::IMPLEMENT_BOOLEAN_SCRIPT_SETTING (Culling)
 
 JSI_GameView::IMPLEMENT_BOOLEAN_SCRIPT_SETTING (LockCullCamera)
 
 JSI_GameView::IMPLEMENT_BOOLEAN_SCRIPT_SETTING (ConstrainCamera)
 
void JSI_GameView::RegisterScriptFunctions_Settings (const ScriptRequest &rq)
 
JS::Value JSI_GameView::GetCameraRotation (const ScriptRequest &rq)
 
JS::Value JSI_GameView::GetCameraZoom ()
 
JS::Value JSI_GameView::GetCameraPivot (const ScriptRequest &rq)
 
JS::Value JSI_GameView::GetCameraPosition (const ScriptRequest &rq)
 
void JSI_GameView::CameraMoveTo (entity_pos_t x, entity_pos_t z)
 Move camera to a 2D location. More...
 
void JSI_GameView::SetCameraTarget (float x, float y, float z)
 Set the camera to look at the given location. More...
 
void JSI_GameView::SetCameraData (entity_pos_t x, entity_pos_t y, entity_pos_t z, entity_pos_t rotx, entity_pos_t roty, entity_pos_t zoom)
 Set the data (position, orientation and zoom) of the camera. More...
 
void JSI_GameView::CameraFollow (entity_id_t entityid)
 Start / stop camera following mode. More...
 
void JSI_GameView::CameraFollowFPS (entity_id_t entityid)
 Start / stop first-person camera following mode. More...
 
entity_id_t JSI_GameView::GetFollowedEntity ()
 
CFixedVector3D JSI_GameView::GetTerrainAtScreenPoint (int x, int y)
 
void JSI_GameView::RegisterScriptFunctions (const ScriptRequest &rq)
 

Macro Definition Documentation

◆ IMPLEMENT_BOOLEAN_SCRIPT_SETTING

#define IMPLEMENT_BOOLEAN_SCRIPT_SETTING (   NAME)
Value:
bool Get##NAME##Enabled() \
{ \
if (!g_Game || !g_Game->GetView()) \
{ \
LOGERROR("Trying to get a setting from GameView when it's not initialized!"); \
return false; \
} \
return g_Game->GetView()->Get##NAME##Enabled(); \
} \
\
void Set##NAME##Enabled(bool Enabled) \
{ \
if (!g_Game || !g_Game->GetView()) \
{ \
LOGERROR("Trying to set a setting of GameView when it's not initialized!"); \
return; \
} \
g_Game->GetView()->Set##NAME##Enabled(Enabled); \
}
CGame * g_Game
Globally accessible pointer to the CGame object.
Definition: Game.cpp:62
void Get(const CStr &value, T &ret)
Definition: ConfigDB.cpp:56
CGameView * GetView()
Get the pointer to the game view object.
Definition: Game.h:166

◆ REGISTER_BOOLEAN_SCRIPT_SETTING

#define REGISTER_BOOLEAN_SCRIPT_SETTING (   NAME)
Value:
ScriptFunction::Register<&Get##NAME##Enabled>(rq, "GameView_Get" #NAME "Enabled"); \
ScriptFunction::Register<&Set##NAME##Enabled>(rq, "GameView_Set" #NAME "Enabled");