ParaEngine::ParaEngineSettings Class Reference
[ParaEngine]

List of all members.

Detailed Description

global settings for ParaEngine.

such as rendering technique, window setting, etc. Most settings can be set from the script interface


Public Member Functions

virtual int GetAttributeClassID ()
 attribute class ID should be identical, unless one knows how overriding rules work.
virtual const char * GetAttributeClassName ()
 a static string, describing the attribute class object's name
virtual const char * GetAttributeClassDescription ()
 a static string, describing the attribute class object
virtual int InstallFields (CAttributeClass *pClass, bool bOverride)
 this class should be implemented if one wants to add new attribute.
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetScriptEditor_s, const char **)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetScriptEditor_s, const char *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetCtorColor_s, D3DXVECTOR3 *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetCtorColor_s, D3DXVECTOR3)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetCtorHeight_s, float *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetCtorHeight_s, float)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetCtorSpeed_s, float *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetCtorSpeed_s, float)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetSelectionColor_s, D3DXVECTOR3 *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetSelectionColor_s, D3DXVECTOR3)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsDebugging_s, bool *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsEditing_s, bool *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetEditingMode_s, bool)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetGameEffectSet_s, int *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, LoadGameEffectSet_s, int)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetTextureLOD_s, int *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetTextureLOD_s, int)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetLocale_s, const char **)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetLocale_s, const char *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetMouseInverse_s1, bool *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetMouseInverse_s1, bool)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetIgnoreWindowSizeChange_s, bool *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetIgnoreWindowSizeChange_s, bool)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetWindowText1_s, const char **)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetWindowText1_s, const char *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, IsFullScreenMode_s, bool *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetFullScreenMode_s, bool)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetScreenResolution_s, D3DXVECTOR2 *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetScreenResolution_s, D3DXVECTOR2)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetMultiSampleType_s, int *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetMultiSampleType_s, int)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, GetMultiSampleQuality_s, int *)
 ATTRIBUTE_METHOD1 (ParaEngineSettings, SetMultiSampleQuality_s, int)
 ATTRIBUTE_METHOD (ParaEngineSettings, UpdateScreenMode_s)
void SetScriptEditor (const string &sEditorFilePath)
 set the default script editor file path for ParaEngine.The windows notepad.exe is used if not specifcied.
const string & GetScriptEditor ()
 Get the default script editor for ParaEngine.
D3DXCOLOR GetCtorColor ()
 get the construction animation color.
void SetCtorColor (const D3DXCOLOR &color)
 set the construction animation color.
D3DXCOLOR GetSelectionColor (int nGroupID=0)
 get the selection color.
void SetSelectionColor (const D3DXCOLOR &color, int nGroupID=0)
 set the construction animation color.
float GetCtorHeight ()
 Get the construction animation region's height in meters.
void SetCtorHeight (float fHeight)
 set the construction height.
float GetCtorSpeed ()
 Get the construction Speed.
void SetCtorSpeed (float fSpeed)
 set the construction Speed.
void LoadGameEffectSet (int nSetID)
 Load the game effect set.
int GetGameEffectSet ()
void SetTextureLOD (int nLOD)
 Most detailed level-of-detail value to set for the mipmap chain.
int GetTextureLOD ()
const char * GetLocale ()
 The locale is what makes it possible to know what language the interface is using and thus determine which specific code is going to be executed.
void SetLocale (const char *sLocale)
 
See also:
GetLocale().

void SetFullScreenMode (bool bFullscreen)
 whether to use full screen mode, it does not immediately change the device, call UpdateScreenMode() to update the device.
bool IsFullScreenMode ()
D3DXVECTOR2 GetScreenResolution ()
 change the full screen mode, it does not immediately change the device, call UpdateScreenMode() to update the device.
void SetScreenResolution (const D3DXVECTOR2 &vSize)
int GetMultiSampleType ()
 anti-aliasing for both windowed and full screen mode.
void SetMultiSampleType (int nType)
int GetMultiSampleQuality ()
 anti-aliasing for both windowed and full screen mode.
void SetMultiSampleQuality (int nType)
void UpdateScreenMode ()
 call this function to update changes of FullScreen Mode and Screen Resolution.
