Index: trunk/src/world_entities/creatures/md2_creature.cc
===================================================================
--- trunk/src/world_entities/creatures/md2_creature.cc	(revision 7173)
+++ trunk/src/world_entities/creatures/md2_creature.cc	(revision 7193)
@@ -22,5 +22,5 @@
 #include "objModel.h"
 #include "md2Model.h"
-#include "resource_manager.h"
+#include "util/loading/resource_manager.h"
 #include "state.h"
 
@@ -30,5 +30,5 @@
 #include "weapons/cannon.h"
 
-#include "factory.h"
+#include "util/loading/factory.h"
 #include "key_mapper.h"
 #include "event_handler.h"
Index: trunk/src/world_entities/effects/lightning_bolt.cc
===================================================================
--- trunk/src/world_entities/effects/lightning_bolt.cc	(revision 7173)
+++ trunk/src/world_entities/effects/lightning_bolt.cc	(revision 7193)
@@ -17,8 +17,8 @@
 #include "lightning_bolt.h"
 
-#include "factory.h"
+#include "util/loading/factory.h"
 #include "material.h"
 
-#include "resource_manager.h"
+#include "util/loading/resource_manager.h"
 
 
Index: trunk/src/world_entities/elements/image_entity.cc
===================================================================
--- trunk/src/world_entities/elements/image_entity.cc	(revision 7173)
+++ trunk/src/world_entities/elements/image_entity.cc	(revision 7193)
@@ -18,6 +18,6 @@
 #include "image_entity.h"
 
-#include "load_param.h"
-#include "factory.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
 
 #include "graphics_engine.h"
Index: trunk/src/world_entities/elements/text_element.cc
===================================================================
--- trunk/src/world_entities/elements/text_element.cc	(revision 7173)
+++ trunk/src/world_entities/elements/text_element.cc	(revision 7193)
@@ -18,6 +18,6 @@
 #include "text_element.h"
 
-#include "load_param.h"
-#include "factory.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
 
 #include "graphics_engine.h"
Index: trunk/src/world_entities/environment.cc
===================================================================
--- trunk/src/world_entities/environment.cc	(revision 7173)
+++ trunk/src/world_entities/environment.cc	(revision 7193)
@@ -20,10 +20,10 @@
 #include "environment.h"
 
-#include "resource_manager.h"
+#include "util/loading/resource_manager.h"
 
 #include "vector.h"
 #include "objModel.h"
 #include "obb_tree.h"
-#include "factory.h"
+#include "util/loading/factory.h"
 
 using namespace std;
Index: trunk/src/world_entities/environments/building.cc
===================================================================
--- trunk/src/world_entities/environments/building.cc	(revision 7173)
+++ trunk/src/world_entities/environments/building.cc	(revision 7193)
@@ -18,6 +18,6 @@
 #include "building.h"
 
-#include "load_param.h"
-#include "factory.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
 
 using namespace std;
Index: trunk/src/world_entities/environments/model_entity.cc
===================================================================
--- trunk/src/world_entities/environments/model_entity.cc	(revision 7173)
+++ trunk/src/world_entities/environments/model_entity.cc	(revision 7193)
@@ -18,6 +18,6 @@
 #include "model_entity.h"
 
-#include "load_param.h"
-#include "factory.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
 
 using namespace std;
Index: trunk/src/world_entities/environments/water.cc
===================================================================
--- trunk/src/world_entities/environments/water.cc	(revision 7173)
+++ trunk/src/world_entities/environments/water.cc	(revision 7193)
@@ -17,11 +17,11 @@
 
 #include "water.h"
-#include "factory.h"
-#include "load_param.h"
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
 
 #include "grid.h"
 #include "material.h"
 
-#include "resource_manager.h"
+#include "util/loading/resource_manager.h"
 #include "shader.h"
 
Index: trunk/src/world_entities/movie_entity.cc
===================================================================
--- trunk/src/world_entities/movie_entity.cc	(revision 7173)
+++ trunk/src/world_entities/movie_entity.cc	(revision 7193)
@@ -17,6 +17,6 @@
 
 #include "media_container.h"
-#include "load_param.h"
-#include "factory.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
 
 using namespace std;
Index: trunk/src/world_entities/npcs/ground_turret.cc
===================================================================
--- trunk/src/world_entities/npcs/ground_turret.cc	(revision 7173)
+++ trunk/src/world_entities/npcs/ground_turret.cc	(revision 7193)
@@ -23,7 +23,7 @@
 
 
-#include "factory.h"
+#include "util/loading/factory.h"
 #include "network_game_manager.h"
