Index: orxonox/trunk/src/lib/graphics/importer/Makefile.am
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/Makefile.am	(revision 4578)
+++ orxonox/trunk/src/lib/graphics/importer/Makefile.am	(revision 4579)
@@ -9,6 +9,5 @@
                            md2Model.cc \
                            material.cc \
-                           texture.cc \
-                           array.cc
+                           texture.cc
 
 
Index: orxonox/trunk/src/lib/graphics/importer/Makefile.in
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/Makefile.in	(revision 4578)
+++ orxonox/trunk/src/lib/graphics/importer/Makefile.in	(revision 4579)
@@ -56,10 +56,10 @@
 am_libORXimporter_a_OBJECTS = model.$(OBJEXT) objModel.$(OBJEXT) \
 	primitive_model.$(OBJEXT) md2Model.$(OBJEXT) \
-	material.$(OBJEXT) texture.$(OBJEXT) array.$(OBJEXT)
+	material.$(OBJEXT) texture.$(OBJEXT)
 libORXimporter_a_OBJECTS = $(am_libORXimporter_a_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po ./$(DEPDIR)/material.Po \
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/material.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/md2Model.Po ./$(DEPDIR)/model.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/objModel.Po \
@@ -192,6 +192,5 @@
                            md2Model.cc \
                            material.cc \
-                           texture.cc \
-                           array.cc
+                           texture.cc
 
 noinst_HEADERS = abstract_model.h \
@@ -253,5 +252,4 @@
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md2Model.Po@am__quote@
Index: orxonox/trunk/src/lib/graphics/importer/array.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/array.cc	(revision 4578)
+++ 	(revision )
@@ -1,121 +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: Benjamin Grauer
-   co-programmer: ...
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
-
-#include "array.h"
-
-#include "debug.h"
-
-/**
-   \brief creates a new Array
-*/
-Array::Array ()
-{
-  this->initializeArray ();
-}
-
-/**
-   \brief deletes an Array.
-   It does this by first deleting all the array-entries, and then delete the array[] itself
-*/
-Array::~Array()
-{
-  PRINTF(4)("deleting array\n");
-  Entry* walker = this->firstEntry;
-  Entry* previous;
-  while (walker)
-    {
-      previous = walker;
-      walker = walker->next;
-      delete previous;
-    }
-  if (finalized)
-    delete []this->array;
-}
-
-/**
-   \brief initializes an Array
-   the Function does this by setting up a fistEntry, and setting the entryCount.
-*/
-void Array::initializeArray ()
-{
-  PRINTF(4)("crating new Array\n");
-  this->firstEntry = new Entry;
-  this->firstEntry->next =NULL;
-  this->currentEntry=firstEntry;
-  this->finalized = false;
-  this->entryCount = 0; //0 means one entry
-  return;
-}
-
-/**
-   \brief finalizes an array.
-   This Function creates the array, and makes it ready to be sent to the application.
-*/
-void Array::finalizeArray (void)
-{
-  PRINTF(4)("Finalizing array. Length: %i\n", entryCount);
-  //  if ((array = (GLfloat*)malloc( entryCount* sizeof(GLfloat))) == NULL)
-  if (!(this->array = new GLfloat [this->entryCount]))
-    PRINTF(1)("could not allocate %i data Blocks\n", this->entryCount);
-  Entry* walker = this->firstEntry;
-  for (int i=0; i<this->entryCount; i++)
-    {
-      this->array[i] = walker->value;
-      walker = walker->next;
-    }
-  this->finalized = true;
-
-  return;
-}
-
-/**
-   \brief adds a new Entry to the Array
-   \param entry Entry to add.
-*/
-void Array::addEntry (GLfloat entry)
-{
-  if (!this->finalized)
-    {
-      PRINTF(5)("adding new Entry to Array: %f\n", entry);
-
-      this->currentEntry->value = entry;
-      this->currentEntry->next = new Entry;
-      this->currentEntry = currentEntry->next;
-      this->currentEntry->next = NULL;
-      ++this->entryCount;
-    }
-  else
-    PRINTF(2)("adding failed, because list has been finalized\n");
-}
-
-/**
-   \brief Adds 3 entries at once (convenience)
-*/
-void Array::addEntry (GLfloat entry0, GLfloat entry1, GLfloat entry2)
-{
-  this->addEntry (entry0);
-  this->addEntry (entry1);
-  this->addEntry (entry2);
-}
-
-/**
-   \brief Simple debug info about the Array
-*/
-void Array::debug (void) const
-{
-  PRINT(0)("entryCount=%i, address=%p\n", this->entryCount, this->array);
-}
Index: orxonox/trunk/src/lib/graphics/importer/array.h
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/array.h	(revision 4578)
+++ orxonox/trunk/src/lib/graphics/importer/array.h	(revision 4579)
@@ -1,2 +1,17 @@
+/*
+   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: Benjamin Grauer
+   co-programmer: ...
+*/
+
 /*!
   \file array.h
@@ -8,39 +23,132 @@
 #ifndef _ARRAY_H
 #define _ARRAY_H
-#include "glincl.h"
+#include "debug.h"
 
 //! Array Class that handles dynamic-float arrays.
-class Array
+template<class T> class Array
 {
- public:
-  Array ();
-  ~Array();
+  public:
+    Array ();
+    ~Array();
 
-  void initializeArray ();
-  void finalizeArray (void);
-  void addEntry (GLfloat entry);
-  void addEntry(GLfloat entry0, GLfloat entry1, GLfloat entry2);
+    void finalizeArray (void);
+    void addEntry (T entry);
+    void addEntry(T entry0, T entry1, T entry2);
 
-  /** \returns The array */
-  inline const GLfloat* getArray () const { return this->array; };
-  /**   \returns The Count of entries in the Array*/
-  inline int getCount(void)const { return this->entryCount; };
-  void debug(void) const ;
- private:
-  //! One entry of the Array
-  struct Entry
-  {
-    GLfloat value;  //!< The value of this Entry.
-    Entry* next;    //!< Pointer to the Next entry.
-  };
+    /** \returns The array */
+    inline const T* getArray () const { return this->array; };
+    /**   \returns The Count of entries in the Array*/
+    inline unsigned int getCount(void)const { return this->entryCount; };
+    void debug(void) const ;
 
-  GLfloat* array;      //!< The array that will be produced when finalizing the Array.
-  int entryCount;      //!< The count of Entries in this Array.
-  bool finalized;      //!< If this variable is set to true, the Array can not be changed anymore. true if finalized, false else (initially).
-  Entry* firstEntry;   //!< Pointer to the first Entry of this Array
-  Entry* currentEntry; //!< Pointer to the current Entry of this Array. The one Entry we are working with.
+  private:
+    //! One entry of the Array
+    struct Entry
+    {
+      T            value;          //!< The value of this Entry.
+      Entry*       next;           //!< Pointer to the Next entry.
+    };
+
+    T*            array;           //!< The array that will be produced when finalizing the Array.
+    unsigned int  entryCount;      //!< The count of Entries in this Array.
+    bool          finalized;       //!< If this variable is set to true, the Array can not be changed anymore. true if finalized, false else (initially).
+    Entry*        firstEntry;      //!< Pointer to the first Entry of this Array
+    Entry*        currentEntry;    //!< Pointer to the current Entry of this Array. The one Entry we are working with.
+};
 
 
-};
+/**
+   \brief creates a new Array
+*/
+template<class T>
+Array<T>::Array ()
+{
+  PRINTF(4)("crating new Array\n");
+  this->firstEntry = new Entry;
+  this->firstEntry->next =NULL;
+  this->currentEntry=firstEntry;
+  this->finalized = false;
+  this->entryCount = 0; //0 means one entry
+}
 
