Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5369 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Oct 13, 2005, 12:39:28 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: saver font-changing in the Shell

Location:
trunk/src/lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/text_engine/font.cc

    r5368 r5369  
    428428                                               0xFF000000
    429429#else
    430                                                    0xFF000000,
     430                                               0xFF000000,
    431431                                               0x00FF0000,
    432432                                               0x0000FF00,
     
    497497  glGenTextures(1, &texture);
    498498  glBindTexture(GL_TEXTURE_2D, texture);
    499   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    500   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
     499  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     500  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    501501  glTexImage2D(GL_TEXTURE_2D,
    502502               0,
  • trunk/src/lib/graphics/text_engine/font.h

    r5368 r5369  
    2323
    2424/* some default values */
    25 #define FONT_NUM_COLORS              256                        //!< number of colors.
     25#define FONT_NUM_COLORS              256           //!< number of colors.
    2626
    27 #define FONT_HIGHEST_KNOWN_CHAR      128                        //!< The highest character known to the textEngine.
    28 
     27#define FONT_HIGHEST_KNOWN_CHAR      128           //!< The highest character known to the textEngine.
     28#define FONT_DEFAULT_RENDER_SIZE     50            //!< At what Resolution to render fonts.
    2929// FORWARD DECLARATION
    3030
  • trunk/src/lib/graphics/text_engine/text.cc

    r5368 r5369  
    3737
    3838  if (fontFile != NULL)
    39     this->setFont(fontFile, textSize);
     39    this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE);
    4040  this->setType(type);
    4141  this->size = textSize;
  • trunk/src/lib/graphics/text_engine/text.h

    r5367 r5369  
    5858    void init();
    5959
    60     void setFont(const char* fontFile, unsigned int fontSize);
     60    void setFont(const char* fontFile, unsigned int renderSize);
    6161
    6262    void setText(const char* text, bool isExtern = false);
     
    6767    inline void setBlending(float blending) { this->blending = blending; };
    6868    /** sets the Color of the Text to render (values in [0-1]) @param r red @param g green @param b blue */
    69     void setColor(float r, float g, float b) { this->color = Vector(r,g,b); };
     69    void setColor(float r, float g, float b) { this->color = Vector(r, g, b); };
    7070    /** sets the Size of the Font */
    7171    void setSize(float size) { this->size = size; };
     72    /** @returns the Size of the Text */
     73    float getSize() const { return this->size; };
    7274
    7375    void setType(TEXT_RENDER_TYPE type);
  • trunk/src/lib/shell/shell.cc

    r5344 r5369  
    183183  this->textSize = textSize;
    184184  this->lineSpacing = lineSpacing;
    185   this->shellInput->setFont(this->fontFile, this->textSize);
    186 
    187   this->rebuildText();
     185  this->shellInput->setSize(this->textSize);
     186  this->shellInput->setRelCoor2D(5, (this->textSize + this->lineSpacing)*this->bufferDisplaySize + this->textSize);
     187
     188  if (this->bufferText != NULL)
     189  {
     190    for (unsigned int i = 0; i < this->bufferDisplaySize; i++)
     191    {
     192      if (this->bufferText[i] != NULL)
     193      {
     194        this->bufferText[i]->setSize(this->textSize);
     195        this->bufferText[i]->setRelCoorSoft2D(calculateLinePosition(i));
     196      }
     197    }
     198  }
     199  this->shellHeight = (this->textSize + this->lineSpacing) * (bufferDisplaySize+1);
     200
    188201}
    189202
  • trunk/src/lib/shell/shell_input.cc

    r5309 r5369  
    208208  ShellBuffer::addBufferLineStatic("Execute Command: %s\n", this->inputLine);
    209209
     210  if (strlen(this->inputLine) == 0)
     211    return false;
     212
    210213  char* newCommand = new char[strlen(this->inputLine)+1];
    211214  strcpy(newCommand, this->inputLine);
     215
     216  ShellCommandBase::execute(newCommand);
    212217
    213218  // removing the eventually added Entry (from scrolling) to the List
     
    227232  }
    228233
    229   ShellCommandBase::execute(this->inputLine);
    230 
    231234  this->flush();
    232235
    233   return false;
     236  return true;
    234237}
    235238
Note: See TracChangeset for help on using the changeset viewer.