Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

sp::tool::ScriptLoader Class Reference

#include <spToolScriptLoader.hpp>

List of all members.

Classes

struct  SAnimation
struct  SAnimationFrame
struct  SCommand
struct  SContainer
struct  SLoopRange
struct  SParameter
struct  SVector

Public Member Functions

 ScriptLoader (scene::SceneGraph *ActiveSceneGraph=0, audio::SoundDevice *ActiveSoundDevice=0)
virtual ~ScriptLoader ()
virtual io::stringc getVersion () const
bool loadScriptFile (const io::stringc &Filename)
void setConstant (const io::stringc &Name, const io::stringc &Value)
std::vector< video::Texture * > getTextureList () const
std::vector< audio::Sound * > getSoundList () const
std::vector< scene::SceneNode * > getNodeList () const
std::vector< scene::Mesh * > getMeshList () const
std::vector< scene::Camera * > getCameraList () const
std::vector< scene::Light * > getLightList () const
std::vector< scene::Billboard * > getBillboardList () const
virtual void clearLists ()

Protected Types

enum  ECommandTypes {
  CMD_NONE = 0x00, CMD_DIRECT = 0x01, CMD_MACRO = 0x02, CMD_FORLOOP = 0x04,
  CMD_BLOCK = 0x08, CMD_ACCESS = 0x10, CMD_ALL = CMD_DIRECT | CMD_MACRO | CMD_FORLOOP | CMD_BLOCK | CMD_ACCESS
}

Protected Member Functions

bool readScript ()
io::stringc readNextLine ()
bool checkEOF () const
bool readLine ()
void cropLineInside (s32 BeginPos, s32 EndPos)
void cropLineOutside (s32 BeginPos, s32 EndPos)
s32 readString (io::stringc &Str, s32 BeginPos=0) const
SCommand readNextCommand (s32 AllowedCommands=CMD_ALL) const
bool readNextParameter (SParameter &Param, s32 BeginPos=0)
bool readNextParameterValue (SParameter &Param, io::stringc &CurLineContext)
io::stringc getLinesIndicate () const
void printErrorLI (const io::stringc &Message) const
void printWarningLI (const io::stringc &Message) const
bool readCommandDirect ()
bool readCommandMacro ()
bool readCommandForLoop ()
bool readCommandBlock ()
bool readCommandAccess ()
bool isParam (const io::stringc &Name)
virtual bool examineBlockNode ()
virtual bool examineBlockMesh ()
virtual bool examineBlockLight ()
virtual bool examineBlockCamera ()
virtual bool examineBlockBillboard ()
virtual bool examineBlockTerrain ()
virtual bool examineBlockTexture ()
virtual bool examineBlockSound ()
virtual bool examineBlockShader ()
virtual bool examineBlockAnim ()
virtual bool examineBlockFrame ()
virtual bool examineBlockSurface ()
virtual bool examineBlockVertex ()
virtual bool examineBlockTriangle ()
bool examineBlockNode (scene::SceneNode *Obj)
bool examineBlockMaterialNode (scene::MaterialNode *Obj)
void applyAnimation (scene::SceneNode *Obj)
void applySurfaces (scene::Mesh *Obj)

Protected Attributes

io::FileSystem FileSys_
io::FileFile_
scene::SceneGraphActiveSceneGraph_
audio::SoundDeviceActiveSoundDevice_
SContainer< video::TextureTextures_
SContainer< audio::SoundSounds_
SContainer< scene::SceneNodeNodes_
SContainer< scene::MeshMeshes_
SContainer< scene::CameraCameras_
SContainer< scene::LightLights_
SContainer< scene::BillboardBillboards_
std::map< std::string,
io::stringc
UniformMap_
std::map< std::string, SParameterVariableMap_
std::map< std::string, bool > InternalUniformMap_
io::stringc Line_
io::stringc Trimed_
u32 CurLineNr_
std::map< std::string, SLoopRangeLoopMap_
SCommand CurCommand_
std::map< std::string, SParameterParamMap_
SParameter CurParam_
std::map< std::string,
scene::SceneNode * > 
NodeMap_
std::map< std::string,
video::Texture * > 
TextureMap_
io::stringc WorkDir_
SAnimation CurAnim_
video::MeshBufferCurSurface_
std::list< video::MeshBuffer * > CurSurfaceList_

Detailed Description

The ScriptLoader can be used to load several textures, sounds and geometry objects. The basic idea of the "ConstructiveScriptLoader" is to create 3D scenes very fast and easy. Here is an example of a script file:

// // Comments are equal to those in C/C++
// 
// // Changes the current working directory to "media/" (only internally; your program will not be affected)
// workdir "media/"
// 
// // Loads the "media/HLC.png" file, resizes the texture to 32x32 texels, sets the min & mag filter
// texture: { file = "HLC.png"; size = vec(32, 32); filter = "bilinear"; }

Member Enumeration Documentation

Enumerator:
CMD_NONE 
CMD_DIRECT 
CMD_MACRO 
CMD_FORLOOP 
CMD_BLOCK 
CMD_ACCESS 
CMD_ALL 

Constructor & Destructor Documentation

sp::tool::ScriptLoader::ScriptLoader ( scene::SceneGraph ActiveSceneGraph = 0,
audio::SoundDevice ActiveSoundDevice = 0 
)
virtual sp::tool::ScriptLoader::~ScriptLoader (  )  [virtual]

Member Function Documentation

