53 #include "entresolmanager.h"
57 #include "eventmanager.h"
58 #include "Graphics/graphicsmanager.h"
59 #include "Graphics/meshmanager.h"
60 #include "Graphics/scenemanager.h"
61 #include "Graphics/texturemanager.h"
62 #include "Input/inputmanager.h"
63 #include "Network/networkmanager.h"
64 #include "Physics/collisionshapemanager.h"
65 #include "Physics/physicsmanager.h"
67 #include "UI/uimanager.h"
72 #ifdef ENABLE_OALS_AUDIO_IMPLEMENTATION
73 #include "Audio/OALS/oalsaudiomanagerfactory.h"
74 #endif // ENABLE_OALS_AUDIO_IMPLEMENTATION
85 #include "OgreParticleFXPlugin.h"
90 #include <btBulletDynamicsCommon.h>
101 Entresol::ManagerFactoryMap Entresol::ManagerFactories;
110 this->Construct(
".",
"Mezzanine.log",temp);
115 if( String::npos != InitializerFile.find(
".mxi") ) {
116 this->ConstructFromXML(EngineDataPath, ArchType, InitializerFile);
118 MEZZ_EXCEPTION(ExceptionBase::NOT_IMPLEMENTED_EXCEPTION,
"Attempting to initialze Mezzanine from an unsupported file type.");
124 for(ManagerFactoryVec::iterator it = CustomFactories.begin(); it != CustomFactories.end(); ++it)
126 this->AddManagerFactory( (*it) );
129 if( String::npos != InitializerFile.find(
".mxi") ) {
130 this->ConstructFromXML(EngineDataPath, ArchType, InitializerFile);
132 MEZZ_EXCEPTION(ExceptionBase::NOT_IMPLEMENTED_EXCEPTION,
"Attempting to initialze Mezzanine from an unsupported file type.");
136 Entresol::Entresol(
const String& EngineDataPath,
const String& LogFileName)
139 this->Construct(EngineDataPath, LogFileName, temp);
144 this->Construct(EngineDataPath, LogFileName, ManagersToBeAdded);
147 Entresol::~Entresol()
149 this->Deinitialize();
151 this->DestroyAllWorlds();
152 World::DestroyAllManagerFactories();
153 this->DestroyAllManagers();
154 Entresol::DestroyAllManagerFactories();
155 this->DestroyLogging();
164 void Entresol::Construct(
const String& EngineDataPath,
const String& GraphicsLogFileName,
const ManagerVec& ManagersToBeAdded)
167 Entresol::AddAllEngineDefaultManagerFactories();
168 World::AddAllEngineDefaultManagerFactories();
170 this->ManualLoopBreak = 0;
173 this->SetupLogging(GraphicsLogFileName);
176 SubSystemParticleFXPlugin =
new Ogre::ParticleFXPlugin();
177 Ogre::Root::getSingleton().installPlugin(SubSystemParticleFXPlugin);
180 for( ConstManagerVecIterator iter = ManagersToBeAdded.begin() ; iter!= ManagersToBeAdded.end() ; iter++ )
181 { this->AddManager(*iter); }
186 if( this->GetManager(ManagerBase::MT_ResourceManager) == 0 ) {
187 Params.push_back( std::pair<String,String>(
"EngineDataPath",EngineDataPath) );
188 this->CreateManager(
"DefaultResourceManager", Params );
191 if( this->GetManager(ManagerBase::MT_GraphicsManager) == 0 ) {
192 this->CreateManager(
"DefaultGraphicsManager", Params );
194 if( this->GetManager(ManagerBase::MT_EventManager) == 0 ) {
195 this->CreateManager(
"DefaultEventManager", Params );
197 if( this->GetManager(ManagerBase::MT_InputManager) == 0 ) {
198 this->CreateManager(
"DefaultInputManager", Params );
200 if( this->GetManager(ManagerBase::MT_UIManager) == 0 ) {
201 this->CreateManager(
"DefaultUIManager", Params );
203 if( this->GetManager(ManagerBase::MT_MeshManager) == 0 ) {
204 this->CreateManager(
"DefaultMeshManager", Params );
206 if( this->GetManager(ManagerBase::MT_TextureManager) == 0 ) {
207 this->CreateManager(
"DefaultTextureManager", Params );
209 if( this->GetManager(ManagerBase::MT_CollisionShapeManager) == 0 ) {
210 this->CreateManager(
"DefaultCollisionShapeManager", Params );
213 #ifdef ENABLE_OALS_AUDIO_IMPLEMENTATION
214 if( this->GetManager(ManagerBase::MT_AudioManager) == 0 ) {
215 this->CreateManager(
"OALSAudioManager",Params);
217 #endif //ENABLE_OALS_AUDIO_IMPLEMENTATION
220 this->SanityChecks();
223 void Entresol::ConstructFromXML(
const String& EngineDataPath,
const Resource::ArchiveType ArchType,
const String& InitializerFile)
226 Entresol::AddAllEngineDefaultManagerFactories();
227 World::AddAllEngineDefaultManagerFactories();
229 this->ManualLoopBreak =
false;
235 this->SubSystemParticleFXPlugin =
new Ogre::ParticleFXPlugin();
236 Ogre::Root::getSingleton().installPlugin(this->SubSystemParticleFXPlugin);
239 XML::Attribute CurrAttrib;
240 String GUIInit, ResourceInit, PluginsInit, LogFileName;
241 String PluginExtension, PluginPath;
246 if( Resource::ResourceManager::SingletonValid() ) {
247 this->AddManager( Resource::ResourceManager::GetSingletonPtr() );
249 this->AddManager(
new Resource::ResourceManager(EngineDataPath, ArchType) );
253 Resource::ResourceManager* ResourceMan =
static_cast<Resource::ResourceManager*
>( this->GetManager(ManagerBase::MT_ResourceManager) );
254 Resource::FileStream InitStream(InitializerFile,EngineDataPath);
255 XML::Document InitDoc;
256 XML::ParseResult DocResult = InitDoc.Load(InitStream);
259 ExceptionStream <<
"Failed to parse XML file \"" << InitializerFile <<
"\".";
260 MEZZ_EXCEPTION(ExceptionBase::SYNTAX_ERROR_EXCEPTION_XML,ExceptionStream.str());
262 XML::Node InitRoot = InitDoc.GetChild(
"InitializerRoot");
263 if( InitRoot.Empty() ) {
265 ExceptionStream <<
"Failed to find expected Root node in \"" << InitializerFile <<
"\".";
266 MEZZ_EXCEPTION(ExceptionBase::SYNTAX_ERROR_EXCEPTION_XML,ExceptionStream.str());
270 XML::Node CoreConfig = InitRoot.GetChild(
"CoreConfig");
271 for( XML::NodeIterator SetIt = CoreConfig.begin() ; SetIt != CoreConfig.end() ; ++SetIt )
273 String SecName = (*SetIt).Name();
274 if(
"FrameSettings" == SecName ) {
275 CurrAttrib = (*SetIt).GetAttribute(
"TargetFrameRate");
276 if(CurrAttrib.Empty()) {
277 CurrAttrib = (*SetIt).GetAttribute(
"TargetFrameTime");
278 if(!CurrAttrib.Empty())
279 SetTargetFrameTimeMicroseconds(CurrAttrib.AsWhole());
281 this->SetTargetFrameRate(CurrAttrib.AsWhole());
284 MEZZ_EXCEPTION(ExceptionBase::SYNTAX_ERROR_EXCEPTION_XML,
String(
"Unknown WorldSetting ")+SecName);
289 this->SetupLogging(LogFileName);
292 XML::Node InitFiles = InitRoot.GetChild(
"OtherInitializers");
293 for( XML::NodeIterator InitIt = InitFiles.begin() ; InitIt != InitFiles.end() ; ++InitIt )
295 String InitFileName = (*InitIt).Name();
296 if(
"PluginInit" == InitFileName ) {
297 CurrAttrib = (*InitIt).GetAttribute(
"FileName");
298 if(!CurrAttrib.Empty())
299 PluginsInit = CurrAttrib.AsString();
300 }
else if(
"ResourceInit" == InitFileName ) {
301 CurrAttrib = (*InitIt).GetAttribute(
"FileName");
302 if(!CurrAttrib.Empty())
303 ResourceInit = CurrAttrib.AsString();
304 }
else if(
"GUIInit" == InitFileName ) {
305 CurrAttrib = (*InitIt).GetAttribute(
"FileName");
306 if(!CurrAttrib.Empty())
307 GUIInit = CurrAttrib.AsString();
312 XML::Node Managers = InitRoot.GetChild(
"Managers");
313 for( XML::NodeIterator ManIt = Managers.begin() ; ManIt != Managers.end() ; ++ManIt )
315 this->CreateManager( (*ManIt).Name(), (*ManIt) );
319 if( !ResourceInit.empty() ) {
321 Resource::FileStream ResourceStream(ResourceInit,EngineDataPath);
322 XML::Document ResourceDoc;
323 ResourceDoc.Load(ResourceStream);
325 XML::Node ResourceLocations = ResourceDoc.GetChild(
"ResourceLocations");
326 for( XML::NodeIterator GroupIt = ResourceLocations.begin() ; GroupIt != ResourceLocations.end() ; ++GroupIt )
328 String GroupName, GroupPath;
329 Resource::ArchiveType GroupType = Resource::AT_Invalid;
330 Boole GroupRecursive =
false;
332 CurrAttrib = (*GroupIt).GetAttribute(
"GroupPath");
333 if(!CurrAttrib.Empty())
334 GroupPath = CurrAttrib.AsString();
336 CurrAttrib = (*GroupIt).GetAttribute(
"GroupType");
337 if(!CurrAttrib.Empty())
338 GroupType = Resource::ResourceManager::GetArchiveTypeFromString(CurrAttrib.AsString());
340 CurrAttrib = (*GroupIt).GetAttribute(
"GroupName");
341 if(!CurrAttrib.Empty())
342 GroupName = CurrAttrib.AsString();
344 CurrAttrib = (*GroupIt).GetAttribute(
"Recursive");
345 if(!CurrAttrib.Empty())
346 GroupRecursive = StringTools::ConvertToBool(CurrAttrib.AsString());
348 ResourceMan->AddAssetLocation(GroupPath,GroupType,GroupName,GroupRecursive);
351 XML::Node InitGroups = ResourceDoc.GetChild(
"InitGroups");
352 for( XML::NodeIterator InitIt = InitGroups.begin() ; InitIt != InitGroups.end() ; ++InitIt )
355 CurrAttrib = (*InitIt).GetAttribute(
"GroupName");
356 if(!CurrAttrib.Empty())
357 GroupName = CurrAttrib.AsString();
358 ResourceMan->InitAssetGroup(GroupName);
363 if(!GUIInit.empty()) {
367 this->SanityChecks();
370 void Entresol::SetupOgre()
372 if( Ogre::Root::getSingletonPtr() == NULL ) {
373 Ogre::Root* OgreCore =
new Ogre::Root(
"",
"",
"");
378 void Entresol::DestroyOgre()
383 if( Ogre::Root::getSingletonPtr() != NULL ) {
384 delete Ogre::Root::getSingletonPtr();
386 if( this->SubSystemParticleFXPlugin != NULL ) {
387 delete this->SubSystemParticleFXPlugin;
391 void Entresol::DestroySDL()
395 assert( NULL == Ogre::Root::getSingletonPtr()
396 &&
"SDL already shut down. SDL Shutdown forces x11 unload, which Ogre needs for it's shutdown." );
401 void Entresol::SetupLogging(
const String& OgreLogFileName)
403 this->SetupOgreLogging(OgreLogFileName);
404 this->SetupInternalLogging();
407 void Entresol::SetupOgreLogging(
const String& OgreLogFileName)
410 Ogre::LogManager* OgreLogs = Ogre::LogManager::getSingletonPtr();
411 if( NULL == OgreLogs ) {
412 OgreLogs =
new Ogre::LogManager();
415 if(!OgreLogFileName.empty()) {
416 OgreLogs->createLog(
String(
"Graphics")+OgreLogFileName,
true,
true,
true);
418 OgreLogs->createLog(
"GraphicsMezzanine.log",
true,
true,
true);
422 void Entresol::SetupInternalLogging()
424 this->Aggregator =
new Threading::LogAggregator();
425 this->Aggregator->SetAggregationTarget(&WorkScheduler);
426 this->WorkScheduler.AddWorkUnitMain(Aggregator,
"LogAggregator");
429 void Entresol::DestroyLogging()
434 Threading::DefaultThreadSpecificStorage::Type* LogResource = this->WorkScheduler.GetThreadResource();
435 this->WorkScheduler.GetLog() << LogResource->GetUsableLogger().str();
436 LogResource->SwapAllBufferedResources();
437 this->WorkScheduler.GetLog() << LogResource->GetUsableLogger().str();
440 this->WorkScheduler.RemoveWorkUnitMain(Aggregator);
441 delete this->Aggregator;
444 void Entresol::SanityChecks()
452 if(
sizeof(Input::InputCode) !=
sizeof(SDL_Scancode)) {
453 MEZZ_EXCEPTION(ExceptionBase::INVALID_STATE_EXCEPTION,
"User input subsystem Event Sizes Don't match, userinput subsystem will go be buggier than a highschool fortran class.");
456 if(
sizeof(Input::InputCode) !=
sizeof(
int)) {
457 MEZZ_EXCEPTION(ExceptionBase::INVALID_STATE_EXCEPTION,
"Internal User input subsystem Event Sizes Don't match, userinput subsystem cannot function.");
461 Boole Entresol::VerifyManagerInitializations()
463 std::vector<String> ManagerNames;
464 for( ManagerIterator Iter=this->ManagerList.begin(); Iter!=this->ManagerList.end(); ++Iter )
466 if(!(*Iter)->IsInitialized()) {
467 ManagerNames.push_back( (*Iter)->GetInterfaceTypeAsString() );
471 if( ManagerNames.empty() ) {
475 if( 1 == ManagerNames.size() ) {
476 ExceptionStream <<
"Manager: ";
477 ExceptionStream << ManagerNames.at(0);
478 ExceptionStream <<
"is not initialized. All managers need to be initiailzed when entering the main loop.";
480 ExceptionStream <<
"Managers: ";
481 for( std::vector<String>::iterator Iter = ManagerNames.begin() ; Iter != ManagerNames.end() ; ++Iter )
483 ExceptionStream << (*Iter) <<
", ";
485 ExceptionStream <<
"are not initialized. All managers need to be initiailzed when entering the main loop.";
487 MEZZ_EXCEPTION(ExceptionBase::INVALID_STATE_EXCEPTION,ExceptionStream.str());
496 {
return this->WorkScheduler; }
501 void Entresol::Initialize(
const Boole InitWorlds)
503 Graphics::GraphicsManager::GetSingletonPtr()->Initialize();
504 for(
ManagerIterator Iter = this->ManagerList.begin() ; Iter != this->ManagerList.end() ; ++Iter )
507 InitStream <<
"Initializing " << (*Iter)->GetImplementationTypeName() <<
" as " << (*Iter)->GetInterfaceTypeAsString() <<
"." << endl;
508 this->_Log( InitStream.str() );
509 if( (*Iter)->GetInterfaceType() != ManagerBase::MT_GraphicsManager ) {
510 (*Iter)->Initialize();
515 for(
WorldIterator WorldIt = this->Worlds.begin() ; WorldIt != this->Worlds.end() ; ++WorldIt )
517 (*WorldIt)->Initialize();
522 void Entresol::Deinitialize()
525 for(
WorldIterator WorldIt = this->Worlds.begin() ; WorldIt != this->Worlds.end() ; ++WorldIt )
527 (*WorldIt)->Deinitialize();
530 for(
ManagerIterator Iter = this->ManagerList.begin() ; Iter != this->ManagerList.end() ; ++Iter )
533 DeinitStream <<
"Deinitializing " << (*Iter)->GetImplementationTypeName() <<
" as " << (*Iter)->GetInterfaceTypeAsString() <<
"." << endl;
534 this->_Log( DeinitStream.str() );
535 (*Iter)->Deinitialize();
539 void Entresol::PreMainLoopInit()
541 this->VerifyManagerInitializations();
543 for(
WorldIterator it = this->Worlds.begin(); it != this->Worlds.end(); it++ )
544 { (*it)->PreMainLoopInit(); }
550 void Entresol::MainLoop()
552 this->PreMainLoopInit();
554 while( !this->ManualLoopBreak )
555 { this->DoOneFrame(); }
557 this->ManualLoopBreak = 0;
560 void Entresol::DoOneFrame()
563 WorkScheduler.GetLog() <<
"<FrameCounterStart Frame=\"" << WorkScheduler.GetFrameCount() <<
"\" Time=\"" <<
GetTimeStamp()<<
"\" />" << endl;
565 WorkScheduler.RunAllMonopolies();
566 WorkScheduler.CreateThreads();
567 WorkScheduler.RunMainThreadWork();
568 WorkScheduler.JoinAllThreads();
569 WorkScheduler.ResetAllWorkUnits();
571 WorkScheduler.GetLog() <<
"<FrameCounterPrePause Frame=\"" << WorkScheduler.GetFrameCount() <<
"\" Time=\"" <<
GetTimeStamp()<<
"\" />" << endl;
573 WorkScheduler.WaitUntilNextFrame();
575 WorkScheduler.GetLog() <<
"<FrameCounterEnd Frame=\"" << WorkScheduler.GetFrameCount() <<
"\" Time=\"" <<
GetTimeStamp()<<
"\" />" << endl;
579 void Entresol::BreakMainLoop(
Boole Break)
582 while( !this->ManualLoopBreak )
585 while( this->ManualLoopBreak )
590 Whole Entresol::GetFrameCount()
const
591 {
return this->WorkScheduler.GetFrameCount(); }
597 void Entresol::SetTargetFrameRate(
const Whole NewFrameRate)
598 { this->SetTargetFrameTimeMicroseconds(
Real(1000000) /
Real(NewFrameRate) ); }
600 void Entresol::SetTargetFrameTimeMilliseconds(
const Whole NewTargetTime)
601 { this->SetTargetFrameTimeMicroseconds( NewTargetTime * 1000 ); }
603 void Entresol::SetTargetFrameTimeMicroseconds(
const Whole NewTargetTime)
604 { this->WorkScheduler.SetFrameLength(NewTargetTime); }
606 Whole Entresol::GetTargetFrameTimeMilliseconds()
const
607 {
return this->WorkScheduler.GetFrameLength()*0.001; }
609 Whole Entresol::GetTargetFrameTimeMicroseconds()
const
610 {
return this->WorkScheduler.GetFrameLength(); }
612 Whole Entresol::GetLastFrameTimeMilliseconds()
const
613 {
return this->WorkScheduler.GetLastFrameTime()*0.001; }
615 Whole Entresol::GetLastFrameTimeMicroseconds()
const
616 {
return this->WorkScheduler.GetLastFrameTime(); }
623 Entresol::ManagerFactories.insert(std::pair<String,EntresolManagerFactory*>(ToBeAdded->
GetManagerImplName(),ToBeAdded));
631 void Entresol::RemoveManagerFactory(
const String& ImplName)
634 if( ManIt != Entresol::ManagerFactories.end() )
635 { Entresol::ManagerFactories.erase(ManIt); }
643 void Entresol::DestroyManagerFactory(
const String& ImplName)
646 if( ManIt != Entresol::ManagerFactories.end() ) {
647 delete ManIt->second;
648 Entresol::ManagerFactories.erase(ManIt);
652 void Entresol::DestroyAllManagerFactories()
654 for(
ManagerFactoryIterator ManIt = Entresol::ManagerFactories.begin() ; ManIt != Entresol::ManagerFactories.end() ; ++ManIt )
655 {
delete (*ManIt).second; }
656 Entresol::ManagerFactories.clear();
659 void Entresol::AddAllEngineDefaultManagerFactories()
663 ManIt = Entresol::ManagerFactories.find(
"DefaultCollisionShapeManager");
666 ManIt = Entresol::ManagerFactories.find(
"DefaultEventManager");
669 ManIt = Entresol::ManagerFactories.find(
"DefaultGraphicsManager");
672 ManIt = Entresol::ManagerFactories.find(
"DefaultInputManager");
675 ManIt = Entresol::ManagerFactories.find(
"DefaultMeshManager");
678 ManIt = Entresol::ManagerFactories.find(
"DefaultResourceManager");
681 ManIt = Entresol::ManagerFactories.find(
"DefaultTextureManager");
684 ManIt = Entresol::ManagerFactories.find(
"DefaultUIManager");
687 #ifdef ENABLE_OALS_AUDIO_IMPLEMENTATION
689 ManIt = Entresol::ManagerFactories.find(
"OALSAudioManager");
690 if( ManIt == Entresol::ManagerFactories.end() ) Entresol::AddManagerFactory(
new Audio::OALS::OALSAudioManagerFactory());
691 #endif //ENABLE_OALS_AUDIO_IMPLEMENTATION
695 ManIt = Entresol::ManagerFactories.find(
"DefaultNetworkManager");
700 ManIt = Entresol::ManagerFactories.find(
"Lua51ScriptingEngine");
711 if( ManIt == Entresol::ManagerFactories.end() ) {
712 MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,
"Attempting to create manager of type \"" + ManagerImplName +
"\", which has no factory registered.");
716 this->AddManager(NewMan);
723 if( ManIt == Entresol::ManagerFactories.end() ) {
724 MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,
"Attempting to create manager of type \"" + ManagerImplName +
"\", which has no factory registered.");
728 this->AddManager(NewMan);
735 if( ManIt == Entresol::ManagerFactories.end() ) {
736 MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,
"Attempting to destroy manager of type \"" + ToBeDestroyed->
GetImplementationTypeName() +
"\", which has no factory registered.");
738 this->RemoveManager(ToBeDestroyed);
739 (*ManIt).second->DestroyManager(ToBeDestroyed);
742 void Entresol::DestroyAllManagers()
760 while( !(this->ManagerList.empty()) )
768 if( ManIt == Entresol::ManagerFactories.end() ) {
771 (*ManIt).second->DestroyManager(Current);
774 this->ManagerList.pop_front();
784 for(
ManagerIterator ManIter = this->ManagerList.begin() ; ManIter != this->ManagerList.end() ; ++ManIter )
786 if( (*ManIter) == ManagerToAdd )
789 this->ManagerList.push_back(ManagerToAdd);
794 for(
ManagerIterator ManIter = this->ManagerList.begin(); ManIter!=this->ManagerList.end(); ++ManIter )
796 if( (*ManIter)->GetInterfaceType() == RetrieveType ) {
797 if( 0 == WhichOne )
return *ManIter;
806 for(
ManagerIterator ManIter = this->ManagerList.begin() ; ManIter != this->ManagerList.end() ; ++ManIter )
808 if( *ManIter == ManagerToRemove ) {
809 this->ManagerList.erase(ManIter);
815 void Entresol::RemoveManager(
const Whole RemoveType,
UInt16 WhichOne)
817 for(
ManagerIterator ManIter = this->ManagerList.begin(); ManIter!=this->ManagerList.end(); ++ManIter )
819 if( (*ManIter)->GetInterfaceType() == RemoveType ) {
820 if( 0 == WhichOne ) {
821 this->ManagerList.erase(ManIter);
836 this->AddWorld(NewWorld);
840 World* Entresol::CreateWorld(
const String& WorldName,
const std::vector <WorldManager*>& ManagerToBeAdded)
842 World* NewWorld =
new World(WorldName, ManagerToBeAdded);
843 this->AddWorld(NewWorld);
849 World* NewWorld =
new World(WorldName, PhysicsInfo, SceneType );
850 this->AddWorld(NewWorld);
854 World* Entresol::CreateWorld(
const String& WorldName,
const std::vector <WorldManager*>& ManagerToBeAdded,
857 World* NewWorld =
new World(WorldName, ManagerToBeAdded, PhysicsInfo, SceneType );
858 this->AddWorld(NewWorld);
862 void Entresol::AddWorld(
World* WorldToBeAdded)
864 Worlds.push_back(WorldToBeAdded);
872 if ( WorldName == w->
GetName() ) {
881 return this->Worlds.at(Index);
886 return this->Worlds.size();
891 for(
WorldIterator it = this->Worlds.begin(); it != this->Worlds.end(); it++ )
894 if ( WorldToBeRemoved == w ) {
895 this->Worlds.erase(it);
904 for(
WorldIterator it = this->Worlds.begin(); it != this->Worlds.end(); it++ )
907 if ( WorldName == w->
GetName() ) {
908 this->Worlds.erase(it);
915 void Entresol::RemoveAllWorlds()
917 this->Worlds.clear();
920 void Entresol::DestroyWorld(
World* WorldToBeDestroyed)
922 for(
WorldIterator it = this->Worlds.begin(); it != this->Worlds.end(); it++ )
925 if ( WorldToBeDestroyed == w ) {
927 this->Worlds.erase(it);
933 void Entresol::DestroyWorldByName(
const String& WorldName)
935 for(
WorldIterator it = this->Worlds.begin(); it != this->Worlds.end(); it++ )
938 if ( WorldName == w->
GetName() ) {
940 this->Worlds.erase(it);
946 void Entresol::DestroyAllWorlds()
948 for(
WorldIterator it = this->Worlds.begin(); it != this->Worlds.end(); it++ )
953 this->Worlds.clear();
956 void Entresol::PauseAllWorlds(
Boole Pause)
958 for(
WorldIterator it = this->Worlds.begin(); it != this->Worlds.end(); it++ )
967 void Entresol::_LogString(
const String& Message)
970 if( Message.size() > 0 )
971 { this->_GetLogStream() << Message; }
980 {
MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_RANGE_EXCEPTION,
"Could not access thread Specific Logger from invalid thread."); }
984 {
return this->Aggregator; }
A factory responsible for the creation and destruction of the default resourcemanager.
A factory responsible for the creation and destruction of the default networkmanager.
static Entresol * SingletonPtr
The one and only pointer to the single object.
std::stringstream Logger
In case we ever replace the stringstream with another class, this will allow us to swap it out...
std::vector< EntresolManager * > ManagerVec
Container type for passing pre-created managers into the Entresol upon creation.
bool Boole
Generally acts a single bit, true or false.
MaxInt GetTimeStamp()
Get a timestamp, in microseconds. This will generally be some multiple of the GetTimeStampResolution ...
This is a base class for factories that construct managers used by the Entresol class.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
Declaration of FileStream.
A factory responsible for the creation and destruction of the default graphicsmanager.
ArchiveType
Used to indicate what kind of resources the Entrosol should look for.
A factory responsible for the creation and destruction of the default MeshManager.
virtual String GetImplementationTypeName() const =0
This Allows any manager name to be sent to a stream. Primarily used for logging.
A factory responsible for the creation and destruction of the default TextureManager.
std::stringstream StringStream
A Datatype used for streaming operations with strings.
This is returned to indicated there where no issues parsing the XML document.
float Real
A Datatype used to represent a real floating point number.
A thread specific collection of double-buffered and algorithm specific resources. ...
A factory responsible for the creation and destruction of the default collisionshapemanager.
uint16_t UInt16
An 16-bit unsigned integer.
Int32 AtomicCompareAndSwap32(Int32 *VariableToChange, const Int32 &OldValue, const Int32 &NewValue)
Atomically Compares And Swaps a 32 bit value.
This is the base class for all managers that do no describe properties of a single world...
A light-weight handle for manipulating nodes in DOM tree.
This is central object in this algorithm, it is responsible for spawning threads and managing the ord...
The defintion of the Resource Manager.
A factory responsible for the creation and destruction of the default scripting engine providing Lua ...
Logger & GetUsableLogger()
Get the usable logger for this thread specific resource.
void PauseWorld(const Boole Pause)
Pauses all animations, particles, and object movement throughout the world.
A factory responsible for the creation and destruction of the default eventmanager.
std::list< NameValuePair > NameValuePairList
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
virtual String GetManagerImplName() const =0
Gets the name of the manager that is created by this factory.
Gather all the thread specific logs and commit them to the main log.
A factory responsible for the creation and destruction of the default uimanager.
WorldContainer::const_iterator ConstWorldIterator
Const Iterator type for Worlds stored by this class.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
This class represents a world for objects to interact within.
WorldContainer::iterator WorldIterator
Iterator type for Worlds stored by this class.
const String & GetName() const
Gets the name of this world.
The thread ID is a unique identifier for each thread.
std::vector< EntresolManagerFactory * > ManagerFactoryVec
Basic container type for factories that construct known manager types.
This file has the interface for the Lua based implementation of the Scripting system.
std::string String
A datatype used to a series of characters.
ManagerFactoryMap::iterator ManagerFactoryIterator
Iterator type for manager factories stored by this class.
ManagerContainer::iterator ManagerIterator
Iterator type for managers stored by this class.
This is a helper class storing information needed for the construction of a PhysicsManager.
virtual String GetInterfaceTypeAsString() const
Gets a string of the interface type of this manager.