-#include "load_param.h"
+#include "util/loading/load_param.h"
 
 #include "effects/explosion.h"
Index: trunk/src/world_entities/planet.cc
===================================================================
--- trunk/src/world_entities/planet.cc	(revision 7173)
+++ trunk/src/world_entities/planet.cc	(revision 7193)
@@ -18,6 +18,6 @@
 #include "planet.h"
 
-#include "load_param.h"
-#include "factory.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
 #include "static_model.h"
 
Index: trunk/src/world_entities/playable.cc
===================================================================
--- trunk/src/world_entities/playable.cc	(revision 7173)
+++ trunk/src/world_entities/playable.cc	(revision 7193)
@@ -21,5 +21,5 @@
 #include "player.h"
 #include "state.h"
-#include "load_param.h"
+#include "util/loading/load_param.h"
 
 #include "world_entities/projectiles/projectile.h"
Index: trunk/src/world_entities/power_ups/laser_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/laser_power_up.cc	(revision 7173)
+++ trunk/src/world_entities/power_ups/laser_power_up.cc	(revision 7193)
@@ -17,5 +17,5 @@
 
 #include "laser_power_up.h"
-#include "factory.h"
+#include "util/loading/factory.h"
 #include "state.h"
 #include "network_game_manager.h"
Index: trunk/src/world_entities/power_ups/param_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/param_power_up.cc	(revision 7173)
+++ trunk/src/world_entities/power_ups/param_power_up.cc	(revision 7193)
@@ -17,11 +17,11 @@
 
 #include "param_power_up.h"
-#include "factory.h"
+#include "util/loading/factory.h"
 #include "state.h"
 
 #include "primitive_model.h"
 
-#include "factory.h"
-#include "load_param.h"
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
 #include "network_game_manager.h"
 
Index: trunk/src/world_entities/power_ups/power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/power_up.cc	(revision 7173)
+++ trunk/src/world_entities/power_ups/power_up.cc	(revision 7193)
@@ -21,6 +21,6 @@
 #include "primitive_model.h"
 
-#include "resource_manager.h"
-#include "load_param.h"
+#include "util/loading/resource_manager.h"
+#include "util/loading/load_param.h"
 
 using namespace std;
Index: trunk/src/world_entities/power_ups/turret_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/turret_power_up.cc	(revision 7173)
+++ trunk/src/world_entities/power_ups/turret_power_up.cc	(revision 7193)
@@ -17,5 +17,5 @@
 
 #include "turret_power_up.h"
-#include "factory.h"
+#include "util/loading/factory.h"
 #include "network_game_manager.h"
 #include "state.h"
Index: trunk/src/world_entities/power_ups/weapon_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/weapon_power_up.cc	(revision 7173)
+++ trunk/src/world_entities/power_ups/weapon_power_up.cc	(revision 7193)
@@ -17,5 +17,5 @@
 
 #include "weapon_power_up.h"
-#include "factory.h"
+#include "util/loading/factory.h"
 #include "state.h"
 #include "network_game_manager.h"
@@ -23,6 +23,6 @@
 #include "primitive_model.h"
 
-#include "factory.h"
-#include "load_param.h"
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
 
 using namespace std;
Index: trunk/src/world_entities/projectiles/bomb.cc
===================================================================
--- trunk/src/world_entities/projectiles/bomb.cc	(revision 7173)
+++ trunk/src/world_entities/projectiles/bomb.cc	(revision 7193)
@@ -19,9 +19,4 @@
 #include "model.h"
 #include "primitive_model.h"
-
-#include "fast_factory.h"
-
-
-#include "object_manager.h"
 
 #include "dot_emitter.h"
Index: trunk/src/world_entities/projectiles/guided_missile.cc
===================================================================
--- trunk/src/world_entities/projectiles/guided_missile.cc	(revision 7173)
+++ trunk/src/world_entities/projectiles/guided_missile.cc	(revision 7193)
@@ -17,6 +17,4 @@
 
 #include "guided_missile.h"
-
-#include "fast_factory.h"
 
 #include "state.h"
Index: trunk/src/world_entities/projectiles/hyperblast.cc
===================================================================
--- trunk/src/world_entities/projectiles/hyperblast.cc	(revision 7173)
+++ trunk/src/world_entities/projectiles/hyperblast.cc	(revision 7193)
@@ -17,6 +17,4 @@
 
 #include "hyperblast.h"
-
-#include "fast_factory.h"
 
 #include "state.h"
Index: trunk/src/world_entities/projectiles/laser.cc
===================================================================
--- trunk/src/world_entities/projectiles/laser.cc	(revision 7173)
+++ trunk/src/world_entities/projectiles/laser.cc	(revision 7193)
@@ -17,8 +17,5 @@
 
 #include "laser.h"
