aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorVicent Marti2008-09-29 19:23:36 +0000
committerVicent Marti2008-09-29 19:23:36 +0000
commit60ad4bd0d94321cdd78bcf79a507981f17d6ee43 (patch)
tree041ac12b1682b2d75beef7c90345a019b80a10f0 /gui
parentc8f42a39737dbd50cbdc4cad7c6a6c89ca0efe69 (diff)
parent1776c75566603d4ecba657e4d4cd67a769ddb43d (diff)
downloadscummvm-rg350-60ad4bd0d94321cdd78bcf79a507981f17d6ee43.tar.gz
scummvm-rg350-60ad4bd0d94321cdd78bcf79a507981f17d6ee43.tar.bz2
scummvm-rg350-60ad4bd0d94321cdd78bcf79a507981f17d6ee43.zip
- Merged 75 revisions from trunk.
- Fixed new conflicts. - Changed Theme loading to use the new ZipArchive class. - Implemented ZipArchive::getAllNames() Original log message from SVNMerge.py ================================ Merged revisions 34605,34613-34615,34617,34619-34624,34627-34628,34630-34639,34642-34649,34656-34661,34663-34664,34671-34672,34674-34676,34678-34685 via svnmerge from https://tanoku@scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk ........ r34605 | Tanoku | 2008-09-20 12:32:59 +0200 (Sat, 20 Sep 2008) | 1 line Fixed "empty control statement" warning in FSDirectory::matchPattern(). ........ r34613 | lordhoto | 2008-09-20 16:53:31 +0200 (Sat, 20 Sep 2008) | 2 lines Updated theme file version, to reflect latest addition of new required entries/files. ........ r34614 | wjpalenstijn | 2008-09-20 17:03:37 +0200 (Sat, 20 Sep 2008) | 1 line fix drawing order in saveload choosers (draw container before contents) ........ r34615 | fingolfin | 2008-09-20 17:53:17 +0200 (Sat, 20 Sep 2008) | 1 line Little readability tweak ........ r34617 | fingolfin | 2008-09-20 18:10:29 +0200 (Sat, 20 Sep 2008) | 1 line Fix for bug #2120602: 5ALL: Starting the launcher with -f triggers assertion ........ r34619 | eriktorbjorn | 2008-09-20 18:21:27 +0200 (Sat, 20 Sep 2008) | 4 lines I think this is the correct fix for bug #2081347 ("MM: Charset out of bounds!"). If I understand correctly, version <= 2 games only have one (hard- coded) font, so when that's initialised we can set _curId to 0. ........ r34620 | marcus_c | 2008-09-20 18:38:50 +0200 (Sat, 20 Sep 2008) | 1 line game.h is now in engines, not base. ........ r34621 | marcus_c | 2008-09-20 18:47:31 +0200 (Sat, 20 Sep 2008) | 5 lines In the CD filesystem, nothing can be opened for writing, so just short-circuit any call to openForWriting(). Also, directories and non-existing files can't be opened for reading either, so just return 0 for those. ........ r34622 | sev | 2008-09-21 12:23:22 +0200 (Sun, 21 Sep 2008) | 2 lines Patch #2054467: CRUISE: 64bits fixes ........ r34623 | sev | 2008-09-21 13:17:22 +0200 (Sun, 21 Sep 2008) | 2 lines Add recent patch contributors. Reflect current ScummVM team in the credits ........ r34624 | sev | 2008-09-21 13:18:16 +0200 (Sun, 21 Sep 2008) | 2 lines Reflect current team ........ r34627 | lordhoto | 2008-09-22 19:33:30 +0200 (Mon, 22 Sep 2008) | 1 line Fixed full screen toggling via alt+enter. ........ r34628 | fingolfin | 2008-09-22 22:55:27 +0200 (Mon, 22 Sep 2008) | 1 line Fix comments for random() funcs (thanks to salty-horse for pointing this out) ........ r34630 | fingolfin | 2008-09-23 11:39:37 +0200 (Tue, 23 Sep 2008) | 1 line Moved ZipArchive implementation into unzip.cpp, added new ZipArchive::isOpen method ........ r34631 | fingolfin | 2008-09-23 11:42:38 +0200 (Tue, 23 Sep 2008) | 1 line ImageManager: renamed remArchive() to removeArchive(); switched to using a SearchSet + ZipArchive to access ZIP files (code is much simpler now yet more flexible, yay) ........ r34632 | fingolfin | 2008-09-23 11:50:03 +0200 (Tue, 23 Sep 2008) | 1 line Moved ZipArchive to namespace Common; moved unzip internals from unzip.h to unzip.cpp (to be cleaned up) ........ r34633 | fingolfin | 2008-09-23 12:08:45 +0200 (Tue, 23 Sep 2008) | 1 line cleanup ........ r34634 | fingolfin | 2008-09-23 12:10:29 +0200 (Tue, 23 Sep 2008) | 1 line Perform error checking when reading from a ZIP file ........ r34635 | fingolfin | 2008-09-23 13:43:57 +0200 (Tue, 23 Sep 2008) | 1 line Fix for bug #1917981: Game crash when finishing Indy3 demo. At the same time, added a new paranoia check ........ r34636 | Kirben | 2008-09-23 14:34:02 +0200 (Tue, 23 Sep 2008) | 1 line Add another French Windows version of Putt-Putt Enters the Race. ........ r34637 | lordhoto | 2008-09-23 18:40:41 +0200 (Tue, 23 Sep 2008) | 2 lines Fix for bug #2120780 "GUI: gui-theme command-line option ignored", '-f' and '-g' command line switch behavior. ........ r34638 | john_doe | 2008-09-24 01:16:47 +0200 (Wed, 24 Sep 2008) | 1 line Improved updateScreenAndWait; the mouse cursor is less jerky now in some scenes in Manhole:N&E ........ r34639 | thebluegr | 2008-09-24 09:26:45 +0200 (Wed, 24 Sep 2008) | 1 line Readded missing special case for the storm animation in ITE. Fixes bug #2125675 - "ITE: Game locks up in storm clouds scene" ........ r34642 | fingolfin | 2008-09-24 22:29:29 +0200 (Wed, 24 Sep 2008) | 1 line Changed Common::String to use a MemoryPool for its refcounts ........ r34643 | fingolfin | 2008-09-24 22:31:14 +0200 (Wed, 24 Sep 2008) | 1 line cleanup ........ r34644 | fingolfin | 2008-09-24 22:35:31 +0200 (Wed, 24 Sep 2008) | 1 line Changed builtin Common::String capacity to 24 (on 32 bit systems), to make sizeof(String) 32; reduces overall memory req by 200k on my system; overall # of mallocs after this + the refcount memory pool change is almost unchanged ........ r34645 | sev | 2008-09-25 00:44:01 +0200 (Thu, 25 Sep 2008) | 2 lines Fix bugs #1981081: "ITE: No blinking disk icon" and #1971729: "IHNM: No Animation of Disk Icon" ........ r34646 | fingolfin | 2008-09-25 10:06:18 +0200 (Thu, 25 Sep 2008) | 1 line SCUMM: Added a new ActorHE class, as well as a virtual Actor::prepareDrawActorCostume() method ........ r34647 | fingolfin | 2008-09-25 10:19:51 +0200 (Thu, 25 Sep 2008) | 1 line SCUMM: Moved Actor::drawActorToBackBuf to class ActorHE ........ r34648 | fingolfin | 2008-09-25 12:11:06 +0200 (Thu, 25 Sep 2008) | 1 line SCUMM: Moved more stuf from class Actor to ActorHE ........ r34649 | fingolfin | 2008-09-25 12:14:50 +0200 (Thu, 25 Sep 2008) | 1 line cleanup ........ r34656 | eriktorbjorn | 2008-09-27 19:25:40 +0200 (Sat, 27 Sep 2008) | 2 lines Fixed typos. ........ r34657 | eriktorbjorn | 2008-09-27 19:47:22 +0200 (Sat, 27 Sep 2008) | 2 lines Allow quitting or returning to the launcher while cutscenes are playing. ........ r34658 | eriktorbjorn | 2008-09-27 19:51:22 +0200 (Sat, 27 Sep 2008) | 2 lines Slight simplification of last commit. ........ r34659 | fingolfin | 2008-09-27 20:32:01 +0200 (Sat, 27 Sep 2008) | 1 line Modified Common::SearchSet to take signed integer priorities, for convenience (so that one can add archives with less-than-default priority) ........ r34660 | fingolfin | 2008-09-27 20:34:24 +0200 (Sat, 27 Sep 2008) | 1 line Fixed a nasty bug in SearchManager::addDirectory; made the 'char' constructor of Common::String explicit, to avoid such bugs in the future ........ r34661 | drmccoy | 2008-09-27 22:04:04 +0200 (Sat, 27 Sep 2008) | 2 lines Added a spanish floppy version of Lost in Time, as supplied by goodoldgeorg in bug report #2105220 ........ r34663 | fingolfin | 2008-09-28 01:00:46 +0200 (Sun, 28 Sep 2008) | 1 line Changed Common::File to use SearchMan ........ r34664 | fingolfin | 2008-09-28 01:27:01 +0200 (Sun, 28 Sep 2008) | 1 line SCUMM: Use FilesystemNode::openForReading instead of Common::File::open(FilesystemNode) in the detector ........ r34671 | john_doe | 2008-09-28 22:02:01 +0200 (Sun, 28 Sep 2008) | 1 line Return 32000 in sfGetCdTime instead of 0; this fixes the Manhole intro/credits (until the function is actually implemented) ........ r34672 | sev | 2008-09-28 23:07:41 +0200 (Sun, 28 Sep 2008) | 2 lines Add Italian C64 Zak ........ r34674 | sev | 2008-09-28 23:53:14 +0200 (Sun, 28 Sep 2008) | 2 lines Fix bug #2043489: DRASCULA: Cannot disable speech ........ r34675 | sev | 2008-09-29 00:07:16 +0200 (Mon, 29 Sep 2008) | 3 lines - Renamed withVoices to _subtitlesDisabled as it reflect the true meaning. - Allowed to disable subtitles from options dialogs including RTL. ........ r34676 | sev | 2008-09-29 00:19:11 +0200 (Mon, 29 Sep 2008) | 2 lines Use better "silence" without clicks when speech is disabled. ........ r34678 | fingolfin | 2008-09-29 12:29:01 +0200 (Mon, 29 Sep 2008) | 1 line Added FIXME to GP2x port ........ r34679 | fingolfin | 2008-09-29 12:30:31 +0200 (Mon, 29 Sep 2008) | 1 line Add priority parameter to the SearchMan API ........ r34680 | fingolfin | 2008-09-29 12:32:06 +0200 (Mon, 29 Sep 2008) | 1 line File::open no longer falls back to searching the current dir (if this causes any regressions, please report them; don't work around them, don't revert this change, without discussing it first) ........ r34681 | fingolfin | 2008-09-29 12:49:36 +0200 (Mon, 29 Sep 2008) | 1 line Don't subclass ArjFile from Common::File (there seems to be no good reason for it). BTW, this code is an abomination and should be replaced by an Archive/SearchSet approach ........ r34682 | fingolfin | 2008-09-29 13:01:25 +0200 (Mon, 29 Sep 2008) | 1 line Added const qualifiers ........ r34683 | fingolfin | 2008-09-29 13:02:11 +0200 (Mon, 29 Sep 2008) | 1 line SCUMM HE: Fixed leak in Win32ResExtractor::extractResource_, use _filename instead of File::name ........ r34684 | fingolfin | 2008-09-29 13:03:10 +0200 (Mon, 29 Sep 2008) | 1 line Added const qualifiers ........ r34685 | fingolfin | 2008-09-29 13:07:39 +0200 (Mon, 29 Sep 2008) | 1 line Don't use File::name() needlessly (i.e. if you still know which file you just opened :) ........ svn-id: r34687
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 {