void SetWindowText1 (const char *pChar)
const char * GetWindowText1 ()
void SetMouseInverse (bool bInverse)
 set whether the mouse is inversed.
bool GetMouseInverse ()

Static Public Member Functions

static ParaEngineSettingsGetSingleton ()
 get an instance of this class.
static void SetOceanTechnique (DWORD dwTechnique)
 
Parameters:
dwTechnique,: 0 for basic, the higher the more advanced.

static D3DXCOLOR GetCtorColorS ()
static void SetCtorColorS (const D3DXCOLOR &color)
static D3DXCOLOR GetSelectionColorS ()
static void SetSelectionColorS (const D3DXCOLOR &color)
static float GetCtorHeightS ()
static void SetCtorHeightS (float fHeight)
static float GetCtorSpeedS ()
static void SetCtorSpeedS (float fSpeed)
static void GetClientSize (int *width, int *height)
 get client width and height, by liuweili
static void LoadGameEffectSetS (int nSetID)
static int GetGameEffectSetS ()
static bool IsDebugging ()
 whether ParaEngine is compiled as debug build.
static bool IsEditing ()
 whether the game engine is in developing mode.
static void SetEditingMode (bool bEnable)
 set editing mode.
static const char * GetLocaleS ()
static void SetLocaleS (const char *sLocale)
static bool IsProductActivated ()
 If ActivateProduct() is called and returns true before this function is called when the application starts, then this function will return true.
static bool ActivateProduct (const char *sActivationCode)
 activate the product using a activation code.
static const char * GetProductKey (const char *sProductName)
 Get the product key for the current application.
static bool GenerateActivationCodes (const char *sOutputFileName, int nFrom, int nTo)
 generate product activation codes in large numbers in to a given file.
static bool SetWindowedMode (bool bWindowed)
 switch to either windowed mode or full screen mode.
static bool IsWindowedMode ()
 return true if it is currently under windowed mode.
static void SetIgnoreWindowSizeChange (bool bIgnoreSizeChange)
 switch to ignore windows size change.
static bool GetIgnoreWindowSizeChange ()
 return true if it is currently under windowed mode.
static void EnablePassiveRendering (bool bEnable)
 passive rendering, it will not render the scene, but simulation and time remains the same.
static bool IsPassiveRenderingEnabled ()
 passive rendering, it will not render the scene, but simulation and time remains the same.
static void SetWindowText (const char *pChar)
 set the window title when at windowed mode
static const char * GetWindowText ()
 get the window title when at windowed mode
static void WriteConfigFile (const char *sFileName)
 write the current setting to config file.
static void SetMouseInverse_s (bool bInverse)
static bool GetMouseInverse_s ()
static const char * GetAppCommandLine ()
 get string specifying the command line for the application, excluding the program name.
static const char * GetAppCommandLineByParam (const char *pParam, const char *defaultValue)
 return a specified parameter value in the command line of the application.
static void SetAppCommandLine (const char *pCommandLine)
 set string specifying the command line for the application, excluding the program name.


Member Function Documentation

static ParaEngineSettings& ParaEngine::ParaEngineSettings::GetSingleton (  )  [static]

get an instance of this class.

virtual int ParaEngine::ParaEngineSettings::GetAttributeClassID (  )  [virtual]

attribute class ID should be identical, unless one knows how overriding rules work.

virtual int ParaEngine::ParaEngineSettings::InstallFields ( CAttributeClass *  pClass,
bool  bOverride 
) [virtual]

this class should be implemented if one wants to add new attribute.

This function is always called internally.

static void ParaEngine::ParaEngineSettings::SetOceanTechnique ( DWORD  dwTechnique  )  [static]

Parameters:
dwTechnique,: 0 for basic, the higher the more advanced.

up to 3.

void ParaEngine::ParaEngineSettings::SetScriptEditor ( const string &  sEditorFilePath  ) 

set the default script editor file path for ParaEngine.The windows notepad.exe is used if not specifcied.

const string& ParaEngine::ParaEngineSettings::GetScriptEditor (  ) 

Get the default script editor for ParaEngine.

D3DXCOLOR ParaEngine::ParaEngineSettings::GetCtorColor (  ) 

get the construction animation color.

void ParaEngine::ParaEngineSettings::SetCtorColor ( const D3DXCOLOR &  color  ) 

