Index: trunk/src/story_entities/campaign.cc
===================================================================
--- trunk/src/story_entities/campaign.cc	(revision 9656)
+++ trunk/src/story_entities/campaign.cc	(revision 9869)
@@ -24,7 +24,9 @@
 
 #include "campaign_data.h"
+#include "debug.h"
 
 
 
+ObjectListDefinition(Campaign);
 
 /**
@@ -36,5 +38,5 @@
 Campaign::Campaign ( TiXmlElement* root)
 {
-  this->setClassID(CL_CAMPAIGN, "Campaign");
+  this->registerObject(this, Campaign::_objectList);
 
   PRINTF(4)("Loading Campaign...\n");
Index: trunk/src/story_entities/campaign.h
===================================================================
--- trunk/src/story_entities/campaign.h	(revision 9656)
+++ trunk/src/story_entities/campaign.h	(revision 9869)
@@ -18,5 +18,5 @@
 class Campaign : public StoryEntity
 {
-
+  ObjectListDeclaration(Campaign);
   public:
     Campaign( TiXmlElement* root);
Index: trunk/src/story_entities/campaign_data.cc
===================================================================
--- trunk/src/story_entities/campaign_data.cc	(revision 9656)
+++ trunk/src/story_entities/campaign_data.cc	(revision 9869)
@@ -18,11 +18,13 @@
 
 #include "util/loading/factory.h"
-#include "util/loading/load_param.h"
+#include "util/loading/load_param_xml.h"
 
 #include "story_entity.h"
 
+#include "debug.h"
 
 
 
+ObjectListDefinition(CampaignData);
 
 /**
@@ -31,5 +33,5 @@
 CampaignData::CampaignData(const TiXmlElement* root)
 {
-  this->setClassID(CL_CAMPAIGN_DATA, "CampaignData");
+  this->registerObject(this, CampaignData::_objectList);
 
   this->currentEntity = NULL;
Index: trunk/src/story_entities/campaign_data.h
===================================================================
--- trunk/src/story_entities/campaign_data.h	(revision 9656)
+++ trunk/src/story_entities/campaign_data.h	(revision 9869)
@@ -16,4 +16,5 @@
 class CampaignData : public DataTank
 {
+  ObjectListDeclaration(CampaignData);
 
 public:
Index: trunk/src/story_entities/dedicated_server_world.cc
===================================================================
--- trunk/src/story_entities/dedicated_server_world.cc	(revision 9656)
+++ trunk/src/story_entities/dedicated_server_world.cc	(revision 9869)
@@ -21,5 +21,5 @@
 
 #include "util/loading/load_param.h"
-#include "fast_factory.h"
+#include "loading/fast_factory.h"
 #include "util/loading/factory.h"
 
Index: trunk/src/story_entities/game_world.cc
===================================================================
--- trunk/src/story_entities/game_world.cc	(revision 9656)
+++ trunk/src/story_entities/game_world.cc	(revision 9869)
@@ -20,7 +20,5 @@
 #include "game_world_data.h"
 
-#include "util/loading/resource_manager.h"
 #include "state.h"
-#include "class_list.h"
 
 #include "util/loading/game_loader.h"
@@ -39,10 +37,10 @@
 
 #include "util/loading/factory.h"
-#include "util/loading/load_param.h"
-#include "fast_factory.h"
+#include "util/loading/load_param_xml.h"
+#include "loading/fast_factory.h"
 #include "shell_command.h"
 
 #include "graphics_engine.h"
-#include "effects/atmospheric_engine.h"
+#include "weather_effects/atmospheric_engine.h"
 #include "event_handler.h"
 #include "sound_engine.h"
@@ -50,5 +48,4 @@
 #include "network_manager.h"
 #include "physics_engine.h"
-#include "fields.h"
 
 #include "glmenu_imagescreen.h"
@@ -63,7 +60,8 @@
 
 #include "script_class.h"
-CREATE_SCRIPTABLE_CLASS(GameWorld, CL_GAME_WORLD,
-                        addMethod("setPlaymode", ExecutorLua1<GameWorld,const std::string&>(&GameWorld::setPlaymode))
-                        ->addMethod("setSoundtrack", ExecutorLua1<GameWorld, const std::string&>(&GameWorld::setSoundtrack))
+ObjectListDefinition(GameWorld);
+CREATE_SCRIPTABLE_CLASS(GameWorld,
+			addMethod("setPlaymode", Executor1<GameWorld, lua_State*,const std::string&>(&GameWorld::setPlaymode))
+                        ->addMethod("setSoundtrack", Executor1<GameWorld, lua_State*, const std::string&>(&GameWorld::setSoundtrack))
                        );
 
@@ -77,9 +75,8 @@
 
 
-
 GameWorld::GameWorld()
     : StoryEntity()
 {
-  this->setClassID(CL_GAME_WORLD, "GameWorld");
+  this->registerObject(this, GameWorld::_objectList);
   this->setName("Preloaded World - no name yet");
 
@@ -154,5 +151,5 @@
 
 
-  PRINTF(0)("Loading the GameWorld\n");
+  PRINTF(4)("Loading the GameWorld\n");
 
   PRINTF(3)("> Loading world: '%s'\n", getLoadFile().c_str());
@@ -339,5 +336,5 @@
   }
 
-  PRINTF(0)("GameWorld::mainLoop() - Exiting the main loop\n");
+  PRINTF(4)("GameWorld::mainLoop() - Exiting the main loop\n");
 }
 
@@ -416,5 +413,5 @@
     if (currentFrame - this->lastFrame < .01)
     {
-      SDL_Delay(1000.0 * (0.01 - (currentFrame - lastFrame)));
+      SDL_Delay((int)(1000.0 * (0.01 - (currentFrame - lastFrame))));
       currentFrame = Timer::getNow();
     }
@@ -432,5 +429,5 @@
     // TICK everything
     for (i = 0; i < this->dataTank->tickLists.size(); ++i)
-      this->tick(this->dataTank->objectManager->getObjectList(this->dataTank->tickLists[i]), this->dtS);
+      this->tick(this->dataTank->objectManager->getEntityList(this->dataTank->tickLists[i]), this->dtS);
 
     /* update tick the rest */