+/**
+   \brief deletes an Array.
+   It does this by first deleting all the array-entries, and then delete the array[] itself
+*/
+template<class T>
+Array<T>::~Array()
+{
+  PRINTF(4)("deleting array\n");
+  Entry* walker = this->firstEntry;
+  Entry* previous;
+  while (walker)
+  {
+    previous = walker;
+    walker = walker->next;
+    delete previous;
+  }
+  if (finalized)
+    delete []this->array;
+}
+
+/**
+   \brief finalizes an array.
+   This Function creates the array, and makes it ready to be sent to the application.
+*/
+template<class T>
+void Array<T>::finalizeArray (void)
+{
+  PRINTF(4)("Finalizing array. Length: %i\n", entryCount);
+  //  if ((array = (GLfloat*)malloc( entryCount* sizeof(GLfloat))) == NULL)
+  if (!(this->array = new GLfloat [this->entryCount]))
+    PRINTF(1)("could not allocate %i data Blocks\n", this->entryCount);
+  Entry* walker = this->firstEntry;
+  for (int i=0; i<this->entryCount; i++)
+  {
+    this->array[i] = walker->value;
+    walker = walker->next;
+  }
+  this->finalized = true;
+}
+
+/**
+   \brief adds a new Entry to the Array
+   \param entry Entry to add.
+*/
+template<class T>
+void Array<T>::addEntry (T entry)
+{
+  if (!this->finalized)
+  {
+    PRINTF(5)("adding new Entry to Array: %f\n", entry);
+
+    this->currentEntry->value = entry;
+    this->currentEntry->next = new Entry;
+    this->currentEntry = currentEntry->next;
+    this->currentEntry->next = NULL;
+    ++this->entryCount;
+  }
+  else
+    PRINTF(2)("adding failed, because list has been finalized\n");
+}
+
+/**
+   \brief Adds 3 entries at once (convenience)
+*/
+template<class T>
+void Array<T>::addEntry (T entry0, T entry1, T entry2)
+{
+  this->addEntry(entry0);
+  this->addEntry(entry1);
+  this->addEntry(entry2);
+}
+
+/**
+   \brief Simple debug info about the Array
+*/
+template<class T>
+void Array<T>::debug (void) const
+{
+  PRINT(0)("entryCount=%i, address=%p\n", this->entryCount, this->array);
+}
 #endif
