- Timestamp:
- Apr 29, 2006, 10:38:12 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/BuildLibs.am
r7453 r7455 2 2 libORXlibs_a_LIBRARIES_ = \ 3 3 $(LIB_PREFIX)/libORXlibs.a \ 4 $(LIB_PREFIX)/shell/libORXshell.a \ 4 5 $(LIB_PREFIX)/gui/gtk_gui/libORXgui.a \ 5 6 $(LIB_PREFIX)/gui/gl_gui/libORXglgui.a \ -
trunk/src/lib/graphics/text_engine/multi_line_text.cc
r7454 r7455 91 91 for (unsigned int i = 0; i < this->getText().size(); ++i) 92 92 { 93 if (unlikely( this->getText()[i] == '\n' ||i == this->lineEnds[lineNumber]))93 if (unlikely(!this->lineEnds.empty() && i == this->lineEnds[lineNumber])) 94 94 { 95 95 // go to the next Line. … … 140 140 width += this->getFont()->getGlyphArray()[this->getText()[i]]->advance; 141 141 } 142 this->setSizeY2D(this->lineEnds.size() * (this->lineSpacing +this->getFont()->getMaxHeight()));142 this->setSizeY2D(this->lineEnds.size() * (this->lineSpacing + this->getFont()->getMaxHeight())); 143 143 } -
trunk/src/lib/graphics/text_engine/text.cc
r7453 r7455 35 35 // initialize this Text 36 36 this->font = NULL; 37 this->text = ""; 38 this->setAlignment(TEXT_DEFAULT_ALIGNMENT); 37 38 this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE); 39 39 40 this->blending = TEXT_DEFAULT_BLENDING; 40 41 this->color = TEXT_DEFAULT_COLOR; 41 42 if (!fontFile.empty()) 43 this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE); 44 42 this->setAlignment(TEXT_DEFAULT_ALIGNMENT); 45 43 this->setSize(TEXT_DEFAULT_SIZE); 46 44 } … … 63 61 void Text::setFont(const std::string& fontFile, unsigned int fontSize) 64 62 { 65 Font* newFont ;63 Font* newFont = NULL; 66 64 Font* oldFont = this->font; 67 65 … … 76 74 } 77 75 } 78 else76 if (newFont == NULL) 79 77 newFont = Font::getDefaultFont(); 78 assert(newFont != NULL); 80 79 81 80 // unloading the Font if we alrady have one loaded. -
trunk/src/lib/shell/shell_input.cc
r7452 r7455 46 46 */ 47 47 ShellInput::ShellInput () 48 : Text ("") 49 { 48 : MultiLineText ("") 49 { 50 this->setLineWidth(100); 51 50 52 this->pressedKey = SDLK_FIRST; 51 53 this->setClassID(CL_SHELL_INPUT, "ShellInput"); -
trunk/src/lib/shell/shell_input.h
r7452 r7455 10 10 #define _SHELL_INPUT_H 11 11 12 #include " text.h"12 #include "multi_line_text.h" 13 13 #include "event_listener.h" 14 14 #include "shell_completion.h" … … 28 28 * [UP] and [DOWN] move through the history of allready given commands. 29 29 */ 30 class ShellInput : public Text, public EventListener30 class ShellInput : public MultiLineText, public EventListener 31 31 { 32 32
Note: See TracChangeset
for help on using the changeset viewer.