set the construction animation color.

D3DXCOLOR ParaEngine::ParaEngineSettings::GetSelectionColor ( int  nGroupID = 0  ) 

get the selection color.

void ParaEngine::ParaEngineSettings::SetSelectionColor ( const D3DXCOLOR &  color,
int  nGroupID = 0 
)

set the construction animation color.

float ParaEngine::ParaEngineSettings::GetCtorHeight (  ) 

Get the construction animation region's height in meters.

void ParaEngine::ParaEngineSettings::SetCtorHeight ( float  fHeight  ) 

set the construction height.

float ParaEngine::ParaEngineSettings::GetCtorSpeed (  ) 

Get the construction Speed.

in meters per second

void ParaEngine::ParaEngineSettings::SetCtorSpeed ( float  fSpeed  ) 

set the construction Speed.

in meters per second

void ParaEngine::ParaEngineSettings::LoadGameEffectSet ( int  nSetID  ) 

Load the game effect set.

This function can be used to load a predefined set of ParaEngine's rendering choices, such as best performance, maximum speed, etc. Please note that ParaEngine may change the set content as computer hardware evolves Hence, for more granular control over the rendering settings, please use respective functions in the ParaScene and ParaTerrain namespace,etc. Please note if a computer does not support a shader in an effect set, the game engine will automatically degrade to a previous level.

Parameters:
nSetID,: The following set id are internally supported. 1024: force using fixed function pipeline. It will run on the oldest possible hardware without using any shaders. 0: recommended setting at the time the game engine is released. 1: use more expensive settings than the set id=0. 2: use more expensive settings than the set id=1. -1: use less expensive settings than the set id=0. -2: use less expensive settings than the set id=-1.

void ParaEngine::ParaEngineSettings::SetTextureLOD ( int  nLOD  ) 

Most detailed level-of-detail value to set for the mipmap chain.

Default value is 0 More specifically, if the texture was created with the dimensions of 256x256, setting the most detailed level to 0 indicates that 256 x 256 is the largest mipmap available, setting the most detailed level to 1 indicates that 128 x 128 is the largest mipmap available, and so on, up to the most detailed mip level (the smallest texture size) for the chain.

static bool ParaEngine::ParaEngineSettings::IsDebugging (  )  [static]

whether ParaEngine is compiled as debug build.

static bool ParaEngine::ParaEngineSettings::IsEditing (  )  [static]

whether the game engine is in developing mode.

static void ParaEngine::ParaEngineSettings::SetEditingMode ( bool  bEnable  )  [static]

set editing mode.

Parameters:
bEnable,: true if enable.

const char* ParaEngine::ParaEngineSettings::GetLocale (  ) 

The locale is what makes it possible to know what language the interface is using and thus determine which specific code is going to be executed.

Returns:
: "frFR": French "deDE": German "enUS": American english "enGB": British english "koKR": Korean "zhCN": Chinese (simplified) "zhTW": Chinese (traditional) "ruRU": Russian (UI AddOn) "esES": Spanish

void ParaEngine::ParaEngineSettings::SetLocale ( const char *  sLocale  ) 

See also:
GetLocale().

static bool ParaEngine::ParaEngineSettings::IsProductActivated (  )  [static]

If ActivateProduct() is called and returns true before this function is called when the application starts, then this function will return true.

Otherwise it will return false.

Note:
: IsProductActivated() and ActivateProduct() provides a very simple method to ship product with shareware One can use license code generation tools in ParaIDE to generate, say 2000, valid license codes at a time into a text file.
Returns:

static bool ParaEngine::ParaEngineSettings::ActivateProduct ( const char *  sActivationCode  )  [static]

activate the product using a activation code.

This function must be called every time the application start with a valid license code, otherwise, IsProductActivated() will always be false.

Note:
: IsProductActivated() and ActivateProduct() provides a very simple method to ship product with shareware One can use license code generation tools in ParaIDE to generate, say 2000, valid license codes at a time into a text file.

static const char* ParaEngine::ParaEngineSettings::GetProductKey ( const char *  sProductName  )  [static]

Get the product key for the current application.

Parameters:
sProductName,: this can be NULL, it is reserved for future use
Returns:
product key is returned.