-#include <assert.h>
-
-
-#include "fast_factory.h"
+#include <cassert>
 
 #include "state.h"
Index: trunk/src/world_entities/projectiles/projectile.cc
===================================================================
--- trunk/src/world_entities/projectiles/projectile.cc	(revision 7173)
+++ trunk/src/world_entities/projectiles/projectile.cc	(revision 7193)
@@ -22,5 +22,5 @@
 #include "world_entities/weapons/weapon.h"
 #include "model.h"
-#include "resource_manager.h"
+#include "util/loading/resource_manager.h"
 
 using namespace std;
Index: trunk/src/world_entities/projectiles/projectile.h
===================================================================
--- trunk/src/world_entities/projectiles/projectile.h	(revision 7173)
+++ trunk/src/world_entities/projectiles/projectile.h	(revision 7193)
@@ -11,4 +11,5 @@
 
 #include "world_entity.h"
+#include "fast_factory.h"
 
 #include "sound_source.h"
Index: trunk/src/world_entities/projectiles/rocket.cc
===================================================================
--- trunk/src/world_entities/projectiles/rocket.cc	(revision 7173)
+++ trunk/src/world_entities/projectiles/rocket.cc	(revision 7193)
@@ -17,6 +17,4 @@
 
 #include "rocket.h"
-
-#include "fast_factory.h"
 
 #include "state.h"
Index: trunk/src/world_entities/projectiles/test_bullet.cc
===================================================================
--- trunk/src/world_entities/projectiles/test_bullet.cc	(revision 7173)
+++ trunk/src/world_entities/projectiles/test_bullet.cc	(revision 7193)
@@ -18,6 +18,4 @@
 #include "test_bullet.h"
 
-#include "fast_factory.h"
-
 #include "state.h"
 #include "class_list.h"
@@ -25,5 +23,4 @@
 #include "dot_emitter.h"
 #include "sprite_particles.h"
-
 
 using namespace std;
Index: trunk/src/world_entities/recorder.cc
===================================================================
--- trunk/src/world_entities/recorder.cc	(revision 7173)
+++ trunk/src/world_entities/recorder.cc	(revision 7193)
@@ -16,7 +16,7 @@
 #include "recorder.h"
 
-#include "load_param.h"
-#include "factory.h"
-#include "resource_manager.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "util/loading/resource_manager.h"
 #include "state.h"
 
Index: trunk/src/world_entities/satellite.h
===================================================================
--- trunk/src/world_entities/satellite.h	(revision 7173)
+++ trunk/src/world_entities/satellite.h	(revision 7193)
@@ -9,5 +9,5 @@
 #include "world_entity.h"
 #include "comincl.h"
-#include "resource_manager.h"
+#include "util/loading/resource_manager.h"
 
 
Index: trunk/src/world_entities/skybox.cc
===================================================================
--- trunk/src/world_entities/skybox.cc	(revision 7173)
+++ trunk/src/world_entities/skybox.cc	(revision 7193)
@@ -18,6 +18,6 @@
 #include "skybox.h"
 
-#include "load_param.h"
-#include "factory.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
 #include "static_model.h"
 
@@ -27,5 +27,5 @@
 #include "network_game_manager.h"
 #include "converter.h"
-#include "resource_manager.h"
+#include "util/loading/resource_manager.h"
 
 
Index: trunk/src/world_entities/space_ships/helicopter.cc
===================================================================
--- trunk/src/world_entities/space_ships/helicopter.cc	(revision 7173)
+++ trunk/src/world_entities/space_ships/helicopter.cc	(revision 7193)
@@ -24,5 +24,5 @@
 #include "weapons/cannon.h"
 
-#include "factory.h"
+#include "util/loading/factory.h"
 #include "key_mapper.h"
 #include "event_handler.h"
Index: trunk/src/world_entities/space_ships/hover.cc
===================================================================
--- trunk/src/world_entities/space_ships/hover.cc	(revision 7173)
+++ trunk/src/world_entities/space_ships/hover.cc	(revision 7193)
@@ -24,5 +24,5 @@
 #include "weapons/cannon.h"
 
-#include "factory.h"
+#include "util/loading/factory.h"
 #include "key_mapper.h"
 #include "event_handler.h"
Index: trunk/src/world_entities/space_ships/space_ship.cc
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.cc	(revision 7173)
+++ trunk/src/world_entities/space_ships/space_ship.cc	(revision 7193)
@@ -20,5 +20,5 @@
 #include "space_ship.h"
 
-#include "resource_manager.h"
+#include "util/loading/resource_manager.h"
 
 #include "weapons/test_gun.h"
@@ -29,5 +29,5 @@
 #include "sprite_particles.h"
 
-#include "factory.h"
+#include "util/loading/factory.h"
 #include "key_mapper.h"
 #include "event_handler.h"
@@ -45,5 +45,5 @@
 #include "player.h"
 
-#include "load_param.h"
+#include "util/loading/load_param.h"
 
 
Index: trunk/src/world_entities/space_ships/turbine_hover.cc
===================================================================
--- trunk/src/world_entities/space_ships/turbine_hover.cc	(revision 7173)
+++ trunk/src/world_entities/space_ships/turbine_hover.cc	(revision 7193)
@@ -24,5 +24,5 @@
 #include "weapons/cannon.h"
 
-#include "factory.h"
+#include "util/loading/factory.h"
 #include "key_mapper.h"
 #include "event_handler.h"
Index: trunk/src/world_entities/spawning_point.cc
===================================================================
--- trunk/src/world_entities/spawning_point.cc	(revision 7173)
+++ trunk/src/world_entities/spawning_point.cc	(revision 7193)
@@ -17,6 +17,6 @@
 #include "spawning_point.h"
 
-#include "load_param.h"
-#include "factory.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
 
 #include "compiler.h"
Index: trunk/src/world_entities/terrain.cc
===================================================================
--- trunk/src/world_entities/terrain.cc	(revision 7173)
+++ trunk/src/world_entities/terrain.cc	(revision 7193)
@@ -18,9 +18,9 @@
 #include "terrain.h"
 
-#include "load_param.h"
-#include "factory.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
 #include "spatial_separation.h"
 
-#include "resource_manager.h"
+#include "util/loading/resource_manager.h"
 #include "model.h"
 #include "network_game_manager.h"
@@ -186,5 +186,5 @@
   {
     PRINTF(4)("fetching %s\n", vegetationFile);
-    this->vegetation = (Model*)ResourceManager::getInstance()->load(vegetationFile, OBJ, RP_CAMPAIGN);
+    this->vegetation = dynamic_cast<Model*>(ResourceManager::getInstance()->load(vegetationFile, OBJ, RP_CAMPAIGN));
   }
   else
Index: trunk/src/world_entities/test_entity.cc
===================================================================
--- trunk/src/world_entities/test_entity.cc	(revision 7173)
+++ trunk/src/world_entities/test_entity.cc	(revision 7193)
@@ -19,6 +19,6 @@
 
 #include "executor/executor.h"
-#include "factory.h"
-#include "load_param.h"
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
 
 #include "test_entity.h"
Index: trunk/src/world_entities/weapons/aim.cc
===================================================================
--- trunk/src/world_entities/weapons/aim.cc	(revision 7173)
+++ trunk/src/world_entities/weapons/aim.cc	(revision 7193)
@@ -18,5 +18,5 @@
 #include "aim.h"
 
-#include "load_param.h"
+#include "util/loading/load_param.h"
 #include "graphics_engine.h"
 #include "state.h"
Index: trunk/src/world_entities/weapons/aiming_turret.cc
===================================================================
--- trunk/src/world_entities/weapons/aiming_turret.cc	(revision 7173)
+++ trunk/src/world_entities/weapons/aiming_turret.cc	(revision 7193)
@@ -25,5 +25,5 @@
 #include "animation3d.h"
 
-#include "factory.h"
+#include "util/loading/factory.h"
 
 CREATE_FACTORY(AimingTurret, CL_AIMING_TURRET);
Index: trunk/src/world_entities/weapons/cannon.cc
===================================================================
--- trunk/src/world_entities/weapons/cannon.cc	(revision 7173)
+++ trunk/src/world_entities/weapons/cannon.cc	(revision 7193)
@@ -27,5 +27,5 @@
 #include "world_entities/projectiles/projectile.h"
 #include "weapon_manager.h"
-#include "factory.h"
+#include "util/loading/factory.h"
 
 #include "vector.h"
Index: trunk/src/world_entities/weapons/crosshair.cc
===================================================================
--- trunk/src/world_entities/weapons/crosshair.cc	(revision 7173)
+++ trunk/src/world_entities/weapons/crosshair.cc	(revision 7193)
@@ -19,5 +19,5 @@
 #include "event_handler.h"
 
-#include "load_param.h"
+#include "util/loading/load_param.h"
 #include "graphics_engine.h"
 #include "glincl.h"
