aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeEngine.cpp78
-rw-r--r--gui/credits.h17
-rw-r--r--gui/launcher.cpp8
-rw-r--r--gui/theme.cpp8
-rw-r--r--gui/theme.h2
5 files changed, 53 insertions, 60 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index c33251b546..6af62f7b80 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -30,6 +30,7 @@
#include "common/events.h"
#include "common/config-manager.h"
#include "common/fs.h"
+#include "common/unzip.h"
#include "graphics/imageman.h"
#include "graphics/cursorman.h"
#include "gui/launcher.h"
@@ -251,7 +252,7 @@ void ThemeEngine::unloadTheme() {
ImageMan.unregisterSurface(i->_key);
if (_themeFileName.hasSuffix(".zip"))
- ImageMan.remArchive(_themeFileName);
+ ImageMan.removeArchive(_themeFileName);
Common::File::resetDefaultDirectories();
@@ -534,53 +535,36 @@ bool ThemeEngine::loadThemeXML(Common::String themeName) {
bool failed = false;
#ifdef USE_ZLIB
- unzFile zipFile = unzOpen((themeName).c_str());
+ Common::ZipArchive zipFile(themeName.c_str());
+ Common::StringList zipContents;
- if (zipFile && unzGoToFirstFile(zipFile) == UNZ_OK) {
- while (true) {
- unz_file_info fileInfo;
- unzOpenCurrentFile(zipFile);
- unzGetCurrentFileInfo(zipFile, &fileInfo, fileNameBuffer, 32, NULL, 0, NULL, 0);
+ if (zipFile.isOpen() && zipFile.getAllNames(zipContents)) {
- if (matchString(fileNameBuffer, "*.stx") || !strcmp(fileNameBuffer, "THEMERC")) {
- uint8 *buffer = new uint8[fileInfo.uncompressed_size+1];
- assert(buffer);
- memset(buffer, 0, (fileInfo.uncompressed_size+1)*sizeof(uint8));
- unzReadCurrentFile(zipFile, buffer, fileInfo.uncompressed_size);
-
- Common::MemoryReadStream *stream = new Common::MemoryReadStream(buffer, fileInfo.uncompressed_size+1, true);
+ for (uint i = 0; i < zipContents.size(); ++i) {
+ if (!failed && matchString(zipContents[i].c_str(), "*.stx")) {
+ if (parser()->loadStream(zipFile.openFile(zipContents[i])) == false) {
+ warning("Failed to load stream for zipped file '%s'", fileNameBuffer);
+ failed = true;
+ }
- if (!strcmp(fileNameBuffer, "THEMERC")) {
- stxHeader = stream->readLine();
-
- if (!themeConfigParseHeader(stxHeader.c_str(), _themeName)) {
- warning("Corrupted 'THEMERC' file in theme '%s'", _themeFileName.c_str());
- failed = true;
- }
-
- delete stream;
-
- } else if (!failed) {
- parseCount++;
-
- if (parser()->loadStream(stream) == false) {
- warning("Failed to load stream for zipped file '%s'", fileNameBuffer);
- failed = true;
- }
-
- if (parser()->parse() == false) {
- warning("Theme parsing failed on zipped file '%s'.", fileNameBuffer);
- failed = true;
- }
-
- parser()->close();
+ if (parser()->parse() == false) {
+ warning("Theme parsing failed on zipped file '%s'.", fileNameBuffer);
+ failed = true;
}
- }
-
- unzCloseCurrentFile(zipFile);
-
- if (unzGoToNextFile(zipFile) != UNZ_OK)
- break;
+
+ parser()->close();
+ parseCount++;
+ } else if (zipContents[i] == "THEMERC") {
+ Common::SeekableReadStream *stream = zipFile.openFile(zipContents[i]);
+ stxHeader = stream->readLine();
+
+ if (!themeConfigParseHeader(stxHeader.c_str(), _themeName)) {
+ warning("Corrupted 'THEMERC' file in theme '%s'", _themeFileName.c_str());
+ failed = true;
+ }
+
+ delete stream;
+ }
}
} else {
#endif
@@ -619,13 +603,9 @@ bool ThemeEngine::loadThemeXML(Common::String themeName) {
}
}
#ifdef USE_ZLIB
- }
-
- unzClose(zipFile);
-
+ }
#endif
-
return (parseCount > 0 && _themeName.empty() == false && failed == false);
}
diff --git a/gui/credits.h b/gui/credits.h
index b8d2e345c8..c04a99ddbd 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -144,7 +144,6 @@ static const char *credits[] = {
"\\C\\c0""Kostas Nakos",
"\\C\\c0""",
"\\C\\c1""PlayStation 2",
-"\\C\\c0""Robert G\366ffringmann",
"\\C\\c0""Max Lingua",
"\\C\\c0""",
"\\C\\c1""PSP (PlayStation Portable)",
@@ -205,6 +204,10 @@ static const char *credits[] = {
"\\C\\c2""Help with GUI implementation",
"\\C\\c0""Jamieson Christian",
"\\C\\c2""iMUSE, MIDI, all things musical",
+"\\C\\c0""Hans-J\366rg Frieden",
+"\\C\\c2""Former AmigaOS 4 packager",
+"\\C\\c0""Robert G\366ffringmann",
+"\\C\\c2""Original PS2 porter",
"\\C\\c0""R\374diger Hanke",
"\\C\\c2""Port: MorphOS",
"\\C\\c0""Felix Jakschitsch",
@@ -213,6 +216,8 @@ static const char *credits[] = {
"\\C\\c2""Original MacOS porter",
"\\C\\c0""Peter Moraliyski",
"\\C\\c2""Port: GP32",
+"\\C\\c0""Juha Niemim\344ki",
+"\\C\\c2""Formaer AmigaOS 4 packager",
"\\C\\c0""Jeremy Newman",
"\\C\\c2""Former webmaster",
"\\C\\c0""Lionel Ulmer",
@@ -225,9 +230,7 @@ static const char *credits[] = {
"\\C\\c0""",
"\\C\\c1""Packages",
"\\C\\c1""AmigaOS 4",
-"\\C\\c0""Hans-J\366rg Frieden",
"\\C\\c0""Hubert Maier",
-"\\C\\c0""Juha Niemim\344ki",
"\\C\\c0""",
"\\C\\c1""Atari/FreeMiNT",
"\\C\\c0""Keith Scroggins",
@@ -294,6 +297,8 @@ static const char *credits[] = {
"\\C\\c2""PSP port contributions",
"\\C\\c0""Thierry Crozat",
"\\C\\c2""Support for Broken Sword 1 Macintosh version",
+"\\C\\c0""Martin Doucha",
+"\\C\\c2""CinE engine objectification",
"\\C\\c0""Thomas Fach-Pedersen",
"\\C\\c2""ProTracker module player",
"\\C\\c0""Benjamin Haisch",
@@ -342,10 +347,14 @@ static const char *credits[] = {
"\\C\\c2""For the original MT-32 emulator",
"\\C\\c0""Kevin Carnes",
"\\C\\c2""For Scumm16, the basis of ScummVM's older gfx codecs",
+"\\C\\c0""Curt Coder",
+"\\C\\c2""For the original TrollVM (preAGI) code",
"\\C\\c0""Patrick Combet",
"\\C\\c2""For the original Gobliiins ADL player",
"\\C\\c0""Ivan Dubrov",
"\\C\\c2""For contributing the initial version of the Gobliiins engine",
+"\\C\\c0""Till Kresslein",
+"\\C\\c2""For design of modern ScummVM GUI",
"\\C\\c0""Jezar",
"\\C\\c2""For his freeverb filter implementation",
"\\C\\c0""Jim Leiterman",
@@ -358,6 +367,8 @@ static const char *credits[] = {
"\\C\\c2""For ScummRev, and much obscure code/documentation",
"\\C\\c0""Tristan",
"\\C\\c2""For additional work on the original MT-32 emulator",
+"\\C\\c0""James Woodcock",
+"\\C\\c2""Soundtrack enhancements",
"\\C\\c0""Tony Warriner and everyone at Revolution Software Ltd. for sharing with us the source of some of their brilliant games, allowing us to release Beneath a Steel Sky as freeware... and generally being supportive above and beyond the call of duty.",
"\\C\\c0""",
"\\C\\c0""John Passfield and Steve Stamatiadis for sharing the source of their classic title, Flight of the Amazon Queen and also being incredibly supportive.",
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 978c224afd..e337c718a2 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -524,10 +524,7 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel)
// Add choice list
_list = new GUI::ListWidget(this, "ScummSaveLoad.List");
_list->setNumberingMode(GUI::kListNumberingOff);
-
- _container = new GUI::ContainerWidget(this, 0, 0, 10, 10);
-// _container->setHints(GUI::THEME_HINT_USE_SHADOW);
-
+
_gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 10, 10);
_date = new StaticTextWidget(this, 0, 0, 10, 10, "No date saved", kTextAlignCenter);
@@ -543,6 +540,9 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel)
_deleteButton->setEnabled(false);
_delSupport = _metaInfoSupport = _thumbnailSupport = false;
+
+ _container = new GUI::ContainerWidget(this, 0, 0, 10, 10);
+// _container->setHints(GUI::THEME_HINT_USE_SHADOW);
}
SaveLoadChooser::~SaveLoadChooser() {
diff --git a/gui/theme.cpp b/gui/theme.cpp
index df9ae34017..8c27d27417 100644
--- a/gui/theme.cpp
+++ b/gui/theme.cpp
@@ -45,7 +45,7 @@ const Graphics::Font *Theme::loadFont(const char *filename) {
return font;
#ifdef USE_ZLIB
- ZipArchive zipArchive(getThemeFileName().c_str());
+ Common::ZipArchive zipArchive(getThemeFileName().c_str());
if (zipArchive.hasFile(cacheFilename)) {
Common::FilePtr stream(zipArchive.openFile(cacheFilename));
font = Graphics::NewFont::loadFromCache(*stream.get());
@@ -62,7 +62,8 @@ const Graphics::Font *Theme::loadFont(const char *filename) {
#ifdef USE_ZLIB
if (!font) {
- ZipArchive zipArchive(getThemeFileName().c_str());
+ Common::ZipArchive zipArchive(getThemeFileName().c_str());
+
if (zipArchive.hasFile(filename)) {
Common::FilePtr stream(zipArchive.openFile(filename));
font = Graphics::NewFont::loadFont(*stream.get());
@@ -145,7 +146,8 @@ bool Theme::themeConfigUseable(const Common::FilesystemNode &node, Common::Strin
if (node.getName().hasSuffix(".zip")) {
#ifdef USE_ZLIB
- ZipArchive zipArchive(node.getPath().c_str());
+
+ Common::ZipArchive zipArchive(node.getPath().c_str());
if (zipArchive.hasFile("THEMERC")) {
Common::FilePtr stream(zipArchive.openFile("THEMERC"));
stxHeader = stream->readLine();
diff --git a/gui/theme.h b/gui/theme.h
index 302029247b..5294daa4d4 100644
--- a/gui/theme.h
+++ b/gui/theme.h
@@ -34,7 +34,7 @@
#include "graphics/surface.h"
#include "graphics/fontman.h"
-#define THEME_VERSION 23
+#define THEME_VERSION 24
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_THEME_V23"
namespace GUI {