Added const to reference parameters of Font::drawString() and Font::getStringWidth().

svn-id: r41530
This commit is contained in:
Denis Kasak 2009-06-15 00:31:25 +00:00
parent 910991ddde
commit a3a9f5c790
2 changed files with 4 additions and 4 deletions

View File

@ -217,7 +217,7 @@ void Font::drawChar(Graphics::Surface *dst, uint8 chr, int tx, int ty) const {
* @param spacing Space to leave between individual characters. Defaults to 0.
*/
void Font::drawString(Graphics::Surface *dst, Common::String &str,
void Font::drawString(Graphics::Surface *dst, const Common::String &str,
int x, int y, int spacing) const {
assert(dst != NULL);
assert(x >= 0);
@ -247,7 +247,7 @@ void Font::drawString(Graphics::Surface *dst, Common::String &str,
* @return The calculated width of the string
*/
int Font::getStringWidth(Common::String &str, int spacing) const {
int Font::getStringWidth(const Common::String &str, int spacing) const {
int width = 0;
uint len = str.size();
for (unsigned int i = 0; i < len; ++i) {

View File

@ -50,9 +50,9 @@ public:
uint8 getMaxCharWidth() const { return _maxCharWidth; };
uint8 getCharWidth(byte chr) const;
void drawChar(Graphics::Surface *dst, uint8 chr, int tx, int ty) const;
void drawString(Graphics::Surface *dst, Common::String &str,
void drawString(Graphics::Surface *dst, const Common::String &str,
int x, int y, int spacing = 0) const;
int getStringWidth(Common::String &str, int spacing = 0) const;
int getStringWidth(const Common::String &str, int spacing = 0) const;
void setColour(uint8 colour);
private: