Main class containing all important call to the irrlicht and a lot of utilities, derive from base. More...
#include <coeur.h>
Public Member Functions | |
coeur () | |
Constructor. | |
~coeur () | |
Destructor. | |
int | init (startmenu *) |
Init the coeur. | |
int | update () |
Updating (must be call on each loop). | |
int | close () |
Close the coeur. | |
int | setCaption (stringw) |
Set the title of the window. | |
IAnimatedMeshSceneNode * | addMesh (stringc) |
Add a mesh to irrlicht. | |
ILightSceneNode * | addLight (int) |
Add a light to irrlicht. | |
ITexture * | getTexture (stringc) |
Load a texture. | |
dimension2d< s32 > | getDim () |
Return the dimension of the window. | |
actionMesh * | getSelectedAction () |
Return wich actionMesh the user is looking at. | |
item | getItem (int) |
Return an Item from his Id. | |
actionMesh * | getActionMesh (int) |
Return an ActionMesh from his id. | |
actionMesh * | getActionMesh (ISceneNode *) |
Return an ActionMesh from his node. | |
localItem * | getObservationMesh (int) |
Return the localItem of an observationMesh from his id. | |
localItem * | getObservationItem (int) |
Return the localItem of an observationItem from his id. | |
localItem * | getCombinaison () |
Return the localItem corresponding to a failing combinaison. | |
position2d< s32 > | getCurPos () |
Return the postion of the cursor. | |
u32 | getTime () |
Return the current time. | |
stringc | getVersion () |
Return the version of the soft. | |
int | play (stringc) |
Play a sound. | |
int | anim (int, int, int) |
Launch the animation of an actionMesh. | |
int | setSkyBox (stringc, stringc, stringc, stringc, stringc, stringc) |
Set the skybox. | |
virtual bool | OnEvent (const SEvent &) |
Called when an event occured. | |
logger * | getLogger () |
Return the pointer to the logger. | |
int | startCredit () |
Launch the Credit. | |
int | loadChap (int) |
Load a new chapter. | |
int | loadLieu (int) |
Load a new lieu. | |
int | loadLocal (int) |
Load a new local. | |
IParticleSystemSceneNode * | addParticleSystem () |
Public Attributes | |
ISceneManager * | smgr |
The Irrlicht SceneManager. | |
ICameraSceneNode * | cam |
The Camera. | |
Private Member Functions | |
ISceneNode * | getSelectedNode () |
Get Selected Node. | |
void | pickNode (ISceneNode *, line3df, f32 &, ISceneNode *&) |
Pick a node. | |
Private Attributes | |
IrrlichtDevice * | device |
The Irrlicht Device. | |
IVideoDriver * | driver |
The Irrlicht Driver. | |
IGUIEnvironment * | env |
The Irrlicht Envirronement. | |
E_DRIVER_TYPE | dr |
The driver chosen. | |
dimension2d< s32 > | dim |
The dimension chosen. | |
int | bits |
The bits o the window. | |
bool | fullscreen |
Does the render take all the screen. | |
bool | stencilbuffer |
Does it draw the stencil shadow. | |
bool | vsync |
Does the certical synchronisation is activated. | |
int | lang |
Language of the game loaded. | |
interface * | in |
Pointer to the interface class. | |
console * | co |
Pointer to the console class. | |
credit * | mycredit |
Pointer to the credit class. | |
logger * | mylogger |
bool | q |
Set to true if the coeur must be quit. | |
position2d< s32 > | curPos |
Position of the cursor. | |
std::vector< stringc * > * | pathChap |
List containing the path of all the chapters. | |
std::vector< stringc * > * | pathLieu |
List containing the path of all the lieu. | |
std::vector< stringc * > * | pathLocal |
List containing the path of all the local. | |
chap * | currentChap |
Pointer to the chap class. | |
lieu * | currentLieu |
Pointer to the lieu class. | |
local * | currentLocal |
Pointer to the local class. | |
pyInt * | py |
actionMesh * | selectedAction |
Pointer to the actionMesh selected. | |
IMetaTriangleSelector * | metaSelector |
Pointer to the metaSelector. | |
stringc | pathGame |
Folder containg all the data of the game. | |
bool | activeScene |
True if the coeur must draw the scene. | |
bool | activeIn |
True if the coeur must draw the interface. | |
Friends | |
class | console |
The console has all right on this class. | |
class | pyInt |
The python interface has all right on this class. |
Main class containing all important call to the irrlicht and a lot of utilities, derive from base.
This class contain all the reference to the irrlicht and irrklang engine It contains most of the stuff needed by other class. It's the only class who have to be create, all th others are handle by this one, and the xml config file. This is class is configured by two xml files : the config.xml for all basic stuff and the main.xml which is the main config filoe of the game
If you want to know more about the xml configuration see config.xml and main.xml
Definition at line 27 of file coeur.h.
coeur::coeur | ( | ) |
Constructor.
Construct the coeur class, call base::base() and create all the class and initialize some value.
Definition at line 105 of file coeur.cpp.
References bits, co, currentChap, currentLieu, currentLocal, dim, dr, fullscreen, in, lang, mycredit, mylogger, pathChap, pathLieu, pathLocal, py, stencilbuffer, and vsync.
coeur::~coeur | ( | ) |
Destructor.
Destruct the coeur class, delete all what is needed.
Definition at line 133 of file coeur.cpp.
References co, currentChap, currentLieu, currentLocal, in, mycredit, mylogger, pathChap, pathLieu, pathLocal, and py.
ILightSceneNode * coeur::addLight | ( | int | radius | ) |
Add a light to irrlicht.
Definition at line 473 of file coeur.cpp.
References smgr.
Referenced by lieu::init().
IAnimatedMeshSceneNode * coeur::addMesh | ( | stringc | pathm | ) |
Add a mesh to irrlicht.
Definition at line 449 of file coeur.cpp.
References base::log(), metaSelector, and smgr.
Referenced by lieu::addAnimateMesh(), lieu::addObservationMesh(), lieu::addPrendreMesh(), and lieu::addStaticMesh().
IParticleSystemSceneNode * coeur::addParticleSystem | ( | ) |
int coeur::anim | ( | int | id, | |
int | begin, | |||
int | end | |||
) |
Launch the animation of an actionMesh.
Definition at line 643 of file coeur.cpp.
References getActionMesh(), staticMesh::getNode(), metaSelector, and smgr.
Referenced by init(), and interface::OnEvent().
int coeur::close | ( | ) | [virtual] |
Close the coeur.
Reimplemented from base.
Definition at line 398 of file coeur.cpp.
References logger::close(), pyInt::close(), credit::close(), interface::close(), chap::close(), lieu::close(), local::close(), console::close(), co, currentChap, currentLieu, currentLocal, device, in, base::log(), mycredit, mylogger, pathChap, pathLieu, pathLocal, and py.
Referenced by startmenu::startCoeur().
actionMesh * coeur::getActionMesh | ( | ISceneNode * | node | ) |
Return an ActionMesh from his node.
Definition at line 613 of file coeur.cpp.
References currentLieu, and lieu::getActionMesh().
actionMesh * coeur::getActionMesh | ( | int | id | ) |
Return an ActionMesh from his id.
/todo Maybe returning a pointer is not a good idea
Definition at line 608 of file coeur.cpp.
References currentLieu, and lieu::getActionMesh().
Referenced by anim(), BOOST_PYTHON_MODULE(), and update().
localItem * coeur::getCombinaison | ( | ) |
Return the localItem corresponding to a failing combinaison.
Definition at line 628 of file coeur.cpp.
References currentLocal, and local::getCombinaison().
Referenced by BOOST_PYTHON_MODULE(), and interface::OnEvent().
position2d< s32 > coeur::getCurPos | ( | ) |
Return the postion of the cursor.
Definition at line 496 of file coeur.cpp.
References curPos.
Referenced by interface::update().
dimension2d< s32 > coeur::getDim | ( | ) |
Return the dimension of the window.
Definition at line 486 of file coeur.cpp.
References dim.
Referenced by interface::addInventaire(), credit::addLogo(), credit::addText(), BOOST_PYTHON_MODULE(), interface::init(), credit::init(), and interface::update().
item coeur::getItem | ( | int | id | ) |
Return an Item from his Id.
Definition at line 602 of file coeur.cpp.
References currentChap, and chap::getItemFromId().
Referenced by BOOST_PYTHON_MODULE(), and interface::OnEvent().
logger * coeur::getLogger | ( | ) |
Return the pointer to the logger.
Definition at line 633 of file coeur.cpp.
References mylogger.
Referenced by base::close(), base::init(), and base::log().
localItem * coeur::getObservationItem | ( | int | id | ) |
Return the localItem of an observationItem from his id.
Definition at line 623 of file coeur.cpp.
References currentLocal, and local::getObservationItem().
Referenced by BOOST_PYTHON_MODULE(), and interface::OnEvent().
localItem * coeur::getObservationMesh | ( | int | id | ) |
Return the localItem of an observationMesh from his id.
Definition at line 618 of file coeur.cpp.
References currentLocal, and local::getObservationMesh().
Referenced by BOOST_PYTHON_MODULE(), and interface::OnEvent().
actionMesh * coeur::getSelectedAction | ( | ) |
Return wich actionMesh the user is looking at.
Definition at line 491 of file coeur.cpp.
References selectedAction.
Referenced by BOOST_PYTHON_MODULE(), interface::OnEvent(), and interface::update().
ISceneNode * coeur::getSelectedNode | ( | ) | [private] |
ITexture * coeur::getTexture | ( | stringc | path | ) |
Load a texture.
Definition at line 480 of file coeur.cpp.
References driver, and base::log().
Referenced by inventaire::addItem(), credit::addLogo(), lieu::init(), inventaire::init(), interface::init(), interface::setImage(), and setSkyBox().
u32 coeur::getTime | ( | ) |
Return the current time.
Definition at line 501 of file coeur.cpp.
References device.
Referenced by BOOST_PYTHON_MODULE(), interface::speak(), and logger::write().
stringc coeur::getVersion | ( | ) |
Return the version of the soft.
Definition at line 638 of file coeur.cpp.
Referenced by BOOST_PYTHON_MODULE(), and console::help().
int coeur::init | ( | startmenu * | cb | ) |
Init the coeur.
Call base::init() and read xmlChap
Definition at line 154 of file coeur.cpp.
References activeIn, activeScene, anim(), bits, cam, co, currentLocal, device, dim, dr, driver, env, fullscreen, local::getCaption(), startmenu::getFileSystem(), in, console::init(), pyInt::init(), credit::init(), interface::init(), logger::init(), lang, loadChap(), loadLocal(), base::log(), metaSelector, mycredit, mylogger, pathChap, pathGame, pathLieu, pathLocal, startmenu::progress(), py, q, selectedAction, setCaption(), smgr, stencilbuffer, and vsync.
Referenced by startmenu::startCoeur().
int coeur::loadChap | ( | int | i | ) |
Load a new chapter.
Definition at line 552 of file coeur.cpp.
References chap::close(), currentChap, device, chap::init(), base::isInit(), loadLieu(), base::log(), and pathChap.
Referenced by BOOST_PYTHON_MODULE(), and init().
int coeur::loadLieu | ( | int | i | ) |
Load a new lieu.
Definition at line 567 of file coeur.cpp.
References lieu::close(), currentLieu, device, lieu::init(), base::isInit(), base::log(), and pathLieu.
Referenced by loadChap().
int coeur::loadLocal | ( | int | i | ) |
Load a new local.
Definition at line 580 of file coeur.cpp.
References local::close(), currentLocal, device, local::init(), base::isInit(), base::log(), and pathLocal.
Referenced by init().
bool coeur::OnEvent | ( | const SEvent & | event | ) | [virtual] |
Called when an event occured.
Definition at line 516 of file coeur.cpp.
References cam, co, in, mycredit, interface::OnEvent(), credit::OnEvent(), console::OnEvent(), q, and startCredit().
void coeur::pickNode | ( | ISceneNode * | root, | |
line3df | ray, | |||
f32 & | outbestdistance, | |||
ISceneNode *& | outbestnode | |||
) | [private] |
Pick a node.
Definition at line 341 of file coeur.cpp.
References smgr.
Referenced by getSelectedNode().
int coeur::play | ( | stringc | path | ) |
Play a sound.
Definition at line 507 of file coeur.cpp.
References base::log(), and pathGame.
Referenced by BOOST_PYTHON_MODULE(), interface::OnEvent(), interface::speak(), and credit::start().
int coeur::setCaption | ( | stringw | caption | ) |
Set the title of the window.
Definition at line 442 of file coeur.cpp.
References device, and base::log().
Referenced by BOOST_PYTHON_MODULE(), and init().
int coeur::setSkyBox | ( | stringc | top, | |
stringc | bottom, | |||
stringc | left, | |||
stringc | right, | |||
stringc | front, | |||
stringc | back | |||
) |
Set the skybox.
Definition at line 663 of file coeur.cpp.
References getTexture(), and smgr.
Referenced by lieu::init().
int coeur::startCredit | ( | ) |
Launch the Credit.
Definition at line 593 of file coeur.cpp.
References activeIn, activeScene, cam, mycredit, and credit::start().
Referenced by BOOST_PYTHON_MODULE(), and OnEvent().
int coeur::update | ( | ) | [virtual] |
Updating (must be call on each loop).
Desc
Reimplemented from base.
Definition at line 369 of file coeur.cpp.
References activeIn, activeScene, co, curPos, device, driver, env, getActionMesh(), getSelectedNode(), in, base::log(), mycredit, q, selectedAction, smgr, credit::update(), console::update(), and interface::update().
Referenced by startmenu::startCoeur().
friend class console [friend] |
friend class pyInt [friend] |
bool coeur::activeIn [private] |
bool coeur::activeScene [private] |
int coeur::bits [private] |
ICameraSceneNode* coeur::cam |
The Camera.
Definition at line 146 of file coeur.h.
Referenced by init(), OnEvent(), console::position(), console::rotation(), startCredit(), console::target(), and interface::update().
position2d<s32> coeur::curPos [private] |
Position of the cursor.
Definition at line 184 of file coeur.h.
Referenced by getCurPos(), getSelectedNode(), and update().
chap* coeur::currentChap [private] |
Pointer to the chap class.
Definition at line 196 of file coeur.h.
Referenced by close(), coeur(), getItem(), console::init(), loadChap(), and ~coeur().
lieu* coeur::currentLieu [private] |
Pointer to the lieu class.
Definition at line 199 of file coeur.h.
Referenced by close(), coeur(), getActionMesh(), loadLieu(), and ~coeur().
local* coeur::currentLocal [private] |
Pointer to the local class.
Definition at line 202 of file coeur.h.
Referenced by close(), coeur(), getCombinaison(), getObservationItem(), getObservationMesh(), console::init(), init(), loadLocal(), and ~coeur().
IrrlichtDevice* coeur::device [private] |
The Irrlicht Device.
Definition at line 134 of file coeur.h.
Referenced by close(), getTime(), init(), loadChap(), loadLieu(), loadLocal(), setCaption(), and update().
dimension2d<s32> coeur::dim [private] |
E_DRIVER_TYPE coeur::dr [private] |
IVideoDriver* coeur::driver [private] |
The Irrlicht Driver.
Definition at line 137 of file coeur.h.
Referenced by getTexture(), init(), and update().
IGUIEnvironment* coeur::env [private] |
bool coeur::fullscreen [private] |
int coeur::lang [private] |
IMetaTriangleSelector* coeur::metaSelector [private] |
credit* coeur::mycredit [private] |
logger* coeur::mylogger [private] |
std::vector<stringc*>* coeur::pathChap [private] |
stringc coeur::pathGame [private] |
std::vector<stringc*>* coeur::pathLieu [private] |
std::vector<stringc*>* coeur::pathLocal [private] |
Definition at line 204 of file coeur.h.
Referenced by console::close(), close(), coeur(), console::init(), init(), console::OnEvent(), and ~coeur().
bool coeur::q [private] |
actionMesh* coeur::selectedAction [private] |
Pointer to the actionMesh selected.
Definition at line 207 of file coeur.h.
Referenced by getSelectedAction(), init(), and update().
ISceneManager* coeur::smgr |
The Irrlicht SceneManager.
Definition at line 140 of file coeur.h.
Referenced by addLight(), addMesh(), addParticleSystem(), anim(), getSelectedNode(), init(), pickNode(), setSkyBox(), interface::update(), and update().
bool coeur::stencilbuffer [private] |
bool coeur::vsync [private] |