Index: /orxonox/trunk/src/Makefile.am
===================================================================
--- /orxonox/trunk/src/Makefile.am	(revision 3471)
+++ /orxonox/trunk/src/Makefile.am	(revision 3472)
@@ -1,3 +1,5 @@
 AM_CXXFLAGS="-I./world_entities"
+AM_CXXFLAGS+="-I./story_entities"
+
 AM_LDFLAGS= $(MWINDOWS)
 
@@ -12,5 +14,5 @@
 		 collision.cc \
 		 data_tank.cc \
-		 world_entity.cc \
+		 world_entities/world_entity.cc \
 		 vector.cc \
 		 camera.cc \
@@ -20,7 +22,7 @@
 		 base_entity.cc \
 		 game_loader.cc \
-		 campaign.cc \
-		 story_entity.cc \
-		 environment.cc \
+		 story_entities/campaign.cc \
+		 story_entities/story_entity.cc \
+		 world_entities/environment.cc \
 		 importer/model.cc \
 		 importer/objModel.cc \
@@ -44,9 +46,9 @@
 		 data_tank.h \
 		 collision.h \
-		 npc.h \
+		 world_entities/npc.h \
 		 stdincl.h \
 		 glincl.h \
 		 ai.h \
-		 environment.h \
+		 world_entities/environment.h \
 		 orxonox.h \
 		 synchronisable.h \
@@ -64,12 +66,12 @@
 		 list.h \
 		 shoot_laser.h \
-		 world_entity.h \
+		 world_entities/world_entity.h \
 		 message_structures.h \
 		 shoot_rocket.h \
 		 list_template.h \
-		 story_entity.h \
-		 story_def.h \
+		 story_entities/story_entity.h \
+		 story_entities/story_def.h \
 		 game_loader.h \
-		 campaign.h \
+		 story_entities/campaign.h \
 		 p_node.h \
 		 null_parent.h \
Index: /orxonox/trunk/src/Makefile.in
===================================================================
--- /orxonox/trunk/src/Makefile.in	(revision 3471)
+++ /orxonox/trunk/src/Makefile.in	(revision 3472)
@@ -214,5 +214,5 @@
 target_os = @target_os@
 target_vendor = @target_vendor@
-AM_CXXFLAGS = "-I./world_entities"
+AM_CXXFLAGS = "-I./world_entities" "-I./story_entities"
 AM_LDFLAGS = $(MWINDOWS)
 orxonox_SOURCES = orxonox.cc \
@@ -221,5 +221,5 @@
 		 collision.cc \
 		 data_tank.cc \
-		 world_entity.cc \
+		 world_entities/world_entity.cc \
 		 vector.cc \
 		 camera.cc \
@@ -229,7 +229,7 @@
 		 base_entity.cc \
 		 game_loader.cc \
-		 campaign.cc \
-		 story_entity.cc \
-		 environment.cc \
+		 story_entities/campaign.cc \
+		 story_entities/story_entity.cc \
+		 world_entities/environment.cc \
 		 importer/model.cc \
 		 importer/objModel.cc \
@@ -253,9 +253,9 @@
 		 data_tank.h \
 		 collision.h \
-		 npc.h \
+		 world_entities/npc.h \
 		 stdincl.h \
 		 glincl.h \
 		 ai.h \
-		 environment.h \
+		 world_entities/environment.h \
 		 orxonox.h \
 		 synchronisable.h \
@@ -273,12 +273,12 @@
 		 list.h \
 		 shoot_laser.h \
-		 world_entity.h \
+		 world_entities/world_entity.h \
 		 message_structures.h \
 		 shoot_rocket.h \
 		 list_template.h \
-		 story_entity.h \
-		 story_def.h \
+		 story_entities/story_entity.h \
+		 story_entities/story_def.h \
 		 game_loader.h \
-		 campaign.h \
+		 story_entities/campaign.h \
 		 p_node.h \
 		 null_parent.h \
@@ -438,4 +438,68 @@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o player.obj `if test -f 'world_entities/player.cc'; then $(CYGPATH_W) 'world_entities/player.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/player.cc'; fi`
+
+world_entity.o: world_entities/world_entity.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT world_entity.o -MD -MP -MF "$(DEPDIR)/world_entity.Tpo" -c -o world_entity.o `test -f 'world_entities/world_entity.cc' || echo '$(srcdir)/'`world_entities/world_entity.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/world_entity.Tpo" "$(DEPDIR)/world_entity.Po"; else rm -f "$(DEPDIR)/world_entity.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/world_entity.cc' object='world_entity.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/world_entity.Po' tmpdepfile='$(DEPDIR)/world_entity.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o world_entity.o `test -f 'world_entities/world_entity.cc' || echo '$(srcdir)/'`world_entities/world_entity.cc
+
+world_entity.obj: world_entities/world_entity.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT world_entity.obj -MD -MP -MF "$(DEPDIR)/world_entity.Tpo" -c -o world_entity.obj `if test -f 'world_entities/world_entity.cc'; then $(CYGPATH_W) 'world_entities/world_entity.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/world_entity.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/world_entity.Tpo" "$(DEPDIR)/world_entity.Po"; else rm -f "$(DEPDIR)/world_entity.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/world_entity.cc' object='world_entity.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/world_entity.Po' tmpdepfile='$(DEPDIR)/world_entity.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o world_entity.obj `if test -f 'world_entities/world_entity.cc'; then $(CYGPATH_W) 'world_entities/world_entity.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/world_entity.cc'; fi`
+
+campaign.o: story_entities/campaign.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT campaign.o -MD -MP -MF "$(DEPDIR)/campaign.Tpo" -c -o campaign.o `test -f 'story_entities/campaign.cc' || echo '$(srcdir)/'`story_entities/campaign.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/campaign.Tpo" "$(DEPDIR)/campaign.Po"; else rm -f "$(DEPDIR)/campaign.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='story_entities/campaign.cc' object='campaign.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/campaign.Po' tmpdepfile='$(DEPDIR)/campaign.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o campaign.o `test -f 'story_entities/campaign.cc' || echo '$(srcdir)/'`story_entities/campaign.cc
+
+campaign.obj: story_entities/campaign.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT campaign.obj -MD -MP -MF "$(DEPDIR)/campaign.Tpo" -c -o campaign.obj `if test -f 'story_entities/campaign.cc'; then $(CYGPATH_W) 'story_entities/campaign.cc'; else $(CYGPATH_W) '$(srcdir)/story_entities/campaign.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/campaign.Tpo" "$(DEPDIR)/campaign.Po"; else rm -f "$(DEPDIR)/campaign.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='story_entities/campaign.cc' object='campaign.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/campaign.Po' tmpdepfile='$(DEPDIR)/campaign.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o campaign.obj `if test -f 'story_entities/campaign.cc'; then $(CYGPATH_W) 'story_entities/campaign.cc'; else $(CYGPATH_W) '$(srcdir)/story_entities/campaign.cc'; fi`
+
+story_entity.o: story_entities/story_entity.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT story_entity.o -MD -MP -MF "$(DEPDIR)/story_entity.Tpo" -c -o story_entity.o `test -f 'story_entities/story_entity.cc' || echo '$(srcdir)/'`story_entities/story_entity.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/story_entity.Tpo" "$(DEPDIR)/story_entity.Po"; else rm -f "$(DEPDIR)/story_entity.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='story_entities/story_entity.cc' object='story_entity.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/story_entity.Po' tmpdepfile='$(DEPDIR)/story_entity.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o story_entity.o `test -f 'story_entities/story_entity.cc' || echo '$(srcdir)/'`story_entities/story_entity.cc
+
+story_entity.obj: story_entities/story_entity.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT story_entity.obj -MD -MP -MF "$(DEPDIR)/story_entity.Tpo" -c -o story_entity.obj `if test -f 'story_entities/story_entity.cc'; then $(CYGPATH_W) 'story_entities/story_entity.cc'; else $(CYGPATH_W) '$(srcdir)/story_entities/story_entity.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/story_entity.Tpo" "$(DEPDIR)/story_entity.Po"; else rm -f "$(DEPDIR)/story_entity.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='story_entities/story_entity.cc' object='story_entity.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/story_entity.Po' tmpdepfile='$(DEPDIR)/story_entity.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o story_entity.obj `if test -f 'story_entities/story_entity.cc'; then $(CYGPATH_W) 'story_entities/story_entity.cc'; else $(CYGPATH_W) '$(srcdir)/story_entities/story_entity.cc'; fi`
+
+environment.o: world_entities/environment.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT environment.o -MD -MP -MF "$(DEPDIR)/environment.Tpo" -c -o environment.o `test -f 'world_entities/environment.cc' || echo '$(srcdir)/'`world_entities/environment.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/environment.Tpo" "$(DEPDIR)/environment.Po"; else rm -f "$(DEPDIR)/environment.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/environment.cc' object='environment.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/environment.Po' tmpdepfile='$(DEPDIR)/environment.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o environment.o `test -f 'world_entities/environment.cc' || echo '$(srcdir)/'`world_entities/environment.cc
+
+environment.obj: world_entities/environment.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT environment.obj -MD -MP -MF "$(DEPDIR)/environment.Tpo" -c -o environment.obj `if test -f 'world_entities/environment.cc'; then $(CYGPATH_W) 'world_entities/environment.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/environment.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/environment.Tpo" "$(DEPDIR)/environment.Po"; else rm -f "$(DEPDIR)/environment.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/environment.cc' object='environment.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/environment.Po' tmpdepfile='$(DEPDIR)/environment.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o environment.obj `if test -f 'world_entities/environment.cc'; then $(CYGPATH_W) 'world_entities/environment.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/environment.cc'; fi`
 
 model.o: importer/model.cc
