aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2008-11-20 18:25:22 +0000
committerJohannes Schickel2008-11-20 18:25:22 +0000
commit4368081c555a2eda46e8b0743761bbe2db607da8 (patch)
treeeba3ea2aac9e178864119c3672ca2456afe17997
parent398fdab2765d769479b1060548f9205f860750a5 (diff)
downloadscummvm-rg350-4368081c555a2eda46e8b0743761bbe2db607da8.tar.gz
scummvm-rg350-4368081c555a2eda46e8b0743761bbe2db607da8.tar.bz2
scummvm-rg350-4368081c555a2eda46e8b0743761bbe2db607da8.zip
Fixed ZipArchive/FSDirectory creation.
svn-id: r35133
-rw-r--r--graphics/imageman.cpp7
-rw-r--r--gui/ThemeEngine.cpp11
2 files changed, 10 insertions, 8 deletions
diff --git a/graphics/imageman.cpp b/graphics/imageman.cpp
index 5b7b490cd7..04c732028b 100644
--- a/graphics/imageman.cpp
+++ b/graphics/imageman.cpp
@@ -47,10 +47,11 @@ ImageManager::~ImageManager() {
bool ImageManager::addArchive(const Common::String &name) {
Common::Archive *arch = 0;
+ Common::FSNode node(name);
- if (name.hasSuffix(".zip")) {
+ if (node.getName().hasSuffix(".zip")) {
#ifdef USE_ZLIB
- Common::ZipArchive *zip = new Common::ZipArchive(name);
+ Common::ZipArchive *zip = new Common::ZipArchive(node);
if (!zip || !zip->isOpen())
return false;
@@ -59,7 +60,7 @@ bool ImageManager::addArchive(const Common::String &name) {
return false;
#endif
} else {
- Common::FSDirectory *dir = new Common::FSDirectory(name);
+ Common::FSDirectory *dir = new Common::FSDirectory(node);
if (!dir || !dir->getFSNode().isDirectory())
return false;
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index ace3114f63..90ab2e211f 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -398,9 +398,8 @@ bool ThemeEngine::addFont(const Common::String &fontId, const Common::String &fi
}
bool ThemeEngine::addBitmap(const Common::String &filename) {
- if (_bitmaps.contains(filename)) {
+ if (_bitmaps.contains(filename))
ImageMan.unregisterSurface(filename);
- }
ImageMan.registerSurface(filename, 0);
_bitmaps[filename] = ImageMan.getSurface(filename);
@@ -1070,9 +1069,11 @@ const Graphics::Font *ThemeEngine::loadFontFromArchive(const Common::String &fil
Common::Archive *arch = 0;
const Graphics::NewFont *font = 0;
- if (getThemeFileName().hasSuffix(".zip")) {
+ Common::FSNode node(getThemeFileName());
+
+ if (node.getName().hasSuffix(".zip")) {
#ifdef USE_ZLIB
- Common::ZipArchive *zip = new Common::ZipArchive(getThemeFileName());
+ Common::ZipArchive *zip = new Common::ZipArchive(node);
if (!zip || !zip->isOpen())
return 0;
@@ -1081,7 +1082,7 @@ const Graphics::Font *ThemeEngine::loadFontFromArchive(const Common::String &fil
return 0;
#endif
} else {
- Common::FSDirectory *dir = new Common::FSDirectory(getThemeFileName());
+ Common::FSDirectory *dir = new Common::FSDirectory(node);
if (!dir || !dir->getFSNode().isDirectory())
return 0;