Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3605 in orxonox.OLD for orxonox/branches/levelloader/src/lib


Ignore:
Timestamp:
Mar 18, 2005, 11:52:15 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: merged trunk back to levelloader
merged with command:
svn merge -r 3499:HEAD trunk branches/levelloader

Conflicts in
C track_manager.h
C world_entities/player.cc
C world_entities/player.h
C world_entities/environment.h
C lib/coord/p_node.cc
C defs/debug.h
C track_manager.cc
C story_entities/campaign.h

solved in merge-favouring. It was quite easy because Chris only worked on the headers, and he didi it quite clean. Thats the spirit :)

Conflits in world.cc are a MESS: fix it

Location:
orxonox/branches/levelloader/src/lib
Files:
2 deleted
30 edited
2 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/lib/Makefile.in

    r3563 r3605  
    1 # Makefile.in generated by automake 1.8.2 from Makefile.am.
     1# Makefile.in generated by automake 1.8.5 from Makefile.am.
    22# @configure_input@
    33
     
    7878DEFS = @DEFS@
    7979DEPDIR = @DEPDIR@
     80DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
     81DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
    8082DOXYGEN = @DOXYGEN@
    8183DOXYGEN_FALSE = @DOXYGEN_FALSE@
     
    181183          esac; \
    182184        done; \
    183         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/Makefile'; \
     185        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/Makefile'; \
    184186        cd $(top_srcdir) && \
    185           $(AUTOMAKE) --gnu  src/lib/Makefile
     187          $(AUTOMAKE) --foreign  src/lib/Makefile
    186188.PRECIOUS: Makefile
    187189Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
     
    276278        tags=; \
    277279        here=`pwd`; \
    278         if (etags --etags-include --version) >/dev/null 2>&1; then \
     280        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
    279281          include_option=--etags-include; \
     282          empty_fix=.; \
    280283        else \
    281284          include_option=--include; \
     285          empty_fix=; \
    282286        fi; \
    283287        list='$(SUBDIRS)'; for subdir in $$list; do \
    284288          if test "$$subdir" = .; then :; else \
    285             test -f $$subdir/TAGS && \
     289            test ! -f $$subdir/TAGS || \
    286290              tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
    287291          fi; \
     
    293297          $(AWK) '    { files[$$0] = 1; } \
    294298               END { for (i in files) print i; }'`; \
    295         test -z "$(ETAGS_ARGS)$$tags$$unique" \
    296           || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    297              $$tags $$unique
     299        if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
     300          test -n "$$unique" || unique=$$empty_fix; \
     301          $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     302            $$tags $$unique; \
     303        fi
    298304ctags: CTAGS
    299305CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  • orxonox/branches/levelloader/src/lib/coord/helper_parent.cc

    r3499 r3605  
    3939   \todo this deconstructor is not jet implemented - do it
    4040*/
    41 HelperParent::~HelperParent () {}
     41HelperParent::~HelperParent ()
     42{
    4243
     44}
  • orxonox/branches/levelloader/src/lib/coord/helper_parent.h

    r3499 r3605  
    1717 public:
    1818  HelperParent ();
    19   ~HelperParent ();
    20 
     19  virtual ~HelperParent ();
    2120
    2221};
  • orxonox/branches/levelloader/src/lib/coord/null_parent.cc

    r3499 r3605  
    1616*/
    1717
     18#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_NULL_PARENT
    1819
    1920#include "null_parent.h"
     
    2627NullParent* NullParent::getInstance ()
    2728{
    28   if( singletonRef == NULL)
     29  if(!singletonRef)
    2930    singletonRef = new NullParent ();
    3031  return singletonRef;
     
    3637   \todo this constructor is not jet implemented - do it
    3738*/
    38 NullParent::NullParent ()
     39NullParent::NullParent () : PNode (new Vector(0,0,0), NULL)
    3940{
     41  PRINTF(4)("NullParent::NullParent() - making new NullParent, there can only be one..\n");
    4042  this->parent = this;
    41   this->mode = ALL;
     43  this->mode = PNODE_ALL;
     44  this->setName("NullParent");
    4245}
    4346
    4447
    45 NullParent::NullParent (Vector* absCoordinate)
     48NullParent::NullParent (Vector* absCoordinate) : PNode (new Vector(0,0,0), NULL)
    4649{
     50  singletonRef = this;
    4751  this->parent = this;
    48   this->mode = ALL;
     52  this->mode = PNODE_ALL;
    4953  this->absCoordinate = *absCoordinate;
     54  this->setName("NullParent");
    5055}
    5156
     
    5863NullParent::~NullParent ()
    5964{
    60   delete singletonRef;
     65  //delete singletonRef;
    6166  singletonRef = NULL;
    6267}
    63 
    64 
    65 
    6668
    6769/**
     
    7274   worry, normaly...
    7375*/
    74 void NullParent::update (float timeStamp)
     76void NullParent::update ()
    7577{
     78
     79  PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
    7680  this->absCoordinate = this->relCoordinate;
    7781  this->absDirection = parent->getAbsDir () * this->relDirection;
     
    8589      if( this->bRelDirChanged || this->bAbsDirChanged)
    8690        pn->parentDirChanged ();
    87       pn->update (timeStamp);
     91      pn->update ();
    8892      pn = this->children->nextElement ();
    8993    }
  • orxonox/branches/levelloader/src/lib/coord/null_parent.h

    r3499 r3605  
    1616 public:
    1717  static NullParent* getInstance ();
    18   ~NullParent ();
    19  
    20   static NullParent* singletonRef;
     18  virtual ~NullParent ();
    2119
    22   virtual void update (float timeStamp);
     20
     21  virtual void update ();
    2322
    2423 private:
    2524  NullParent ();
    2625  NullParent (Vector* absCoordinate);
     26  static NullParent* singletonRef;
    2727
    2828};
  • orxonox/branches/levelloader/src/lib/coord/p_node.cc

    r3557 r3605  
    1313   ### File Specific:
    1414   main-programmer: Patrick Boenzli
    15    co-programmer: ...
    16 
    17    \todo Null-Parent => center of the coord system - singleton
     15   co-programmer:
     16
    1817   \todo Smooth-Parent: delay, speed
    19    \todo destroy the stuff again, delete...
    20 */
    21 
     18*/
     19
     20#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_PNODE
    2221
    2322#include "p_node.h"
    2423
     24#include "null_parent.h"
     25#include "vector.h"
    2526
    2627using namespace std;
     
    3435PNode::PNode ()
    3536{
    36   this->children = new tList<PNode>();
    37   this->bRelCoorChanged = true;
    38   this->bAbsCoorChanged = false;
    39   this->bRelDirChanged = true;
    40   this->bAbsDirChanged = false;
    41   this->parent = NULL;
     37  init(NULL);
     38
     39  NullParent* np = NullParent::getInstance();
     40  np->addChild(this);
    4241  this->objectName = NULL;
    4342}
     
    5150PNode::PNode (Vector* absCoordinate, PNode* parent )
    5251{
     52  this->init(parent);
     53
    5354  this->absCoordinate = *absCoordinate;
    54   this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
    55  
    56   this->children = new tList<PNode>();
    57   this->bRelCoorChanged = true;
    58   this->bAbsCoorChanged = false;
    59   this->bRelDirChanged = true;
    60   this->bAbsDirChanged = false;
    61   this->parent = parent;
    62   this->objectName = NULL;
    63  
    64   parent->addChild (this);
    65 }
    66 
     55  if (parent != NULL)
     56    {
     57      this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
     58      parent->addChild (this);
     59    }
     60  else
     61    this->relCoordinate = Vector(0,0,0);
     62}
    6763
    6864/**
     
    8076  delete &this->absDirection;
    8177  */
    82   this->parent = NULL;
     78  //this->parent = NULL;
    8379  if( this->objectName) delete this->objectName;
    8480  /* there is currently a problem with cleaning up - fix*/
    85 }
    86 
     81
     82  PNode* pn = this->children->enumerate();
     83  while( pn != NULL)
     84    {
     85      delete pn;
     86      pn = this->children->nextElement();
     87
     88    }
     89   
     90  /* this deletes all children in the list */
     91  delete this->children;
     92
     93  delete []this->objectName;
     94}
     95
     96void PNode::init(PNode* parent)
     97{
     98  this->children = new tList<PNode>();
     99  this->bRelCoorChanged = true;
     100  this->bAbsCoorChanged = false;
     101  this->bRelDirChanged = true;
     102  this->bAbsDirChanged = false;
     103  this->parent = parent;
     104  this->objectName = NULL;
     105}
    87106
    88107/**
     
    91110   cleans up all pnodes
    92111*/
     112/*
    93113void PNode::destroy ()
    94114{
     
    99119      pn = this->children->nextElement();
    100120    }
     121  // this deletes all children in the list
    101122  this->children->destroy ();
    102 }
    103 
     123
     124  static_cast<BaseObject*>(this)->destroy();
     125}
     126*/
    104127
    105128/**
     
    262285{}
    263286
    264 
    265 
    266287/**
    267288   \brief adds a child and makes this node to a parent
     
    283304   use this to add a child to this node.
    284305*/
    285 void PNode::addChild (PNode* pNode, parentingMode mode)
    286 {
    287   pNode->mode = mode;
     306void PNode::addChild (PNode* pNode, int parentingMode)
     307{
     308  if( pNode->parent != NULL )
     309    {
     310      PRINTF(2)("PNode::addChild() - reparenting node: removing it and adding it again\n");
     311      pNode->parent->children->remove(pNode);
     312    }
     313  pNode->mode = parentingMode;
    288314  pNode->parent = this;
    289   this->children->add (pNode);
     315  this->children->add(pNode);
    290316}
    291317
     
    294320   \brief removes a child from the node
    295321   \param pNode the child to remove from this pNode.
     322
     323   Children from pNode will not be lost, they are referenced to NullPointer
    296324*/
    297325void PNode::removeChild (PNode* pNode)
    298326{
     327  pNode->remove();
    299328  this->children->remove (pNode);
     329  pNode->parent = NULL;
     330}
     331
     332
     333/**
     334   \brief remove this pnode from the tree and adds all following to NullParent
     335
     336   this can be the case, if an entity in the world is been destroyed.
     337*/
     338void PNode::remove()
     339{
     340  NullParent* np = NullParent::getInstance();
     341  PNode* pn = this->children->enumerate();
     342  while( pn != NULL)
     343    {
     344      this->children->remove(pn);
     345      np->addChild(pn, pn->getMode());
     346      pn = this->children->nextElement();
     347    }
    300348}
    301349
     
    307355void PNode::setParent (PNode* parent)
    308356{
    309   this->parent = parent;
    310 }
     357  parent->addChild(this);
     358}
     359
    311360
    312361/**
     
    314363   \param mode the mode of the bind-type.
    315364*/
    316 void PNode::setMode (parentingMode mode)
    317 {
    318   this->mode = mode;
     365void PNode::setMode (int parentingMode)
     366{
     367  this->mode = parentingMode;
     368}
     369
     370
     371/**
     372   \brief gets the mode of this parent manualy
     373   \return the mode of the bind-type.
     374*/
     375int PNode::getMode()
     376{
     377  return this->mode;
    319378}
    320379
     
    351410   worry, normaly...
    352411*/
    353 void PNode::update (float timeStamp)
    354 {
    355   printf ("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
    356 
    357       if( this->mode == MOVEMENT || this->mode == ALL)
     412void PNode::update ()
     413{
     414  PRINTF(2)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
     415  // printf("%s", this->objectName);
     416  if(this->mode & PNODE_MOVEMENT )
     417    {
     418      if( this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
    358419        {
    359           if( this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     420          /* if you have set the absolute coordinates this overrides all other changes */
     421          this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
     422        }
     423      else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     424        {
     425          /*this is bad style... must be deleted later - just for testing*/
     426          if( this->parent == NULL)
    360427            {
    361               printf("PNode::update () - this->bAbsCoorChanged = true\n");
    362               /* if you have set the absolute coordinates this overrides all other changes */
    363               this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
     428              this->absCoordinate = this->relCoordinate;
    364429            }
    365           else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
    366             {
    367               /*this is bad style... must be deleted later - just for testing*/
    368               if( this->parent == NULL)
    369                 {
    370                 this->absCoordinate = this->relCoordinate;
    371                 }
    372               else
    373                 this->absCoordinate = parent->getAbsCoor () + this->relCoordinate;            /* update the current absCoordinate */
    374             }
     430          else
     431            this->absCoordinate = parent->getAbsCoor() + this->relCoordinate;         /* update the current absCoordinate */
    375432        }
    376      
    377       if( this->mode == ROTATION && this->mode == ALL)
     433    }
     434 
     435  if( this->mode & PNODE_LOCAL_ROTATE)
     436    {
     437      if( this->bAbsDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
    378438        {
    379           if( this->bAbsDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
    380             {
    381               /* if you have set the absolute coordinates this overrides all other changes */
    382               this->relDirection = this->absDirection - parent->getAbsDir ();
    383             }
    384           else if( this->bRelDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
    385             {
    386               /* update the current absDirection - remember * means rotation around sth.*/
    387               this->absDirection = parent->getAbsDir () * this->relDirection;
    388             }
    389         }   
    390       // }
     439          /* if you have set the absolute coordinates this overrides all other changes */
     440          this->relDirection = this->absDirection - parent->getAbsDir();
     441        }
     442      else if( this->bRelDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     443        {
     444          /* update the current absDirection - remember * means rotation around sth.*/
     445          this->absDirection = parent->getAbsDir() * this->relDirection;
     446        }
     447    }
     448 
     449  if( this->mode & PNODE_ROTATE_MOVEMENT)
     450    {
     451      if( this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     452        {
     453          /* if you have set the absolute coordinates this overrides all other changes */
     454          this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
     455        }
     456      else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     457        {
     458          /*this is bad style... must be deleted later - just for testing*/
     459          if( this->parent == NULL)
     460            this->absCoordinate = this->relCoordinate;
     461          else
     462            this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(this->relCoordinate);              /* update the current absCoordinate */
     463        }
     464    }
     465 
     466 
    391467  PNode* pn = this->children->enumerate();
    392468  while( pn != NULL)
     
    397473      if( this->bRelDirChanged || this->bAbsDirChanged)
    398474        pn->parentDirChanged ();
    399       pn->update(timeStamp);
     475      pn->update();
    400476      pn = this->children->nextElement();
    401477    }
     
    415491void PNode::processTick (float dt)
    416492{
    417   this->tick (dt);
     493  //this->tick (dt);
    418494  PNode* pn = this->children->enumerate();
    419495  while( pn != NULL)
     
    424500}
    425501
    426 /**
    427    \param dt time to tick
    428 */
    429 void PNode::tick (float dt)
    430 {}
    431502
    432503/**
     
    435506void PNode::debug()
    436507{
    437   printf("PNode::debug() - absCoord: (%f, %f, %f)\n",
     508  PRINTF(2)("PNode::debug() - absCoord: (%f, %f, %f)\n",
    438509         this->absCoordinate.x,
    439510         this->absCoordinate.y,
     
    451522void PNode::setName (const char* newName)
    452523{
    453         int l = strlen( newName);
    454        
    455         if( this->objectName != NULL) delete this->objectName;
    456         this->objectName = NULL;
    457        
    458         if( newName != NULL)
    459         {
    460                 this->objectName = new char[l+1];
    461                
    462                 for( int i = 0; i < l+1; i++)
    463                         this->objectName[i] = newName[i];
    464         }
     524  if (this->objectName)
     525    delete []this->objectName;
     526  this->objectName = new char[strlen(newName)+1];
     527  strcpy(this->objectName,newName);
    465528}
    466529
     
    473536  return this->objectName;
    474537}
     538
  • orxonox/branches/levelloader/src/lib/coord/p_node.h

    r3557 r3605  
    2222#define _P_NODE_H
    2323
    24 #include "stdincl.h"
     24#include "base_object.h"
    2525
     26// FORWARD DEFINITION \\
    2627class PNode; /* forward decleration, so that parentEntry has access to PNode */
     28class Quaternion;
     29class Vector;
    2730
    2831//! enumeration for the different translation-binding-types
    29 typedef enum parentingMode {MOVEMENT = 0, ROTATION, ALL};
     32//typedef enum parentingMode {PNODE_LOCAL_ROTATE, PNODE_ROTATE_MOVEMENT, PNODE_ALL, PNODE_MOVEMENT, PNODE_ROTATE_AND_MOVE};
     33// linkage modes
     34#define PNODE_LOCAL_ROTATE       1    //!< Rotates all the children around their centers.
     35#define PNODE_ROTATE_MOVEMENT    2    //!< Moves all the children around the center of their parent, without the rotation around their own centers.
     36#define PNODE_MOVEMENT           4    //!< Moves all children along with the parent.
     37// special linkage modes
     38#define PNODE_ALL                3    //!< Moves all children around the center of their parent, and also rotates their centers
     39#define PNODE_ROTATE_AND_MOVE    5    //!< Rotates all children around their axis, and moves them as the Parent Moves, but does not rotate around the center of their parent.
     40
    3041//! The default mode of the translation-binding.
    31 #define DEFAULT_MODE ALL
     42#define DEFAULT_MODE PNODE_ALL
    3243
    3344//! Patent Node is a Engine to calculate the position of an Object in respect to the position of its parent.
     
    3950  virtual ~PNode ();
    4051
    41   void destroy ();
    42 
    4352  PNode* parent;            //!< a pointer to the parent node
    4453  tList<PNode>* children;   //!< list of the children
    4554
    46   parentingMode mode;       //!< the mode of the binding
     55
    4756
    4857  Vector getRelCoor ();
     
    6271
    6372  void addChild (PNode* pNode);
    64   void addChild (PNode* pNode, parentingMode mode);
     73  void addChild (PNode* pNode, int parentingMode);
    6574  void removeChild (PNode* pNode);
     75  void remove();
     76
     77
    6678  void setParent (PNode* parent);
    6779  void parentCoorChanged ();
    6880  void parentDirChanged ();
    69   void setMode (parentingMode mode);
     81  void setMode (int parentingMode);
     82  int getMode();
    7083
    71   virtual void update (float timeStamp);
     84  virtual void update ();
    7285  void processTick (float dt);
    73   virtual void tick (float dt);
    7486
    7587  void setName (const char* newName);
     
    7991  void debug ();
    8092
     93 private:
     94  void init(PNode* parent);
     95
     96 protected:
    8197  float timeStamp;         //!< this the timeStamp of when the abs{Coordinat, Direction} has been calculated
    8298  char* objectName;        //!< The name of the Object
     
    91107  Quaternion absDirection; //!< absolute direvtion in the world ( from (0,0,1) )
    92108
     109  int mode;                //!< the mode of the binding
     110
    93111};
    94112
    95113#endif /* _P_NODE_H */
     114 
  • orxonox/branches/levelloader/src/lib/graphics/Makefile.in

    r3563 r3605  
    1 # Makefile.in generated by automake 1.8.2 from Makefile.am.
     1# Makefile.in generated by automake 1.8.5 from Makefile.am.
    22# @configure_input@
    33
     
    7878DEFS = @DEFS@
    7979DEPDIR = @DEPDIR@
     80DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
     81DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
    8082DOXYGEN = @DOXYGEN@
    8183DOXYGEN_FALSE = @DOXYGEN_FALSE@
     
    175177          esac; \
    176178        done; \
    177         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/graphics/Makefile'; \
     179        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/graphics/Makefile'; \
    178180        cd $(top_srcdir) && \
    179           $(AUTOMAKE) --gnu  src/lib/graphics/Makefile
     181          $(AUTOMAKE) --foreign  src/lib/graphics/Makefile
    180182.PRECIOUS: Makefile
    181183Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
     
    270272        tags=; \
    271273        here=`pwd`; \
    272         if (etags --etags-include --version) >/dev/null 2>&1; then \
     274        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
    273275          include_option=--etags-include; \
     276          empty_fix=.; \
    274277        else \
    275278          include_option=--include; \
     279          empty_fix=; \
    276280        fi; \
    277281        list='$(SUBDIRS)'; for subdir in $$list; do \
    278282          if test "$$subdir" = .; then :; else \
    279             test -f $$subdir/TAGS && \
     283            test ! -f $$subdir/TAGS || \
    280284              tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
    281285          fi; \
     
    287291          $(AWK) '    { files[$$0] = 1; } \
    288292               END { for (i in files) print i; }'`; \
    289         test -z "$(ETAGS_ARGS)$$tags$$unique" \
    290           || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    291              $$tags $$unique
     293        if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
     294          test -n "$$unique" || unique=$$empty_fix; \
     295          $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     296            $$tags $$unique; \
     297        fi
    292298ctags: CTAGS
    293299CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  • orxonox/branches/levelloader/src/lib/graphics/font/fontset.cc

    r3499 r3605  
    4545#include <stdarg.h>
    4646
    47 #include "../importer/texture.h"
     47#include "texture.h"
     48#include <string.h>
    4849
    4950/**
  • orxonox/branches/levelloader/src/lib/graphics/importer/Makefile.in

    r3563 r3605  
    1 # Makefile.in generated by automake 1.8.2 from Makefile.am.
     1# Makefile.in generated by automake 1.8.5 from Makefile.am.
    22# @configure_input@
    33
     
    4242subdir = src/lib/graphics/importer
    4343DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
    44         $(srcdir)/Makefile.in TODO
     44        $(srcdir)/Makefile.in
    4545ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    4646am__aclocal_m4_deps = $(top_srcdir)/configure.ac
     
    5050CONFIG_HEADER = $(top_builddir)/config.h
    5151CONFIG_CLEAN_FILES =
    52 am__installdirs = $(DESTDIR)$(bindir)
     52am__installdirs = "$(DESTDIR)$(bindir)"
    5353binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    5454PROGRAMS = $(bin_PROGRAMS)
     
    9898DEFS = @DEFS@
    9999DEPDIR = @DEPDIR@
     100DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
     101DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
    100102DOXYGEN = @DOXYGEN@
    101103DOXYGEN_FALSE = @DOXYGEN_FALSE@
     
    215217          esac; \
    216218        done; \
    217         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/graphics/importer/Makefile'; \
     219        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/graphics/importer/Makefile'; \
    218220        cd $(top_srcdir) && \
    219           $(AUTOMAKE) --gnu  src/lib/graphics/importer/Makefile
     221          $(AUTOMAKE) --foreign  src/lib/graphics/importer/Makefile
    220222.PRECIOUS: Makefile
    221223Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
     
    237239install-binPROGRAMS: $(bin_PROGRAMS)
    238240        @$(NORMAL_INSTALL)
    239         $(mkdir_p) $(DESTDIR)$(bindir)
     241        test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
    240242        @list='$(bin_PROGRAMS)'; for p in $$list; do \
    241243          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
     
    243245          ; then \
    244246            f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
    245            echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
    246            $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
     247           echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
     248           $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
    247249          else :; fi; \
    248250        done
     
    252254        @list='$(bin_PROGRAMS)'; for p in $$list; do \
    253255          f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
    254           echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
    255           rm -f $(DESTDIR)$(bindir)/$$f; \
     256          echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
     257          rm -f "$(DESTDIR)$(bindir)/$$f"; \
    256258        done
    257259
     
    330332          $(AWK) '    { files[$$0] = 1; } \
    331333               END { for (i in files) print i; }'`; \
    332         test -z "$(ETAGS_ARGS)$$tags$$unique" \
    333           || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    334              $$tags $$unique
     334        if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
     335          test -n "$$unique" || unique=$$empty_fix; \
     336          $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     337            $$tags $$unique; \
     338        fi
    335339ctags: CTAGS
    336340CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
     
    387391all-am: Makefile $(PROGRAMS) $(HEADERS)
    388392installdirs:
    389         $(mkdir_p) $(DESTDIR)$(bindir)
     393        for dir in "$(DESTDIR)$(bindir)"; do \
     394          test -z "$$dir" || $(mkdir_p) "$$dir"; \
     395        done
    390396install: install-am
    391397install-exec: install-exec-am
  • orxonox/branches/levelloader/src/lib/graphics/importer/array.cc

    r3499 r3605  
    1313   co-programmer: ...
    1414*/
     15
     16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
    1517
    1618#include "array.h"
     
    3032Array::~Array()
    3133{
    32   PRINTF(2)("deleting array\n");
     34  PRINTF(4)("deleting array\n");
    3335  Entry* walker = this->firstEntry;
    3436  Entry* previous;
     
    4951void Array::initializeArray ()
    5052{
    51   PRINTF(2)("crating new Array\n");
     53  PRINTF(4)("crating new Array\n");
    5254  this->firstEntry = new Entry;
    5355  this->firstEntry->next =NULL;
     
    6466void Array::finalizeArray (void)
    6567{
    66   PRINTF(3)("Finalizing array. Length: %i\n", entryCount); 
     68  PRINTF(4)("Finalizing array. Length: %i\n", entryCount); 
    6769  //  if ((array = (GLfloat*)malloc( entryCount* sizeof(GLfloat))) == NULL)
    6870  if (!(this->array = new GLfloat [this->entryCount]))
     
    8789  if (!this->finalized)
    8890    {
    89       PRINTF(3)("adding new Entry to Array: %f\n", entry);
     91      PRINTF(5)("adding new Entry to Array: %f\n", entry);
    9092     
    9193      this->currentEntry->value = entry;
     
    9698    }
    9799  else
    98     PRINTF(1)("adding failed, because list has been finalized\n");
     100    PRINTF(2)("adding failed, because list has been finalized\n");
    99101}
    100102
     
    131133void Array::debug ()
    132134{
    133   PRINTF(0)("entryCount=%i, address=%p\n", this->entryCount, this->array);
     135  PRINT(0)("entryCount=%i, address=%p\n", this->entryCount, this->array);
    134136}
  • orxonox/branches/levelloader/src/lib/graphics/importer/array.h

    r3499 r3605  
    88#ifndef _ARRAY_H
    99#define _ARRAY_H
    10 
    11 extern int verbose; //!< will be obsolete soon
    1210
    1311#include "stdincl.h"
  • orxonox/branches/levelloader/src/lib/graphics/importer/material.cc

    r3499 r3605  
    1515*/
    1616
     17#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
     18
    1719#include "material.h"
    1820
    1921#include "texture.h"
     22#include "debug.h"
    2023#include <stdlib.h>
    2124#include <string.h>
     
    5154Material::~Material()
    5255{
    53   PRINTF(2)("delete Material %s.\n", this->name);
     56  PRINTF(4)("delete Material %s.\n", this->name);
    5457  if (this->name)
    5558    delete []this->name;
     
    6770Material* Material::addMaterial(char* mtlName)
    6871{
    69   PRINTF(2)("adding Material %s.\n", mtlName);
     72  PRINTF(4)("adding Material %s.\n", mtlName);
    7073   Material* tmpMat = this;
    7174  while (tmpMat->nextMat != NULL)
     
    8386void Material::init(void)
    8487{
    85   PRINTF(2)("initializing new Material.\n");
     88  PRINTF(4)("initializing new Material.\n");
    8689  this->nextMat = NULL;
    8790  this->name ="";
     
    112115Material* Material::search(char* mtlName)
    113116{
    114   PRINTF(2)("Searching for material %s", mtlName);
     117  PRINTF(5)("Searching for material %s", mtlName);
    115118  Material* searcher = this;
    116119  while (searcher != NULL)
    117120    {
    118       PRINT(2)(".");
     121      PRINT(5)(".");
    119122      if (!strcmp (searcher->getName(), mtlName))
    120123        {
    121           PRINT(2)("found.\n");
     124          PRINT(5)("found.\n");
    122125          return searcher;
    123126        }
    124127      searcher = searcher->nextMat;
    125128    }
    126   PRINT(2)("not found\n");
     129  PRINT(2)("material %s not found\n", mtlName);
    127130  return NULL;
    128131}
     
    153156
    154157  if (this->diffuseTextureSet)
    155     glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture());
     158    {
     159      glEnable(GL_TEXTURE_2D);
     160      glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture());
     161    }
    156162  else
    157     glBindTexture(GL_TEXTURE_2D, 0);
    158  
     163    {
     164      glDisable(GL_TEXTURE_2D);
     165      glBindTexture(GL_TEXTURE_2D, 0);
     166    }
    159167}
    160168
     
    166174void Material::setName (char* mtlName)
    167175{
    168   PRINTF(3)("setting Material Name to %s.\n", this->name);
     176  PRINTF(4)("setting Material Name to %s.\n", this->name);
    169177  this->name = new char [strlen(mtlName)+1];
    170178  strcpy(this->name, mtlName);
     
    185193void Material::setIllum (int illum)
    186194{
    187   PRINTF(3)("setting illumModel of Material %s to %i\n", this->name, illum);
     195  PRINTF(4)("setting illumModel of Material %s to %i\n", this->name, illum);
    188196  this->illumModel = illum;
    189   //  PRINTF(3)("setting illumModel to: %i\n", illumModel);
    190197}
    191198/**
     
    205212void Material::setDiffuse (float r, float g, float b)
    206213{
    207   PRINTF(3)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
     214  PRINTF(4)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
    208215  this->diffuse[0] = r;
    209216  this->diffuse[1] = g;
     
    231238void Material::setAmbient (float r, float g, float b)
    232239{
    233   PRINTF(3)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
     240  PRINTF(4)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
    234241  this->ambient[0] = r;
    235242  this->ambient[1] = g;
     
    256263void Material::setSpecular (float r, float g, float b)
    257264{
    258   PRINTF(3)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
     265  PRINTF(4)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
    259266  this->specular[0] = r;
    260267  this->specular[1] = g;
     
    296303void Material::setTransparency (float trans)
    297304{
    298   PRINTF(3)("setting Transparency of Material %s to %f.\n", this->name, trans);
     305  PRINTF(4)("setting Transparency of Material %s to %f.\n", this->name, trans);
    299306  this->transparency = trans;
    300307}
     
    325332void Material::setDiffuseMap(char* dMap)
    326333{
    327   PRINTF(3)("setting Diffuse Map %s\n", dMap);
     334  PRINTF(4)("setting Diffuse Map %s\n", dMap);
    328335  diffuseTexture = new Texture();
    329336  this->diffuseTextureSet = diffuseTexture->loadImage(dMap);
  • orxonox/branches/levelloader/src/lib/graphics/importer/material.h

    r3499 r3605  
    99#define _MATERIAL_H
    1010
    11 
    12 
    13 extern int verbose; //!< will be obsolete soon.
    1411
    1512#if HAVE_CONFIG_H
  • orxonox/branches/levelloader/src/lib/graphics/importer/model.cc

    r3499 r3605  
    1313   co-programmer: ...
    1414*/
     15
     16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
    1517
    1618#include "model.h"
     
    8082Model::~Model(void)
    8183{
    82   PRINTF(3)("Deleting Model ");
     84  PRINTF(4)("Deleting Model ");
    8385  if (this->name)
    8486    {
    85       PRINT(3)("%s\n", this->name);
     87      PRINT(4)("%s\n", this->name);
    8688      delete []this->name;
    8789    }
    8890  else
    89       PRINT(3)("\n");
    90 
    91   PRINTF(3)("Deleting display Lists.\n");
     91      PRINT(4)("\n");
     92
     93  PRINTF(4)("Deleting display Lists.\n");
    9294  Group* walker = this->firstGroup;
    9395  while (walker != NULL)
     
    99101    }
    100102
    101   PRINTF(3)("Deleting Materials.\n");
     103  PRINTF(4)("Deleting Materials.\n");
    102104  if (this->material)
    103105    delete this->material;
     
    122124void Model::draw (void) const
    123125{
    124   PRINTF(2)("drawing the 3D-Models\n");
     126  PRINTF(4)("drawing the 3D-Models\n");
    125127  Group* walker = this->firstGroup;
    126128  while (walker != NULL)
    127129    {
    128       PRINTF(3)("Drawing model %s\n", walker->name);
     130      PRINTF(5)("Drawing model %s\n", walker->name);
    129131      glCallList (walker->listNumber);
    130132      walker = walker->next;
     
    142144  if (groupNumber >= this->groupCount)
    143145    {
    144       PRINTF(1)("You requested model number %i, but this File only contains of %i Models.\n", groupNumber-1, this->groupCount);
     146      PRINTF(2)("You requested model number %i, but this File only contains of %i Models.\n", groupNumber-1, this->groupCount);
    145147      return;
    146148    }
    147   PRINTF(2)("drawing the requested 3D-Models if found.\n");
     149  PRINTF(4)("drawing the requested 3D-Models if found.\n");
    148150  Group* walker = this->firstGroup;
    149151  int counter = 0;
     
    152154      if (counter == groupNumber)
    153155        {
    154           PRINTF(2)("Drawing model number %i named %s\n", counter, walker->name);
     156          PRINTF(4)("Drawing model number %i named %s\n", counter, walker->name);
    155157          glCallList (walker->listNumber);
    156158          return;
     
    159161      walker = walker->next;
    160162    }
    161   PRINTF(1)("Model number %i in %s not Found.\n", groupNumber, this->name);
     163  PRINTF(2)("Model number %i in %s not Found.\n", groupNumber, this->name);
    162164  return;
    163165
     
    172174void Model::draw (char* groupName) const
    173175{
    174   PRINTF(2)("drawing the requested 3D-Models if found.\n");
     176  PRINTF(4)("drawing the requested 3D-Models if found.\n");
    175177  Group* walker = this->firstGroup;
    176178  while (walker != NULL)
     
    178180      if (!strcmp(walker->name, groupName))
    179181        {
    180           PRINTF(2)("Drawing model %s\n", walker->name);
     182          PRINTF(4)("Drawing model %s\n", walker->name);
    181183          glCallList (walker->listNumber);
    182184          return;
     
    184186      walker = walker->next;
    185187    }
    186   PRINTF(1)("Model Named %s in %s not Found.\n", groupName, this->name);
     188  PRINTF(2)("Model Named %s in %s not Found.\n", groupName, this->name);
    187189  return;
    188190}
     
    204206bool Model::initialize (void)
    205207{
    206   PRINTF(2)("new 3D-Model is being created\n");
     208  PRINTF(4)("new 3D-Model is being created\n");
    207209
    208210  this->name = NULL;
     
    243245bool Model::initGroup(Group* group)
    244246{
    245   PRINTF(3)("Adding new Group\n");
     247  PRINTF(4)("Adding new Group\n");
    246248  group->name = "";
    247249  group->faceMode = -1;
     
    277279bool Model::cleanup(void)
    278280{
    279   PRINTF(3)("cleaning up the 3D-Model to save Memory.\n");
     281  PRINTF(4)("cleaning up the 3D-Model to save Memory.\n");
    280282
    281283  if (this->vertices)
     
    296298bool Model::cleanupGroup (Group* group)
    297299{
    298   PRINTF(3)("Cleaning up group\n");
     300  PRINTF(5)("Cleaning up group\n");
    299301  if (group->firstFace != NULL)
    300302    {
     
    314316bool Model::cleanupFace (Face* face)
    315317{
    316   PRINTF(3)("Cleaning up Face\n");
     318  PRINTF(5)("Cleaning up Face\n");
    317319
    318320  if (face->materialString != NULL)
     
    355357bool Model::addGroup (char* groupString)
    356358{
    357   PRINTF(3)("Read Group: %s.\n", groupString);
     359  PRINTF(5)("Read Group: %s.\n", groupString);
    358360  if (this->groupCount != 0 && this->currentGroup->faceCount>0)
    359361    {
     
    384386  float subbuffer3;
    385387  sscanf (vertexString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3);
    386   PRINTF(3)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);
     388  PRINTF(5)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);
    387389  this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor);
    388390  return true;
     
    398400bool Model::addVertex(const float x, const float y, const float z)
    399401{
    400   PRINTF(4)("reading in a vertex: %f %f %f\n", x, y, z);
     402  PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z);
    401403  this->vertices->addEntry(x*scaleFactor, y*scaleFactor, z*scaleFactor);
    402404  return true;
     
    513515  float subbuffer3;
    514516  sscanf (normalString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3);
    515   PRINTF(3)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);
     517  PRINTF(5)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);
    516518  this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3);
    517519  return true;
     
    544546  float subbuffer2;
    545547  sscanf (vTextureString, "%f %f", &subbuffer1, &subbuffer2);
    546   PRINTF(3)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2);
     548  PRINTF(5)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2);
    547549  this->vTexture->addEntry(subbuffer1);
    548550  this->vTexture->addEntry(subbuffer2);
     
    610612      if ((this->currentGroup->listNumber = glGenLists(1)) == 0)
    611613        {
    612           PRINTF(1)("list could not be created for this Model\n");
     614          PRINTF(2)("glList could not be created for this Model\n");
    613615          return false;
    614616        }
     
    628630                {
    629631                  tmpMat->select();
    630                   PRINTF(2)("using material %s for coming Faces.\n", tmpFace->materialString);
     632                  PRINTF(5)("using material %s for coming Faces.\n", tmpFace->materialString);
    631633                }
    632634              else
    633                 PRINTF(1)("material %s not found.\n", tmpFace->materialString);
     635                PRINTF(2)("material %s not found.\n", tmpFace->materialString);
    634636
    635637
     
    646648             
    647649              this->currentGroup->faceMode = 3;
    648               PRINTF(3)("found triag.\n");
     650              PRINTF(5)("found triag.\n");
    649651            }
    650652         
     
    658660                }
    659661              this->currentGroup->faceMode = 4;
    660               PRINTF(3)("found quad.\n");
     662              PRINTF(5)("found quad.\n");
    661663            }
    662664         
     
    666668                glEnd();
    667669              glBegin(GL_POLYGON);
    668               PRINTF(3)("Polygon with %i faces found.", tmpFace->vertexCount);
     670              PRINTF(5)("Polygon with %i faces found.", tmpFace->vertexCount);
    669671              this->currentGroup->faceMode = tmpFace->vertexCount;
    670672            }
     
    698700bool Model::addGLElement (FaceElement* elem)
    699701{
    700   PRINTF(3)("importing grafical Element to openGL.\n");
     702  PRINTF(5)("importing grafical Element to openGL.\n");
    701703
    702704  if (elem->texCoordNumber != -1)
     
    721723{
    722724 
    723   PRINTF(2)("Normals are being calculated.\n");
     725  PRINTF(4)("Normals are being calculated.\n");
    724726
    725727  Vector* normArray = new Vector [vertices->getCount()/3];
     
    778780    {
    779781      normArray[i].normalize();
    780       PRINTF(3)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);
     782      PRINTF(5)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);
    781783     
    782784      this->normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z);
     
    881883        //printf ("%f %f\n", vz, sin (vz));
    882884        if (i==0.0)
    883                   printf("%f, %f\n", j/df*2.0*PI, cos(j/df*PI));
     885          PRINTF(0)("%f, %f\n", j/df*2.0*PI, cos(j/df*PI));
    884886      }
    885887    }
  • orxonox/branches/levelloader/src/lib/graphics/importer/objModel.cc

    r3542 r3605  
    1313   co-programmer: ...
    1414*/
     15
     16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
    1517
    1618#include "objModel.h"
     
    8688bool OBJModel::importFile (const char* fileName)
    8789{
    88   PRINTF(3)("preparing to read in file: %s\n", fileName);
     90  PRINTF(4)("preparing to read in file: %s\n", fileName);
    8991
    9092
     
    107109  strncpy(this->objPath, fileName, name-fileName);
    108110  this->objPath[name-fileName] = '\0';
    109   if (verbose>=2)
    110     if (strlen(objPath)> 0)
    111       PRINTF(0)("Resolved file %s to folder: %s.\n", name, objPath);
    112     else
    113       PRINTF(0)("Resolved file %s.\n", name);
     111  if (strlen(objPath)> 0)
     112    PRINTF(5)("Resolved file %s to folder: %s.\n", name, objPath);
     113  else
     114    PRINTF(5)("Resolved file %s.\n", name);
    114115 
    115116  this->setName(name);
     
    144145      return false;
    145146    }
    146   PRINTF(2)("Reading from opened file %s\n", fileName);
     147  PRINTF(4)("Reading from opened file %s\n", fileName);
    147148  char Buffer[10000];
    148149  while(!OBJ_FILE->eof())
    149150    {
    150151      OBJ_FILE->getline(Buffer, 10000);
    151       PRINTF(3)("Read input line: %s\n", Buffer);
     152      PRINTF(5)("Read input line: %s\n", Buffer);
    152153     
    153154
     
    192193      else if (!strncmp(Buffer, "s ", 2)) //! \todo smoothing groups have to be implemented
    193194        {
    194           if (verbose >= 2)
    195             PRINTF(2)("smoothing groups not supportet yet. line: %s\n", Buffer);
     195          PRINTF(3)("smoothing groups not supportet yet. line: %s\n", Buffer);
    196196        }
    197197    }
     
    221221 
    222222
    223   PRINTF(3)("Opening mtlFile: %s\n", fileName);
     223  PRINTF(4)("Opening mtlFile: %s\n", fileName);
    224224
    225225  ifstream* MTL_FILE = new ifstream (fileName);
    226226  if (MTL_FILE->fail())
    227227    {
    228       PRINTF(1)("unable to open file: %s\n", fileName);
     228      PRINTF(2)("unable to open file: %s\n", fileName);
    229229      MTL_FILE->close();
    230230      delete []fileName;
     
    237237    {
    238238      MTL_FILE->getline(Buffer, 500);
    239       PRINTF(4)("found line in mtlFile: %s\n", Buffer);
     239      PRINTF(5)("found line in mtlFile: %s\n", Buffer);
    240240     
    241241
  • orxonox/branches/levelloader/src/lib/graphics/importer/texture.cc

    r3499 r3605  
    1717*/
    1818
     19
     20#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
    1921
    2022#include "texture.h"
     
    8789  if (pName[0] == '\0')
    8890    {
    89       PRINTF(3)("not Adding empty Path to the List.\n");
     91      PRINTF(2)("not Adding empty Path to the List.\n");
    9092      return;
    9193    }
     
    99101      if (status.st_mode & S_IFDIR)
    100102        {
    101           PRINTF(2)("Adding Path %s to the PathList.\n", pName);
     103          PRINTF(4)("Adding Path %s to the PathList.\n", pName);
    102104          PathList* tmpPathList = this;
    103105          while (tmpPathList->next)
     
    193195bool Texture::loadTexToGL (Image* pImage)
    194196{
    195   PRINTF(2)("Loading texture to OpenGL-Environment.\n");
     197  PRINTF(4)("Loading texture to OpenGL-Environment.\n");
    196198  glGenTextures(1, &this->texture);
    197199  glBindTexture(GL_TEXTURE_2D, this->texture);
     
    229231        pImage->format = GL_RGBA;
    230232         
    231       PRINTF(0)("Bits Per Pixel: %d\n", pImage->bpp);
    232233      if( !IMG_isPNG(SDL_RWFromFile(imgNameWithPath, "rb")) && !IMG_isJPG(SDL_RWFromFile(imgNameWithPath, "rb")))
    233234        for (int i=0;i<map->h * map->w *3;i+=3)
     
    249250  else
    250251    {
    251       PRINTF(1)("Image not Found: %s\n", imgNameWithPath);
     252      PRINTF(2)("Image not Found: %s\n", imgNameWithPath);
    252253      return false;
    253254    }
     
    268269      if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".bmp", 4))
    269270        {
    270           PRINTF(3)("Requested bmp-image. Trying to Import.\n");
     271          PRINTF(4)("Requested bmp-image. Trying to Import.\n");
    271272          return this->loadBMP(imgNameWithPath);
    272273        }
     
    274275      else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".jpg", 4) || !strncmp(imgNameWithPath+strlen(imgNameWithPath)-5, ".jpg", 5))
    275276        {
    276           PRINTF(3)("Requested jpeg-image. Trying to Import\n");
     277          PRINTF(4)("Requested jpeg-image. Trying to Import\n");
    277278          return this->loadJPG(imgNameWithPath);
    278279        }
    279280      else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".tga", 4))
    280281        {
    281           PRINTF(3)("Requested tga-image. Trying to Import\n");
     282          PRINTF(4)("Requested tga-image. Trying to Import\n");
    282283          return this->loadTGA(imgNameWithPath);
    283284        }
    284285      else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".png", 4))
    285286        {
    286           PRINTF(3)("Requested png-image. Trying to Import\n");
     287          PRINTF(4)("Requested png-image. Trying to Import\n");
    287288          return this->loadPNG(imgNameWithPath);
    288289        }
    289290      else
    290291        {
    291           PRINTF(1)("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imgNameWithPath);
     292          PRINTF(2)("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imgNameWithPath);
    292293          return false;
    293294        }
     
    295296  else
    296297    {
    297       PRINTF(1)("Image not Found: %s\n", imgNameWithPath);
     298      PRINTF(2)("Image not Found: %s\n", imgNameWithPath);
    298299      return false;
    299300    }
     
    316317  if ((file = fopen(bmpName, "rb"))==NULL)
    317318    {
    318       PRINTF(1)("File Not Found : %s\n",bmpName);
     319      PRINTF(2)("File Not Found : %s\n",bmpName);
    319320      return false;
    320321    }
     
    325326  if ((i = fread(&pImage->width, 4, 1, file)) != 1)
    326327    {
    327       PRINTF(1)("Error reading width from %s.\n", bmpName);
     328      PRINTF(2)("Error reading width from %s.\n", bmpName);
    328329      return false;
    329330    }
     
    331332  if ((i = fread(&pImage->height, 4, 1, file)) != 1)
    332333    {
    333       PRINTF(1)("Error reading height from %s.\n", bmpName);
     334      PRINTF(2)("Error reading height from %s.\n", bmpName);
    334335      return false;
    335336    }
     
    341342  if ((fread(&planes, 2, 1, file)) != 1)
    342343    {
    343       PRINTF(1)("Error reading planes from %s.\n", bmpName);
     344      PRINTF(2)("Error reading planes from %s.\n", bmpName);
    344345      return false;
    345346    }
     
    353354  if ((i = fread(&bpp, 2, 1, file)) != 1)
    354355    {
    355       PRINTF(1)("Error reading bpp from %s.\n", bmpName);
     356      PRINTF(2)("Error reading bpp from %s.\n", bmpName);
    356357      return false;
    357358    }
    358359  if (bpp != 24)
    359360    {
    360       PRINTF(1)("Bpp from %s is not 24: %u\n", bmpName, bpp);
     361      PRINTF(2)("Bpp from %s is not 24: %u\n", bmpName, bpp);
    361362      return false;
    362363    }
     
    369370  if (pImage->data == NULL)
    370371    {
    371       PRINTF(1)("Error allocating memory for color-corrected image data");
     372      PRINTF(2)("Error allocating memory for color-corrected image data");
    372373      return false;     
    373374    }
     
    375376  if ((i = fread(pImage->data, size, 1, file)) != 1)
    376377    {
    377       PRINTF(1)("Error reading image data from %s.\n", bmpName);
     378      PRINTF(2)("Error reading image data from %s.\n", bmpName);
    378379      return false;
    379380    }
     
    418419    {
    419420      // Display an error message saying the file was not found, then return NULL
    420       PRINTF(1)("Unable to load JPG File %s.\n", jpgName);
     421      PRINTF(2)("Unable to load JPG File %s.\n", jpgName);
    421422      return false;
    422423    }
     
    521522  if(fTGA == NULL)
    522523    {
    523       PRINTF(1)("Error could not open texture file: %s\n", tgaName);
     524      PRINTF(2)("Error could not open texture file: %s\n", tgaName);
    524525      return false;
    525526    }
     
    527528  if(fread(&tgaHeader, sizeof(TGAHeader), 1, fTGA) == 0)
    528529    {
    529       PRINTF(1)("Error could not read file header of %s\n", tgaName);
     530      PRINTF(2)("Error could not read file header of %s\n", tgaName);
    530531      if(fTGA != NULL)
    531532        {
     
    549550  else
    550551    {
    551       PRINTF(1)("Error TGA file be type 2 or type 10\n");
     552      PRINTF(2)("Error TGA file be type 2 or type 10\n");
    552553      if (fTGA)
    553554        fclose(fTGA);
     
    576577  if(fread(header, sizeof(header), 1, fTGA) == 0)
    577578    {
    578       PRINTF(1)("Error could not read info header\n");
     579      PRINTF(2)("Error could not read info header\n");
    579580      return false;
    580581    }
     
    586587  if((pImage->width <= 0) || (pImage->height <= 0) || ((pImage->bpp != 24) && (pImage->bpp !=32)))
    587588    {
    588       PRINTF(1)("Error invalid texture information\n");
     589      PRINTF(2)("Error invalid texture information\n");
    589590      return false;
    590591    }
     
    605606  if(pImage->data == NULL)
    606607    {
    607       PRINTF(1)("Error could not allocate memory for image\n");
     608      PRINTF(2)("Error could not allocate memory for image\n");
    608609      return false;
    609610    }
     
    611612  if(fread(pImage->data, 1, imageSize, fTGA) != imageSize)
    612613    {
    613       PRINTF(1)("Error could not read image data\n");
     614      PRINTF(2)("Error could not read image data\n");
    614615      if(pImage->data != NULL)
    615616        {
     
    648649  if(fread(header, sizeof(header), 1, fTGA) == 0)
    649650    {
    650       PRINTF(1)("Error could not read info header\n");
     651      PRINTF(2)("Error could not read info header\n");
    651652      return false;
    652653    }
     
    664665  if((pImage->width <= 0) || (pImage->height <= 0) || ((pImage->bpp != 24) && (pImage->bpp !=32)))
    665666    {
    666       PRINTF(1)("Error Invalid pImage information\n");
     667      PRINTF(2)("Error Invalid pImage information\n");
    667668      return false;
    668669    }
     
    674675  if(pImage->data == NULL)
    675676    {
    676       PRINTF(1)("Error could not allocate memory for image\n");
     677      PRINTF(2)("Error could not allocate memory for image\n");
    677678      return false;
    678679    }
     
    684685      if(fread(&chunkheader, sizeof(GLubyte), 1, fTGA) == 0)
    685686        {
    686           PRINTF(1)("Error could not read RLE header\n");
     687          PRINTF(2)("Error could not read RLE header\n");
    687688          if(pImage->data != NULL)
    688689            {
     
    702703              if(fread(colorbuffer, 1, bytesPerPixel, fTGA) != bytesPerPixel)
    703704                {
    704                   PRINTF(1)("Error could not read image data\n");
     705                  PRINTF(2)("Error could not read image data\n");
    705706                  if(colorbuffer != NULL)
    706707                    {
     
    732733              if(currentpixel > pixelcount)     
    733734                {
    734                   PRINTF(1)("Error too many pixels read\n");
     735                  PRINTF(2)("Error too many pixels read\n");
    735736                  if(colorbuffer != NULL)
    736737                    {
     
    754755          if(fread(colorbuffer, 1, bytesPerPixel, fTGA) != bytesPerPixel) // Attempt to read following color values
    755756            {
    756               PRINTF(1)("Error could not read from file");
     757              PRINTF(2)("Error could not read from file");
    757758              if(colorbuffer != NULL)
    758759                {
     
    785786              if(currentpixel > pixelcount)
    786787                {
    787                   PRINTF(1)("Error too many pixels read\n");
     788                  PRINTF(2)("Error too many pixels read\n");
    788789                  if(colorbuffer != NULL)
    789790                    {
  • orxonox/branches/levelloader/src/lib/graphics/importer/texture.h

    r3499 r3605  
    1010#define _TEXTURE_H
    1111
    12 #include "stdincl.h"
     12#include "glincl.h"
     13
     14#include "debug.h"
     15
    1316#ifdef HAVE_SDL_SDL_IMAGE_H
    1417#include <SDL/SDL_image.h>
  • orxonox/branches/levelloader/src/lib/graphics/importer/windowHandler.h

    r3499 r3605  
    77#ifndef _WINDOWHANDLER_H
    88#define _WINDOWHANDLER_H
    9 
    10 extern int verbose;
    119
    1210#include "stdincl.h"
  • orxonox/branches/levelloader/src/lib/gui/Makefile.in

    r3563 r3605  
    1 # Makefile.in generated by automake 1.8.2 from Makefile.am.
     1# Makefile.in generated by automake 1.8.5 from Makefile.am.
    22# @configure_input@
    33
     
    7878DEFS = @DEFS@
    7979DEPDIR = @DEPDIR@
     80DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
     81DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
    8082DOXYGEN = @DOXYGEN@
    8183DOXYGEN_FALSE = @DOXYGEN_FALSE@
     
    177179          esac; \
    178180        done; \
    179         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/gui/Makefile'; \
     181        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/gui/Makefile'; \
    180182        cd $(top_srcdir) && \
    181           $(AUTOMAKE) --gnu  src/lib/gui/Makefile
     183          $(AUTOMAKE) --foreign  src/lib/gui/Makefile
    182184.PRECIOUS: Makefile
    183185Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
     
    272274        tags=; \
    273275        here=`pwd`; \
    274         if (etags --etags-include --version) >/dev/null 2>&1; then \
     276        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
    275277          include_option=--etags-include; \
     278          empty_fix=.; \
    276279        else \
    277280          include_option=--include; \
     281          empty_fix=; \
    278282        fi; \
    279283        list='$(SUBDIRS)'; for subdir in $$list; do \
    280284          if test "$$subdir" = .; then :; else \
    281             test -f $$subdir/TAGS && \
     285            test ! -f $$subdir/TAGS || \
    282286              tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
    283287          fi; \
     
    289293          $(AWK) '    { files[$$0] = 1; } \
    290294               END { for (i in files) print i; }'`; \
    291         test -z "$(ETAGS_ARGS)$$tags$$unique" \
    292           || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    293              $$tags $$unique
     295        if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
     296          test -n "$$unique" || unique=$$empty_fix; \
     297          $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     298            $$tags $$unique; \
     299        fi
    294300ctags: CTAGS
    295301CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  • orxonox/branches/levelloader/src/lib/gui/console/Makefile.in

    r3563 r3605  
    1 # Makefile.in generated by automake 1.8.2 from Makefile.am.
     1# Makefile.in generated by automake 1.8.5 from Makefile.am.
    22# @configure_input@
    33
     
    5050CONFIG_HEADER = $(top_builddir)/config.h
    5151CONFIG_CLEAN_FILES =
    52 am__installdirs = $(DESTDIR)$(bindir)
     52am__installdirs = "$(DESTDIR)$(bindir)"
    5353binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    5454PROGRAMS = $(bin_PROGRAMS)
     
    9696DEFS = @DEFS@
    9797DEPDIR = @DEPDIR@
     98DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
     99DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
    98100DOXYGEN = @DOXYGEN@
    99101DOXYGEN_FALSE = @DOXYGEN_FALSE@
     
    203205          esac; \
    204206        done; \
    205         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/gui/console/Makefile'; \
     207        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/gui/console/Makefile'; \
    206208        cd $(top_srcdir) && \
    207           $(AUTOMAKE) --gnu  src/lib/gui/console/Makefile
     209          $(AUTOMAKE) --foreign  src/lib/gui/console/Makefile
    208210.PRECIOUS: Makefile
    209211Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
     
    225227install-binPROGRAMS: $(bin_PROGRAMS)
    226228        @$(NORMAL_INSTALL)
    227         $(mkdir_p) $(DESTDIR)$(bindir)
     229        test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
    228230        @list='$(bin_PROGRAMS)'; for p in $$list; do \
    229231          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
     
    231233          ; then \
    232234            f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
    233            echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
    234            $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
     235           echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
     236           $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
    235237          else :; fi; \
    236238        done
     
    240242        @list='$(bin_PROGRAMS)'; for p in $$list; do \
    241243          f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
    242           echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
    243           rm -f $(DESTDIR)$(bindir)/$$f; \
     244          echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
     245          rm -f "$(DESTDIR)$(bindir)/$$f"; \
    244246        done
    245247
     
    297299          $(AWK) '    { files[$$0] = 1; } \
    298300               END { for (i in files) print i; }'`; \
    299         test -z "$(ETAGS_ARGS)$$tags$$unique" \
    300           || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    301              $$tags $$unique
     301        if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
     302          test -n "$$unique" || unique=$$empty_fix; \
     303          $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     304            $$tags $$unique; \
     305        fi
    302306ctags: CTAGS
    303307CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
     
    354358all-am: Makefile $(PROGRAMS) $(HEADERS)
    355359installdirs:
    356         $(mkdir_p) $(DESTDIR)$(bindir)
     360        for dir in "$(DESTDIR)$(bindir)"; do \
     361          test -z "$$dir" || $(mkdir_p) "$$dir"; \
     362        done
    357363install: install-am
    358364install-exec: install-exec-am
  • orxonox/branches/levelloader/src/lib/gui/gui/Makefile.in

    r3563 r3605  
    1 # Makefile.in generated by automake 1.8.2 from Makefile.am.
     1# Makefile.in generated by automake 1.8.5 from Makefile.am.
    22# @configure_input@
    33
     
    5050CONFIG_HEADER = $(top_builddir)/config.h
    5151CONFIG_CLEAN_FILES =
    52 am__installdirs = $(DESTDIR)$(bindir)
     52am__installdirs = "$(DESTDIR)$(bindir)"
    5353binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    5454PROGRAMS = $(bin_PROGRAMS)
     
    105105DEFS = @DEFS@
    106106DEPDIR = @DEPDIR@
     107DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
     108DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
    107109DOXYGEN = @DOXYGEN@
    108110DOXYGEN_FALSE = @DOXYGEN_FALSE@
     
    236238          esac; \
    237239        done; \
    238         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/gui/gui/Makefile'; \
     240        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/gui/gui/Makefile'; \
    239241        cd $(top_srcdir) && \
    240           $(AUTOMAKE) --gnu  src/lib/gui/gui/Makefile
     242          $(AUTOMAKE) --foreign  src/lib/gui/gui/Makefile
    241243.PRECIOUS: Makefile
    242244Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
     
    258260install-binPROGRAMS: $(bin_PROGRAMS)
    259261        @$(NORMAL_INSTALL)
    260         $(mkdir_p) $(DESTDIR)$(bindir)
     262        test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
    261263        @list='$(bin_PROGRAMS)'; for p in $$list; do \
    262264          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
     
    264266          ; then \
    265267            f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
    266            echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
    267            $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
     268           echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
     269           $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
    268270          else :; fi; \
    269271        done
     
    273275        @list='$(bin_PROGRAMS)'; for p in $$list; do \
    274276          f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
    275           echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
    276           rm -f $(DESTDIR)$(bindir)/$$f; \
     277          echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
     278          rm -f "$(DESTDIR)$(bindir)/$$f"; \
    277279        done
    278280
     
    336338          $(AWK) '    { files[$$0] = 1; } \
    337339               END { for (i in files) print i; }'`; \
    338         test -z "$(ETAGS_ARGS)$$tags$$unique" \
    339           || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    340              $$tags $$unique
     340        if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
     341          test -n "$$unique" || unique=$$empty_fix; \
     342          $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     343            $$tags $$unique; \
     344        fi
    341345ctags: CTAGS
    342346CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
     
    393397all-am: Makefile $(PROGRAMS) $(HEADERS)
    394398installdirs:
    395         $(mkdir_p) $(DESTDIR)$(bindir)
     399        for dir in "$(DESTDIR)$(bindir)"; do \
     400          test -z "$$dir" || $(mkdir_p) "$$dir"; \
     401        done
    396402install: install-am
    397403install-exec: install-exec-am
  • orxonox/branches/levelloader/src/lib/gui/gui/orxonox_gui_gtk.h

    r3499 r3605  
    99#include <config.h>
    1010#endif
    11 
    12 //! verbose level, soon obsolete
    13 extern int verbose; // soon obsolete here
    1411
    1512#include "debug.h"
  • orxonox/branches/levelloader/src/lib/lang/base_object.cc

    r3499 r3605  
    2626   \brief standard constructor
    2727*/
    28 BaseObject::BaseObject () {}
     28BaseObject::BaseObject ()
     29{
     30  this->className = NULL;
     31}
    2932
    3033
     
    3235   \brief standard deconstructor
    3336*/
    34 BaseObject::~BaseObject () {}
    35 
     37BaseObject::~BaseObject ()
     38{
     39  delete []this->className;
     40}
    3641
    3742void BaseObject::setClassName (char* className)
    3843{
    39   this->className = className;
     44  this->className = new char[strlen(className)+1];
     45  strcpy(this->className, className);
    4046}
    4147
  • orxonox/branches/levelloader/src/lib/lang/base_object.h

    r3499 r3605  
    1515 public:
    1616  BaseObject ();
    17   ~BaseObject ();
     17  virtual ~BaseObject ();
    1818
    1919  void setClassName (char* className);
  • orxonox/branches/levelloader/src/lib/math/curve.cc

    r3499 r3605  
    1919     local-Time implementation
    2020     NURBS
     21     tList implementation
    2122     
    2223*/
    2324
     25#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_MATH
     26
    2427#include "curve.h"
    25 #include "matrix.h"
     28
    2629#include "debug.h"
    2730
    2831#include <math.h>
    2932#include <stdio.h>
     33
     34
     35/**
     36    \brief default constructor for a Curve
     37*/
     38Curve::Curve(void)
     39{
     40  nodeCount = 0;
     41  firstNode = new PathNode;
     42  currentNode = firstNode;
     43
     44  firstNode->position = Vector (.0, .0, .0);
     45  firstNode->number = 0;
     46  firstNode->next = 0; // not sure if this really points to NULL!!
     47}
    3048
    3149/**
     
    131149  this->derivation = 0;
    132150  dirCurve = new BezierCurve(1);
    133   this->init();
    134151}
    135152
     
    141158  this->derivation = derivation;
    142159  dirCurve=NULL;
    143   this->init();
    144160}
    145161
     
    161177  if (dirCurve)
    162178    delete dirCurve;
    163 }
    164 
    165 /**
    166    \brief Initializes a BezierCurve
    167 */
    168 void BezierCurve::init(void)
    169 {
    170   nodeCount = 0;
    171   firstNode = new PathNode;
    172   currentNode = firstNode;
    173 
    174   firstNode->position = Vector (.0, .0, .0);
    175   firstNode->number = 0;
    176   firstNode->next = 0; // not sure if this really points to NULL!!
    177 
    178   return;
    179179}
    180180
     
    285285  return curvePoint;
    286286}
    287 
    288 
    289 
    290 ///////////////////////////////////
    291 //// Uniform Point curve  /////////
    292 ///////////////////////////////////
    293 /**
    294    \brief Creates a new UPointCurve
    295 */
    296 UPointCurve::UPointCurve (void)
    297 {
    298   this->derivation = 0;
    299   this->init();
    300 }
    301 
    302 /**
    303    \brief Creates a new UPointCurve-Derivation-Curve of deriavation'th degree
    304 */
    305 UPointCurve::UPointCurve (int derivation)
    306 {
    307   this->derivation = derivation;
    308   dirCurve=NULL;
    309   this->init();
    310 }
    311 
    312 /**
    313    \brief Deletes a UPointCurve.
    314 
    315    It does this by freeing all the space taken over from the nodes
    316 */
    317 UPointCurve::~UPointCurve(void)
    318 {
    319   PathNode* tmpNode;
    320   currentNode = firstNode;
    321   while (tmpNode != 0)
    322     {
    323       tmpNode = currentNode;
    324       currentNode = currentNode->next;
    325       delete tmpNode;
    326     }
    327   if (dirCurve)
    328     delete dirCurve;
    329 }
    330 
    331 /**
    332    \brief Initializes a UPointCurve
    333 */
    334 void UPointCurve::init(void)
    335 {
    336   nodeCount = 0;
    337   firstNode = new PathNode;
    338   currentNode = firstNode;
    339 
    340   firstNode->position = Vector (.0, .0, .0);
    341   firstNode->number = 0;
    342   firstNode->next = 0; // not sure if this really points to NULL!!
    343 
    344   return;
    345 }
    346 
    347 /**
    348    \brief Rebuilds a UPointCurve
    349    
    350    \todo very bad algorithm
    351 */
    352 void UPointCurve::rebuild(void)
    353 {
    354   // rebuilding the Curve itself
    355   PathNode* tmpNode = this->firstNode;
    356   int i=0;
    357   Matrix xTmpMat = Matrix(this->nodeCount, this->nodeCount);
    358   Matrix yTmpMat = Matrix(this->nodeCount, this->nodeCount);
    359   Matrix zTmpMat = Matrix(this->nodeCount, this->nodeCount);
    360   Matrix xValMat = Matrix(this->nodeCount, 3);
    361   Matrix yValMat = Matrix(this->nodeCount, 3);
    362   Matrix zValMat = Matrix(this->nodeCount, 3);
    363   while(tmpNode)
    364     {
    365       Vector fac = Vector(1,1,1);
    366       for (int j = 0; j < this->nodeCount; j++)
    367         {
    368           xTmpMat(i,j) = fac.x; fac.x *= (float)i/(float)this->nodeCount;//tmpNode->position.x;
    369           yTmpMat(i,j) = fac.y; fac.y *= (float)i/(float)this->nodeCount;//tmpNode->position.y;
    370           zTmpMat(i,j) = fac.z; fac.z *= (float)i/(float)this->nodeCount;//tmpNode->position.z;
    371         }
    372       xValMat(i,0) = tmpNode->position.x;
    373       yValMat(i,0) = tmpNode->position.y;
    374       zValMat(i,0) = tmpNode->position.z;
    375       ++i;
    376       tmpNode = tmpNode->next;
    377     }
    378   tmpNode = this->firstNode;
    379   xValMat = xTmpMat.Inv() *= xValMat;
    380   yValMat = yTmpMat.Inv() *= yValMat;
    381   zValMat = zTmpMat.Inv() *= zValMat;
    382   i = 0;
    383   while(tmpNode)
    384     {
    385       tmpNode->vFactor.x = xValMat(i,0);
    386       tmpNode->vFactor.y = yValMat(i,0);
    387       tmpNode->vFactor.z = zValMat(i,0);
    388 
    389       i++;
    390       tmpNode = tmpNode->next;
    391     }
    392 }
    393 
    394 /**
    395    \brief calculates the Position on the curve
    396    \param t The position on the Curve (0<=t<=1)
    397    \return the Position on the Path
    398 */
    399 Vector UPointCurve::calcPos(float t)
    400 {
    401   PathNode* tmpNode = firstNode;
    402   Vector ret = Vector(0.0,0.0,0.0);
    403   float factor = 1.0;
    404   while(tmpNode)
    405     {
    406       ret.x += tmpNode->vFactor.x * factor;
    407       ret.y += tmpNode->vFactor.y * factor;
    408       ret.z += tmpNode->vFactor.z * factor;
    409       factor *= t;
    410 
    411       tmpNode = tmpNode->next;
    412     }
    413   return ret;
    414 }
    415 
    416 /**
    417    \brief Calulates the direction of the Curve at time t.
    418    \param The time at which to evaluate the curve.
    419    \returns The vvaluated Vector.
    420 */
    421 Vector UPointCurve::calcDir (float t)
    422 {
    423   PathNode* tmpNode = firstNode;
    424   Vector ret = Vector(0.0,0.0,0.0);
    425   float factor = 1.0/t;
    426   int k=0;
    427   while(tmpNode)
    428     {
    429       ret.x += tmpNode->vFactor.x * factor *k;
    430       ret.y += tmpNode->vFactor.y * factor *k;
    431       ret.z += tmpNode->vFactor.z * factor *k;
    432       factor *= t;
    433       k++;
    434       tmpNode = tmpNode->next;
    435     }
    436   ret.normalize();
    437   return ret;
    438 }
    439 
    440 Vector UPointCurve::calcAcc (float t)
    441 {
    442 }
    443 
    444 /**
    445    \brief Calculates the Quaternion needed for our rotations
    446    \param t The time at which to evaluate the cuve.
    447    \returns The evaluated Quaternion.
    448 */
    449 Quaternion UPointCurve::calcQuat (float t)
    450 {
    451   return Quaternion (calcDir(t), Vector(0,0,1));
    452 }
    453 
    454 
    455 /**
    456   \brief returns the Position of the point calculated on the Curve
    457   \return a Vector to the calculated position
    458 */
    459 Vector UPointCurve::getPos(void) const
    460 {
    461   return curvePoint;
    462 }
  • orxonox/branches/levelloader/src/lib/math/curve.h

    r3499 r3605  
    1313
    1414//! An Enumerator that defines what sort of Curves are availible
    15 enum CurveType {BEZIERCURVE, UPOINTCURVE};
     15enum CurveType {BEZIERCURVE};
    1616
    1717
     
    3838  PathNode* currentNode; //!< The node we are working with (the Last node).
    3939
     40
    4041 private:
    4142  virtual void rebuild(void) = 0;
    4243 public:
     44  Curve(void);
     45
    4346  Curve* dirCurve;       //!< The derivation-curve of this Curve.
    4447  void addNode(const Vector& newNode);
     
    6871  BezierCurve(void);
    6972  BezierCurve(int derivation);
    70   ~BezierCurve(void);
    71   void init(void);
     73  virtual ~BezierCurve(void);
    7274
    7375  Vector calcPos(float t);
     
    9193};
    9294
    93 //! Uniform Point Curve-class
    94 /**
    95    A UPoint Curve is a A Curve, that flows through all the nodes given it.
    96    The Algorithm to buid the curve is rather slow, but Painting and tracing along the curve has high speed, so do not change this curve during the Game.
    97 
    98    This Curve is very erattic, so i do not recommend to use it.
    99 */
    100 class UPointCurve : public Curve
    101 {
    102  private:
    103   void rebuild(void);
    104  public:
    105   UPointCurve(void);
    106   UPointCurve(int derivation);
    107   ~UPointCurve(void);
    108   void init(void);
    109 
    110   Vector calcPos(float t);
    111   Vector calcDir(float t);
    112   Vector calcAcc(float t);
    113   Quaternion calcQuat(float t);
    114  
    115   Vector getPos(void) const;
    116 };
    117 
    11895#endif /* _CURVE_H */
  • orxonox/branches/levelloader/src/lib/math/vector.cc

    r3499 r3605  
    1919*/
    2020
     21#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_MATH
    2122
    2223#include "vector.h"
    23 
     24#include "debug.h"
    2425
    2526using namespace std;
     
    201202}
    202203
    203 
    204204/**
    205205   \brief calculate the angle between two vectors in radiances
     
    225225  f = acos( v1 * v2 / (v1.len() * v2.len()));
    226226  return f * 180 / PI;
     227}
     228
     229
     230/**
     231   \brief Outputs the values of the Vector
     232*/
     233void Vector::debug(void)
     234{
     235  PRINT(0)("Vector Debug information\n");
     236  PRINT(0)("x: %f; y: %f; z: %f", x, y, z);
     237  PRINT(3)(" lenght: %f", len());
     238  PRINT(0)("\n");
    227239}
    228240
     
    581593
    582594/**
     595   \brief outputs some nice formated debug information about this quaternion
     596*/
     597void Quaternion::debug(void)
     598{
     599  PRINT(0)("Quaternion Debug Information\n");
     600  PRINT(0)("real a=%f; imag: x=%f y=%f z=%f\n", w, v.x, v.y, v.z);
     601}
     602
     603/**
    583604   \brief create a rotation from a vector
    584605   \param v: a vector
  • orxonox/branches/levelloader/src/lib/math/vector.h

    r3499 r3605  
    4141  Vector* getNormalized();
    4242  Vector abs();
     43
     44  void debug();
    4345};
    4446
     
    5355{
    5456 public:
    55         Vector v;       //!< Imaginary Vector
    56         float w;        //!< Real part of the number
    57 
    58         Quaternion ();
    59         Quaternion (float m[4][4]);
    60         Quaternion (float angle, const Vector& axis);
    61         Quaternion (const Vector& dir, const Vector& up);
    62         Quaternion (float roll, float pitch, float yaw);
    63        
    64         Quaternion operator/ (const float& f) const;
    65         Quaternion operator* (const float& f) const;
    66         Quaternion operator* (const Quaternion& q) const;
    67         Quaternion operator+ (const Quaternion& q) const;
    68         Quaternion operator- (const Quaternion& q) const;
    69         Quaternion conjugate () const;
    70         Quaternion inverse () const;
    71         Vector apply (Vector& f) const;
    72         float norm () const;
    73         void matrix (float m[4][4]) const;
    74         void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res);
    75 
     57  Vector v;     //!< Imaginary Vector
     58  float w;        //!< Real part of the number
     59 
     60  Quaternion ();
     61  Quaternion (float m[4][4]);
     62  Quaternion (float angle, const Vector& axis);
     63  Quaternion (const Vector& dir, const Vector& up);
     64  Quaternion (float roll, float pitch, float yaw);
     65 
     66  Quaternion operator/ (const float& f) const;
     67  Quaternion operator* (const float& f) const;
     68  Quaternion operator* (const Quaternion& q) const;
     69  Quaternion operator+ (const Quaternion& q) const;
     70  Quaternion operator- (const Quaternion& q) const;
     71  Quaternion conjugate () const;
     72  Quaternion inverse () const;
     73  Vector apply (Vector& f) const;
     74  float norm () const;
     75  void matrix (float m[4][4]) const;
     76  void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res);
     77 
     78  void debug();
    7679 private:
    77         float DELTA;      //!< resolution of calculation
     80  float DELTA;      //!< resolution of calculation
    7881
    7982};
  • orxonox/branches/levelloader/src/lib/util/list.h

    r3499 r3605  
    8686  T* enumerate();
    8787  T* nextElement();
     88  T* nextElement(T* toEntity);
    8889  T* toArray();
    8990  void debug();
     
    101102template<class T>
    102103tList<T>::~tList ()
    103 {}
     104{
     105  this->currentEl = this->first;
     106  while(this->currentEl != NULL)
     107    {
     108      listElement* le = this->currentEl->next;
     109      //delete this->currentEl->curr;
     110      delete this->currentEl;
     111      this->currentEl = le;
     112    }
     113  this->first = NULL;
     114  this->last = NULL;
     115  this->size = 0;
     116}
     117
    104118
    105119template<class T>
    106120void tList<T>::add(T* entity)
    107121{
     122  if( entity == NULL) return;
    108123  listElement* el = new listElement;
    109124  el->prev = this->last;
     
    113128  this->last = el;
    114129
    115   if(this->size == 0) this->first = el;
     130  if(el->prev == NULL) this->first = el; /* if first element */
    116131  else el->prev->next = el;
    117132  this->size++;
     
    122137void tList<T>::remove(T* entity)
    123138{
     139  if( entity == NULL) return;
    124140  this->currentEl = this->first;
    125141  listElement* te;
     
    134150          else this->currentEl->next->prev = this->currentEl->prev;
    135151
    136           te = this->currentEl->next;
     152          te = this->currentEl->next;  // for what am i doing this?
    137153          delete this->currentEl;
    138154          this->currentEl = te;
     155          this->size--;
    139156          return;
    140157        }
     
    151168    {
    152169      listElement* le = this->currentEl->next;
    153       delete this->currentEl->curr;
     170      //delete this->currentEl->curr;
    154171      delete this->currentEl;
    155172      this->currentEl = le;
     
    185202T* tList<T>::enumerate()
    186203{
     204  //if( this->last == this->first == NULL) return NULL;
    187205  if(this->size == 0) return NULL;
    188206  this->currentEl = this->first;
     
    194212T* tList<T>::nextElement()
    195213{
     214  // if( this->last == this->first == NULL) return NULL;
    196215  if(this->size == 0) return NULL;
    197216  this->currentEl = this->currentEl->next;
     
    201220
    202221
     222/**
     223   \brief this returns the next element after toEntity or the first if toEntity is last
     224*/
     225template<class T>
     226T* tList<T>::nextElement(T* toEntity)
     227{
     228  //if( this->last == this->first == NULL) return NULL;
     229  if(this->size == 0) return NULL;
     230  if( toEntity == NULL) return this->first->curr;
     231  if( toEntity == this->last->curr ) return this->first->curr;
     232  this->currentEl = this->first;
     233  while(this->currentEl->curr != toEntity && this->currentEl->next != NULL)
     234    {
     235      this->currentEl = this->currentEl->next;
     236    }
     237  if(this->currentEl == NULL) return NULL;
     238  return this->currentEl->next->curr;
     239}
     240
     241
    203242template<class T>
    204243T* tList<T>::toArray()
Note: See TracChangeset for help on using the changeset viewer.