Index: trunk/src/world_entities/weapons/hyperblaster.cc
===================================================================
--- trunk/src/world_entities/weapons/hyperblaster.cc	(revision 7173)
+++ trunk/src/world_entities/weapons/hyperblaster.cc	(revision 7193)
@@ -27,5 +27,5 @@
 #include "world_entities/projectiles/projectile.h"
 #include "weapon_manager.h"
-#include "factory.h"
+#include "util/loading/factory.h"
 
 #include "animation3d.h"
Index: trunk/src/world_entities/weapons/targeting_turret.cc
===================================================================
--- trunk/src/world_entities/weapons/targeting_turret.cc	(revision 7173)
+++ trunk/src/world_entities/weapons/targeting_turret.cc	(revision 7193)
@@ -25,5 +25,5 @@
 #include "animation3d.h"
 
-#include "factory.h"
+#include "util/loading/factory.h"
 
 CREATE_FACTORY(TargetingTurret, CL_TARGETING_TURRET);
Index: trunk/src/world_entities/weapons/test_gun.cc
===================================================================
--- trunk/src/world_entities/weapons/test_gun.cc	(revision 7173)
+++ trunk/src/world_entities/weapons/test_gun.cc	(revision 7193)
@@ -27,5 +27,5 @@
 #include "static_model.h"
 #include "weapon_manager.h"
-#include "factory.h"
+#include "util/loading/factory.h"
 
 #include "animation3d.h"
Index: trunk/src/world_entities/weapons/turret.cc
===================================================================
--- trunk/src/world_entities/weapons/turret.cc	(revision 7173)
+++ trunk/src/world_entities/weapons/turret.cc	(revision 7193)
@@ -25,5 +25,5 @@
 #include "animation3d.h"
 
-#include "factory.h"
+#include "util/loading/factory.h"
 
 CREATE_FACTORY(Turret, CL_TURRET);
Index: trunk/src/world_entities/weapons/weapon.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon.cc	(revision 7173)
+++ trunk/src/world_entities/weapons/weapon.cc	(revision 7193)
@@ -24,7 +24,7 @@
 #include "world_entities/projectiles/projectile.h"
 
-#include "resource_manager.h"
+#include "util/loading/resource_manager.h"
 #include "class_list.h"
-#include "load_param.h"
+#include "util/loading/load_param.h"
 #include "state.h"
 #include "animation3d.h"
Index: trunk/src/world_entities/weapons/weapon_manager.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon_manager.cc	(revision 7173)
+++ trunk/src/world_entities/weapons/weapon_manager.cc	(revision 7193)
@@ -25,6 +25,6 @@
 #include "playable.h"
 
-#include "load_param.h"
-#include "factory.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
 
 #include "t_animation.h"
Index: trunk/src/world_entities/world_entity.cc
===================================================================
--- trunk/src/world_entities/world_entity.cc	(revision 7173)
+++ trunk/src/world_entities/world_entity.cc	(revision 7193)
@@ -22,6 +22,6 @@
 #include "model.h"
 #include "md2Model.h"
-#include "resource_manager.h"
-#include "load_param.h"
+#include "util/loading/resource_manager.h"
+#include "util/loading/load_param.h"
 #include "vector.h"
 #include "obb_tree.h"
@@ -86,5 +86,4 @@
   if (this->healthWidget != NULL)
     delete this->healthWidget;
-
 }
 
@@ -147,14 +146,13 @@
     if (this->scaling <= 0.0)
     {
+      PRINTF(1)("YOU GAVE ME A CRAPY SCALE resetting to 1.0\n");
       this->scaling = 1.0;
-      PRINTF(1)("YOU GAVE ME A CRAPY SCALE resetting to 1\n");
     }
     if(strstr(fileName, ".obj"))
     {
       PRINTF(4)("fetching OBJ file: %s\n", fileName);
-      if (this->scaling == 1.0)
-        this->setModel((Model*)ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN), modelNumber);
-      else
-        this->setModel((Model*)ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN, this->scaling), modelNumber);
+      BaseObject* loadedModel = ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN, this->scaling);
+      if (loadedModel != NULL)
+        this->setModel(dynamic_cast<Model*>(loadedModel), modelNumber);
 
       if( modelNumber == 0)
@@ -190,5 +188,5 @@
   if (this->models[modelNumber] != NULL)
   {
-    Resource* resource = ResourceManager::getInstance()->locateResourceByPointer(this->models[modelNumber]);
+    Resource* resource = ResourceManager::getInstance()->locateResourceByPointer(dynamic_cast<BaseObject*>(this->models[modelNumber]));
     if (resource != NULL)
       ResourceManager::getInstance()->unload(resource, RP_LEVEL);
