aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/font
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-29 00:27:50 +0200
committerEinar Johan Trøan Sømåen2012-07-29 00:27:50 +0200
commit6dc1e09da93c0ba0507fd0ceadbbb504469deccc (patch)
treedae477f4ed7c6b9be7a5dd38174d81cdbae48c58 /engines/wintermute/base/font
parente841bf16d6b955f779e5e30535848bd650d22352 (diff)
downloadscummvm-rg350-6dc1e09da93c0ba0507fd0ceadbbb504469deccc.tar.gz
scummvm-rg350-6dc1e09da93c0ba0507fd0ceadbbb504469deccc.tar.bz2
scummvm-rg350-6dc1e09da93c0ba0507fd0ceadbbb504469deccc.zip
WINTERMUTE: Replace const char* with const Common::String & in fonts, gfx, particles, sound and files.
Diffstat (limited to 'engines/wintermute/base/font')
-rw-r--r--engines/wintermute/base/font/base_font.cpp4
-rw-r--r--engines/wintermute/base/font/base_font.h4
-rw-r--r--engines/wintermute/base/font/base_font_bitmap.cpp8
-rw-r--r--engines/wintermute/base/font/base_font_bitmap.h2
-rw-r--r--engines/wintermute/base/font/base_font_storage.cpp6
-rw-r--r--engines/wintermute/base/font/base_font_storage.h2
-rw-r--r--engines/wintermute/base/font/base_font_truetype.cpp8
-rw-r--r--engines/wintermute/base/font/base_font_truetype.h2
8 files changed, 18 insertions, 18 deletions
diff --git a/engines/wintermute/base/font/base_font.cpp b/engines/wintermute/base/font/base_font.cpp
index 5087f1752d..4a5cd31002 100644
--- a/engines/wintermute/base/font/base_font.cpp
+++ b/engines/wintermute/base/font/base_font.cpp
@@ -151,7 +151,7 @@ bool BaseFont::persist(BasePersistenceManager *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-BaseFont *BaseFont::createFromFile(BaseGame *gameRef, const char *filename) {
+BaseFont *BaseFont::createFromFile(BaseGame *gameRef, const Common::String &filename) {
if (isTrueType(gameRef, filename)) {
BaseFontTT *font = new BaseFontTT(gameRef);
if (font) {
@@ -179,7 +179,7 @@ TOKEN_DEF(FONT)
TOKEN_DEF(TTFONT)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-bool BaseFont::isTrueType(BaseGame *gameRef, const char *filename) {
+bool BaseFont::isTrueType(BaseGame *gameRef, const Common::String &filename) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(FONT)
TOKEN_TABLE(TTFONT)
diff --git a/engines/wintermute/base/font/base_font.h b/engines/wintermute/base/font/base_font.h
index 695bce2af3..f1dc962565 100644
--- a/engines/wintermute/base/font/base_font.h
+++ b/engines/wintermute/base/font/base_font.h
@@ -48,12 +48,12 @@ public:
BaseFont(BaseGame *inGame);
virtual ~BaseFont();
- static BaseFont *createFromFile(BaseGame *game, const char *filename);
+ static BaseFont *createFromFile(BaseGame *game, const Common::String &filename);
private:
//bool loadBuffer(byte * Buffer);
//bool loadFile(const char* Filename);
- static bool isTrueType(BaseGame *game, const char *filename);
+ static bool isTrueType(BaseGame *game, const Common::String &filename);
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/font/base_font_bitmap.cpp b/engines/wintermute/base/font/base_font_bitmap.cpp
index e2c5fa881c..e7bf362b32 100644
--- a/engines/wintermute/base/font/base_font_bitmap.cpp
+++ b/engines/wintermute/base/font/base_font_bitmap.cpp
@@ -270,19 +270,19 @@ void BaseFontBitmap::drawChar(byte c, int x, int y) {
//////////////////////////////////////////////////////////////////////
-bool BaseFontBitmap::loadFile(const char *filename) {
+bool BaseFontBitmap::loadFile(const Common::String &filename) {
byte *buffer = _gameRef->_fileManager->readWholeFile(filename);
if (buffer == NULL) {
- _gameRef->LOG(0, "BaseFontBitmap::LoadFile failed for file '%s'", filename);
+ _gameRef->LOG(0, "BaseFontBitmap::LoadFile failed for file '%s'", filename.c_str());
return STATUS_FAILED;
}
bool ret;
- setFilename(filename);
+ setFilename(filename.c_str());
if (DID_FAIL(ret = loadBuffer(buffer))) {
- _gameRef->LOG(0, "Error parsing FONT file '%s'", filename);
+ _gameRef->LOG(0, "Error parsing FONT file '%s'", filename.c_str());
}
delete[] buffer;
diff --git a/engines/wintermute/base/font/base_font_bitmap.h b/engines/wintermute/base/font/base_font_bitmap.h
index abf2d39aa0..fb992d2e9a 100644
--- a/engines/wintermute/base/font/base_font_bitmap.h
+++ b/engines/wintermute/base/font/base_font_bitmap.h
@@ -38,7 +38,7 @@ class BaseFontBitmap : public BaseFont {
public:
DECLARE_PERSISTENT(BaseFontBitmap, BaseFont)
bool loadBuffer(byte *Buffer);
- bool loadFile(const char *filename);
+ bool loadFile(const Common::String &filename);
virtual int getTextWidth(byte *text, int maxLength = -1);
virtual int getTextHeight(byte *text, int width);
virtual void drawText(byte *text, int x, int y, int width, TTextAlign align = TAL_LEFT, int max_height = -1, int maxLength = -1);
diff --git a/engines/wintermute/base/font/base_font_storage.cpp b/engines/wintermute/base/font/base_font_storage.cpp
index bc4152131f..0c34a8822a 100644
--- a/engines/wintermute/base/font/base_font_storage.cpp
+++ b/engines/wintermute/base/font/base_font_storage.cpp
@@ -71,13 +71,13 @@ bool BaseFontStorage::initLoop() {
}
//////////////////////////////////////////////////////////////////////////
-BaseFont *BaseFontStorage::addFont(const char *filename) {
- if (!filename) {
+BaseFont *BaseFontStorage::addFont(const Common::String &filename) {
+ if (!filename.size()) {
return NULL;
}
for (int i = 0; i < _fonts.getSize(); i++) {
- if (scumm_stricmp(_fonts[i]->getFilename(), filename) == 0) {
+ if (scumm_stricmp(_fonts[i]->getFilename(), filename.c_str()) == 0) {
_fonts[i]->_refCount++;
return _fonts[i];
}
diff --git a/engines/wintermute/base/font/base_font_storage.h b/engines/wintermute/base/font/base_font_storage.h
index 3af9244ffe..3a39617c32 100644
--- a/engines/wintermute/base/font/base_font_storage.h
+++ b/engines/wintermute/base/font/base_font_storage.h
@@ -43,7 +43,7 @@ public:
DECLARE_PERSISTENT(BaseFontStorage, BaseClass)
bool cleanup(bool warn = false);
bool removeFont(BaseFont *font);
- BaseFont *addFont(const char *filename);
+ BaseFont *addFont(const Common::String &filename);
BaseFontStorage(BaseGame *inGame);
virtual ~BaseFontStorage();
BaseArray<BaseFont *> _fonts;
diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp
index 2dd436dc37..793c044839 100644
--- a/engines/wintermute/base/font/base_font_truetype.cpp
+++ b/engines/wintermute/base/font/base_font_truetype.cpp
@@ -292,19 +292,19 @@ int BaseFontTT::getLetterHeight() {
//////////////////////////////////////////////////////////////////////
-bool BaseFontTT::loadFile(const char *filename) {
+bool BaseFontTT::loadFile(const Common::String &filename) {
byte *buffer = _gameRef->_fileManager->readWholeFile(filename);
if (buffer == NULL) {
- _gameRef->LOG(0, "BaseFontTT::LoadFile failed for file '%s'", filename);
+ _gameRef->LOG(0, "BaseFontTT::LoadFile failed for file '%s'", filename.c_str());
return STATUS_FAILED;
}
bool ret;
- setFilename(filename);
+ setFilename(filename.c_str());
if (DID_FAIL(ret = loadBuffer(buffer))) {
- _gameRef->LOG(0, "Error parsing TTFONT file '%s'", filename);
+ _gameRef->LOG(0, "Error parsing TTFONT file '%s'", filename.c_str());
}
delete[] buffer;
diff --git a/engines/wintermute/base/font/base_font_truetype.h b/engines/wintermute/base/font/base_font_truetype.h
index 20ef531a46..a893e70ec0 100644
--- a/engines/wintermute/base/font/base_font_truetype.h
+++ b/engines/wintermute/base/font/base_font_truetype.h
@@ -105,7 +105,7 @@ public:
virtual int getLetterHeight();
bool loadBuffer(byte *buffer);
- bool loadFile(const char *filename);
+ bool loadFile(const Common::String &filename);
float getLineHeight() const {
return _lineHeight;