@@ -471,25 +468,25 @@
 {
   // object-object collision detection
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
-      this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-      this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-      this->dataTank->objectManager->getObjectList(OM_GROUP_00));
-
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-      this->dataTank->objectManager->getObjectList(OM_GROUP_02));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_02),
-      this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
-
-
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
-      this->dataTank->objectManager->getObjectList(OM_COMMON));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-      this->dataTank->objectManager->getObjectList(OM_COMMON));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
+      this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+      this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+      this->dataTank->objectManager->getEntityList(OM_GROUP_00));
+
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+      this->dataTank->objectManager->getEntityList(OM_GROUP_02));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_02),
+      this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
+
+
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
+      this->dataTank->objectManager->getEntityList(OM_COMMON));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+      this->dataTank->objectManager->getEntityList(OM_COMMON));
 
   // ground collision detection: BSP Model
-  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_00));
-  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_01));
+  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00));
+  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01));
 }
 
@@ -567,32 +564,29 @@
   //  glLoadIdentity();
 
-  const std::list<BaseObject*>* reflectedWaters;
   MappedWater* mw;
 
-  if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)
-  {
-    std::list<BaseObject*>::const_iterator it;
-    for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)
-    {
-      mw =  dynamic_cast<MappedWater*>(*it);
-
-      //camera and light
-      //this->dataTank->localCamera->apply ();
-      //this->dataTank->localCamera->project ();
-
-      LightManager::getInstance()->draw();
-
-
-      // prepare for reflection rendering
-      mw->activateReflection();
-
-      // draw everything to be included in the reflection
-      this->drawEntityList(State::getObjectManager()->getReflectionList());
-      //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
-      //         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
-
-      // clean up from reflection rendering
-      mw->deactivateReflection();
-    }
+  for (ObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin();
+       it != MappedWater::objectList().end();
+       ++it)
+  {
+    mw =  (*it);
+
+    //camera and light
+    //this->dataTank->localCamera->apply ();
+    //this->dataTank->localCamera->project ();
+
+    LightManager::getInstance()->draw();
+
+
+    // prepare for reflection rendering
+    mw->activateReflection();
+
+    // draw everything to be included in the reflection
+    this->drawEntityList(State::getObjectManager()->getReflectionList());
+    //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
+    //         this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
+
+    // clean up from reflection rendering
+    mw->deactivateReflection();
   }
 
