Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3773 in orxonox.OLD


Ignore:
Timestamp:
Apr 11, 2005, 2:07:13 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/textEngine: unloading works

Location:
orxonox/branches/textEngine/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/textEngine/src/lib/graphics/font/text_engine.cc

    r3772 r3773  
    4141/// TEXT ///
    4242////////////
     43/**
     44   \brief creates a new Text Element
     45   \param font the Font to render this text in
     46   \param type The renderType to display this font in
     47
     48   this constructor is private, because the user should initialize
     49   a text with the TextEngine.
     50*/
    4351Text::Text(Font* font, int type)
    4452{
     
    5462}
    5563
    56 
     64/**
     65   \brief deletes a Text out of memory
     66   
     67   This also ereases the text from the textList of the TextEngine
     68*/
    5769Text::~Text(void)
    5870{
     
    807819   \see Text::Text
    808820*/
    809 Text* TextEngine::createText(const char* fontFile, unsigned int fontSize, Uint8 r, Uint8 g, Uint8 b)
     821Text* TextEngine::createText(const char* fontFile, unsigned int fontSize, int textType, Uint8 r, Uint8 g, Uint8 b)
    810822{
    811823  Font* tmpFont;
    812824  Text* newText;
     825 
    813826
    814827  tmpFont = (Font*)ResourceManager::getInstance()->load(fontFile, TTF, RP_GAME);
     
    828841   \brief removes a Text from the List
    829842   \param the text to delete
     843
     844   this only ereases allocated memory, and removes the text
     845   The normal way to call it, is through "delete text;"
     846   So you do not have to concetn yourselves with this.
    830847*/
    831848void TextEngine::deleteText(Text* text)
     
    839856   \brief draws all the Texts that have been initialized
    840857*/
    841 void TextEngine::draw(void)
     858void TextEngine::draw(void) const
    842859{
    843860  tIterator<Text>* textIterator = textList->getIterator();
  • orxonox/branches/textEngine/src/lib/graphics/font/text_engine.h

    r3772 r3773  
    9292class Text
    9393{
     94  friend class TextEngine;
    9495 public:
    95   Text(Font* font, int type = TEXT_DYNAMIC);
    9696  ~Text(void);
    9797
     
    113113  virtual void draw(void);
    114114
     115 private:
     116  Text(Font* font, int type = TEXT_DYNAMIC);
    115117
    116118  Font* font;
     
    186188///////////////////
    187189//! A singleton Class that operates as a Handler for generating and rendering Text in 2D
    188 class TextEngine : public BaseObject {
    189 
     190class TextEngine : public BaseObject
     191{
    190192 public:
    191193  static TextEngine* getInstance(void);
     
    194196  Text* createText(const char* fontFile,
    195197                   unsigned int fontSize = FONT_DEFAULT_SIZE,
     198                   int textType = TEXT_DYNAMIC,
    196199                   Uint8 r = FONT_DEFAULT_COLOR_R,
    197200                   Uint8 g = FONT_DEFAULT_COLOR_G,
     
    200203  void deleteText(Text* text);
    201204
    202   void draw(void);
    203 
     205  void draw(void) const;
     206 
    204207 private:
    205208  TextEngine(void);
  • orxonox/branches/textEngine/src/lib/util/resource_manager.cc

    r3769 r3773  
    309309              delete (Texture*)resource->pointer;
    310310              break;
     311            case TTF:
     312              delete (Font*)resource->pointer;
     313              break;
    311314            default:
    312315              PRINTF(1)("NOT YET IMPLEMENTED !!FIX FIX!!\n");
Note: See TracChangeset for help on using the changeset viewer.