Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions
JSInterface_GameView.cpp File Reference
#include "precompiled.h"
#include "JSInterface_GameView.h"
#include "graphics/GameView.h"
#include "ps/Game.h"
#include "ps/CLogger.h"
#include "scriptinterface/ScriptInterface.h"

Go to the source code of this file.

Macros

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

Functions

 IMPLEMENT_BOOLEAN_SCRIPT_SETTING (Culling)
 
 IMPLEMENT_BOOLEAN_SCRIPT_SETTING (LockCullCamera)
 
 IMPLEMENT_BOOLEAN_SCRIPT_SETTING (ConstrainCamera)
 

Macro Definition Documentation

#define IMPLEMENT_BOOLEAN_SCRIPT_SETTING (   NAME)
Value:
bool JSI_GameView::Get##NAME##Enabled(void* UNUSED(cbdata)) \
{ \
if (!g_Game || !g_Game->GetView()) \
{ \
LOGERROR(L"Trying to get a setting from GameView when it's not initialized!"); \
return false; \
} \
return g_Game->GetView()->Get##NAME##Enabled(); \
} \
\
void JSI_GameView::Set##NAME##Enabled(void* UNUSED(cbdata), bool Enabled) \
{ \
if (!g_Game || !g_Game->GetView()) \
{ \
LOGERROR(L"Trying to set a setting of GameView when it's not initialized!"); \
return; \
} \
g_Game->GetView()->Set##NAME##Enabled(Enabled); \
}
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
#define LOGERROR
Definition: CLogger.h:35
CGame * g_Game
Globally accessible pointer to the CGame object.
Definition: Game.cpp:56
CGameView * GetView()
Get the pointer to the game view object.
Definition: Game.h:128

Definition at line 26 of file JSInterface_GameView.cpp.

#define REGISTER_BOOLEAN_SCRIPT_SETTING (   NAME)
Value:
scriptInterface.RegisterFunction<bool, &JSI_GameView::Get##NAME##Enabled>("GameView_Get" #NAME "Enabled"); \
scriptInterface.RegisterFunction<void, bool, &JSI_GameView::Set##NAME##Enabled>("GameView_Set" #NAME "Enabled");

Definition at line 54 of file JSInterface_GameView.cpp.

Function Documentation

IMPLEMENT_BOOLEAN_SCRIPT_SETTING ( Culling  )
IMPLEMENT_BOOLEAN_SCRIPT_SETTING ( LockCullCamera  )
IMPLEMENT_BOOLEAN_SCRIPT_SETTING ( ConstrainCamera  )