@@ -609,30 +603,27 @@
   //glLoadIdentity();
 
-  const std::list<BaseObject*>* reflectedWaters;
   MappedWater* mw;
 
-  if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)
-  {
-    std::list<BaseObject*>::const_iterator it;
-    for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)
-    {
-      mw =  dynamic_cast<MappedWater*>(*it);
-
-      //camera and light
-      //this->dataTank->localCamera->apply ();
-      //this->dataTank->localCamera->project ();
-      // prepare for reflection rendering
-      mw->activateRefraction();
-
-
-      LightManager::getInstance()->draw();
-      // draw everything to be included in the reflection
-      this->drawEntityList(State::getObjectManager()->getReflectionList());
-      //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
-      //         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
-
-      // clean up from reflection rendering
-      mw->deactivateRefraction();
-    }
+  for (ObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin();
+       it != MappedWater::objectList().end();
+       ++it)
+  {
+    mw =  dynamic_cast<MappedWater*>(*it);
+
+    //camera and light
+    //this->dataTank->localCamera->apply ();
+    //this->dataTank->localCamera->project ();
+    // prepare for reflection rendering
+    mw->activateRefraction();
+
+
+    LightManager::getInstance()->draw();
+    // draw everything to be included in the reflection
+    this->drawEntityList(State::getObjectManager()->getReflectionList());
+    //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
+    //         this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
+
+    // clean up from reflection rendering
+    mw->deactivateRefraction();
   }
 }
@@ -659,10 +650,10 @@
   {
     /* Draw the BackGround */
-    this->drawEntityList(State::getObjectManager()->getObjectList(OM_BACKGROUND));
+    this->drawEntityList(State::getObjectManager()->getEntityList(OM_BACKGROUND));
     engine->drawBackgroundElements();
 
     /* draw all WorldEntiy groups */
     for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
-      this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
+      this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
 
     AtmosphericEngine::getInstance()->draw();
@@ -672,5 +663,5 @@
       CDEngine* engine = CDEngine::getInstance();
       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
-        engine->drawBV(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]), this->showBVLevel);
+        engine->drawBV(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]), this->showBVLevel);
     }
 
@@ -702,5 +693,5 @@
  *  removes the loadscreen, and changes over to the game
  */