void sp::tool::ScriptLoader::applyAnimation ( scene::SceneNode Obj  )  [protected]
void sp::tool::ScriptLoader::applySurfaces ( scene::Mesh Obj  )  [protected]
bool sp::tool::ScriptLoader::checkEOF (  )  const [protected]
virtual void sp::tool::ScriptLoader::clearLists (  )  [virtual]
void sp::tool::ScriptLoader::cropLineInside ( s32  BeginPos,
s32  EndPos 
) [protected]
void sp::tool::ScriptLoader::cropLineOutside ( s32  BeginPos,
s32  EndPos 
) [protected]
virtual bool sp::tool::ScriptLoader::examineBlockAnim (  )  [protected, virtual]
virtual bool sp::tool::ScriptLoader::examineBlockBillboard (  )  [protected, virtual]
virtual bool sp::tool::ScriptLoader::examineBlockCamera (  )  [protected, virtual]
virtual bool sp::tool::ScriptLoader::examineBlockFrame (  )  [protected, virtual]
virtual bool sp::tool::ScriptLoader::examineBlockLight (  )  [protected, virtual]
bool sp::tool::ScriptLoader::examineBlockMaterialNode ( scene::MaterialNode Obj  )  [protected]
virtual bool sp::tool::ScriptLoader::examineBlockMesh (  )  [protected, virtual]
bool sp::tool::ScriptLoader::examineBlockNode ( scene::SceneNode Obj  )  [protected]
virtual bool sp::tool::ScriptLoader::examineBlockNode (  )  [protected, virtual]
virtual bool sp::tool::ScriptLoader::examineBlockShader (  )  [protected, virtual]
virtual bool sp::tool::ScriptLoader::examineBlockSound (  )  [protected, virtual]
virtual bool sp::tool::ScriptLoader::examineBlockSurface (  )  [protected, virtual]
virtual bool sp::tool::ScriptLoader::examineBlockTerrain (  )  [protected, virtual]
virtual bool sp::tool::ScriptLoader::examineBlockTexture (  )  [protected, virtual]
virtual bool sp::tool::ScriptLoader::examineBlockTriangle (  )  [protected, virtual]
virtual bool sp::tool::ScriptLoader::examineBlockVertex (  )  [protected, virtual]
std::vector<scene::Billboard*> sp::tool::ScriptLoader::getBillboardList (  )  const [inline]
std::vector<scene::Camera*> sp::tool::ScriptLoader::getCameraList (  )  const [inline]
std::vector<scene::Light*> sp::tool::ScriptLoader::getLightList (  )  const [inline]
io::stringc sp::tool::ScriptLoader::getLinesIndicate (  )  const [protected]
std::vector<scene::Mesh*> sp::tool::ScriptLoader::getMeshList (  )  const [inline]
std::vector<scene::SceneNode*> sp::tool::ScriptLoader::getNodeList (  )  const [inline]
std::vector<audio::Sound*> sp::tool::ScriptLoader::getSoundList (  )  const [inline]
std::vector<video::Texture*> sp::tool::ScriptLoader::getTextureList (  )  const [inline]
virtual io::stringc sp::tool::ScriptLoader::getVersion (  )  const [virtual]
Returns:
ScriptLoader version (e.g. "ConstructiveScriptLoader - v.2.0").
bool sp::tool::ScriptLoader::isParam ( const io::stringc Name  )  [protected]
bool sp::tool::ScriptLoader::loadScriptFile ( const io::stringc Filename  ) 

Loads a "SoftPixel Engine" script file.

Parameters:
Filename,: Script filename which is to be loaded.
Returns:
True if the script file could be loaded successful. Otherwise false.
void sp::tool::ScriptLoader::printErrorLI ( const io::stringc Message  )  const [protected]
void sp::tool::ScriptLoader::printWarningLI ( const io::stringc Message  )  const [protected]
bool sp::tool::ScriptLoader::readCommandAccess (  )  [protected]
bool sp::tool::ScriptLoader::readCommandBlock (  )  [protected]
bool sp::tool::ScriptLoader::readCommandDirect (  )  [protected]
bool sp::tool::ScriptLoader::readCommandForLoop (  )  [protected]
bool sp::tool::ScriptLoader::readCommandMacro (  )  [protected]
bool sp::tool::ScriptLoader::readLine (  )  [protected]
SCommand sp::tool::ScriptLoader::readNextCommand ( s32  AllowedCommands = CMD_ALL  )  const [protected]
io::stringc sp::tool::ScriptLoader::readNextLine (  )  [protected]
bool sp::tool::ScriptLoader::readNextParameter ( SParameter Param,
s32  BeginPos = 0 
) [protected]
bool sp::tool::ScriptLoader::readNextParameterValue ( SParameter Param,
io::stringc CurLineContext 
) [protected]
bool sp::tool::ScriptLoader::readScript (  )  [protected]
s32 sp::tool::ScriptLoader::readString ( io::stringc Str,
s32  BeginPos = 0 
) const [protected]
void sp::tool::ScriptLoader::setConstant ( const io::stringc Name,
const io::stringc Value 
)

Member Data Documentation

std::map<std::string, bool> sp::tool::ScriptLoader::InternalUniformMap_ [protected]
std::map<std::string, SLoopRange> sp::tool::ScriptLoader::LoopMap_ [protected]
std::map<std::string, scene::SceneNode*> sp::tool::ScriptLoader::NodeMap_ [protected]
std::map<std::string, SParameter> sp::tool::ScriptLoader::ParamMap_ [protected]
std::map<std::string, video::Texture*> sp::tool::ScriptLoader::TextureMap_ [protected]
std::map<std::string, io::stringc> sp::tool::ScriptLoader::UniformMap_ [protected]
std::map<std::string, SParameter> sp::tool::ScriptLoader::VariableMap_ [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines