Index: /branches/network/src/defs/class_id.h
===================================================================
--- /branches/network/src/defs/class_id.h	(revision 6513)
+++ /branches/network/src/defs/class_id.h	(revision 6514)
@@ -99,4 +99,5 @@
   CL_PLAYER                     =    0x00202000,
   CL_NPC                        =    0x00204000,
+  CL_IMAGE_ENTITY               =    0x00206000,
   CL_PROJECTILE                 =    0x00208000,
   CL_WEAPON                     =    0x00210000,
Index: /branches/network/src/world_entities/Makefile.am
===================================================================
--- /branches/network/src/world_entities/Makefile.am	(revision 6513)
+++ /branches/network/src/world_entities/Makefile.am	(revision 6514)
@@ -22,4 +22,5 @@
                   world_entities/character_attributes.cc \
                   world_entities/test_entity.cc \
+		  world_entities/image_entity.cc \
                   \
                   world_entities/weapons/weapon_manager.cc \
@@ -70,4 +71,5 @@
                  world_entities/character_attributes.h \
                  world_entities/test_entity.h \
+                 world_entities/image_entity.h \
                  \
                  world_entities/weapons/weapon_manager.h \
Index: /branches/network/src/world_entities/image_entity.cc
===================================================================
--- /branches/network/src/world_entities/image_entity.cc	(revision 6514)
+++ /branches/network/src/world_entities/image_entity.cc	(revision 6514)
@@ -0,0 +1,186 @@
+/*
+   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: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "image_entity.h"
+
+#include "load_param.h"
+#include "factory.h"
+
+#include "graphics_engine.h"
+#include "material.h"
+#include "glincl.h"
+#include "state.h"
+
+
+using namespace std;
+
+
+CREATE_FACTORY(ImageEntity, CL_IMAGE_ENTITY);
+
+
+/**
+ * standart constructor
+ */
+ImageEntity::ImageEntity (const TiXmlElement* root)
+{
+  this->init();
+  this->loadParams(root);
+}
+
+
+/**
+ * destroys a ImageEntity
+*/
+ImageEntity::~ImageEntity ()
+{
+  if (this->material)
+  delete this->material;
+
+  // delete what has to be deleted here
+
+  GraphicsEngine::showMouse(true);
+  GraphicsEngine::stealWMEvents(false);
+}
+
+
+/**
+ * initializes the ImageEntity
+ */
+void ImageEntity::init()
+{
+  this->setClassID(CL_IMAGE_ENTITY, "ImageEntity");
+  this->setName("ImageEntity");
+
+  this->setLayer(E2D_LAYER_TOP);
+  this->setRotationSpeed(5);
+  this->setSize(GraphicsEngine::getInstance()->getResolutionX()/10.0);
+
+  this->setBindNode(this);
+  this->material = new Material;
+  this->bBillboarding = false;
+}
+
+
+void ImageEntity::loadParams(const TiXmlElement* root)
+{
+  static_cast<PNode*>(this)->loadParams(root);
+
+  if( root == NULL)
+    this->setTexture("maps/error_texture.png");
+
+  LoadParam(root, "texture", this, ImageEntity, setTexture)
+      .describe("the texture-file to load onto the ImageEntity");
+
+  LoadParam(root, "size", this, ImageEntity, setSize)
+      .describe("the size of the ImageEntity in Pixels");
+
+  LoadParam(root, "rotation-speed", this, ImageEntity, setRotationSpeed)
+      .describe("the Speed with which the ImageEntity should rotate");
+
+  LoadParam(root, "billboarding", this, ImageEntity, toggleBillboard)
+      .describe("sets the ImageEntity to always look in the direction of the Player");
+}
+
+
+/**
+ * sets the size of the ImageEntity.
+ * @param size the size in pixels
+ */
+void ImageEntity::setSize(float size)
+{
+  this->setSize2D(size/2, size/2);
+}
+
+
+/**
+ * sets the material to load
+ * @param textureFile The texture-file to load onto the crosshair
+ */
+void ImageEntity::setTexture(const char* textureFile)
+{
+  this->material->setDiffuseMap(textureFile);
+}
+
+
+/** this turns on/off the billboarding of this WorldEntity
+ *
+ * This means that the image will always look in the direction of the Player
+ */
+void ImageEntity::toggleBillboard()
+{
+  this->bBillboarding = !this->bBillboarding;
+}
+
+
+/**
+ * ticks the ImageEntity
+ * @param dt the time to ticks
+ */
+void ImageEntity::tick(float dt)
+{
+  // let the crosshair rotate
+  //this->shiftDir2D(dt * rotationSpeed);
+
+
+  float z = 0.0f;
+  glReadPixels ((int)this->getAbsCoor2D().x,
+                 GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
+                 1,
+                 1,
+                 GL_DEPTH_COMPONENT,
+                 GL_FLOAT,
+                 &z);
+
+
+  GLdouble objX=.0, objY=.0, objZ=.0;
+  gluUnProject(this->getAbsCoor2D().x,
+               GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
+               .99,  // z
+               GraphicsEngine::modMat,
+               GraphicsEngine::projMat,
+               GraphicsEngine::viewPort,
+               &objX,
+               &objY,
+               &objZ );
+
+  //this->setAbsCoor(objX, objY, objZ);
+}
+
+
+/**
+ * draws the crosshair
+ */
+void ImageEntity::draw() const
+{
+  glPushMatrix();
+  glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
+
+  //glRotatef(this->getAbsDir2D(), 0,0,1);
+  this->material->select();
+  glBegin(GL_TRIANGLE_STRIP);
+  glTexCoord2f(0, 0);
+  glVertex2f(-this->getSizeX2D(), -this->getSizeY2D());
+  glTexCoord2f(1, 0);
+  glVertex2f(this->getSizeX2D(), -this->getSizeY2D());
+  glTexCoord2f(0, 1);
+  glVertex2f(-this->getSizeX2D(), this->getSizeY2D());
+  glTexCoord2f(1, 1);
+  glVertex2f(this->getSizeX2D(), this->getSizeY2D());
+  glEnd();
+  glPopMatrix();
+
+}
Index: /branches/network/src/world_entities/image_entity.h
===================================================================
--- /branches/network/src/world_entities/image_entity.h	(revision 6514)
+++ /branches/network/src/world_entities/image_entity.h	(revision 6514)
@@ -0,0 +1,47 @@
+/*!
+ * @file crosshair.h
+  *  Definition of ...
+
+*/
+
+#ifndef _IMAGE_ENTITY_H
+#define _IMAGE_ENTITY_H
+
+#include "p_node.h"
+#include "element_2d.h"
+#include "event_listener.h"
+
+#include "vector.h"
+
+
+// FORWARD DECLARATION
+class Model;
+class Material;
+class TiXmlElement;
+
+//! A class that enables the
+class ImageEntity : public PNode, public Element2D {
+
+ public:
+  ImageEntity(const TiXmlElement* root = NULL);
+  virtual ~ImageEntity();
+
+  void init();
+  void loadParams(const TiXmlElement* root);
+
+  void setSize(float size);
+  void setTexture(const char* textureFile);
+  /** @param rotationSpeed the speed at what the crosshair should rotate */
+  void setRotationSpeed(float rotationSpeed) { this->rotationSpeed = rotationSpeed; };
+  void toggleBillboard();
+
+  virtual void tick(float dt);
+  virtual void draw() const;
+
+ private:
+   Material*        material;             //!< a material for the Aim.
+   float            rotationSpeed;        //!< Speed of the Rotation.
+   bool             bBillboarding;        //!< true if billboarding is on
+};
+
+#endif /* _IMAGE_ENTITY_H */
Index: /branches/network/src/world_entities/skybox.cc
===================================================================
--- /branches/network/src/world_entities/skybox.cc	(revision 6513)
+++ /branches/network/src/world_entities/skybox.cc	(revision 6514)
@@ -210,8 +210,10 @@
 void SkyBox::draw()
 {
-  glPushAttrib(GL_LIGHTING_BIT);
+  glPushAttrib(GL_ENABLE_BIT);
+//   glPushAttrib(GL_LIGHTING_BIT);
   glDisable(GL_LIGHTING);
+
   WorldEntity::draw();
-//   glEnable(GL_LIGHTING);
+
   glPopAttrib();
 