-void GameWorld::releaseLoadScreen ()
+void GameWorld::releaseLoadScreen()
 {
   PRINTF(3)("GameWorld::releaseLoadScreen - start\n");
Index: trunk/src/story_entities/game_world.h
===================================================================
--- trunk/src/story_entities/game_world.h	(revision 9656)
+++ trunk/src/story_entities/game_world.h	(revision 9869)
@@ -31,4 +31,6 @@
 class GameWorld : public StoryEntity
 {
+  ObjectListDeclaration(GameWorld);
+
 public:
   GameWorld ();
Index: trunk/src/story_entities/game_world_data.cc
===================================================================
--- trunk/src/story_entities/game_world_data.cc	(revision 9656)
+++ trunk/src/story_entities/game_world_data.cc	(revision 9869)
@@ -21,10 +21,9 @@
 #include "game_world_data.h"
 
+#include "state.h"
+#include "substring.h"
+
+#include "util/loading/game_loader.h"
 #include "util/loading/resource_manager.h"
-#include "state.h"
-#include "class_list.h"
-#include "substring.h"
-
-#include "util/loading/game_loader.h"
 
 #include "world_entity.h"
@@ -41,9 +40,10 @@
 
 #include "util/loading/factory.h"
-#include "fast_factory.h"
-#include "util/loading/load_param.h"
+#include "loading/fast_factory.h"
+#include "util/loading/load_param_xml.h"
 
 #include "graphics_engine.h"
-#include "effects/atmospheric_engine.h"
+#include "graphics_effect.h"
+#include "weather_effects/atmospheric_engine.h"
 #include "event_handler.h"
 #include "sound_engine.h"
@@ -51,5 +51,4 @@
 #include "network_manager.h"
 #include "physics_engine.h"
-#include "fields.h"
 
 #include "glmenu_imagescreen.h"
@@ -61,7 +60,5 @@
 
 
-
-
-
+ObjectListDefinition(GameWorldData);
 /**
  * constructor of the GameWorldData
@@ -69,5 +66,5 @@
 GameWorldData::GameWorldData()
 {
-  this->setClassID(CL_GAME_WORLD_DATA, "GameWorldData");
+  this->registerObject(this, GameWorldData::_objectList);
 
   this->glmis = NULL;
@@ -119,7 +116,8 @@
 ErrorMessage GameWorldData::loadData(const TiXmlElement* root)
 {
+  assert (root != NULL);
   // load the parameters
   // name
-  std::string string = grabParameter( root, "name");
+  std::string string = LoadParamBase::grabParameter( root, "name");
   if( string.empty() )
   {
@@ -194,5 +192,4 @@
 ErrorMessage GameWorldData::loadWorldEntities(const TiXmlElement* root)
 {
-
   const TiXmlElement* element = root->FirstChildElement("WorldEntities");
   bool mouseCaptured = EventHandler::getInstance()->grabbedEvents();
@@ -215,10 +212,10 @@
 
       //todo do this more elegant
-      if( element->Value() == "SkyBox" && created->isA(CL_SKYBOX))
+      if( element->Value() == "SkyBox" && created->isA(SkyBox::staticClassID()))
       {
         this->sky = dynamic_cast<WorldEntity*>(created);
         State::setSkyBox(dynamic_cast<SkyBox*>(this->sky));
       }
-      if( element->Value() == "Terrain" && created->isA(CL_TERRAIN))
+      if( element->Value() == "Terrain" && created->isA(Terrain::staticClassID()))
       {
         this->terrain = dynamic_cast<Terrain*>(created);
@@ -236,10 +233,8 @@
 
   Playable* playable;
-  const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
-  if (playableList != NULL && !playableList->empty())
+  if (!Playable::objectList().empty())
   {
     /// TODO Make this also loadable
-    playable = dynamic_cast<Playable*>(playableList->front());
-    this->localPlayer->setPlayable(playable);
+    this->localPlayer->setPlayable(Playable::objectList().front());
   }
 
@@ -280,16 +275,8 @@
   GraphicsEngine::getInstance()->displayFPS(false);
   // erease everything that is left.
-  // delete PNode::getNullParent(); // not needed as this is also done in the next step (and also much cleaner)
-  const std::list<BaseObject*>* nodeList;
   //secondary cleanup of PNodes;
-  nodeList = ClassList::getList(CL_PARENT_NODE);
-  if (nodeList != NULL)
-    while (!nodeList->empty())
-    {
-      //    ClassList::debug( 3, CL_PARENT_NODE);
-      //    PNode::getNullParent()->debugNode(0);
-      //    printf("%s::%s\n", nodeList->front()->getClassCName(), nodeList->front()->getName());
-      delete nodeList->front();
-    }
+  while (!PNode::objectList().empty())
+    delete PNode::objectList().front();
+
   /* remove the player object */
   if( this->localPlayer)
@@ -302,14 +289,10 @@
   this->terrain = NULL;
 
-  nodeList = ClassList::getList(CL_GRAPHICS_EFFECT);
-  if (nodeList != NULL)
-    while (!nodeList->empty())
-      delete nodeList->front();
-
-
-  nodeList = ClassList::getList(CL_ELEMENT_2D);
-  if (nodeList != NULL)
-    while (!nodeList->empty())
-      delete nodeList->front();
+  while (!GraphicsEffect::objectList().empty())
+    delete GraphicsEffect::objectList().front();
+
+
+  while (!Element2D::objectList().empty())
+    delete Element2D::objectList().front();
 
   // At this Point all the WorldEntites should be unloaded.
@@ -318,5 +301,6 @@
 
   // unload the resources loaded in this Level !!
-  ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
+  /// FIXME TODO HACK!!
+//  ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
 
   if (State::getObjectManager() == this->objectManager)
@@ -395,5 +379,5 @@
   {
     PRINTF(3)("Setting Sound Track to %s\n", name.c_str());
-    std::string oggFile = ResourceManager::getFullName(name);
+    std::string oggFile = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(name);
     this->music = new OrxSound::OggPlayer(oggFile);
     if (this->localPlayer != NULL)
@@ -414,5 +398,5 @@
     PRINTF(2)("creating %s\n", element->Value());
     BaseObject* created = Factory::fabricate(element);
-    if (created != NULL && created->isA(CL_GAME_RULES))
+    if (created != NULL && created->isA(GameRules::staticClassID()))
     {
       this->gameRule = dynamic_cast<GameRules*>(created);
Index: trunk/src/story_entities/game_world_data.h
===================================================================
--- trunk/src/story_entities/game_world_data.h	(revision 9656)
+++ trunk/src/story_entities/game_world_data.h	(revision 9869)
@@ -30,4 +30,5 @@
 class GameWorldData : public DataTank
 {
+  ObjectListDeclaration(GameWorldData);
   public:
     GameWorldData();
Index: trunk/src/story_entities/menu/game_menu.cc
===================================================================
--- trunk/src/story_entities/menu/game_menu.cc	(revision 9656)
+++ trunk/src/story_entities/menu/game_menu.cc	(revision 9869)
@@ -22,9 +22,7 @@
 
 #include "state.h"
-#include "class_list.h"
 
 #include "util/loading/load_param.h"
 #include "util/loading/factory.h"
-#include "util/loading/resource_manager.h"
 
 #include "graphics_engine.h"
@@ -41,9 +39,10 @@
 #include "network_manager.h"
 
-#include "preferences.h"
-
+#include "parser/preferences/preferences.h"
+
+#include "class_id_DEPRECATED.h"
 //! This creates a Factory to fabricate a GameMenu
-CREATE_FACTORY(GameMenu, CL_GAME_MENU);
-
+ObjectListDefinitionID(GameMenu, CL_GAME_MENU);
+CREATE_FACTORY(GameMenu);
 
 
@@ -51,5 +50,5 @@
     : GameWorld()
 {
-  this->setClassID(CL_GAME_MENU, "GameMenu");
+  this->registerObject(this, GameMenu::_objectList);
   this->setName("GameMenu uninitialized");
 
@@ -191,14 +190,14 @@
       image->setForegroundColor(Color( 1,1,1,.6));
 
-      const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY);
-      std::list<BaseObject*>::const_iterator it;
       bool first = true;
-      for( it = storyEntities->begin(); it != storyEntities->end(); it++)
+      for(ObjectList<StoryEntity>::const_iterator it = StoryEntity::objectList().begin();
+	  it != StoryEntity::objectList().end();
+	  ++it)
       {
-        StoryEntity* se = dynamic_cast<StoryEntity*>(*it);
+        StoryEntity* se = *it;
         if( se->isContainedInMenu())
         {
 
-          printf("%s\n", se->getMenuScreenshoot().c_str());
+	  PRINTF(3)("Load image %s\n", se->getMenuScreenshoot().c_str());
           OrxGui::GLGuiImageButton* button = new OrxGui::GLGuiImageButton(se->getName(), se->getStoryID(), se->getMenuScreenshoot(), image);
           button->startLevel.connect(this, &GameMenu::startLevel);
Index: trunk/src/story_entities/menu/game_menu.h
===================================================================
--- trunk/src/story_entities/menu/game_menu.h	(revision 9656)
+++ trunk/src/story_entities/menu/game_menu.h	(revision 9869)
@@ -22,5 +22,5 @@
 class GameMenu : virtual public GameWorld, virtual public EventListener
 {
-
+  ObjectListDeclaration(GameMenu);
   public:
     GameMenu(const TiXmlElement* root = NULL);
@@ -45,8 +45,8 @@
     void showMultiPlayer();
     void showOptionsMenu();
-    
+
     void showClientMenu();
     void connectToServer();
-    
+
     void showServerMenu();
     void createMasterServer();
@@ -69,5 +69,5 @@
     void setSelectorSound(const std::string& selectorSound);
 
-    
+
 
 
@@ -76,8 +76,8 @@
     OrxGui::GLGuiBox*                 levelsBox;
     OrxGui::GLGuiBox*                 networkBox;
-    
+
     OrxGui::GLGuiBox*                 clientNetworkBox;
     OrxGui::GLGuiInputLine*           ipInputLine;
-    
+
     OrxGui::GLGuiBox*                 serverNetworkBox;
 
Index: trunk/src/story_entities/menu/glgui_imagebutton.cc
===================================================================
--- trunk/src/story_entities/menu/glgui_imagebutton.cc	(revision 9656)
+++ trunk/src/story_entities/menu/glgui_imagebutton.cc	(revision 9869)
@@ -14,5 +14,4 @@
 */
 
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_SHELL
 
 #include "glgui_imagebutton.h"
@@ -45,5 +44,5 @@
   void GLGuiImageButton::receivedFocus()
   {
-    printf("%s:: %s\n", this->label().c_str(), this->imageName.c_str());
+    PRINTF(4)("%s:: %s\n", this->label().c_str(), this->imageName.c_str());
 
     this->image->loadImageFromFile(this->imageName);
Index: trunk/src/story_entities/movie_loader.cc
===================================================================
--- trunk/src/story_entities/movie_loader.cc	(revision 9656)
+++ trunk/src/story_entities/movie_loader.cc	(revision 9869)
@@ -25,10 +25,11 @@
 
 
-
-CREATE_FACTORY(MovieLoader, CL_MOVIE_LOADER);
+#include "class_id_DEPRECATED.h"
+ObjectListDefinitionID(MovieLoader, CL_MOVIE_LOADER);
+CREATE_FACTORY(MovieLoader);
 
 MovieLoader::MovieLoader(const TiXmlElement* root)
 {
-  this->setClassID(CL_MOVIE_LOADER, "MovieLoader");
+  this->registerObject(this, MovieLoader::_objectList);
 
   movie_player = new MoviePlayer();
Index: trunk/src/story_entities/movie_loader.h
===================================================================
--- trunk/src/story_entities/movie_loader.h	(revision 9656)
+++ trunk/src/story_entities/movie_loader.h	(revision 9869)
@@ -15,4 +15,5 @@
 class MovieLoader : public StoryEntity, virtual public EventListener
 {
+  ObjectListDeclaration(MovieLoader);
   private:
     MoviePlayer* movie_player;
Index: trunk/src/story_entities/multi_player_world.cc
===================================================================
--- trunk/src/story_entities/multi_player_world.cc	(revision 9656)
+++ trunk/src/story_entities/multi_player_world.cc	(revision 9869)
@@ -36,13 +36,13 @@
 SHELL_COMMAND(debug, MultiPlayerWorld, debug);
 
-
+#include "class_id_DEPRECATED.h"
 //! This creates a Factory to fabricate a MultiPlayerWorld
-CREATE_FACTORY(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD);
-
+ObjectListDefinitionID(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD);
+CREATE_FACTORY(MultiPlayerWorld);
 
 MultiPlayerWorld::MultiPlayerWorld(const TiXmlElement* root)
   : GameWorld()
 {
-  this->setClassID(CL_MULTI_PLAYER_WORLD, "MultiPlayerWorld");
+  this->registerObject(this, MultiPlayerWorld::_objectList);
 
   this->dataTank = new MultiPlayerWorldData();
@@ -95,46 +95,46 @@
 void MultiPlayerWorld::collisionDetection()
 {
-  //CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS), this->dataTank->objectManager->getObjectList(OM_PLAYERS));
+  //CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS), this->dataTank->objectManager->getEntityList(OM_PLAYERS));
 
   PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n");
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
-    this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
+    this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
   PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n");
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
-    this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
+    this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
   PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_PLAYERS_PROJ\n\n");
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
-    this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
+    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
 
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
-  this->dataTank->objectManager->getObjectList(OM_PLAYERS));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-  this->dataTank->objectManager->getObjectList(OM_PLAYERS));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
+  this->dataTank->objectManager->getEntityList(OM_PLAYERS));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+  this->dataTank->objectManager->getEntityList(OM_PLAYERS));
 
 
 
   PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01_PROJ\n\n");
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
-    this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
+    this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
   PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01\n\n");
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
-    this->dataTank->objectManager->getObjectList(OM_GROUP_01));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
-    this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
+    this->dataTank->objectManager->getEntityList(OM_GROUP_01));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
+    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
 
   PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_01 vs OM_GROUP_00_PROJ\n\n");
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-    this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-    this->dataTank->objectManager->getObjectList(OM_GROUP_00));
-  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
-    this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+    this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+    this->dataTank->objectManager->getEntityList(OM_GROUP_00));
+  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
+    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
 
 
 
     // ground collision detection: BSP Model
-  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_00));
-  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_01));
-  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_PLAYERS));
+  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00));
+  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01));
+  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_PLAYERS));
 }
 