Index: orxonox/trunk/src/lib/graphics/importer/model.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/model.cc	(revision 4578)
+++ orxonox/trunk/src/lib/graphics/importer/model.cc	(revision 4579)
@@ -148,7 +148,7 @@
   this->scaleFactor = 1;
 
-  this->vertices = new Array();
-  this->vTexture = new Array();
-  this->normals = new Array();
+  this->vertices = new Array<GLfloat>();
+  this->vTexture = new Array<GLfloat>();
+  this->normals = new Array<GLfloat>();
 
   this->materialList = new tList<Material>;
@@ -201,5 +201,4 @@
   // this creates the display List.
   this->importToDisplayList();
-
 
   // deletes everything we allocated.
Index: orxonox/trunk/src/lib/graphics/importer/model.h
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/model.h	(revision 4578)
+++ orxonox/trunk/src/lib/graphics/importer/model.h	(revision 4579)
@@ -14,6 +14,6 @@
 
 // FORWARD DEFINITION //
-class Array;
 class Vector;
+template<class T> class Array;
 template<class T> class tList;
 
@@ -174,7 +174,7 @@
   unsigned int     normalCount;     //!< A modelwide Counter for the normals.
   unsigned int     texCoordCount;   //!< A modelwide Counter for the texCoord.
-  Array*           vertices;        //!< The Array that handles the Vertices.
-  Array*           normals;         //!< The Array that handles the Normals.
-  Array*           vTexture;        //!< The Array that handles the VertexTextureCoordinates.
+  Array<GLfloat>*  vertices;        //!< The Array that handles the Vertices.
+  Array<GLfloat>*  normals;         //!< The Array that handles the Normals.
+  Array<GLfloat>*  vTexture;        //!< The Array that handles the VertexTextureCoordinates.
 
   ModelGroup*      firstGroup;      //!< The first of all groups.
