Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5078 in orxonox.OLD for trunk


Ignore:
Timestamp:
Aug 19, 2005, 5:02:38 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Shell is running, but only in orxonox-world, not all-over
I do not know why this behaviour occurs, but maybe it is because of some errors in other pointers…
who knows

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/graphics_engine.cc

    r5024 r5078  
    451451      this->geTextMaxFPS->setAlignment(TEXT_ALIGN_LEFT);
    452452      this->geTextMaxFPS->setPosition2D(5, 35);
    453       this->geTextMinFPS = TextEngine::getInstance()->createText("fonts/arial_black.ttf", 35, TEXT_DYNAMIC, 0, 255, 0);
     453      this->geTextMinFPS = TextEngine::getInstance()->createText("fonts/arial_black.ttf", 15, TEXT_DYNAMIC, 0, 255, 0);
    454454      this->geTextMinFPS->setAlignment(TEXT_ALIGN_LEFT);
    455455      this->geTextMinFPS->setPosition2D(5, 65);
  • trunk/src/lib/graphics/render2D/render_2d.cc

    r5068 r5078  
    8888void Render2D::moveToLayer(Element2D* element2D, E2D_LAYER to)
    8989{
    90   this->element2DList[(int)log2(element2D->getLayer())]->remove(element2D);
    91   this->element2DList[(int)log2(to)]->add(element2D);
     90  if (element2D->getLayer() != to)
     91  {
     92    this->element2DList[(int)log2(element2D->getLayer())]->remove(element2D);
     93    this->element2DList[(int)log2(to)]->add(element2D);
     94  }
    9295}
    9396
  • trunk/src/lib/graphics/text_engine.cc

    r5077 r5078  
    813813/**
    814814 *  creates a new Text with a certain font.
    815    \see Font::Font
    816    \see Text::Text
     815   @see Font::Font
     816   @see Text::Text
    817817*/
    818818Text* TextEngine::createText(const char* fontFile, unsigned int fontSize, int textType, Uint8 r, Uint8 g, Uint8 b)
     
    831831
    832832  return new Text(tmpFont, TEXT_DYNAMIC);
    833 }
    834 
    835 /**
    836  *  deletes all the Text, and tries to delete all allocated fonts
    837 */
    838 void TextEngine::flush()
    839 {
    840   tIterator<BaseObject>* textIterator = ClassList::getList(CL_TEXT)->getIterator();
    841   Text* text = dynamic_cast<Text*>(textIterator->nextElement());
    842   while( text != NULL)
    843     {
    844       delete text;
    845       text = dynamic_cast<Text*>(textIterator->nextElement());
    846     }
    847   delete textIterator;
    848833}
    849834
  • trunk/src/lib/graphics/text_engine.h

    r5077 r5078  
    218218                   Uint8 b = FONT_DEFAULT_COLOR_B);
    219219
    220   void flush();
    221 
    222220  void debug() const;
    223221
  • trunk/src/orxonox.cc

    r5074 r5078  
    8080Orxonox::~Orxonox ()
    8181{
    82   delete this->iniParser;
    83   delete this->configFileName;
    84 
    8582  delete GraphicsEngine::getInstance(); // deleting the Graphics
    8683  delete TextEngine::getInstance();
     
    9491  delete GarbageCollector::getInstance();
    9592  FastFactory::deleteAll();
    96   delete Shell::getInstance();
    9793
    9894  delete EventHandler::getInstance();
     95  delete this->iniParser;
     96  delete this->configFileName;
    9997
    10098  ClassList::debug();
     
    259257int Orxonox::initMisc()
    260258{
    261   Shell::getInstance();
    262259  return 0;
    263260}
  • trunk/src/story_entities/world.cc

    r5055 r5078  
    115115World::~World ()
    116116{
     117  delete Shell::getInstance();
    117118  PRINTF(3)("World::~World() - deleting current world\n");
    118119
     
    130131
    131132  // external engines initialized by the orxonox-class get deleted
    132   TextEngine::getInstance()->flush();
    133133  SoundEngine::getInstance()->flushAllBuffers();
    134134  SoundEngine::getInstance()->flushAllSources();
     
    195195
    196196  /* init the world interface */
     197  Shell::getInstance();
    197198
    198199  LightManager::getInstance();
  • trunk/src/util/resource_manager.cc

    r4961 r5078  
    559559                    subMatch = true;
    560560                }
    561               else if (enumRes->modelSize =- *(int*)param1)
     561              else if (enumRes->ttfSize == *(int*)param1)
    562562                subMatch = true;
    563563              if(subMatch)
  • trunk/src/util/shell.cc

    r5077 r5078  
    4141  //this->bufferDisplaySize = 0;
    4242  this->setBufferSize(100);
    43   // this->setBufferDisplaySize(1);
    44 
     43  this->setBufferDisplaySize(1);
     44
     45//  this->inputLineText = TextEngine::getInstance()->createText("fonts/earth.ttf", 10, TEXT_DYNAMIC, 0, 255, 0);
     46//  this->inputLineText->setText(NULL);
    4547
    4648  //this->addBufferLineStatic("asjflksjdvklasmv %s", "doom");
     
    8183    newText->setText("");
    8284    this->bufferText->add(newText);
    83     // add the Text here
    8485  }
    8586}
     
    137138void Shell::addBufferLine(const char* line, va_list arguments)
    138139{
    139 //  vsprintf(this->bufferArray, line, arguments);
    140 
    141 //  char* newLine = new char[strlen(this->bufferArray)+1];
    142 //  strcpy(newLine, this->bufferArray);
    143 
    144 //  this->buffer->add(newLine);
    145 
    146 //    if (this->buffer->getSize() > this->bufferSize)
    147 //    {
    148 //      delete this->buffer->firstElement();
    149 //      this->buffer->remove(this->buffer->firstElement());
    150 //    }
    151 
    152 //  this->bufferText->firstElement()->setText(newLine);
     140   vsprintf(this->bufferArray, line, arguments);
     141
     142   char* newLine = new char[strlen(this->bufferArray)+1];
     143   strcpy(newLine, this->bufferArray);
     144
     145//   this->buffer->add(newLine);
     146//
     147//   if (this->buffer->getSize() > this->bufferSize)
     148//   {
     149//     delete this->buffer->firstElement();
     150//     this->buffer->remove(this->buffer->firstElement());
     151//   }
     152
     153  this->bufferText->firstElement()->setText(newLine);
     154//  this->inputLineText->setText(line);
    153155}
    154156
Note: See TracChangeset for help on using the changeset viewer.