Index: trunk/src/story_entities/multi_player_world.h
===================================================================
--- trunk/src/story_entities/multi_player_world.h	(revision 9656)
+++ trunk/src/story_entities/multi_player_world.h	(revision 9869)
@@ -20,5 +20,5 @@
  */
 class MultiPlayerWorld : public GameWorld {
-
+  ObjectListDeclaration(MultiPlayerWorld);
  public:
   MultiPlayerWorld (const TiXmlElement* root = NULL);
@@ -26,5 +26,5 @@
 
   virtual void loadParams(const TiXmlElement* root);
-  
+
   virtual ErrorMessage unloadData();
 
Index: trunk/src/story_entities/multi_player_world_data.cc
===================================================================
--- trunk/src/story_entities/multi_player_world_data.cc	(revision 9656)
+++ trunk/src/story_entities/multi_player_world_data.cc	(revision 9869)
@@ -18,7 +18,5 @@
 #include "multi_player_world_data.h"
 
-#include "util/loading/resource_manager.h"
 #include "state.h"
-#include "class_list.h"
 #include "substring.h"
 
@@ -40,5 +38,5 @@
 
 #include "util/loading/factory.h"
-#include "fast_factory.h"
+#include "loading/fast_factory.h"
 #include "util/loading/load_param.h"
 
@@ -50,8 +48,4 @@
 
 #include "glmenu_imagescreen.h"
-
-
-
-
 
 
@@ -313,14 +307,12 @@
 {
   PRINT(0)("==================================================\n");
+
   Playable* playable;
-  const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
-  assert(playableList != NULL);
-  std::list<BaseObject*>::const_iterator entity;
-
-
-
-  for (entity = playableList->begin(); entity != playableList->end(); entity++)
-  {
-    Playable* p = dynamic_cast<Playable*>(*entity);
+
+  for (ObjectList<Playable>::const_iterator entity = Playable::objectList().begin();
+       entity != Playable::objectList().end();
+      ++entity)
+  {
+    Playable* p = *entity;
     PRINTF(0)("Got a playable, class: %s, name: %s, uid: %i\n", (*entity)->getClassCName(), (*entity)->getCName(), p->getUniqueID());
   }
@@ -329,5 +321,5 @@
   if( this->toggle)
   {
-    playable = dynamic_cast<Playable*>(playableList->front());
+    playable = Playable::objectList().front();
     this->localPlayer->setPlayable(playable);
     this->toggle = !this->toggle;
@@ -335,5 +327,5 @@
   else
   {
-    playable = dynamic_cast<Playable*>(playableList->back());
+    playable = Playable::objectList().back();
     this->localPlayer->setPlayable(playable);
     this->toggle = !this->toggle;
Index: trunk/src/story_entities/single_player_world.cc
===================================================================
--- trunk/src/story_entities/single_player_world.cc	(revision 9656)
+++ trunk/src/story_entities/single_player_world.cc	(revision 9869)
@@ -20,8 +20,8 @@
 
 #include "state.h"
-#include "class_list.h"
+#include "debug.h"
 
 #include "util/loading/load_param.h"
-#include "fast_factory.h"
+#include "loading/fast_factory.h"
 #include "util/loading/factory.h"
 
@@ -30,16 +30,13 @@
 
 
-
-
-
+#include "class_id_DEPRECATED.h"
 //! This creates a Factory to fabricate a SinglePlayerWorld
-CREATE_FACTORY(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD);
-
-
+ObjectListDefinitionID(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD);
+CREATE_FACTORY(SinglePlayerWorld);
 
 SinglePlayerWorld::SinglePlayerWorld(const TiXmlElement* root)
   : GameWorld()
 {
-  this->setClassID(CL_SINGLE_PLAYER_WORLD, "SinglePlayerWorld");
+  this->registerObject(this, SinglePlayerWorld::_objectList);
   this->setName("SinglePlayerWorld uninitialized");
 
Index: trunk/src/story_entities/single_player_world.h
===================================================================
--- trunk/src/story_entities/single_player_world.h	(revision 9656)
+++ trunk/src/story_entities/single_player_world.h	(revision 9869)
@@ -22,4 +22,5 @@
 class SinglePlayerWorld : public GameWorld
 {
+  ObjectListDeclaration(SinglePlayerWorld);
 
   public:
Index: trunk/src/story_entities/story_entity.cc
===================================================================
--- trunk/src/story_entities/story_entity.cc	(revision 9656)
+++ trunk/src/story_entities/story_entity.cc	(revision 9869)
@@ -22,10 +22,10 @@
 #include "story_entity.h"
 
-#include "util/loading/load_param.h"
-#include "util/loading/resource_manager.h"
+#include "loading/load_param.h"
+#include "loading/resource_manager.h"
 
+#include "debug.h"
 
-
-
+ObjectListDefinition(StoryEntity);
 
 /**
@@ -34,5 +34,5 @@
 StoryEntity::StoryEntity ()
 {
-  this->setClassID(CL_STORY_ENTITY, "StoryEntity");
+  this->registerObject(this, StoryEntity::_objectList);
 
   this->bInit = false;
@@ -107,5 +107,5 @@
   }
   else
-    this->loadFile = ResourceManager::getFullName(fileName);
+    this->loadFile = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
 
   this->grabWorldInfo();
Index: trunk/src/story_entities/story_entity.h
===================================================================
--- trunk/src/story_entities/story_entity.h	(revision 9656)
+++ trunk/src/story_entities/story_entity.h	(revision 9869)
@@ -26,4 +26,5 @@
 class StoryEntity : virtual public BaseObject
 {
+  ObjectListDeclaration(StoryEntity);
 
 public:
