Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8000 for code


Ignore:
Timestamp:
Feb 28, 2011, 5:15:14 AM (14 years ago)
Author:
rgrieder
Message:

Destructors can sometimes be very useful for clean up ;)

Location:
code/branches/usability/src/orxonox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/src/orxonox/ChatInputHandler.cc

    r7284 r8000  
    7474  }
    7575
     76  ChatInputHandler::~ChatInputHandler()
     77  {
     78    /* Clean up */
     79    InputManager::getInstance().destroyState("chatinput");
     80    delete this->inpbuf;
     81  }
     82
    7683  /* configure input buffer, sub for the constructor */
    7784  void ChatInputHandler::configureInputBuffer()
     
    125132    // reds
    126133    for( i = 0; i < NumberOfColors/3; ++i )
    127     { this->text_colors[ i ] = new CEGUI::colour( red, green, blue );
    128       assert( this->text_colors[ i ] );
     134    { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
    129135      green += 0.2f, blue += 0.2f;
    130136    }
     
    133139    red = 0.5, green = 1, blue = 0.5;
    134140    for( ; i < NumberOfColors*2/3; ++i )
    135     { this->text_colors[ i ] = new CEGUI::colour( red, green, blue );
    136       assert( this->text_colors[ i ] );
     141    { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
    137142      red += 0.2f, blue += 0.2f;
    138143    }
     
    141146    red = 0.5, green = 0.5, blue = 1;
    142147    for( ; i < NumberOfColors; ++i )
    143     { this->text_colors[ i ] = new CEGUI::colour( red, green, blue );
    144       assert( this->text_colors[ i ] );
     148    { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
    145149      red += 0.2f, green += 0.2f;
    146150    }
     
    196200
    197201    /* set the color according to the hash */
    198     tocolor->setTextColours( *(this->text_colors[ hash ]) );
     202    tocolor->setTextColours( this->text_colors[ hash ] );
    199203  }
    200204
  • code/branches/usability/src/orxonox/ChatInputHandler.h

    r7163 r8000  
    3737#include <cassert>
    3838#include <CEGUIForwardRefs.h>
     39#include <CEGUIcolour.h>
    3940
    4041/* project includes */
     
    7071      /* colors for nickname coloring */
    7172      static const int NumberOfColors = 10;
    72       CEGUI::colour *text_colors[ NumberOfColors ];
     73      CEGUI::colour text_colors[ NumberOfColors ];
    7374
    7475      /** input state */
     
    110111      /** constructor */
    111112      ChatInputHandler();
     113      ~ChatInputHandler();
    112114      friend class Singleton<ChatInputHandler>;
    113115
Note: See TracChangeset for help on using the changeset viewer.