Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5119 in orxonox.OLD for trunk


Ignore:
Timestamp:
Aug 24, 2005, 3:22:31 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: cleanup/some display stuff

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/coord/p_node.cc

    r5118 r5119  
    7878PNode::~PNode ()
    7979{
    80   printf("deleting %s::%s\n", this->getClassName(), this->getName());
    8180  tIterator<PNode>* iterator = this->children->getIterator();
    8281  PNode* pn = iterator->firstElement();
  • trunk/src/util/shell.cc

    r5118 r5119  
    6969  EventHandler* evh = EventHandler::getInstance();
    7070  evh->subscribe(this, ES_ALL, SDLK_BACKQUOTE);
    71   for (int i = 1; i < SDLK_F15; i++)
     71  for (int i = 1; i < SDLK_LAST; i++)
    7272    evh->subscribe(this, ES_SHELL, i);
    7373}
     
    105105
    106106
     107/**
     108 * activates the shell
     109 *
     110 * This also feeds the Last few lines from the main buffers into the displayBuffer
     111 */
    107112void Shell::activate()
    108113{
     
    119124}
    120125
     126/**
     127 * deactiveates the Shell.
     128 */
    121129void Shell::deactivate()
    122130{
     
    130138}
    131139
     140/**
     141 * sets the size of the text and spacing
     142 * @param textSize the size of the Text in Pixels
     143 * @param lineSpacing the size of the Spacing between two lines in pixels
     144 *
     145 * this also rebuilds the entire Text, inputLine and displayBuffer,
     146 * to be accurate again.
     147 */
    132148void Shell::setTextSize(unsigned int textSize, unsigned int lineSpacing)
    133149{
     
    150166  this->setBufferDisplaySize(this->bufferDisplaySize);
    151167}
    152 
    153 
    154168
    155169/**
     
    421435    {
    422436      if (EventHandler::getInstance()->getState() == ES_GAME)
    423       {
    424437        this->activate();
    425       }
    426 
    427438      else
    428       {
    429439        this->deactivate();
    430       }
    431     }
     440    }
     441    else if (event.type == SDLK_F1)
     442      this->help();
     443    else if (event.type == SDLK_F2)
     444      this->debug();
    432445    else if (event.type == SDLK_TAB)
    433446      this->autoComplete();
     
    650663}
    651664
    652 
    653 
    654665/**
    655666 * searches for classes, which beginn with classNameBegin
     
    719730}
    720731
     732void Shell::help() const
     733{
     734  PRINT(0)("Help for the most important Shell-commands\n");
     735  PRINT(0)("F1 - HELP; F2 - DEBUG; ` - open/close shell\n");
     736  PRINT(0)("input order:\n");
     737  PRINT(0)("ClassName::objectName function [parameter1, [parameter2 ...]]  or\n");
     738  PRINT(0)("Command [parameter]\n");
     739}
     740
    721741/**
    722742 * displays some nice output from the Shell
     
    724744void Shell::debug() const
    725745{
     746  PRINT(3)("Debugging output to console (not this shell)\n");
     747
    726748  if (this->pressedKey != SDLK_FIRST)
    727749    printf("%s::%f %f\n", SDLKToKeyname(this->pressedKey), this->delayed, this->repeatDelay);
    728 }
     750
     751
     752  char* tmpChar = this->bufferIterator->firstElement();
     753  while(tmpChar != NULL)
     754  {
     755    printf(tmpChar);
     756    tmpChar = this->bufferIterator->nextElement();
     757  }
     758}
  • trunk/src/util/shell.h

    r5118 r5119  
    6969    virtual void draw() const;
    7070
     71    void help() const;
    7172    void debug() const;
    7273
Note: See TracChangeset for help on using the changeset viewer.