static bool ParaEngine::ParaEngineSettings::GenerateActivationCodes ( const char *  sOutputFileName,
int  nFrom,
int  nTo 
) [static]

generate product activation codes in large numbers in to a given file.

this function is only available in debug build.

Parameters:
sOutputFileName the text file that store the generated keys: each key is on a separate line if this is NULL, a automatically generated file name will be used, which is of the following format. temp/ParaEngine Licenses 1.0.1.0_enUS_1-2000.txt, where v1.0.1.0 is the software version number, enUS is the language, 0-2000 is nFrom-nTo This file is usually submitted to shareware website so that they can sell your software.
nFrom copy number
nTo copy number
Returns:

void ParaEngine::ParaEngineSettings::SetFullScreenMode ( bool  bFullscreen  ) 

whether to use full screen mode, it does not immediately change the device, call UpdateScreenMode() to update the device.

D3DXVECTOR2 ParaEngine::ParaEngineSettings::GetScreenResolution (  ) 

change the full screen mode, it does not immediately change the device, call UpdateScreenMode() to update the device.

int ParaEngine::ParaEngineSettings::GetMultiSampleType (  ) 

anti-aliasing for both windowed and full screen mode.

it does not immediately change the device, call UpdateScreenMode() to update the device.

int ParaEngine::ParaEngineSettings::GetMultiSampleQuality (  ) 

anti-aliasing for both windowed and full screen mode.

it does not immediately change the device, call UpdateScreenMode() to update the device.

void ParaEngine::ParaEngineSettings::UpdateScreenMode (  ) 

call this function to update changes of FullScreen Mode and Screen Resolution.

static bool ParaEngine::ParaEngineSettings::SetWindowedMode ( bool  bWindowed  )  [static]

switch to either windowed mode or full screen mode.

static bool ParaEngine::ParaEngineSettings::IsWindowedMode (  )  [static]

return true if it is currently under windowed mode.

static void ParaEngine::ParaEngineSettings::SetIgnoreWindowSizeChange ( bool  bIgnoreSizeChange  )  [static]

switch to ignore windows size change.

default to false. if false, the user is allowed to adjust window size in windowed mode.

static bool ParaEngine::ParaEngineSettings::GetIgnoreWindowSizeChange (  )  [static]

return true if it is currently under windowed mode.

static void ParaEngine::ParaEngineSettings::EnablePassiveRendering ( bool  bEnable  )  [static]

passive rendering, it will not render the scene, but simulation and time remains the same.

Default is false this function is usually used in server mode, when the application is run in silent mode

static bool ParaEngine::ParaEngineSettings::IsPassiveRenderingEnabled (  )  [static]

passive rendering, it will not render the scene, but simulation and time remains the same.

Default is false this function is usually used in server mode, when the application is run in silent mode

static void ParaEngine::ParaEngineSettings::WriteConfigFile ( const char *  sFileName  )  [static]

write the current setting to config file.

Such as graphics mode and whether full screen, etc. config file at ./config.txt will be automatically loaded when the game engine starts.

Parameters:
sFileName,: if this is "", it will be the default config file at ./config.txt

void ParaEngine::ParaEngineSettings::SetMouseInverse ( bool  bInverse  ) 

set whether the mouse is inversed.

static const char* ParaEngine::ParaEngineSettings::GetAppCommandLine (  )  [static]

get string specifying the command line for the application, excluding the program name.

static const char* ParaEngine::ParaEngineSettings::GetAppCommandLineByParam ( const char *  pParam,
const char *  defaultValue 
) [static]

return a specified parameter value in the command line of the application.

If the parameter does not exist, the return value is NULL.

Parameters:
pParam,: key to get
defaultValue,: if the key does not exist, this value will be added and returned. This can be NULL.

static void ParaEngine::ParaEngineSettings::SetAppCommandLine ( const char *  pCommandLine  )  [static]

set string specifying the command line for the application, excluding the program name.

calling this function multiple times with different command line is permitted. The latter settings will merge and override the previous ones.

Parameters:
pCommandLine,: such as key="value" key2="value2"


Generated on Mon Dec 1 14:34:43 2008 for NPL Scripting Reference for ParaEngine by  doxygen 1.5.2