@@ -657,5 +721,5 @@
 
 distdir: $(DISTFILES)
-	$(mkdir_p) $(distdir)/sfont $(distdir)/world_entities
+	$(mkdir_p) $(distdir)/sfont $(distdir)/story_entities $(distdir)/world_entities
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
Index: xonox/trunk/src/campaign.cc
===================================================================
--- /orxonox/trunk/src/campaign.cc	(revision 3471)
+++ 	(revision )
@@ -1,202 +1,0 @@
-
-
-/* 
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer: 
-*/
-
-
-#include "campaign.h"
-#include "world.h"
-#include "camera.h"
-#include "story_entity.h"
-
-using namespace std;
-
-
-Campaign::Campaign () 
-{
-  this->entities = new ListTemplate<StoryEntity>();
-  this->isInit = false;
-}
-
-Campaign::~Campaign () {}
-
-
-ErrorMessage Campaign::init()
-{
-  this->isInit = true;
-}
-
-
-ErrorMessage Campaign::start()
-{
-  this->start(0);
-}
-
-
-ErrorMessage Campaign::start(int storyID = 0)
-{
-  printf("World::start() - starting new StoryEntity Nr:%i\n", storyID);
-  ErrorMessage errorCode;
-  if( !this->isInit) return errorCode; 
-  if( storyID == WORLD_ID_GAMEEND) return errorCode;
-  this->running = true;
-  StoryEntity* se = this->getStoryEntity(storyID);
-  this->currentEntity = se;
-  while( se != NULL && this->running)
-    {
-      se->displayLoadScreen();
-      se->load();
-      se->init();
-      se->releaseLoadScreen();
-      se->start();
-      se->destroy();
-     
-      delete se;
-
-      int nextWorldID = se->getNextStoryID();
-      //printf("Campaing::start() - got nextWorldID = %i\n", nextWorldID);
-      se = this->getStoryEntity(nextWorldID);
-      this->currentEntity = se;
-      if( ( nextWorldID == WORLD_ID_GAMEEND) ||( se == NULL) ) 
-	{
-	  printf("Campaign::start() - quitting campaing story loop\n");
-	  if(se != NULL)
-	    delete se;
-	  return errorCode;
-	}
-      
-    }
-}
-
-
-ErrorMessage Campaign::pause()
-{
-  if(this->currentEntity != NULL)
-    this->isPaused = true;
-}
-
-
-ErrorMessage Campaign::resume()
-{
-  if(this->currentEntity != NULL)
-    this->isPaused = false;
-}
-
-
-ErrorMessage Campaign::stop()
-{
-  this->running = false;
-  if(this->currentEntity != NULL) 
-    {
-      this->currentEntity->stop();
-      //delete this->currentEntity;
-      //this->currentEntity = NULL;
-    }
-}
-
-
-ErrorMessage Campaign::destroy()
-{
-  if(this->currentEntity != NULL)
-    {
-      this->currentEntity->destroy();
-      delete this->currentEntity;
-      this->currentEntity = NULL;
-    }
-}
-
-
-/** 
-    \brief adds an game stroy entity to the campaign
-
-    \param se: The entity
-    \param storyID: The number that identifies the entity in the campaign. Each ID only used once in a Campaign
-
-    An entity can be a world (playable), a cinematic, a shop, sounds, whatever you
-    want to queue up in the campaign.
-*/
-void Campaign::addEntity(StoryEntity* se, int storyID)
-{
-  se->setStoryID(storyID);
-  this->addEntity(se);
-}
-
-void Campaign::addEntity(StoryEntity* se)
-{
-  this->entities->add(se);
-}
-
-
-void Campaign::removeEntity(int storyID)
-{
-  this->removeEntity(this->getStoryEntity(storyID));
-  
-}
-
-
-void Campaign::removeEntity(StoryEntity* se)
-{
-  this->entities->remove(se);
-}
-
-
-/*
-  \brief this changes to the next level
-*/
-void Campaign::nextLevel()
-{
-  printf("Campaign:nextLevel()\n");
-  //int nextID = this->currentEntity->getNextStoryID();
-  //this->stop();
-  //this->start(nextID);
-  this->currentEntity->stop();
-}
-
-/*
-  \brief change to the previous level - not implemented
-
-  this propably useless
-*/
-void Campaign::previousLevel()
-{}
-
-
-/*
-  \brief lookup a entity with a given id
-  \param story id to be lookuped
-  \returns the entity found or NULL if search ended without match
-*/
-StoryEntity* Campaign::getStoryEntity(int storyID)
-{
-  //printf("Campaing::getStoryEntity(%i) - getting next Entity\n", storyID);
-  if( storyID == WORLD_ID_GAMEEND)
-    return NULL;
-  ListTemplate<StoryEntity>* l;
-  StoryEntity* entity = NULL;
-  l = this->entities->getNext();  
-  while( l != NULL) 
-    { 
-      entity = l->getObject();
-      l = l->getNext();
-      int id = entity->getStoryID();
-      //printf("Campaing::getStoryEntity() - now looping, found entity nr=%i\n", id);
-      if(id == storyID)
-	{
-	  //printf("Campaing::getStoryEntity() - yea, this is what we where looking for: %id\n");
-	  return entity;
-	}
-    }
-  return NULL;
-}
Index: xonox/trunk/src/campaign.h
===================================================================
--- /orxonox/trunk/src/campaign.h	(revision 3471)
+++ 	(revision )
@@ -1,42 +1,0 @@
-
-#ifndef _CAMPAIGN_H
-#define _CAMPAIGN_H
-
-#include "stdincl.h"
-#include "story_entity.h"
-
-
-class World;
-
-class Campaign : public StoryEntity {
-
- public:
-  Campaign ();
-  ~Campaign ();
-
-  StoryEntity* currentEntity;
-
-  virtual ErrorMessage init();
-  virtual ErrorMessage start();
-  virtual ErrorMessage start(int storyID);
-  virtual ErrorMessage pause();
-  virtual ErrorMessage resume();
-  virtual ErrorMessage stop();
-  virtual ErrorMessage destroy();
-
-  void addEntity(StoryEntity* se, int storyID);
-  void addEntity(StoryEntity* se);
-  void removeEntity(int storyID);
-  void removeEntity(StoryEntity* se);
-  
-  void nextLevel();
-  void previousLevel();
-
- private:
-  ListTemplate<StoryEntity>* entities;
-  bool running;
-
-  StoryEntity* getStoryEntity(int storyID);
-};
-
-#endif /* _CAMPAIGN_H */
Index: xonox/trunk/src/environment.cc
===================================================================
--- /orxonox/trunk/src/environment.cc	(revision 3471)
+++ 	(revision )
@@ -1,62 +1,0 @@
-
-
-/* 
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific
-   main-programmer: Patrick Boenzli
-   co-programmer: 
-*/
-
-
-#include "environment.h"
-#include "stdincl.h"
-#include "world_entity.h"
-#include "vector.h"
-#include "importer/objModel.h"
-
-using namespace std;
-
-
-
-Environment::Environment () : WorldEntity()
-{
-  this->model = new OBJModel("../data/models/fighter.obj");
-}
-
-
-
-Environment::~Environment () 
-{
-  delete this->model;
-}
-
-void Environment::tick (float time) {}
-
-void Environment::hit (WorldEntity* weapon, Vector loc) {}
-
-void Environment::destroy () {}
-
-void Environment::collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags) {}
-
-void Environment::draw () 
-{
-  glMatrixMode(GL_MODELVIEW);
-  glLoadIdentity();
-  float matrix[4][4];
-  
-  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
-  //rotate
-  this->getAbsDir().matrix (matrix);
-  glMultMatrixf((float*)matrix);
-  
-  this->model->draw();
-}
-
Index: xonox/trunk/src/environment.h
===================================================================
--- /orxonox/trunk/src/environment.h	(revision 3471)
+++ 	(revision )
@@ -1,31 +1,0 @@
-#ifndef _ENVIRONEMENT_H
-#define _ENVIRONEMENT_H
-
-#include "world_entity.h"
-
-
-class Environment : public WorldEntity 
-{
-  friend class World;
-
- private:
-  float xCor;
-  float yCor;
-  float zCor;
-
-  float mountainTest[10][10];
-
- public:
-  Environment ();
-  ~Environment ();
-
-  
-  virtual void tick (float time);
-  virtual void hit (WorldEntity* weapon, Vector loc);
-  virtual void destroy ();
-  virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
-  virtual void draw ();
-
-};
-
-#endif /* _ENVIRONEMENT_H */
Index: xonox/trunk/src/npc.cc
===================================================================
--- /orxonox/trunk/src/npc.cc	(revision 3471)
+++ 	(revision )
@@ -1,94 +1,0 @@
-
-
-/* 
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer:
-*/
-
-#include <iostream>
-#include <GL/glut.h>
-
-#include "ai.h"
-#include "data_tank.h"
-
-#include "npc.h"
-
-using namespace std;
-
-
-NPC::NPC()
-  : WorldEntity()
-{
-  hasDied = 0;
-}
-
-NPC::~NPC () {}
-
-
-void NPC::setPosition(float x, float y, float z)
-{
-  xCor = x; yCor = y; zCor = z;
-}
-
-void NPC::getPosition(float* x, float* y, float* z) 
-{
-  *x = xCor; 
-  *y = yCor; 
-  *z = zCor;
-}
-
-void NPC::setCollisionRadius(float r) 
-{
-  collisionRadius = r;
-}
-
-float NPC::getCollisionRadius() 
-{
-  return collisionRadius;
-}
-
-
-void NPC::addAI(AI* ai)
-{}
-
-void NPC::paint()
-{
-  //cout << "WorldEntity::WorldEntity();" << endl;  
-  /* fix: died flag approach is very stupid, just to show @ convention */
-  if( hasDied == 0 ) {
-    glPushMatrix();
-    glTranslatef(xCor, yCor, 3.0);
-    //glScalef(1.0, 3.0, 1.0);
-    glutWireSphere(1.0, 10, 10);
-    glPopMatrix();
-  }
-}
-
-void NPC::drawNPC() 
-{
-
-}
-
-
-/* define the reaction, if the ship is been hit */
-int NPC::hit()
-{
-  die();
-  return 0;
-}
-
-
-void NPC::die()
-{
-  hasDied = 1;
-}
Index: xonox/trunk/src/npc.h
===================================================================
--- /orxonox/trunk/src/npc.h	(revision 3471)
+++ 	(revision )
@@ -1,43 +1,0 @@
-
-#ifndef _NPC_H
-#define _NPC_H
-
-#include "world_entity.h"
-
-class AI;
-
-class NPC : public WorldEntity {
-
- public:
-  NPC ();
-  ~NPC ();
-
-  /* collision control */
-  float collisionRadius;
-
-  float xCor;
-  float yCor;
-  float zCor;
-
-  void drawNPC(void);
-  void paint(void);
-  void setPosition(float x, float y, float z);
-  void getPosition(float* x, float* y, float* z);
-  void addAI(AI* ai);
-  void setCollisionRadius(float r);
-  float getCollisionRadius(void);
-  int hit(void);
-  void die(void);
-
- private:
-  /* position of the non player space craft */
-
-  int npcType;
-  int hasDied;
-
-
-;
-
-};
-
-#endif /* _NPC_H */
Index: xonox/trunk/src/story_def.h
===================================================================
--- /orxonox/trunk/src/story_def.h	(revision 3471)
+++ 	(revision )
@@ -1,24 +1,0 @@
-
-#ifndef _STORY_DEF_H
-#define _STORY_DEF_H
-
-
-#define DEBUG_CAMPAIGN_0 1000
-#define DEBUG_CAMPAIGN_1 1001
-#define DEBUG_CAMPAIGN_2 1002
-
-#define DEBUG_WORLD_0 100
-#define DEBUG_WORLD_1 101
-#define DEBUG_WORLD_2 102
-
-#define WORLD_ID_0 0
-#define WORLD_ID_1 1
-#define WORLD_ID_2 2
-#define WORLD_ID_3 3
-#define WORLD_ID_4 4
-#define WORLD_ID_5 5
-#define WORLD_ID_GAMEEND 999
-
-#define MAX_STORY_ENTITIES 99 //!> maximal StoryEntities in a Campaign
-
-#endif /* _STORY_DEF_H */
Index: /orxonox/trunk/src/story_entities/campaign.cc
===================================================================
--- /orxonox/trunk/src/story_entities/campaign.cc	(revision 3472)
+++ /orxonox/trunk/src/story_entities/campaign.cc	(revision 3472)
@@ -0,0 +1,202 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer: 
+*/
+
+
+#include "campaign.h"
+#include "world.h"
+#include "camera.h"
+#include "story_entity.h"
+
+using namespace std;
+
+
+Campaign::Campaign () 
+{
+  this->entities = new ListTemplate<StoryEntity>();
+  this->isInit = false;
+}
+
+Campaign::~Campaign () {}
+
+
+ErrorMessage Campaign::init()
+{
+  this->isInit = true;
+}
+
+
+ErrorMessage Campaign::start()
+{
+  this->start(0);
+}
+
+
+ErrorMessage Campaign::start(int storyID = 0)
+{
+  printf("World::start() - starting new StoryEntity Nr:%i\n", storyID);
+  ErrorMessage errorCode;
+  if( !this->isInit) return errorCode; 
+  if( storyID == WORLD_ID_GAMEEND) return errorCode;
+  this->running = true;
+  StoryEntity* se = this->getStoryEntity(storyID);
+  this->currentEntity = se;
+  while( se != NULL && this->running)
+    {
+      se->displayLoadScreen();
+      se->load();
+      se->init();
+      se->releaseLoadScreen();
+      se->start();
+      se->destroy();
+     
+      delete se;
+
+      int nextWorldID = se->getNextStoryID();
+      //printf("Campaing::start() - got nextWorldID = %i\n", nextWorldID);
+      se = this->getStoryEntity(nextWorldID);
+      this->currentEntity = se;
+      if( ( nextWorldID == WORLD_ID_GAMEEND) ||( se == NULL) ) 
+	{
+	  printf("Campaign::start() - quitting campaing story loop\n");
+	  if(se != NULL)
+	    delete se;
+	  return errorCode;
+	}
+      
+    }
+}
+
+
+ErrorMessage Campaign::pause()
+{
+  if(this->currentEntity != NULL)
+    this->isPaused = true;
+}
+
+
+ErrorMessage Campaign::resume()
+{
+  if(this->currentEntity != NULL)
+    this->isPaused = false;
+}
+
+
+ErrorMessage Campaign::stop()
+{
+  this->running = false;
+  if(this->currentEntity != NULL) 
+    {
+      this->currentEntity->stop();
+      //delete this->currentEntity;
+      //this->currentEntity = NULL;
+    }
+}
+
+
+ErrorMessage Campaign::destroy()
+{
+  if(this->currentEntity != NULL)
+    {
+      this->currentEntity->destroy();
+      delete this->currentEntity;
+      this->currentEntity = NULL;
+    }
+}
+
+
+/** 
+    \brief adds an game stroy entity to the campaign
+
+    \param se: The entity
+    \param storyID: The number that identifies the entity in the campaign. Each ID only used once in a Campaign
+
+    An entity can be a world (playable), a cinematic, a shop, sounds, whatever you
+    want to queue up in the campaign.
+*/
+void Campaign::addEntity(StoryEntity* se, int storyID)
+{
+  se->setStoryID(storyID);
+  this->addEntity(se);
+}
+
+void Campaign::addEntity(StoryEntity* se)
+{
+  this->entities->add(se);
+}
+
+
+void Campaign::removeEntity(int storyID)
+{
+  this->removeEntity(this->getStoryEntity(storyID));
+  
+}
+
+
+void Campaign::removeEntity(StoryEntity* se)
+{
+  this->entities->remove(se);
+}
+
+
+/*
+  \brief this changes to the next level
+*/
+void Campaign::nextLevel()
+{
+  printf("Campaign:nextLevel()\n");
+  //int nextID = this->currentEntity->getNextStoryID();
+  //this->stop();
+  //this->start(nextID);
+  this->currentEntity->stop();
+}
+
+/*
+  \brief change to the previous level - not implemented
+
+  this propably useless
+*/
+void Campaign::previousLevel()
+{}
+
+
+/*
+  \brief lookup a entity with a given id
+  \param story id to be lookuped
+  \returns the entity found or NULL if search ended without match
+*/
+StoryEntity* Campaign::getStoryEntity(int storyID)
+{
+  //printf("Campaing::getStoryEntity(%i) - getting next Entity\n", storyID);
+  if( storyID == WORLD_ID_GAMEEND)
+    return NULL;
+  ListTemplate<StoryEntity>* l;
+  StoryEntity* entity = NULL;
+  l = this->entities->getNext();  
+  while( l != NULL) 
+    { 
+      entity = l->getObject();
+      l = l->getNext();
+      int id = entity->getStoryID();
+      //printf("Campaing::getStoryEntity() - now looping, found entity nr=%i\n", id);
+      if(id == storyID)
+	{
+	  //printf("Campaing::getStoryEntity() - yea, this is what we where looking for: %id\n");
+	  return entity;
+	}
+    }
+  return NULL;
+}
Index: /orxonox/trunk/src/story_entities/campaign.h
===================================================================
--- /orxonox/trunk/src/story_entities/campaign.h	(revision 3472)
+++ /orxonox/trunk/src/story_entities/campaign.h	(revision 3472)
@@ -0,0 +1,42 @@
+
+#ifndef _CAMPAIGN_H
+#define _CAMPAIGN_H
+
+#include "stdincl.h"
+#include "story_entity.h"
+
+
+class World;
+
+class Campaign : public StoryEntity {
+
+ public:
+  Campaign ();
+  ~Campaign ();
+
+  StoryEntity* currentEntity;
+
+  virtual ErrorMessage init();
+  virtual ErrorMessage start();
+  virtual ErrorMessage start(int storyID);
+  virtual ErrorMessage pause();
+  virtual ErrorMessage resume();
+  virtual ErrorMessage stop();
+  virtual ErrorMessage destroy();
+
+  void addEntity(StoryEntity* se, int storyID);
+  void addEntity(StoryEntity* se);
+  void removeEntity(int storyID);
+  void removeEntity(StoryEntity* se);
+  
+  void nextLevel();
+  void previousLevel();
+
+ private:
+  ListTemplate<StoryEntity>* entities;
+  bool running;
+
+  StoryEntity* getStoryEntity(int storyID);
+};
+
+#endif /* _CAMPAIGN_H */
Index: /orxonox/trunk/src/story_entities/story_def.h
===================================================================
--- /orxonox/trunk/src/story_entities/story_def.h	(revision 3472)
+++ /orxonox/trunk/src/story_entities/story_def.h	(revision 3472)
@@ -0,0 +1,24 @@
+
+#ifndef _STORY_DEF_H
+#define _STORY_DEF_H
+
+
+#define DEBUG_CAMPAIGN_0 1000
+#define DEBUG_CAMPAIGN_1 1001
+#define DEBUG_CAMPAIGN_2 1002
+
+#define DEBUG_WORLD_0 100
+#define DEBUG_WORLD_1 101
+#define DEBUG_WORLD_2 102
+
+#define WORLD_ID_0 0
+#define WORLD_ID_1 1
+#define WORLD_ID_2 2
+#define WORLD_ID_3 3
+#define WORLD_ID_4 4
+#define WORLD_ID_5 5
+#define WORLD_ID_GAMEEND 999
+
+#define MAX_STORY_ENTITIES 99 //!> maximal StoryEntities in a Campaign
+
+#endif /* _STORY_DEF_H */
Index: /orxonox/trunk/src/story_entities/story_entity.cc
===================================================================
--- /orxonox/trunk/src/story_entities/story_entity.cc	(revision 3472)
+++ /orxonox/trunk/src/story_entities/story_entity.cc	(revision 3472)
@@ -0,0 +1,177 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer: 
+*/
+
+
+#include "story_entity.h"
+
+
+using namespace std;
+
+
+
+StoryEntity::StoryEntity () {}
+StoryEntity::~StoryEntity () {}
+
+
+/** 
+    \brief sets the story ID
+
+    sets the story id of the current entity, this enables it to be identified in a 
+    global context.
+*/
+void StoryEntity::setStoryID(int storyID)
+{
+  this->storyID = storyID;
+}
+
+
+/** 
+    \brief this reads the story id of the current entity
+    \returns the story entity id
+*/
+int StoryEntity::getStoryID()
+{
+  return this->storyID;
+}
+
+
+/** 
+    \brief sets the id of the next story entity
+    
+    StoryEntities can choose their following entity themselfs. the entity id defined here
+    will be startet after this entity ends. this can be convenient if you want to have a
+    non linear story with switches.
+*/
+void StoryEntity::setNextStoryID(int nextStoryID)
+{
+  this->nextStoryID = nextStoryID;
+}
+
+/** 
+    \brief gets the story id of the current entity
+    \returns story id
+*/
+int StoryEntity::getNextStoryID()
+{
+  return this->nextStoryID;
+}
+
+
+/** 
+    \brief initialize the entity before use. 
+    \returns an error code if not able to apply.
+
+    After execution of this function, the Entity is ready to be played/executed, 
+    this shifts the initialisation work before the execution - very important...
+*/
+ErrorMessage StoryEntity::init()
+{}
+
+
+/** 
+    \brief loads the current entity
+
+    this is here to enable you loading maps into the entities. for all other actions you
+    should take the init() function.
+*/
+ErrorMessage StoryEntity::load()
+{}
+
+/** 
+    \brief starts the entity with the choosen id. only for entities with lists.
+    \param story id
+    \returns error code if this action has caused a error
+
+    this simply starts the story with the id storyID. the story with the choosen id has
+    to be part of the current entity else, this doesn't make sense. this is used for
+    campaigns or the GameLoader, they have lists of Campaigns/Worlds with their own
+    storyID.
+*/
+ErrorMessage StoryEntity::start(int storyID)
+{}
+
+
+/** 
+    \brief starts the current entity
+    \returns error code if this action has caused a error    
+*/
+ErrorMessage StoryEntity::start()
+{}
+
+
+/** 
+    \brief pause the current entity
+    \returns error code if this action has caused a error
+
+    this pauses the current entity or passes this call forth to the running entity.
+*/
+ErrorMessage StoryEntity::pause()
+{}
+
+
+/** 
+    \brief resumes a pause
+    \returns error code if this action has caused a error
+
+    this resumess the current entity or passes this call forth to the running entity.
+*/
+ErrorMessage StoryEntity::resume()
+{}
+
+
+/** 
+    \brief stops the current entity
+    \returns error code if this action has caused a error
+
+    ATTENTION: this function shouldn't call other functions, or if so, they must return
+    after finishing. If you ignore or forget to do so, the current entity is not able to
+    terminate and it will run in the background or the ressources can't be freed or even
+    worse: are freed and the program will end in a segmentation fault!
+    hehehe, all seen... :)
+*/
+ErrorMessage StoryEntity::stop()
+{}
+
+
+/** 
+    \brief destroys and cleans up the current entity. 
+
+    this cleans up ressources before the deconstructor is called. for terminating 
+    the entity please use the stop() function.
+*/
+ErrorMessage StoryEntity::destroy()
+{}
+
+
+/** 
+    \brief this displays the load screen
+
+    it will need some time to load maps or things like that. to inform the user about 
+    progress and to just show him/her something for the eyes, put here this stuff
+*/
+void StoryEntity::displayLoadScreen()
+{}
+
+
+/** 
+    \brief undisplay the load screen
+
+    the load process has terminated, you now can release the load screen and start this
+    entity.
+*/
+void StoryEntity::releaseLoadScreen()
+{}
Index: /orxonox/trunk/src/story_entities/story_entity.h
===================================================================
--- /orxonox/trunk/src/story_entities/story_entity.h	(revision 3472)
+++ /orxonox/trunk/src/story_entities/story_entity.h	(revision 3472)
@@ -0,0 +1,48 @@
+/*! 
+    \file story_entity.h
+    \brief holds the base class of everything that is playable - that is part of the story
+*/ 
+
+
+#ifndef _STORY_ENTITY_H
+#define _STORY_ENTITY_H
+
+#include "stdincl.h"
+#include "story_def.h"
+
+//! A class that represents something to play in orxonox. it is a container for worlds, movies, mission briefings, etc...
+class StoryEntity : public BaseObject {
+
+ public:
+  StoryEntity ();
+  virtual ~StoryEntity ();
+
+  bool isInit;  //! if the entity is initialized, this has to be true
+  bool isPaused; //! is true if the entity is paused
+
+  virtual ErrorMessage load();
+  virtual ErrorMessage init();
+  virtual ErrorMessage start(int storyID);
+  virtual ErrorMessage start();
+  virtual ErrorMessage pause();
+  virtual ErrorMessage resume();
+  virtual ErrorMessage stop();
+  virtual ErrorMessage destroy();
+
+
+  virtual void displayLoadScreen();
+  virtual void releaseLoadScreen();
+
+  void setStoryID(int storyID);
+  int getStoryID();
+
+  void setNextStoryID(int nextStoryID);
+  int getNextStoryID();
+
+
+ private:
+  int storyID; //! this is the number of this entity, identifying it in a list/tree...
+  int nextStoryID; //! if this entity has finished, this entity shall be called
+};
+
+#endif /* _STORY_ENTITY_H */
Index: xonox/trunk/src/story_entity.cc
===================================================================
--- /orxonox/trunk/src/story_entity.cc	(revision 3471)
+++ 	(revision )
@@ -1,177 +1,0 @@
-
-
-/* 
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer: 
-*/
-
-
-#include "story_entity.h"
-
-
-using namespace std;
-
-
-
-StoryEntity::StoryEntity () {}
-StoryEntity::~StoryEntity () {}
-
-
-/** 
-    \brief sets the story ID
-
-    sets the story id of the current entity, this enables it to be identified in a 
-    global context.
-*/
-void StoryEntity::setStoryID(int storyID)
-{
-  this->storyID = storyID;
-}
-
-
-/** 
-    \brief this reads the story id of the current entity
-    \returns the story entity id
-*/
-int StoryEntity::getStoryID()
-{
-  return this->storyID;
-}
-
-
-/** 
-    \brief sets the id of the next story entity
-    
-    StoryEntities can choose their following entity themselfs. the entity id defined here
-    will be startet after this entity ends. this can be convenient if you want to have a
-    non linear story with switches.
-*/
-void StoryEntity::setNextStoryID(int nextStoryID)
-{
-  this->nextStoryID = nextStoryID;
-}
-
-/** 
-    \brief gets the story id of the current entity
-    \returns story id
-*/
-int StoryEntity::getNextStoryID()
-{
-  return this->nextStoryID;
-}
-
-
-/** 
-    \brief initialize the entity before use. 
-    \returns an error code if not able to apply.
-
-    After execution of this function, the Entity is ready to be played/executed, 
-    this shifts the initialisation work before the execution - very important...
-*/
-ErrorMessage StoryEntity::init()
-{}
-
-
-/** 
-    \brief loads the current entity
-
-    this is here to enable you loading maps into the entities. for all other actions you
-    should take the init() function.
-*/
-ErrorMessage StoryEntity::load()
-{}
-
-/** 
-    \brief starts the entity with the choosen id. only for entities with lists.
-    \param story id
-    \returns error code if this action has caused a error
-
-    this simply starts the story with the id storyID. the story with the choosen id has
-    to be part of the current entity else, this doesn't make sense. this is used for
-    campaigns or the GameLoader, they have lists of Campaigns/Worlds with their own
-    storyID.
-*/
-ErrorMessage StoryEntity::start(int storyID)
-{}
-
-
-/** 
-    \brief starts the current entity
-    \returns error code if this action has caused a error    
-*/
-ErrorMessage StoryEntity::start()
-{}
-
-
-/** 
-    \brief pause the current entity
-    \returns error code if this action has caused a error
-
-    this pauses the current entity or passes this call forth to the running entity.
-*/
-ErrorMessage StoryEntity::pause()
-{}
-
-
-/** 
-    \brief resumes a pause
-    \returns error code if this action has caused a error
-
-    this resumess the current entity or passes this call forth to the running entity.
-*/
-ErrorMessage StoryEntity::resume()
-{}
-
-
-/** 
-    \brief stops the current entity
-    \returns error code if this action has caused a error
-
-    ATTENTION: this function shouldn't call other functions, or if so, they must return
-    after finishing. If you ignore or forget to do so, the current entity is not able to
-    terminate and it will run in the background or the ressources can't be freed or even
-    worse: are freed and the program will end in a segmentation fault!
-    hehehe, all seen... :)
-*/
-ErrorMessage StoryEntity::stop()
-{}
-
-
-/** 
-    \brief destroys and cleans up the current entity. 
-
-    this cleans up ressources before the deconstructor is called. for terminating 
-    the entity please use the stop() function.
-*/
-ErrorMessage StoryEntity::destroy()
-{}
-
-
-/** 
-    \brief this displays the load screen
-
-    it will need some time to load maps or things like that. to inform the user about 
-    progress and to just show him/her something for the eyes, put here this stuff
-*/
-void StoryEntity::displayLoadScreen()
-{}
-
-
-/** 
-    \brief undisplay the load screen
-
-    the load process has terminated, you now can release the load screen and start this
-    entity.
-*/
-void StoryEntity::releaseLoadScreen()
-{}
Index: xonox/trunk/src/story_entity.h
===================================================================
--- /orxonox/trunk/src/story_entity.h	(revision 3471)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*! 
-    \file story_entity.h
-    \brief holds the base class of everything that is playable - that is part of the story
-*/ 
-
-
-#ifndef _STORY_ENTITY_H
-#define _STORY_ENTITY_H
-
-#include "stdincl.h"
-#include "story_def.h"
-
-//! A class that represents something to play in orxonox. it is a container for worlds, movies, mission briefings, etc...
-class StoryEntity : public BaseObject {
-
- public:
-  StoryEntity ();
-  virtual ~StoryEntity ();
-
-  bool isInit;  //! if the entity is initialized, this has to be true
-  bool isPaused; //! is true if the entity is paused
-
-  virtual ErrorMessage load();
-  virtual ErrorMessage init();
-  virtual ErrorMessage start(int storyID);
-  virtual ErrorMessage start();
-  virtual ErrorMessage pause();
-  virtual ErrorMessage resume();
-  virtual ErrorMessage stop();
-  virtual ErrorMessage destroy();
-
-
-  virtual void displayLoadScreen();
-  virtual void releaseLoadScreen();
-
-  void setStoryID(int storyID);
-  int getStoryID();
-
-  void setNextStoryID(int nextStoryID);
-  int getNextStoryID();
-
-
- private:
-  int storyID; //! this is the number of this entity, identifying it in a list/tree...
-  int nextStoryID; //! if this entity has finished, this entity shall be called
-};
-
-#endif /* _STORY_ENTITY_H */
Index: /orxonox/trunk/src/world_entities/environment.cc
===================================================================
--- /orxonox/trunk/src/world_entities/environment.cc	(revision 3472)
+++ /orxonox/trunk/src/world_entities/environment.cc	(revision 3472)
@@ -0,0 +1,62 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Patrick Boenzli
+   co-programmer: 
+*/
+
+
+#include "environment.h"
+#include "stdincl.h"
+#include "world_entity.h"
+#include "vector.h"
+#include "importer/objModel.h"
+
+using namespace std;
+
+
+
+Environment::Environment () : WorldEntity()
+{
+  this->model = new OBJModel("../data/models/fighter.obj");
+}
+
+
+
+Environment::~Environment () 
+{
+  delete this->model;
+}
+
+void Environment::tick (float time) {}
+
+void Environment::hit (WorldEntity* weapon, Vector loc) {}
+
+void Environment::destroy () {}
+
+void Environment::collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags) {}
+
+void Environment::draw () 
+{
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+  float matrix[4][4];
+  
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+  //rotate
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+  
+  this->model->draw();
+}
+
Index: /orxonox/trunk/src/world_entities/environment.h
===================================================================
--- /orxonox/trunk/src/world_entities/environment.h	(revision 3472)
+++ /orxonox/trunk/src/world_entities/environment.h	(revision 3472)
@@ -0,0 +1,31 @@
+#ifndef _ENVIRONEMENT_H
+#define _ENVIRONEMENT_H
+
+#include "world_entity.h"
+
+
+class Environment : public WorldEntity 
+{
+  friend class World;
+
+ private:
+  float xCor;
+  float yCor;
+  float zCor;
+
+  float mountainTest[10][10];
+
+ public:
+  Environment ();
+  ~Environment ();
+
+  
+  virtual void tick (float time);
+  virtual void hit (WorldEntity* weapon, Vector loc);
+  virtual void destroy ();
+  virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
+  virtual void draw ();
+
+};
+
+#endif /* _ENVIRONEMENT_H */
Index: /orxonox/trunk/src/world_entities/npc.cc
===================================================================
--- /orxonox/trunk/src/world_entities/npc.cc	(revision 3472)
+++ /orxonox/trunk/src/world_entities/npc.cc	(revision 3472)
@@ -0,0 +1,94 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer:
+*/
+
+#include <iostream>
+#include <GL/glut.h>
+
+#include "ai.h"
+#include "data_tank.h"
+
+#include "npc.h"
+
+using namespace std;
+
+
+NPC::NPC()
+  : WorldEntity()
+{
+  hasDied = 0;
+}
+
+NPC::~NPC () {}
+
+
+void NPC::setPosition(float x, float y, float z)
+{
+  xCor = x; yCor = y; zCor = z;
+}
+
+void NPC::getPosition(float* x, float* y, float* z) 
+{
+  *x = xCor; 
+  *y = yCor; 
+  *z = zCor;
+}
+
+void NPC::setCollisionRadius(float r) 
+{
+  collisionRadius = r;
+}
+
+float NPC::getCollisionRadius() 
+{
+  return collisionRadius;
+}
+
+
+void NPC::addAI(AI* ai)
+{}
+
+void NPC::paint()
+{
+  //cout << "WorldEntity::WorldEntity();" << endl;  
+  /* fix: died flag approach is very stupid, just to show @ convention */
+  if( hasDied == 0 ) {
+    glPushMatrix();
+    glTranslatef(xCor, yCor, 3.0);
+    //glScalef(1.0, 3.0, 1.0);
+    glutWireSphere(1.0, 10, 10);
+    glPopMatrix();
+  }
+}
+
+void NPC::drawNPC() 
+{
+
+}
+
+
+/* define the reaction, if the ship is been hit */
+int NPC::hit()
+{
+  die();
+  return 0;
+}
+
+
+void NPC::die()
+{
+  hasDied = 1;
+}
Index: /orxonox/trunk/src/world_entities/npc.h
===================================================================
--- /orxonox/trunk/src/world_entities/npc.h	(revision 3472)
+++ /orxonox/trunk/src/world_entities/npc.h	(revision 3472)
@@ -0,0 +1,43 @@
+
+#ifndef _NPC_H
+#define _NPC_H
+
+#include "world_entity.h"
+
+class AI;
+
+class NPC : public WorldEntity {
+
+ public:
+  NPC ();
+  ~NPC ();
+
+  /* collision control */
+  float collisionRadius;
+
+  float xCor;
+  float yCor;
+  float zCor;
+
+  void drawNPC(void);
+  void paint(void);
+  void setPosition(float x, float y, float z);
+  void getPosition(float* x, float* y, float* z);
+  void addAI(AI* ai);
+  void setCollisionRadius(float r);
+  float getCollisionRadius(void);
+  int hit(void);
+  void die(void);
+
+ private:
+  /* position of the non player space craft */
+
+  int npcType;
+  int hasDied;
+
+
+;
+
+};
+
+#endif /* _NPC_H */
Index: /orxonox/trunk/src/world_entities/world_entity.cc
===================================================================
--- /orxonox/trunk/src/world_entities/world_entity.cc	(revision 3472)
+++ /orxonox/trunk/src/world_entities/world_entity.cc	(revision 3472)
@@ -0,0 +1,207 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer: Christian Meyer
+*/
+
+#include <iostream>
+
+#include "world_entity.h"
+#include "stdincl.h"
+#include "collision.h"
+
+using namespace std;
+
+/**
+   \brief standard constructor
+   
+   Every derived contructor HAS to call the previous one supplying the isFree parameter. This is necessary to distunguish
+   between free and bound entities. The difference between them is simply the fact that the movement of a free entity is
+   not bound to the track of a world. Use this to implement projectile or effect classes that do not have to travel along the track.
+   To specify an entity to be free or bound set the default parameter in the declaration of the constructor.
+   Theoretically you should never have to call the constructor of an Entity directly, for it is called by the spawn() function of the World
+   class. So if you want to create a new entity at any time, call World::spawn(). It will handle everything that is necessary.
+*/
+WorldEntity::WorldEntity (bool isFree) : bFree(isFree)
+{
+  this->setClassName ("WorldEntity");
+  this->bDraw = true;
+  collisioncluster = NULL;
+}
+
+/**
+   \brief standard destructor
+*/
+WorldEntity::~WorldEntity ()
+{
+  if( collisioncluster != NULL) delete collisioncluster;
+}
+
+/**
+   \brief get the Location of the WorldEntity
+   \return a pointer to location
+*/
+/*PN
+Location* WorldEntity::getLocation ()
+{
+  return &loc;
+}
+*/
+
+/**
+   \brief get the Placement of the WorldEntity
+   \return a pointer to placement
+*/
+ /*PN
+Placement* WorldEntity::getPlacement ()
+{
+  return &place;
+}
+ */
+/**
+   \brief query whether the WorldEntity in question is free
+   \return true if the WorldEntity is free or false if it isn't
+*/
+bool WorldEntity::isFree ()
+{
+  return bFree;
+}
+
+/**
+   \brief set the WorldEntity's collision hull
+   \param newhull: a pointer to a completely assembled CollisionCluster
+   
+   Any previously assigned collision hull will be deleted on reassignment
+*/
+void WorldEntity::setCollision (CollisionCluster* newhull)
+{
+  if( newhull == NULL) return;
+  if( collisioncluster != NULL) delete collisioncluster;
+  collisioncluster = newhull;
+}
+
+
+/**
+   \brief this method is called every frame
+   \param time: the time in seconds that has passed since the last tick
+   
+   Handle all stuff that should update with time inside this method (movement, animation, etc.)
+*/
+void WorldEntity::tick(float time) 
+{
+}
+
+
+/** 
+    \brief process draw function 
+*/
+void WorldEntity::processDraw ()
+{
+  this->draw ();
+  PNode* pn = this->children->enumerate ();
+  while( pn != NULL) 
+    { 
+      ((WorldEntity*)pn)->processDraw ();
+      pn = this->children->nextElement();
+    } 
+}
+
+/**
+   \brief sets the drawable state of this entity.
+   \param bDraw TRUE if draweable, FALSE otherwise
+*/
+void WorldEntity::setDrawable (bool bDraw)
+{
+  this->bDraw = bDraw;
+}
+
+
+/**
+   \brief the entity is drawn onto the screen with this function
+   
+   This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn.
+*/
+void WorldEntity::draw() 
+{}
+
+/**
+   \brief this function is called, when two entities collide
+   \param other: the world entity with whom it collides
+   \param ownhitflags: flags to the CollisionCluster subsections that registered an impact
+   \param otherhitflags: flags to the CollisionCluster subsections of the other entity that registered an impact
+
+   Implement behaviour like damage application or other miscellaneous collision stuff in this function
+*/
+void WorldEntity::collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {}
+
+/**
+   \brief this function is called, when the ship is hit by a waepon
+   \param weapon: the laser/rocket/shoot that hits.
+   \param loc: place where it is hit
+
+   calculate the damage depending
+*/
+void WorldEntity::hit(WorldEntity* weapon, Vector loc) {}
+
+/**
+   \brief this function is called when the entity is to be destroied
+   
+   This can be called, if eg. something realy bad happens :)
+*/
+void WorldEntity::destroy() {}
+
+
+/**
+   \brief this is called immediately after the Entity has been constructed and initialized
+   
+   Put any initialisation code that requires knowledge of location (placement if the Entity is free) and owner of the entity here.
+   DO NOT place such code in the constructor, those variables are set AFTER the entity is constucted.
+*/
+void WorldEntity::postSpawn ()
+{
+}
+
+/**
+   \brief this handles incoming command messages
+   \param cmd: a pointer to the incoming Command structure
+   
+   Put all code that handles Command messages here, this will mainly be called by the assigned CommandNode but can also be used
+   to send commands from one WorldEntity to another.
+*/
+void WorldEntity::command (Command* cmd)
+{
+}
+
+/**
+   \brief this is called by the local Camera to determine the point it should look at on the WorldEntity
+   \param locbuf: a pointer to the buffer to fill with a location to look at
+	
+   You may put any Location you want into locbuf, the Camera will determine via the corresponding Track how
+   to look at the location you return with this.
+*/
+/*PN
+void WorldEntity::getLookat (Location* locbuf)
+{
+}
+*/
+
+/**
+   \brief this method is called by the world if the WorldEntity leaves valid gamespace
+   
+   For free entities this means it left the Track boundaries. With bound entities it means its Location adresses a
+   place that is not in the world anymore. In both cases you might have to take extreme measures (a.k.a. call destroy).
+*/
+void WorldEntity::leftWorld ()
+{
+}
Index: /orxonox/trunk/src/world_entities/world_entity.h
===================================================================
--- /orxonox/trunk/src/world_entities/world_entity.h	(revision 3472)
+++ /orxonox/trunk/src/world_entities/world_entity.h	(revision 3472)
@@ -0,0 +1,54 @@
+/*! 
+    \file world_entity.h
+    \brief Definition of the basic WorldEntity
+*/
+
+#ifndef _WORLD_ENTITY_H
+#define _WORLD_ENTITY_H
+
+#include "stdincl.h"
+#include "p_node.h"
+
+class CollisionCluster;
+class OBJModel;
+
+//! Basic class from which all interactive stuff in the world is derived from
+class WorldEntity : public PNode
+{	
+  friend class World;
+
+ public:
+  WorldEntity (bool isFree = false);
+  virtual ~WorldEntity ();
+
+  OBJModel* model;                  //!< The model that should be loaded for this entity.
+  
+  void setCollision (CollisionCluster* newhull);
+  
+  bool isFree ();
+  
+  //void addAbility(Ability* ability);
+  //void removeAbility(Ability* ability);
+  
+  virtual void postSpawn ();
+  virtual void tick (float time);
+  virtual void hit (WorldEntity* weapon, Vector loc);
+  virtual void destroy ();
+  virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
+  virtual void command (Command* cmd);
+
+  void processDraw ();
+  virtual void draw ();
+  void setDrawable (bool bDraw);
+  
+  virtual void leftWorld ();
+  
+ private:
+  const bool bFree;	              //!< If the entity is free.
+  bool bCollide;                      //!< If it should be considered for the collisiontest.
+  bool bDraw;                         //!< If it should be visible.
+
+  CollisionCluster* collisioncluster; //!< The collision-Cluster of this entity.
+};
+
+#endif /* _WORLD_ENTITY_H */
Index: xonox/trunk/src/world_entity.cc
===================================================================
--- /orxonox/trunk/src/world_entity.cc	(revision 3471)
+++ 	(revision )
@@ -1,207 +1,0 @@
-
-
-/* 
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer: Christian Meyer
-*/
-
-#include <iostream>
-
-#include "world_entity.h"
-#include "stdincl.h"
-#include "collision.h"
-
-using namespace std;
-
-/**
-   \brief standard constructor
-   
-   Every derived contructor HAS to call the previous one supplying the isFree parameter. This is necessary to distunguish
-   between free and bound entities. The difference between them is simply the fact that the movement of a free entity is
-   not bound to the track of a world. Use this to implement projectile or effect classes that do not have to travel along the track.
-   To specify an entity to be free or bound set the default parameter in the declaration of the constructor.
-   Theoretically you should never have to call the constructor of an Entity directly, for it is called by the spawn() function of the World
-   class. So if you want to create a new entity at any time, call World::spawn(). It will handle everything that is necessary.
-*/
-WorldEntity::WorldEntity (bool isFree) : bFree(isFree)
-{
-  this->setClassName ("WorldEntity");
-  this->bDraw = true;
-  collisioncluster = NULL;
-}
-
-/**
-   \brief standard destructor
-*/
-WorldEntity::~WorldEntity ()
-{
-  if( collisioncluster != NULL) delete collisioncluster;
-}
-
-/**
-   \brief get the Location of the WorldEntity
-   \return a pointer to location
-*/
-/*PN
-Location* WorldEntity::getLocation ()
-{
-  return &loc;
-}
-*/
-
-/**
-   \brief get the Placement of the WorldEntity
-   \return a pointer to placement
-*/
- /*PN
-Placement* WorldEntity::getPlacement ()
-{
-  return &place;
-}
- */
-/**
-   \brief query whether the WorldEntity in question is free
-   \return true if the WorldEntity is free or false if it isn't
-*/
-bool WorldEntity::isFree ()
-{
-  return bFree;
-}
-
-/**
-   \brief set the WorldEntity's collision hull
-   \param newhull: a pointer to a completely assembled CollisionCluster
-   
-   Any previously assigned collision hull will be deleted on reassignment
-*/
-void WorldEntity::setCollision (CollisionCluster* newhull)
-{
-  if( newhull == NULL) return;
-  if( collisioncluster != NULL) delete collisioncluster;
-  collisioncluster = newhull;
-}
-
-
-/**
-   \brief this method is called every frame
-   \param time: the time in seconds that has passed since the last tick
-   
-   Handle all stuff that should update with time inside this method (movement, animation, etc.)
-*/
-void WorldEntity::tick(float time) 
-{
-}
-
-
-/** 
-    \brief process draw function 
-*/
-void WorldEntity::processDraw ()
-{
-  this->draw ();
-  PNode* pn = this->children->enumerate ();
-  while( pn != NULL) 
-    { 
-      ((WorldEntity*)pn)->processDraw ();
-      pn = this->children->nextElement();
-    } 
-}
-
-/**
-   \brief sets the drawable state of this entity.
-   \param bDraw TRUE if draweable, FALSE otherwise
-*/
-void WorldEntity::setDrawable (bool bDraw)
-{
-  this->bDraw = bDraw;
-}
-
-
-/**
-   \brief the entity is drawn onto the screen with this function
-   
-   This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn.
-*/
-void WorldEntity::draw() 
-{}
-
-/**
-   \brief this function is called, when two entities collide
-   \param other: the world entity with whom it collides
-   \param ownhitflags: flags to the CollisionCluster subsections that registered an impact
-   \param otherhitflags: flags to the CollisionCluster subsections of the other entity that registered an impact
-
-   Implement behaviour like damage application or other miscellaneous collision stuff in this function
-*/
-void WorldEntity::collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {}
-
-/**
-   \brief this function is called, when the ship is hit by a waepon
-   \param weapon: the laser/rocket/shoot that hits.
-   \param loc: place where it is hit
-
-   calculate the damage depending
-*/
-void WorldEntity::hit(WorldEntity* weapon, Vector loc) {}
-
-/**
-   \brief this function is called when the entity is to be destroied
-   
-   This can be called, if eg. something realy bad happens :)
-*/
-void WorldEntity::destroy() {}
-
-
-/**
-   \brief this is called immediately after the Entity has been constructed and initialized
-   
-   Put any initialisation code that requires knowledge of location (placement if the Entity is free) and owner of the entity here.
-   DO NOT place such code in the constructor, those variables are set AFTER the entity is constucted.
-*/
-void WorldEntity::postSpawn ()
-{
-}
-
-/**
-   \brief this handles incoming command messages
-   \param cmd: a pointer to the incoming Command structure
-   
-   Put all code that handles Command messages here, this will mainly be called by the assigned CommandNode but can also be used
-   to send commands from one WorldEntity to another.
-*/
-void WorldEntity::command (Command* cmd)
-{
-}
-
-/**
-   \brief this is called by the local Camera to determine the point it should look at on the WorldEntity
-   \param locbuf: a pointer to the buffer to fill with a location to look at
-	
-   You may put any Location you want into locbuf, the Camera will determine via the corresponding Track how
-   to look at the location you return with this.
-*/
-/*PN
-void WorldEntity::getLookat (Location* locbuf)
-{
-}
-*/
-
-/**
-   \brief this method is called by the world if the WorldEntity leaves valid gamespace
-   
-   For free entities this means it left the Track boundaries. With bound entities it means its Location adresses a
-   place that is not in the world anymore. In both cases you might have to take extreme measures (a.k.a. call destroy).
-*/
-void WorldEntity::leftWorld ()
-{
-}
Index: xonox/trunk/src/world_entity.h
===================================================================
--- /orxonox/trunk/src/world_entity.h	(revision 3471)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*! 
-    \file world_entity.h
-    \brief Definition of the basic WorldEntity
-*/
-
-#ifndef _WORLD_ENTITY_H
-#define _WORLD_ENTITY_H
-
-#include "stdincl.h"
-#include "p_node.h"
-
-class CollisionCluster;
-class OBJModel;
-
-//! Basic class from which all interactive stuff in the world is derived from
-class WorldEntity : public PNode
-{	
-  friend class World;
-
- public:
-  WorldEntity (bool isFree = false);
-  virtual ~WorldEntity ();
-
-  OBJModel* model;                  //!< The model that should be loaded for this entity.
-  
-  void setCollision (CollisionCluster* newhull);
-  
-  bool isFree ();
-  
-  //void addAbility(Ability* ability);
-  //void removeAbility(Ability* ability);
-  
-  virtual void postSpawn ();
-  virtual void tick (float time);
-  virtual void hit (WorldEntity* weapon, Vector loc);
-  virtual void destroy ();
-  virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
-  virtual void command (Command* cmd);
-
-  void processDraw ();
-  virtual void draw ();
-  void setDrawable (bool bDraw);
-  
-  virtual void leftWorld ();
-  
- private:
-  const bool bFree;	              //!< If the entity is free.
-  bool bCollide;                      //!< If it should be considered for the collisiontest.
-  bool bDraw;                         //!< If it should be visible.
-
-  CollisionCluster* collisioncluster; //!< The collision-Cluster of this entity.
-};
-
-#endif /* _WORLD_ENTITY_H */
