[Scummvm-cvs-logs] SF.net SVN: scummvm:[34687] scummvm/branches/gsoc2008-gui

tanoku at users.sourceforge.net tanoku at users.sourceforge.net
Mon Sep 29 21:24:36 CEST 2008


Revision: 34687
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34687&view=rev
Author:   tanoku
Date:     2008-09-29 19:23:36 +0000 (Mon, 29 Sep 2008)

Log Message:
-----------
- 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 :)
........

Modified Paths:
--------------
    scummvm/branches/gsoc2008-gui/AUTHORS
    scummvm/branches/gsoc2008-gui/COPYRIGHT
    scummvm/branches/gsoc2008-gui/backends/platform/dc/dc-fs.cpp
    scummvm/branches/gsoc2008-gui/backends/platform/dc/selector.cpp
    scummvm/branches/gsoc2008-gui/backends/platform/gp2x/gp2x.cpp
    scummvm/branches/gsoc2008-gui/backends/platform/sdl/events.cpp
    scummvm/branches/gsoc2008-gui/backends/platform/sdl/graphics.cpp
    scummvm/branches/gsoc2008-gui/backends/platform/sdl/sdl.cpp
    scummvm/branches/gsoc2008-gui/backends/platform/sdl/sdl.h
    scummvm/branches/gsoc2008-gui/base/main.cpp
    scummvm/branches/gsoc2008-gui/common/archive.cpp
    scummvm/branches/gsoc2008-gui/common/archive.h
    scummvm/branches/gsoc2008-gui/common/file.cpp
    scummvm/branches/gsoc2008-gui/common/str.cpp
    scummvm/branches/gsoc2008-gui/common/str.h
    scummvm/branches/gsoc2008-gui/common/system.h
    scummvm/branches/gsoc2008-gui/common/unarj.cpp
    scummvm/branches/gsoc2008-gui/common/unarj.h
    scummvm/branches/gsoc2008-gui/common/unzip.cpp
    scummvm/branches/gsoc2008-gui/common/unzip.h
    scummvm/branches/gsoc2008-gui/common/util.h
    scummvm/branches/gsoc2008-gui/common/xmlparser.h
    scummvm/branches/gsoc2008-gui/engines/agi/predictive.cpp
    scummvm/branches/gsoc2008-gui/engines/cruise/cruise_main.cpp
    scummvm/branches/gsoc2008-gui/engines/cruise/ctp.cpp
    scummvm/branches/gsoc2008-gui/engines/cruise/dataLoader.cpp
    scummvm/branches/gsoc2008-gui/engines/cruise/overlay.cpp
    scummvm/branches/gsoc2008-gui/engines/cruise/overlay.h
    scummvm/branches/gsoc2008-gui/engines/cruise/saveload.cpp
    scummvm/branches/gsoc2008-gui/engines/cruise/vars.h
    scummvm/branches/gsoc2008-gui/engines/drascula/drascula.cpp
    scummvm/branches/gsoc2008-gui/engines/drascula/drascula.h
    scummvm/branches/gsoc2008-gui/engines/drascula/sound.cpp
    scummvm/branches/gsoc2008-gui/engines/drascula/talk.cpp
    scummvm/branches/gsoc2008-gui/engines/gob/detection.cpp
    scummvm/branches/gsoc2008-gui/engines/made/screen.cpp
    scummvm/branches/gsoc2008-gui/engines/made/scriptfuncs.cpp
    scummvm/branches/gsoc2008-gui/engines/parallaction/balloons.cpp
    scummvm/branches/gsoc2008-gui/engines/parallaction/saveload.cpp
    scummvm/branches/gsoc2008-gui/engines/saga/animation.cpp
    scummvm/branches/gsoc2008-gui/engines/saga/displayinfo.h
    scummvm/branches/gsoc2008-gui/engines/saga/interface.cpp
    scummvm/branches/gsoc2008-gui/engines/saga/interface.h
    scummvm/branches/gsoc2008-gui/engines/scumm/actor.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/actor.h
    scummvm/branches/gsoc2008-gui/engines/scumm/akos.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/charset-fontdata.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/detection.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/detection_tables.h
    scummvm/branches/gsoc2008-gui/engines/scumm/dialogs.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/file.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/file.h
    scummvm/branches/gsoc2008-gui/engines/scumm/file_nes.h
    scummvm/branches/gsoc2008-gui/engines/scumm/gfx.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/he/intern_he.h
    scummvm/branches/gsoc2008-gui/engines/scumm/he/resource_he.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/he/resource_he.h
    scummvm/branches/gsoc2008-gui/engines/scumm/he/script_v100he.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/he/script_v60he.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/he/script_v70he.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/he/script_v71he.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/he/script_v72he.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/he/script_v80he.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/he/script_v90he.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/object.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/scumm-md5.h
    scummvm/branches/gsoc2008-gui/engines/scumm/scumm.cpp
    scummvm/branches/gsoc2008-gui/engines/scumm/scumm.h
    scummvm/branches/gsoc2008-gui/engines/sword1/animation.cpp
    scummvm/branches/gsoc2008-gui/engines/sword1/animation.h
    scummvm/branches/gsoc2008-gui/engines/sword1/logic.cpp
    scummvm/branches/gsoc2008-gui/engines/sword1/logic.h
    scummvm/branches/gsoc2008-gui/engines/sword1/sword1.cpp
    scummvm/branches/gsoc2008-gui/graphics/imageman.cpp
    scummvm/branches/gsoc2008-gui/graphics/imageman.h
    scummvm/branches/gsoc2008-gui/gui/ThemeEngine.cpp
    scummvm/branches/gsoc2008-gui/gui/credits.h
    scummvm/branches/gsoc2008-gui/gui/launcher.cpp
    scummvm/branches/gsoc2008-gui/gui/theme.cpp
    scummvm/branches/gsoc2008-gui/gui/theme.h
    scummvm/branches/gsoc2008-gui/tools/credits.pl
    scummvm/branches/gsoc2008-gui/tools/scumm-md5.txt

Property Changed:
----------------
    scummvm/branches/gsoc2008-gui/


Property changes on: scummvm/branches/gsoc2008-gui
___________________________________________________________________
Modified: svnmerge-integrated
   - /scummvm/trunk:1-34604
   + /scummvm/trunk:1-34685

Modified: scummvm/branches/gsoc2008-gui/AUTHORS
===================================================================
--- scummvm/branches/gsoc2008-gui/AUTHORS	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/AUTHORS	2008-09-29 19:23:36 UTC (rev 34687)
@@ -139,7 +139,6 @@
        Kostas Nakos         
 
     PlayStation 2:
-       Robert Goeffringmann 
        Max Lingua           
 
     PSP (PlayStation Portable):
@@ -192,10 +191,13 @@
      Nicolas Bacca         - Former WinCE porter
      Ralph Brorsen         - Help with GUI implementation
      Jamieson Christian    - iMUSE, MIDI, all things musical
+     Hans-Jorg Frieden     - Former AmigaOS 4 packager
+     Robert Goeffringmann  - Original PS2 porter
      Ruediger Hanke        - Port: MorphOS
      Felix Jakschitsch     - Zak256 reverse engineering
      Mutwin Kraus          - Original MacOS porter
      Peter Moraliyski      - Port: GP32
+     Juha Niemimaki        - Formaer AmigaOS 4 packager
      Jeremy Newman         - Former webmaster
      Lionel Ulmer          - Port: X11
      Won Star              - Former GP32 porter
@@ -205,9 +207,7 @@
   Packages
   --------
     AmigaOS 4:
-       Hans-Jorg Frieden    
        Hubert Maier         
-       Juha Niemimaki       
 
     Atari/FreeMiNT:
        Keith Scroggins      
@@ -266,6 +266,7 @@
      Stuart Caie           - Decoders for Simon 1 Amiga data files
      Paolo Costabel        - PSP port contributions
      Thierry Crozat        - Support for Broken Sword 1 Macintosh version
+     Martin Doucha         - CinE engine objectification
      Thomas Fach-Pedersen  - ProTracker module player
      Benjamin Haisch       - Heavily improved de-/encoder for DXA videos
      Janne Huttunen        - V3 actor mask support, Dig/FT SMUSH audio
@@ -295,15 +296,18 @@
    Sander Buskens   - For his work on the initial reversing of Monkey2
    Canadacow        - For the original MT-32 emulator
    Kevin Carnes     - For Scumm16, the basis of ScummVM's older gfx codecs
+   Curt Coder       - For the original TrollVM (preAGI) code
    Patrick Combet   - For the original Gobliiins ADL player
    Ivan Dubrov      - For contributing the initial version of the Gobliiins
                       engine
+   Till Kresslein   - For design of modern ScummVM GUI
    Jezar            - For his freeverb filter implementation
    Jim Leiterman    - Various info on his FM-TOWNS/Marty SCUMM ports
    lloyd            - For deep tech details about C64 Zak & MM
    Sarien Team      - Original AGI engine code
    Jimmi Thogersen  - For ScummRev, and much obscure code/documentation
    Tristan          - For additional work on the original MT-32 emulator
+   James Woodcock   - Soundtrack enhancements
 
    Tony Warriner and everyone at Revolution Software Ltd. for sharing with us
    the source of some of their brilliant games, allowing us to release

Modified: scummvm/branches/gsoc2008-gui/COPYRIGHT
===================================================================
--- scummvm/branches/gsoc2008-gui/COPYRIGHT	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/COPYRIGHT	2008-09-29 19:23:36 UTC (rev 34687)
@@ -60,6 +60,7 @@
 Johannes Schickel
 Won Star
 Ludvig Strigeus
+Keith Scroggins
 David Symonds
 Jordi Vilalta
 Robin Watts
@@ -74,23 +75,34 @@
 
 Laura Abbott "sageofminerva"
 Vikram Aggarwal "youngelf"
+the rara avis "theraraavis"
 Dieter Baron "dillo"
 Alban Bedel "albeu"
 Bodo Bellut "bellut"
+Bramvandijk "bramvandijk"
 Andreas Bierfert "awjb"
 Elio Blanca "eblanca76"
+Bastien Bouclet "bgk"
 David Breakey "dbreakey"
 Robert Buchholz "prendi"
-Rainer Canavan
+Rainer Canavan "canavan"
 Mathieu Carot "yokna"
 Stefano Ceccherini "jackburton"
 Travis S Coady "theealien"
 Josh Coalson "jcoalson"
 Thomas Combeleran "hibernatus"
+Kees Cook "keescook"
 Carlos Corbacho "cathectic"
 Roberto Costa "fiix76"
+Thiery Crozat "criezy"
+dc france "erwan2004"
+dewt "mncl"
+Martin Doucha "next_ghost"
 Michael Drueing "doc_wagon"
+dubsdj
 Matthew Duggan "stauff1"
+Olivier Duverne "richiefs"
+Andrei Dziahel "develop7"
 John Eckerdal "johneck"
 Thomas Fach-Pedersen "madm00se"
 Florent "flobo"
@@ -109,6 +121,7 @@
 Alexander Holler "holler"
 Falk Hueffner "mellum"
 Casey Hutchinson "nnooiissee"
+j0tt
 Gregor Jasny "gjasny"
 Jellby "jellby"
 Joerg "macdrega"
@@ -122,38 +135,49 @@
 Jay Lanagan "r0ni"
 Norbert Lange "nolange"
 Manuel Lauss "mlau2"
+Rolf Leggewie "leggewie"
 Duncan Lock "dflock"
 Mark Lodato "itsr0y"
 Fridvin Logi "phillip_j_fry"
+Lostech "lostech"
 Georg Lukas "ge0rg"
 Dmitry Marakasov "amdmi3"
-Markus "meist3r"
 Connor McLeod "mcleod2032"
 Mickey McMurray "metafox"
 Vladimir Menshakov "megath"
+Adam Metcalf "gamblore"
 Frank Meyering "frank_m24"
 Gael Le Migno "kilobug"
 Alyssa Anne Milburn "fuzzie"
 Andy Molloy "maloi"
+Sean Murrau "lightcast"
 Armin Mueller "arm_in"
 Andrea Musuruane "musuruan"
 KO Myung-Hun "lvzuufx"
+Markus Napp "meist3r"
 Peter Naulls "pnaulls"
 Christian Neumair "mannythegnome"
 Nicos "anarxia"
 Juha Niemimaki "capehill"
 Markus Niemisto "niemisto"
+ole
 Chris Paras "paras_rasmatazz"
 Aubin Paul "outlyer"
+Vincent Pelletier "subdino"
+phi1
+Pix2 "pix2"
 Carsten Pohl "carstenpohl"
 Markus Pyykko "mankeli"
 Richard "trinity78"
 Felix Riemann "kirschsaft"
+Thomas Richter "thorfdbg"
 Timo Roehling "t1m0"
 Andreas Roever "roever"
 Jonathan Rogers "jonner"
 Marek Roth "logicdeluxe"
+Uwe Ryssel "uweryssel"
 Simon Sawatzki "simsaw"
+Scarlatti "escarlate"
 Daniel Schepler "dschepler"
 Florian Schmitt "fatpenguin"
 Mark Schreiber "mark7"
@@ -161,12 +185,17 @@
 Jean-Yves Simon "lethalwp"
 Andrej Sinicyn "andrej4000"
 Andre Souza "luke_br"
+spookypeanut "spookypeanut"
 Steve Stavropoulos "isnothere"
 Daniel Steinberger "amorphousshape"
 Sven Strothoff "dataslayer"
 Andrea Suatoni "mrhandler"
+tbcarey
+Tim "tipabu"
+Tobigun "tobigun"
 Luigi Toscano "ltosky"
 Xavier Trochu "xtrochu"
+Michal Tulacek "tutchek"
 Michael Udaltsov "cccp99"
 Kristof Vansant "lupusbe"
 Tim Walters "realmz"
@@ -174,16 +203,6 @@
 Eric A. Welsh "eweish42"
 Yudhi Widyatama "yudhi97"
 Robert Wohlrab "moshroum"
+Xanathar "xanathar"
+Grant Yeager "glo_kidd"
 Benjamin W. Zale "junior_aepi"
-the rara avis "theraraavis"
-dewt "mncl"
-dubsdj
-exo "exofreeze"
-dc france "erwan2004"
-j0tt
-glo kidd "glo_kidd"
-ole
-phi1
-spookypeanut "spookypeanut"
-tbcarey
-Tim "tipabu"

Modified: scummvm/branches/gsoc2008-gui/backends/platform/dc/dc-fs.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/backends/platform/dc/dc-fs.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/backends/platform/dc/dc-fs.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -54,7 +54,7 @@
 	virtual AbstractFilesystemNode *getParent() const;
 
 	virtual Common::SeekableReadStream *openForReading();
-	virtual Common::WriteStream *openForWriting();
+	virtual Common::WriteStream *openForWriting() { return 0; }
 
 	static AbstractFilesystemNode *makeFileNodePath(const Common::String &path);
 };
@@ -67,6 +67,7 @@
 	virtual bool isDirectory() const { return true; }
 	virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
 	virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
+	virtual Common::SeekableReadStream *openForReading() { return 0; }
 };
 
 /* A file/directory which does not exist */
@@ -76,6 +77,7 @@
 
 	virtual bool exists() const { return false; }
 	virtual bool isReadable() const { return false; }
+	virtual Common::SeekableReadStream *openForReading() { return 0; }
 };
 
 AbstractFilesystemNode *RoninCDFileNode::makeFileNodePath(const Common::String &path) {
@@ -152,10 +154,6 @@
 	return StdioStream::makeFromPath(getPath().c_str(), false);
 }
 
-Common::WriteStream *RoninCDFileNode::openForWriting() {
-	return StdioStream::makeFromPath(getPath().c_str(), true);
-}
-
 AbstractFilesystemNode *OSystem_Dreamcast::makeRootFileNode() const {
 	return new RoninCDDirectoryNode("/");
 }

Modified: scummvm/branches/gsoc2008-gui/backends/platform/dc/selector.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/backends/platform/dc/selector.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/backends/platform/dc/selector.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -26,8 +26,8 @@
 #include <common/scummsys.h>
 #include <engines/engine.h>
 #include <engines/metaengine.h>
+#include <engines/game.h>
 #include <base/plugins.h>
-#include <base/game.h>
 #include <common/fs.h>
 #include <common/events.h>
 #include "dc.h"

Modified: scummvm/branches/gsoc2008-gui/backends/platform/gp2x/gp2x.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/backends/platform/gp2x/gp2x.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/backends/platform/gp2x/gp2x.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -145,6 +145,7 @@
 			if (mkdir(enginedataPath, 0755) != 0)
 				warning("mkdir for '%s' failed!", enginedataPath);
 
+	//FIXME: Do not use File::addDefaultDirectory, rather implement OSystem::addSysArchivesToSearchSet() !
 	Common::File::addDefaultDirectory(enginedataPath);
 
 	// Note: Review and clean this, it's OTT at the moment.

Modified: scummvm/branches/gsoc2008-gui/backends/platform/sdl/events.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/backends/platform/sdl/events.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/backends/platform/sdl/events.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -195,7 +195,9 @@
 			// Alt-Return and Alt-Enter toggle full screen mode
 			if (b == Common::KBD_ALT && (ev.key.keysym.sym == SDLK_RETURN
 			                  || ev.key.keysym.sym == SDLK_KP_ENTER)) {
+				beginGFXTransaction();
 				setFullscreenMode(!_fullscreen);
+				endGFXTransaction();
 #ifdef USE_OSD
 				if (_fullscreen)
 					displayMessageOnOSD("Fullscreen mode");

Modified: scummvm/branches/gsoc2008-gui/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/backends/platform/sdl/graphics.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/backends/platform/sdl/graphics.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -691,20 +691,14 @@
 
 void OSystem_SDL::setFullscreenMode(bool enable) {
 	Common::StackLock lock(_graphicsMutex);
+	
+	if (_fullscreen == enable)
+		return;
 
-	if (_fullscreen != enable || _transactionMode == kTransactionCommit) {
+	if (_transactionMode == kTransactionCommit) {
 		assert(_hwscreen != 0);
 		_fullscreen = enable;
 
-		if (_transactionMode == kTransactionActive) {
-			_transactionDetails.fs = enable;
-			_transactionDetails.fsChanged = true;
-
-			_transactionDetails.needHotswap = true;
-
-			return;
-		}
-
 		// Switch between fullscreen and windowed mode by invoking hotswapGFXMode().
 		// We used to use SDL_WM_ToggleFullScreen() in the past, but this caused various
 		// problems. E.g. on OS X, it was implemented incorrectly for a long time; on
@@ -713,6 +707,11 @@
 		// So, we just do it "manually" now. There shouldn't be any drawbacks to that
 		// anyway.
 		hotswapGFXMode();
+	} else if (_transactionMode == kTransactionActive) {
+		_transactionDetails.fs = enable;
+		_transactionDetails.fsChanged = true;
+
+		_transactionDetails.needHotswap = true;
 	}
 }
 

Modified: scummvm/branches/gsoc2008-gui/backends/platform/sdl/sdl.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/backends/platform/sdl/sdl.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/backends/platform/sdl/sdl.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -275,7 +275,7 @@
 	return _fsFactory;
 }
 
-void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s, uint priority) {
+void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
 
 #ifdef DATA_PATH
 	// Add the global DATA_PATH to the directory search list

Modified: scummvm/branches/gsoc2008-gui/backends/platform/sdl/sdl.h
===================================================================
--- scummvm/branches/gsoc2008-gui/backends/platform/sdl/sdl.h	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/backends/platform/sdl/sdl.h	2008-09-29 19:23:36 UTC (rev 34687)
@@ -209,7 +209,7 @@
 
 	virtual Common::SaveFileManager *getSavefileManager();
 	virtual FilesystemFactory *getFilesystemFactory();
-	virtual void addSysArchivesToSearchSet(Common::SearchSet &s, uint priority = 0);
+	virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
 
 	virtual Common::SeekableReadStream *openConfigFileForReading();
 	virtual Common::WriteStream *openConfigFileForWriting();

Modified: scummvm/branches/gsoc2008-gui/base/main.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/base/main.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/base/main.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -70,6 +70,17 @@
 			system.setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen"));
 	system.endGFXTransaction();
 
+	// When starting up launcher for the first time, the user might have specified
+	// a --gui-theme option, to allow that option to be working, we need to initialize
+	// GUI here.
+	// FIXME: Find a nicer way to allow --gui-theme to be working
+	GUI::NewGui::instance();
+
+	// Discard any command line options. Those that affect the graphics
+	// mode and the others (like bootparam etc.) should not
+	// blindly be passed to the first game launched from the launcher.
+	ConfMan.getDomain(Common::ConfigManager::kTransientDomain)->clear();
+
 	// Set initial window caption
 	system.setWindowCaption(gScummVMFullVersion);
 
@@ -277,15 +288,8 @@
 	system.initBackend();
 
 	// Unless a game was specified, show the launcher dialog
-	if (0 == ConfMan.getActiveDomain()) {
-		// Discard any command line options. Those that affect the graphics
-		// mode etc. already have should have been handled by the backend at
-		// this point. And the others (like bootparam etc.) should not
-		// blindly be passed to the first game launched from the launcher.
-		ConfMan.getDomain(Common::ConfigManager::kTransientDomain)->clear();
-
+	if (0 == ConfMan.getActiveDomain())
 		launcherDialog(system);
-	}
 
 	// FIXME: We're now looping the launcher. This, of course, doesn't
 	// work as well as it should. In theory everything should be destroyed

Modified: scummvm/branches/gsoc2008-gui/common/archive.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/common/archive.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/archive.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -26,6 +26,7 @@
 #include "common/archive.h"
 #include "common/fs.h"
 #include "common/util.h"
+#include "common/system.h"
 
 namespace Common {
 
@@ -231,7 +232,7 @@
 	_list.insert(it, node);
 }
 
-void SearchSet::add(const String& name, ArchivePtr archive, uint priority) {
+void SearchSet::add(const String& name, ArchivePtr archive, int priority) {
 	if (find(name) == _list.end()) {
 		Node node = { priority, name, archive };
 		insert(node);
@@ -256,7 +257,7 @@
 	_list.clear();
 }
 
-void SearchSet::setPriority(const String& name, uint priority) {
+void SearchSet::setPriority(const String& name, int priority) {
 	ArchiveList::iterator it = find(name);
 	if (it == _list.end()) {
 		warning("SearchSet::setPriority: archive '%s' is not present", name.c_str());
@@ -328,17 +329,29 @@
 
 DECLARE_SINGLETON(SearchManager);
 
-void SearchManager::addArchive(const String &name, ArchivePtr archive) {
-	add(name, archive);
+SearchManager::SearchManager() {
+	clear();	// Force a reset
 }
 
-void SearchManager::addDirectory(const String &name, const String &directory) {
-	addDirectoryRecursive(name, 1);
+void SearchManager::addArchive(const String &name, ArchivePtr archive, int priority) {
+	add(name, archive, priority);
 }
 
-void SearchManager::addDirectoryRecursive(const String &name, const String &directory, int depth) {
-	add(name, SharedPtr<FSDirectory>(new FSDirectory(directory, depth)));
+void SearchManager::addDirectory(const String &name, const String &directory, int priority) {
+	addDirectoryRecursive(name, directory, 1, priority);
 }
 
+void SearchManager::addDirectoryRecursive(const String &name, const String &directory, int depth, int priority) {
+	add(name, ArchivePtr(new FSDirectory(directory, depth)), priority);
+}
 
+void SearchManager::clear() {
+	SearchSet::clear();
+
+	// Always keep system specific archives in the SearchManager.
+	// But we give them a lower priority than the default priority (which is 0),
+	// so that archives added by client code are searched first.
+	g_system->addSysArchivesToSearchSet(*this, -1);
+}
+
 } // namespace Common

Modified: scummvm/branches/gsoc2008-gui/common/archive.h
===================================================================
--- scummvm/branches/gsoc2008-gui/common/archive.h	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/archive.h	2008-09-29 19:23:36 UTC (rev 34687)
@@ -153,7 +153,7 @@
  */
 class SearchSet : public Archive {
 	struct Node {
-		uint		_priority;
+		int			_priority;
 		String		_name;
 		ArchivePtr	_arc;
 	};
@@ -169,7 +169,7 @@
 	/**
 	 * Add a new archive to the searchable set.
 	 */
-	void add(const String& name, ArchivePtr archive, uint priority = 0);
+	void add(const String& name, ArchivePtr archive, int priority = 0);
 
 	/**
 	 * Remove an archive from the searchable set.
@@ -184,12 +184,12 @@
 	/**
      * Empties the searchable set.
      */
-	void clear();
+	virtual void clear();
 
 	/**
      * Change the order of searches.
      */
-	void setPriority(const String& name, uint priority);
+	void setPriority(const String& name, int priority);
 
 	virtual bool hasFile(const String &name);
 	virtual int matchPattern(StringList &list, const String &pattern);
@@ -205,22 +205,28 @@
 
 class SearchManager : public Singleton<SearchManager>, public SearchSet {
 public:
+	SearchManager();
+
 	/**
 	 * Add an existing Archive. This is meant to support searching in system-specific
 	 * archives, namely the MACOSX/IPHONE bundles.
 	 */
-	void addArchive(const String &name, ArchivePtr archive);
+	void addArchive(const String &name, ArchivePtr archive, int priority = 0);
 
 	/**
 	 * Create and add a FSDirectory by name
 	 */
-	void addDirectory(const String &name, const String &directory);
+	void addDirectory(const String &name, const String &directory, int priority = 0);
 
 	/**
 	 * Create and add a FSDirectory and its subdirectories by name
 	 */
-	void addDirectoryRecursive(const String &name, const String &directory, int depth = 4);
+	void addDirectoryRecursive(const String &name, const String &directory, int depth = 4, int priority = 0);
 
+	/**
+	 * TODO
+	 */
+	virtual void clear();
 };
 
 /** Shortcut for accessing the search manager. */

Modified: scummvm/branches/gsoc2008-gui/common/file.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/common/file.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/file.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -31,9 +31,6 @@
 
 namespace Common {
 
-static Common::SearchSet *s_searchSet = 0;
-
-
 void File::addDefaultDirectory(const String &directory) {
 	FilesystemNode dir(directory);
 	addDefaultDirectoryRecursive(dir, 1);
@@ -52,18 +49,12 @@
 	if (level <= 0 || !dir.exists() || !dir.isDirectory())
 		return;
 
-	if (!s_searchSet) {
-		s_searchSet = new Common::SearchSet();
-		g_system->addSysArchivesToSearchSet(*s_searchSet);
-	}
-
 	Common::ArchivePtr dataArchive(new Common::FSDirectory(dir, level));
-	s_searchSet->add(dir.getPath(), dataArchive, 1);
+	SearchMan.add(dir.getPath(), dataArchive);
 }
 
 void File::resetDefaultDirectories() {
-	delete s_searchSet;
-	s_searchSet = 0;
+	SearchMan.clear();
 }
 
 File::File()
@@ -82,23 +73,18 @@
 	_name.clear();
 	clearIOFailed();
 
-	if (s_searchSet && s_searchSet->hasFile(filename)) {
+	if (SearchMan.hasFile(filename)) {
 		debug(3, "Opening hashed: %s", filename.c_str());
-		_handle = s_searchSet->openFile(filename);
-	} else if (s_searchSet && s_searchSet->hasFile(filename + ".")) {
+		_handle = SearchMan.openFile(filename);
+	} else if (SearchMan.hasFile(filename + ".")) {
 		// WORKAROUND: Bug #1458388: "SIMON1: Game Detection fails"
 		// sometimes instead of "GAMEPC" we get "GAMEPC." (note trailing dot)
 		debug(3, "Opening hashed: %s.", filename.c_str());
-		_handle = s_searchSet->openFile(filename);
-	} else {
-		// Last resort: try the current directory
-		FilesystemNode file(filename);
-		if (file.exists() && !file.isDirectory())
-			_handle = file.openForReading();
+		_handle = SearchMan.openFile(filename + ".");
 	}
 	
 	if (_handle == NULL)
-		debug(2, "File %s not opened", filename.c_str());
+		debug(2, "File::open: '%s' not found", filename.c_str());
 	else
 		_name = filename;
 
@@ -127,7 +113,7 @@
 	_handle = node.openForReading();
 
 	if (_handle == NULL)
-		debug(2, "File %s not found", filename.c_str());
+		debug(2, "File::open: '%s' not found", node.getPath().c_str());
 	else
 		_name = filename;
 
@@ -135,17 +121,12 @@
 }
 
 bool File::exists(const String &filename) {
-	if (s_searchSet && s_searchSet->hasFile(filename)) {
+	if (SearchMan.hasFile(filename)) {
 		return true;
-	} else if (s_searchSet && s_searchSet->hasFile(filename + ".")) {
+	} else if (SearchMan.hasFile(filename + ".")) {
 		// WORKAROUND: Bug #1458388: "SIMON1: Game Detection fails"
 		// sometimes instead of "GAMEPC" we get "GAMEPC." (note trailing dot)
 		return true;
-	} else {
-		// Last resort: try the current directory
-		FilesystemNode file(filename);
-		if (file.exists() && !file.isDirectory())
-			return true;
 	}
 	
 	return false;

Modified: scummvm/branches/gsoc2008-gui/common/str.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/common/str.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/str.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -26,6 +26,13 @@
 #include "common/hash-str.h"
 #include "common/util.h"
 
+#include "common/memorypool.h"
+
+#if !defined(__SYMBIAN32__) 
+#include <new>
+#endif
+
+
 namespace Common {
 
 #if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__))
@@ -34,6 +41,9 @@
 const char *String::emptyString = "";
 #endif
 
+
+MemoryPool *g_refCountPool = 0;	// FIXME: This is never freed right now
+
 static uint32 computeCapacity(uint32 len) {
 	// By default, for the capacity we use the next multiple of 32
 	return ((len + 32 - 1) & ~0x1F);
@@ -79,15 +89,17 @@
 }
 
 String::String(const String &str)
- : _size(str._size), _str(str.isStorageIntern() ? _storage : str._str) {
+ : _size(str._size) {
 	if (str.isStorageIntern()) {
 		// String in internal storage: just copy it
-		memcpy(_storage, str._storage, sizeof(_storage));
+		memcpy(_storage, str._storage, _builtinCapacity);
+		_str = _storage;
 	} else {
 		// String in external storage: use refcount mechanism
 		str.incRefCount();
 		_extern._refCount = str._extern._refCount;
 		_extern._capacity = str._extern._capacity;
+		_str = str._str;
 	}
 	assert(_str != 0);
 }
@@ -178,7 +190,11 @@
 void String::incRefCount() const {
 	assert(!isStorageIntern());
 	if (_extern._refCount == 0) {
-		_extern._refCount = new int(2);
+		if (g_refCountPool == 0)
+			g_refCountPool = new MemoryPool(sizeof(int));
+
+		_extern._refCount = (int *)g_refCountPool->malloc();
+		*_extern._refCount = 2;
 	} else {
 		++(*_extern._refCount);
 	}
@@ -194,7 +210,10 @@
 	if (!oldRefCount || *oldRefCount <= 0) {
 		// The ref count reached zero, so we free the string storage
 		// and the ref count storage.
-		delete oldRefCount;
+		if (oldRefCount) {
+			assert(g_refCountPool);
+			g_refCountPool->free(oldRefCount);
+		}
 		free(_str);
 
 		// Even though _str points to a freed memory block now,

Modified: scummvm/branches/gsoc2008-gui/common/str.h
===================================================================
--- scummvm/branches/gsoc2008-gui/common/str.h	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/str.h	2008-09-29 19:23:36 UTC (rev 34687)
@@ -54,7 +54,7 @@
 	 * than 8 makes no sense, since that's the size of member _extern
 	 * (on 32 bit machines; 12 bytes on systems with 64bit pointers).
 	 */
-	static const uint32 _builtinCapacity = 32;
+	static const uint32 _builtinCapacity = 32 - sizeof(uint32) - sizeof(char*);
 
 	/**
 	 * Length of the string. Stored to avoid having to call strlen
@@ -112,7 +112,7 @@
 	String(const String &str);
 	
 	/** Construct a string consisting of the given character. */
-	String(char c);
+	explicit String(char c);
 
 	~String();
 

Modified: scummvm/branches/gsoc2008-gui/common/system.h
===================================================================
--- scummvm/branches/gsoc2008-gui/common/system.h	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/system.h	2008-09-29 19:23:36 UTC (rev 34687)
@@ -917,7 +917,7 @@
 	 * @param s		the SearchSet to which the system specific dirs, if any, are added
 	 * @param priority	the priority with which those dirs are added
 	 */
-	virtual void addSysArchivesToSearchSet(Common::SearchSet &s, uint priority = 0) {}
+	virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0) {}
 
 	/**
 	 * Open the default config file for reading, by returning a suitable

Modified: scummvm/branches/gsoc2008-gui/common/unarj.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/common/unarj.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/unarj.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -324,15 +324,15 @@
 	return _uncompressed->read(dataPtr, dataSize);
 }
 
-bool ArjFile::eos() {
+bool ArjFile::eos() const {
 	return _uncompressed->eos();
 }
 
-int32 ArjFile::pos() {
+int32 ArjFile::pos() const {
 	return _uncompressed->pos();
 }
 
-int32 ArjFile::size() {
+int32 ArjFile::size() const {
 	return _uncompressed->size();
 }
 

Modified: scummvm/branches/gsoc2008-gui/common/unarj.h
===================================================================
--- scummvm/branches/gsoc2008-gui/common/unarj.h	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/unarj.h	2008-09-29 19:23:36 UTC (rev 34687)
@@ -85,7 +85,7 @@
 
 typedef HashMap<String, int, IgnoreCase_Hash, IgnoreCase_EqualTo> ArjFilesMap;
 
-class ArjFile : public File {
+class ArjFile : public SeekableReadStream, public NonCopyable {
 public:
 	ArjFile();
 	~ArjFile();
@@ -98,9 +98,9 @@
 	void close();
 
 	uint32 read(void *dataPtr, uint32 dataSize);
-	bool eos();
-	int32 pos();
-	int32 size();
+	bool eos() const;
+	int32 pos() const;
+	int32 size() const;
 	bool seek(int32 offset, int whence = SEEK_SET);
 	bool isOpen() { return _isOpen; }
 

Modified: scummvm/branches/gsoc2008-gui/common/unzip.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/common/unzip.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/unzip.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -28,14 +28,51 @@
    Read unzip.h for more info
 */
 
+/* unzip.h -- IO for uncompress .zip files using zlib
+   Version 0.15 beta, Mar 19th, 1998,
+
+   Copyright (C) 1998 Gilles Vollant
+
+   This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
+     WinZip, InfoZip tools and compatible.
+   Encryption and multi volume ZipFile (span) are not supported.
+   Old compressions used by old PKZip 1.x are not supported
+
+   THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE
+   CAN CHANGE IN FUTURE VERSION !!
+   I WAIT FEEDBACK at mail info at winimage.com
+   Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
+
+   Condition of use and distribution are the same than zlib :
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+
+*/
+/* for more info about .ZIP format, see
+      ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
+   PkWare has also a specification at :
+      ftp://ftp.pkware.com/probdesc.zip */
+
+
 #include "common/scummsys.h"
 
 #ifdef USE_ZLIB
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
 #ifdef __SYMBIAN32__
 #include <zlib\zlib.h>
 #else
@@ -45,25 +82,214 @@
 #include "common/unzip.h"
 #include "common/file.h"
 
-#ifdef STDC
-#  include <stddef.h>
-#  include <string.h>
-#  include <stdlib.h>
-#endif
-#ifdef NO_ERRNO_H
-    extern int errno;
+#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+/* like the STRICT of WIN32, we define a pointer that cannot be converted
+    from (void*) without cast */
+typedef struct TagunzFile__ { int unused; } unzFile__;
+typedef unzFile__ *unzFile;
 #else
-#   include <errno.h>
+typedef voidp unzFile;
 #endif
 
 
-#ifndef local
-#  define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
+#define UNZ_OK                                  (0)
+#define UNZ_END_OF_LIST_OF_FILE (-100)
+#define UNZ_ERRNO               (Z_ERRNO)
+#define UNZ_EOF                 (0)
+#define UNZ_PARAMERROR                  (-102)
+#define UNZ_BADZIPFILE                  (-103)
+#define UNZ_INTERNALERROR               (-104)
+#define UNZ_CRCERROR                    (-105)
 
+/* tm_unz contain date/time info */
+typedef struct {
+	uInt tm_sec;            /* seconds after the minute - [0,59] */
+	uInt tm_min;            /* minutes after the hour - [0,59] */
+	uInt tm_hour;           /* hours since midnight - [0,23] */
+	uInt tm_mday;           /* day of the month - [1,31] */
+	uInt tm_mon;            /* months since January - [0,11] */
+	uInt tm_year;           /* years - [1980..2044] */
+} tm_unz;
 
+/* unz_global_info structure contain global data about the ZIPfile
+   These data comes from the end of central dir */
+typedef struct {
+	uLong number_entry;         /* total number of entries in
+				       the central dir on this disk */
+	uLong size_comment;         /* size of the global comment of the zipfile */
+} unz_global_info;
 
+
+/* unz_file_info contain information about a file in the zipfile */
+typedef struct {
+    uLong version;              /* version made by                 2 bytes */
+    uLong version_needed;       /* version needed to extract       2 bytes */
+    uLong flag;                 /* general purpose bit flag        2 bytes */
+    uLong compression_method;   /* compression method              2 bytes */
+    uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
+    uLong crc;                  /* crc-32                          4 bytes */
+    uLong compressed_size;      /* compressed size                 4 bytes */
+    uLong uncompressed_size;    /* uncompressed size               4 bytes */
+    uLong size_filename;        /* filename length                 2 bytes */
+    uLong size_file_extra;      /* extra field length              2 bytes */
+    uLong size_file_comment;    /* file comment length             2 bytes */
+
+    uLong disk_num_start;       /* disk number start               2 bytes */
+    uLong internal_fa;          /* internal file attributes        2 bytes */
+    uLong external_fa;          /* external file attributes        4 bytes */
+
+    tm_unz tmu_date;
+} unz_file_info;
+
+int unzStringFileNameCompare(const char* fileName1,
+												 const char* fileName2,
+												 int iCaseSensitivity);
+/*
+   Compare two filename (fileName1,fileName2).
+   If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
+   If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
+								or strcasecmp)
+   If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
+	(like 1 on Unix, 2 on Windows)
+*/
+
+
+unzFile unzOpen(const char *path);
+/*
+  Open a Zip file. path contain the full pathname (by example,
+     on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
+	 "zlib/zlib111.zip".
+	 If the zipfile cannot be opened (file don't exist or in not valid), the
+	   return value is NULL.
+     Else, the return value is a unzFile Handle, usable with other function
+	   of this unzip package.
+*/
+
+int unzClose(unzFile file);
+/*
+  Close a ZipFile opened with unzipOpen.
+  If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
+    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
+  return UNZ_OK if there is no problem. */
+
+int unzGetGlobalInfo(unzFile file,
+					unz_global_info *pglobal_info);
+/*
+  Write info about the ZipFile in the *pglobal_info structure.
+  No preparation of the structure is needed
+  return UNZ_OK if there is no problem. */
+
+
+int unzGetGlobalComment(unzFile file, char *szComment, uLong uSizeBuf);
+/*
+  Get the global comment string of the ZipFile, in the szComment buffer.
+  uSizeBuf is the size of the szComment buffer.
+  return the number of byte copied or an error code <0
+*/
+
+
+/***************************************************************************/
+/* Unzip package allow you browse the directory of the zipfile */
+
+int unzGoToFirstFile(unzFile file);
+/*
+  Set the current file of the zipfile to the first file.
+  return UNZ_OK if there is no problem
+*/
+
+int unzGoToNextFile(unzFile file);
+/*
+  Set the current file of the zipfile to the next file.
+  return UNZ_OK if there is no problem
+  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+*/
+
+int unzLocateFile(unzFile file, const char *szFileName, int iCaseSensitivity);
+/*
+  Try locate the file szFileName in the zipfile.
+  For the iCaseSensitivity signification, see unzStringFileNameCompare
+
+  return value :
+  UNZ_OK if the file is found. It becomes the current file.
+  UNZ_END_OF_LIST_OF_FILE if the file is not found
+*/
+
+
+int unzGetCurrentFileInfo(unzFile file,
+					     unz_file_info *pfile_info,
+					     char *szFileName,
+					     uLong fileNameBufferSize,
+					     void *extraField,
+					     uLong extraFieldBufferSize,
+					     char *szComment,
+					     uLong commentBufferSize);
+/*
+  Get Info about the current file
+  if pfile_info!=NULL, the *pfile_info structure will contain somes info about
+	    the current file
+  if szFileName!=NULL, the filemane string will be copied in szFileName
+			(fileNameBufferSize is the size of the buffer)
+  if extraField!=NULL, the extra field information will be copied in extraField
+			(extraFieldBufferSize is the size of the buffer).
+			This is the Central-header version of the extra field
+  if szComment!=NULL, the comment string of the file will be copied in szComment
+			(commentBufferSize is the size of the buffer)
+*/
+
+/***************************************************************************/
+/* for reading the content of the current zipfile, you can open it, read data
+   from it, and close it (you can close it before reading all the file)
+   */
+
+int unzOpenCurrentFile(unzFile file);
+/*
+  Open for reading data the current file in the zipfile.
+  If there is no error, the return value is UNZ_OK.
+*/
+
+int unzCloseCurrentFile(unzFile file);
+/*
+  Close the file in zip opened with unzOpenCurrentFile
+  Return UNZ_CRCERROR if all the file was read but the CRC is not good
+*/
+
+
+int unzReadCurrentFile(unzFile file, voidp buf, unsigned len);
+/*
+  Read bytes from the current file (opened by unzOpenCurrentFile)
+  buf contain buffer where data must be copied
+  len the size of buf.
+
+  return the number of byte copied if somes bytes are copied
+  return 0 if the end of file was reached
+  return <0 with error code if there is an error
+    (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+*/
+
+z_off_t unztell(unzFile file);
+/*
+  Give the current position in uncompressed data
+*/
+
+int unzeof(unzFile file);
+/*
+  return 1 if the end of file was reached, 0 elsewhere
+*/
+
+int unzGetLocalExtrafield(unzFile file, voidp buf, unsigned len);
+/*
+  Read extra field from the current file (opened by unzOpenCurrentFile)
+  This is the local-header version of the extra field (sometimes, there is
+    more info in the local-header version than in the central-header)
+
+  if buf==NULL, it return the size of the local extra field
+
+  if buf!=NULL, len is the size of the buffer, the extra header is copied in
+	buf.
+  the return value is the number of bytes copied in buf, or (if <0)
+	the error code
+*/
+
 #if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) && \
                       !defined(CASESENSITIVITYDEFAULT_NO)
 #define CASESENSITIVITYDEFAULT_NO
@@ -78,45 +304,22 @@
 #define UNZ_MAXFILENAMEINZIP (256)
 #endif
 
-#ifndef ALLOC
-# define ALLOC(size) (malloc(size))
-#endif
-#ifndef TRYFREE
-# define TRYFREE(p) {if (p) free(p);}
-#endif
-
 #define SIZECENTRALDIRITEM (0x2e)
 #define SIZEZIPLOCALHEADER (0x1e)
 
 
-/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
-
-#ifndef SEEK_CUR
-#define SEEK_CUR    1
-#endif
-
-#ifndef SEEK_END
-#define SEEK_END    2
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET    0
-#endif
-
 const char unz_copyright[] =
    " unzip 0.15 Copyright 1998 Gilles Vollant ";
 
 /* unz_file_info_interntal contain internal info about a file in zipfile*/
-typedef struct unz_file_info_internal_s
-{
+typedef struct {
     uLong offset_curfile;/* relative offset of local header 4 bytes */
 } unz_file_info_internal;
 
 
 /* file_in_zip_read_info_s contain internal information about a file in zipfile,
     when reading and decompress it */
-typedef struct
-{
+typedef struct {
 	char  *read_buffer;         /* internal buffer for compressed data */
 	z_stream stream;            /* zLib stream structure for inflate */
 
@@ -139,8 +342,7 @@
 
 /* unz_s contain internal information about the zipfile
 */
-typedef struct
-{
+typedef struct {
 	Common::File file;				/* io structore of the zipfile */
 	unz_global_info gi;				/* public global information */
 	uLong byte_before_the_zipfile;	/* byte before the zipfile, (>0 for sfx)*/
@@ -166,14 +368,11 @@
 */
 
 
-/*local int unzlocal_getByte(Common::File &fin, int *pi)
-{
+/*static int unzlocal_getByte(Common::File &fin, int *pi) {
     unsigned char c = fin.readByte();
       *pi = (int)c;
         return UNZ_OK;
-    }
-    else
-    {
+    } else {
         if (fin.ioFailed())
             return UNZ_ERRNO;
         else
@@ -185,50 +384,23 @@
 /* ===========================================================================
    Reads a long in LSB order from the given gz_stream. Sets
 */
-local int unzlocal_getShort (Common::File &fin, uLong *pX)
-{
+static int unzlocal_getShort(Common::File &fin, uLong *pX) {
 	*pX = fin.readUint16LE();
-	return UNZ_OK;
+	return fin.ioFailed() ? UNZ_ERRNO : UNZ_OK;
 }
 
-local int unzlocal_getLong (Common::File &fin, uLong *pX)
-{
+static int unzlocal_getLong(Common::File &fin, uLong *pX) {
 	*pX = fin.readUint32LE();
-	return UNZ_OK;
+	return fin.ioFailed() ? UNZ_ERRNO : UNZ_OK;
 }
 
-/* My own strcmpi / strcasecmp */
-local int strcmpcasenosensitive_internal (const char* fileName1, const char* fileName2) {
-	for (;;)
-	{
-		char c1=*(fileName1++);
-		char c2=*(fileName2++);
-		if ((c1>='a') && (c1<='z'))
-			c1 -= 0x20;
-		if ((c2>='a') && (c2<='z'))
-			c2 -= 0x20;
-		if (c1=='\0')
-			return ((c2=='\0') ? 0 : -1);
-		if (c2=='\0')
-			return 1;
-		if (c1<c2)
-			return -1;
-		if (c1>c2)
-			return 1;
-	}
-}
 
-
 #ifdef  CASESENSITIVITYDEFAULT_NO
 #define CASESENSITIVITYDEFAULTVALUE 2
 #else
 #define CASESENSITIVITYDEFAULTVALUE 1
 #endif
 
-#ifndef STRCMPCASENOSENTIVEFUNCTION
-#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal
-#endif
-
 /*
    Compare two filename (fileName1,fileName2).
    If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
@@ -238,15 +410,14 @@
         (like 1 on Unix, 2 on Windows)
 
 */
-extern int ZEXPORT unzStringFileNameCompare (const char* fileName1, const char* fileName2, int iCaseSensitivity)
-{
+int unzStringFileNameCompare(const char* fileName1, const char* fileName2, int iCaseSensitivity) {
 	if (iCaseSensitivity==0)
 		iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;
 
 	if (iCaseSensitivity==1)
 		return strcmp(fileName1,fileName2);
 
-	return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2);
+	return scumm_stricmp(fileName1,fileName2);
 }
 
 #define BUFREADCOMMENT (0x400)
@@ -255,8 +426,7 @@
   Locate the Central directory of a zipfile (at the end, just before
     the global comment)
 */
-local uLong unzlocal_SearchCentralDir(Common::File &fin)
-{
+static uLong unzlocal_SearchCentralDir(Common::File &fin) {
 	unsigned char* buf;
 	uLong uSizeFile;
 	uLong uBackRead;
@@ -270,13 +440,12 @@
 	if (uMaxBack>uSizeFile)
 		uMaxBack = uSizeFile;
 
-	buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
+	buf = (unsigned char*)malloc(BUFREADCOMMENT+4);
 	if (buf==NULL)
 		return 0;
 
 	uBackRead = 4;
-	while (uBackRead<uMaxBack)
-	{
+	while (uBackRead<uMaxBack) {
 		uLong uReadSize,uReadPos ;
 		int i;
 		if (uBackRead+BUFREADCOMMENT>uMaxBack)
@@ -305,7 +474,7 @@
 		if (uPosFound!=0)
 			break;
 	}
-	TRYFREE(buf);
+	free(buf);
 	return uPosFound;
 }
 
@@ -318,8 +487,7 @@
      Else, the return value is a unzFile Handle, usable with other function
 	   of this unzip package.
 */
-extern unzFile ZEXPORT unzOpen (const char *path)
-{
+unzFile unzOpen(const char *path) {
 	unz_s *us = new unz_s;
 	uLong central_pos,uL;
 
@@ -408,8 +576,7 @@
   If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
     these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
   return UNZ_OK if there is no problem. */
-extern int ZEXPORT unzClose (unzFile file)
-{
+int unzClose(unzFile file) {
 	unz_s* s;
 	if (file==NULL)
 		return UNZ_PARAMERROR;
@@ -428,8 +595,7 @@
   Write info about the ZipFile in the *pglobal_info structure.
   No preparation of the structure is needed
   return UNZ_OK if there is no problem. */
-extern int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info *pglobal_info)
-{
+int unzGetGlobalInfo (unzFile file, unz_global_info *pglobal_info) {
 	unz_s* s;
 	if (file==NULL)
 		return UNZ_PARAMERROR;
@@ -442,8 +608,7 @@
 /*
    Translate date/time from Dos format to tm_unz (readable more easilty)
 */
-local void unzlocal_DosDateToTmuDate (uLong ulDosDate, tm_unz* ptm)
-{
+static void unzlocal_DosDateToTmuDate (uLong ulDosDate, tm_unz* ptm) {
 	uLong uDate;
 	uDate = (uLong)(ulDosDate>>16);
 	ptm->tm_mday = (uInt)(uDate&0x1f) ;
@@ -458,7 +623,7 @@
 /*
   Get Info about the current file in the zipfile, with internal only info
 */
-local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file,
+static int unzlocal_GetCurrentFileInfoInternal(unzFile file,
                                                   unz_file_info *pfile_info,
                                                   unz_file_info_internal
                                                   *pfile_info_internal,
@@ -467,9 +632,9 @@
                                                   void *extraField,
 												  uLong extraFieldBufferSize,
                                                   char *szComment,
-												  uLong commentBufferSize));
+												  uLong commentBufferSize);
 
-local int unzlocal_GetCurrentFileInfoInternal (unzFile file,
+static int unzlocal_GetCurrentFileInfoInternal(unzFile file,
                                               unz_file_info *pfile_info,
                                               unz_file_info_internal *pfile_info_internal,
                                               char *szFileName, uLong fileNameBufferSize,
@@ -492,8 +657,7 @@
 
 
 	/* we check the magic */
-	if (err==UNZ_OK)
-	{
+	if (err==UNZ_OK) {
 		if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
 			err=UNZ_ERRNO;
 		else if (uMagic!=0x02014b50)
@@ -548,15 +712,12 @@
 		err=UNZ_ERRNO;
 
 	lSeek+=file_info.size_filename;
-	if ((err==UNZ_OK) && (szFileName!=NULL))
-	{
+	if ((err==UNZ_OK) && (szFileName!=NULL)) {
 		uLong uSizeRead ;
-		if (file_info.size_filename<fileNameBufferSize)
-		{
+		if (file_info.size_filename<fileNameBufferSize) {
 			*(szFileName+file_info.size_filename)='\0';
 			uSizeRead = file_info.size_filename;
-		}
-		else
+		} else
 			uSizeRead = fileNameBufferSize;
 
 		if ((file_info.size_filename>0) && (fileNameBufferSize>0))
@@ -566,16 +727,14 @@
 	}
 
 
-	if ((err==UNZ_OK) && (extraField!=NULL))
-	{
+	if ((err==UNZ_OK) && (extraField!=NULL)) {
 		uLong uSizeRead ;
 		if (file_info.size_file_extra<extraFieldBufferSize)
 			uSizeRead = file_info.size_file_extra;
 		else
 			uSizeRead = extraFieldBufferSize;
 
-		if (lSeek!=0)
-		{
+		if (lSeek!=0) {
 			s->file.seek(lSeek, SEEK_CUR);
 			if (s->file.ioFailed())
 				lSeek=0;
@@ -591,19 +750,15 @@
 		lSeek+=file_info.size_file_extra;
 
 
-	if ((err==UNZ_OK) && (szComment!=NULL))
-	{
+	if ((err==UNZ_OK) && (szComment!=NULL)) {
 		uLong uSizeRead ;
-		if (file_info.size_file_comment<commentBufferSize)
-		{
+		if (file_info.size_file_comment<commentBufferSize) {
 			*(szComment+file_info.size_file_comment)='\0';
 			uSizeRead = file_info.size_file_comment;
-		}
-		else
+		} else
 			uSizeRead = commentBufferSize;
 
-		if (lSeek!=0)
-		{
+		if (lSeek!=0) {
 			s->file.seek(lSeek, SEEK_CUR);
 			if (s->file.ioFailed())
 				lSeek=0;
@@ -614,8 +769,7 @@
 			if (s->file.read(szComment,(uInt)uSizeRead)!=uSizeRead)
 				err=UNZ_ERRNO;
 		lSeek+=file_info.size_file_comment - uSizeRead;
-	}
-	else
+	} else
 		lSeek+=file_info.size_file_comment;
 
 	if ((err==UNZ_OK) && (pfile_info!=NULL))
@@ -634,7 +788,7 @@
   No preparation of the structure is needed
   return UNZ_OK if there is no problem.
 */
-extern int ZEXPORT unzGetCurrentFileInfo (unzFile file,
+int unzGetCurrentFileInfo(unzFile file,
                                                   unz_file_info *pfile_info,
                                                   char *szFileName, uLong fileNameBufferSize,
                                                   void *extraField, uLong extraFieldBufferSize,
@@ -650,8 +804,7 @@
   Set the current file of the zipfile to the first file.
   return UNZ_OK if there is no problem
 */
-extern int ZEXPORT unzGoToFirstFile (unzFile file)
-{
+int unzGoToFirstFile(unzFile file) {
 	int err=UNZ_OK;
 	unz_s* s;
 	if (file==NULL)
@@ -672,8 +825,7 @@
   return UNZ_OK if there is no problem
   return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
 */
-extern int ZEXPORT unzGoToNextFile (unzFile file)
-{
+int unzGoToNextFile(unzFile file) {
 	unz_s* s;
 	int err;
 
@@ -704,8 +856,7 @@
   UNZ_OK if the file is found. It becomes the current file.
   UNZ_END_OF_LIST_OF_FILE if the file is not found
 */
-extern int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity)
-{
+int unzLocateFile(unzFile file, const char *szFileName, int iCaseSensitivity) {
 	unz_s* s;
 	int err;
 
@@ -729,8 +880,7 @@
 
 	err = unzGoToFirstFile(file);
 
-	while (err == UNZ_OK)
-	{
+	while (err == UNZ_OK) {
 		char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
 		unzGetCurrentFileInfo(file,NULL,
 								szCurrentFileName,sizeof(szCurrentFileName)-1,
@@ -754,10 +904,9 @@
   store in *piSizeVar the size of extra info in local header
         (filename and size of extra field data)
 */
-local int unzlocal_CheckCurrentFileCoherencyHeader (unz_s* s, uInt* piSizeVar,
+static int unzlocal_CheckCurrentFileCoherencyHeader(unz_s* s, uInt* piSizeVar,
 													uLong *poffset_local_extrafield,
-													uInt  *psize_local_extrafield)
-{
+													uInt  *psize_local_extrafield) {
 	uLong uMagic,uData,uFlags;
 	uLong size_filename;
 	uLong size_extra_field;
@@ -773,8 +922,7 @@
 		return UNZ_ERRNO;
 
 
-	if (err==UNZ_OK)
-	{
+	if (err==UNZ_OK) {
 		if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
 			err=UNZ_ERRNO;
 		else if (uMagic!=0x04034b50)
@@ -843,8 +991,7 @@
   Open for reading data the current file in the zipfile.
   If there is no error and the file is opened, the return value is UNZ_OK.
 */
-extern int ZEXPORT unzOpenCurrentFile (unzFile file)
-{
+int unzOpenCurrentFile (unzFile file) {
 	int err=UNZ_OK;
 	int Store;
 	uInt iSizeVar;
@@ -866,19 +1013,19 @@
 				&offset_local_extrafield,&size_local_extrafield)!=UNZ_OK)
 		return UNZ_BADZIPFILE;
 
-	pfile_in_zip_read_info = (file_in_zip_read_info_s*) ALLOC(sizeof(file_in_zip_read_info_s));
+	pfile_in_zip_read_info = (file_in_zip_read_info_s*) malloc(sizeof(file_in_zip_read_info_s));
 
 	if (pfile_in_zip_read_info==NULL)
 		return UNZ_INTERNALERROR;
 
-	pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE);
+	pfile_in_zip_read_info->read_buffer=(char*)malloc(UNZ_BUFSIZE);
 	pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
 	pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
 	pfile_in_zip_read_info->pos_local_extrafield=0;
 
 	if (pfile_in_zip_read_info->read_buffer==NULL)
 	{
-		TRYFREE(pfile_in_zip_read_info);
+		free(pfile_in_zip_read_info);
 		return UNZ_INTERNALERROR;
 	}
 
@@ -938,8 +1085,7 @@
   return <0 with error code if there is an error
     (UNZ_ERRNO for IO error, or zLib error for uncompress error)
 */
-extern int ZEXPORT unzReadCurrentFile  (unzFile file, voidp buf, unsigned len)
-{
+int unzReadCurrentFile(unzFile file, voidp buf, unsigned len) {
 	int err=UNZ_OK;
 	uInt iRead = 0;
 	unz_s* s;
@@ -1051,8 +1197,7 @@
 /*
   Give the current position in uncompressed data
 */
-extern z_off_t ZEXPORT unztell (unzFile file)
-{
+z_off_t unztell(unzFile file) {
 	unz_s* s;
 	file_in_zip_read_info_s* pfile_in_zip_read_info;
 	if (file==NULL)
@@ -1070,8 +1215,7 @@
 /*
   return 1 if the end of file was reached, 0 elsewhere
 */
-extern int ZEXPORT unzeof (unzFile file)
-{
+int unzeof(unzFile file) {
 	unz_s* s;
 	file_in_zip_read_info_s* pfile_in_zip_read_info;
 	if (file==NULL)
@@ -1102,8 +1246,7 @@
   the return value is the number of bytes copied in buf, or (if <0)
 	the error code
 */
-extern int ZEXPORT unzGetLocalExtrafield (unzFile file,voidp buf,unsigned len)
-{
+int unzGetLocalExtrafield(unzFile file, voidp buf, unsigned len) {
 	unz_s* s;
 	file_in_zip_read_info_s* pfile_in_zip_read_info;
 	uInt read_now;
@@ -1146,8 +1289,7 @@
   Close the file in zip opened with unzipOpenCurrentFile
   Return UNZ_CRCERROR if all the file was read but the CRC is not good
 */
-extern int ZEXPORT unzCloseCurrentFile (unzFile file)
-{
+int unzCloseCurrentFile(unzFile file) {
 	int err=UNZ_OK;
 
 	unz_s* s;
@@ -1167,13 +1309,13 @@
 	}
 
 
-	TRYFREE(pfile_in_zip_read_info->read_buffer);
+	free(pfile_in_zip_read_info->read_buffer);
 	pfile_in_zip_read_info->read_buffer = NULL;
 	if (pfile_in_zip_read_info->stream_initialised)
 		inflateEnd(&pfile_in_zip_read_info->stream);
 
 	pfile_in_zip_read_info->stream_initialised = 0;
-	TRYFREE(pfile_in_zip_read_info);
+	free(pfile_in_zip_read_info);
 
 	s->pfile_in_zip_read=NULL;
 
@@ -1186,8 +1328,7 @@
   uSizeBuf is the size of the szComment buffer.
   return the number of byte copied or an error code <0
 */
-extern int ZEXPORT unzGetGlobalComment (unzFile file, char *szComment, uLong uSizeBuf)
-{
+int unzGetGlobalComment(unzFile file, char *szComment, uLong uSizeBuf) {
 	unz_s* s;
 	uLong uReadThis ;
 	if (file==NULL)
@@ -1213,4 +1354,111 @@
 	return (int)uReadThis;
 }
 
+
+namespace Common {
+
+
+/*
+class ZipArchiveMember : public ArchiveMember {
+	unzFile _zipFile;
+
+public:
+	ZipArchiveMember(FilesystemNode &node) : _node(node) {
+	}
+
+	String getName() const {
+		...
+	}
+
+	SeekableReadStream *open() {
+		...
+	}
+};
+*/
+
+ZipArchive::ZipArchive(const Common::String &name) {
+	_zipFile = unzOpen(name.c_str());
+}
+
+ZipArchive::~ZipArchive() {
+	unzClose(_zipFile);
+}
+
+bool ZipArchive::isOpen() const {
+	return _zipFile != 0;
+}
+
+bool ZipArchive::hasFile(const Common::String &name) {
+	return (_zipFile && unzLocateFile(_zipFile, name.c_str(), 2) == UNZ_OK);
+}
+
+int ZipArchive::getAllNames(Common::StringList &list) {
+	if (!_zipFile)
+		return 0;
+		
+	if (unzGoToFirstFile(_zipFile) != UNZ_OK)
+		return 0;
+
+	char fileNameBuffer[UNZ_MAXFILENAMEINZIP+1];
+	list.clear();
+		
+	do {
+		unzOpenCurrentFile(_zipFile);
+		unzGetCurrentFileInfo(_zipFile, 0, fileNameBuffer, UNZ_MAXFILENAMEINZIP+1, 0, 0, 0, 0);
+		
+		list.push_back(Common::String(fileNameBuffer));
+		
+		unzCloseCurrentFile(_zipFile);
+
+	} while (unzGoToNextFile(_zipFile) == UNZ_OK);
+	
+	return list.size();
+}
+
+/*
+int ZipArchive::listMembers(Common::ArchiveMemberList &list) {
+	if (!_zipFile)
+		return 0;
+
+	int matches = 0;
+	int err = unzGoToFirstFile(_zipFile);
+
+	while (err == UNZ_OK) {
+		char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
+		unzGetCurrentFileInfo(_zipFile, NULL,
+								szCurrentFileName, sizeof(szCurrentFileName)-1,
+								NULL, 0, NULL, 0);
+		
+		szCurrentFileName
+		matches++;
+		err = unzGoToNextFile(file);
+	}
+	return 0;
+}
+*/
+
+Common::SeekableReadStream *ZipArchive::openFile(const Common::String &name) {
+	if (!_zipFile)
+		return 0;
+
+	unzLocateFile(_zipFile, name.c_str(), 2);
+
+	unz_file_info fileInfo;
+	unzOpenCurrentFile(_zipFile);
+	unzGetCurrentFileInfo(_zipFile, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
+	byte *buffer = (byte *)calloc(fileInfo.uncompressed_size+1, 1);
+	assert(buffer);
+	unzReadCurrentFile(_zipFile, buffer, fileInfo.uncompressed_size);
+	unzCloseCurrentFile(_zipFile);
+	return new Common::MemoryReadStream(buffer, fileInfo.uncompressed_size+1, true);
+	
+	// FIXME: instead of reading all into a memory stream, we could
+	// instead create a new ZipStream class. But then we have to be
+	// careful to handle the case where the client code opens multiple
+	// files in the archive and tries to use them indepenendtly.
+}
+
+}	// End of namespace Common
+
+
 #endif

Modified: scummvm/branches/gsoc2008-gui/common/unzip.h
===================================================================
--- scummvm/branches/gsoc2008-gui/common/unzip.h	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/unzip.h	2008-09-29 19:23:36 UTC (rev 34687)
@@ -22,332 +22,34 @@
  * $Id$
  */
 
-/* unzip.h -- IO for uncompress .zip files using zlib
-   Version 0.15 beta, Mar 19th, 1998,
+#ifndef COMMON_UNZIP_H
+#define COMMON_UNZIP_H
 
-   Copyright (C) 1998 Gilles Vollant
-
-   This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
-     WinZip, InfoZip tools and compatible.
-   Encryption and multi volume ZipFile (span) are not supported.
-   Old compressions used by old PKZip 1.x are not supported
-
-   THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE
-   CAN CHANGE IN FUTURE VERSION !!
-   I WAIT FEEDBACK at mail info at winimage.com
-   Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
-
-   Condition of use and distribution are the same than zlib :
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-
-*/
-/* for more info about .ZIP format, see
-      ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
-   PkWare has also a specification at :
-      ftp://ftp.pkware.com/probdesc.zip */
-
-#ifndef _unz_H
-#define _unz_H
-
 #ifdef USE_ZLIB
 
 #include "common/scummsys.h"
 #include "common/archive.h"
-#include "common/stream.h"
 
+typedef void *unzFile;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+namespace Common {
 
-#ifdef __SYMBIAN32__
-#include <zlib\zlib.h>
-#else
-#include <zlib.h>
-#endif
+class ZipArchive : public Archive {
+	void *_zipFile;
 
-#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
-/* like the STRICT of WIN32, we define a pointer that cannot be converted
-    from (void*) without cast */
-typedef struct TagunzFile__ { int unused; } unzFile__;
-typedef unzFile__ *unzFile;
-#else
-typedef voidp unzFile;
-#endif
-
-
-#define UNZ_OK                                  (0)
-#define UNZ_END_OF_LIST_OF_FILE (-100)
-#define UNZ_ERRNO               (Z_ERRNO)
-#define UNZ_EOF                 (0)
-#define UNZ_PARAMERROR                  (-102)
-#define UNZ_BADZIPFILE                  (-103)
-#define UNZ_INTERNALERROR               (-104)
-#define UNZ_CRCERROR                    (-105)
-
-/* tm_unz contain date/time info */
-typedef struct tm_unz_s
-{
-	uInt tm_sec;            /* seconds after the minute - [0,59] */
-	uInt tm_min;            /* minutes after the hour - [0,59] */
-	uInt tm_hour;           /* hours since midnight - [0,23] */
-	uInt tm_mday;           /* day of the month - [1,31] */
-	uInt tm_mon;            /* months since January - [0,11] */
-	uInt tm_year;           /* years - [1980..2044] */
-} tm_unz;
-
-/* unz_global_info structure contain global data about the ZIPfile
-   These data comes from the end of central dir */
-typedef struct unz_global_info_s
-{
-	uLong number_entry;         /* total number of entries in
-				       the central dir on this disk */
-	uLong size_comment;         /* size of the global comment of the zipfile */
-} unz_global_info;
-
-
-/* unz_file_info contain information about a file in the zipfile */
-typedef struct unz_file_info_s
-{
-    uLong version;              /* version made by                 2 bytes */
-    uLong version_needed;       /* version needed to extract       2 bytes */
-    uLong flag;                 /* general purpose bit flag        2 bytes */
-    uLong compression_method;   /* compression method              2 bytes */
-    uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
-    uLong crc;                  /* crc-32                          4 bytes */
-    uLong compressed_size;      /* compressed size                 4 bytes */
-    uLong uncompressed_size;    /* uncompressed size               4 bytes */
-    uLong size_filename;        /* filename length                 2 bytes */
-    uLong size_file_extra;      /* extra field length              2 bytes */
-    uLong size_file_comment;    /* file comment length             2 bytes */
-
-    uLong disk_num_start;       /* disk number start               2 bytes */
-    uLong internal_fa;          /* internal file attributes        2 bytes */
-    uLong external_fa;          /* external file attributes        4 bytes */
-
-    tm_unz tmu_date;
-} unz_file_info;
-
-extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
-												 const char* fileName2,
-												 int iCaseSensitivity));
-/*
-   Compare two filename (fileName1,fileName2).
-   If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
-   If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
-								or strcasecmp)
-   If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
-	(like 1 on Unix, 2 on Windows)
-*/
-
-
-extern unzFile ZEXPORT unzOpen OF((const char *path));
-/*
-  Open a Zip file. path contain the full pathname (by example,
-     on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
-	 "zlib/zlib111.zip".
-	 If the zipfile cannot be opened (file don't exist or in not valid), the
-	   return value is NULL.
-     Else, the return value is a unzFile Handle, usable with other function
-	   of this unzip package.
-*/
-
-extern int ZEXPORT unzClose OF((unzFile file));
-/*
-  Close a ZipFile opened with unzipOpen.
-  If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
-    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
-  return UNZ_OK if there is no problem. */
-
-extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
-					unz_global_info *pglobal_info));
-/*
-  Write info about the ZipFile in the *pglobal_info structure.
-  No preparation of the structure is needed
-  return UNZ_OK if there is no problem. */
-
-
-extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
-										   char *szComment,
-					   uLong uSizeBuf));
-/*
-  Get the global comment string of the ZipFile, in the szComment buffer.
-  uSizeBuf is the size of the szComment buffer.
-  return the number of byte copied or an error code <0
-*/
-
-
-/***************************************************************************/
-/* Unzip package allow you browse the directory of the zipfile */
-
-extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
-/*
-  Set the current file of the zipfile to the first file.
-  return UNZ_OK if there is no problem
-*/
-
-extern int ZEXPORT unzGoToNextFile OF((unzFile file));
-/*
-  Set the current file of the zipfile to the next file.
-  return UNZ_OK if there is no problem
-  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
-*/
-
-extern int ZEXPORT unzLocateFile OF((unzFile file,
-				     const char *szFileName,
-				     int iCaseSensitivity));
-/*
-  Try locate the file szFileName in the zipfile.
-  For the iCaseSensitivity signification, see unzStringFileNameCompare
-
-  return value :
-  UNZ_OK if the file is found. It becomes the current file.
-  UNZ_END_OF_LIST_OF_FILE if the file is not found
-*/
-
-
-extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
-					     unz_file_info *pfile_info,
-					     char *szFileName,
-					     uLong fileNameBufferSize,
-					     void *extraField,
-					     uLong extraFieldBufferSize,
-					     char *szComment,
-					     uLong commentBufferSize));
-/*
-  Get Info about the current file
-  if pfile_info!=NULL, the *pfile_info structure will contain somes info about
-	    the current file
-  if szFileName!=NULL, the filemane string will be copied in szFileName
-			(fileNameBufferSize is the size of the buffer)
-  if extraField!=NULL, the extra field information will be copied in extraField
-			(extraFieldBufferSize is the size of the buffer).
-			This is the Central-header version of the extra field
-  if szComment!=NULL, the comment string of the file will be copied in szComment
-			(commentBufferSize is the size of the buffer)
-*/
-
-/***************************************************************************/
-/* for reading the content of the current zipfile, you can open it, read data
-   from it, and close it (you can close it before reading all the file)
-   */
-
-extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
-/*
-  Open for reading data the current file in the zipfile.
-  If there is no error, the return value is UNZ_OK.
-*/
-
-extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
-/*
-  Close the file in zip opened with unzOpenCurrentFile
-  Return UNZ_CRCERROR if all the file was read but the CRC is not good
-*/
-
-
-extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
-					  voidp buf,
-					  unsigned len));
-/*
-  Read bytes from the current file (opened by unzOpenCurrentFile)
-  buf contain buffer where data must be copied
-  len the size of buf.
-
-  return the number of byte copied if somes bytes are copied
-  return 0 if the end of file was reached
-  return <0 with error code if there is an error
-    (UNZ_ERRNO for IO error, or zLib error for uncompress error)
-*/
-
-extern z_off_t ZEXPORT unztell OF((unzFile file));
-/*
-  Give the current position in uncompressed data
-*/
-
-extern int ZEXPORT unzeof OF((unzFile file));
-/*
-  return 1 if the end of file was reached, 0 elsewhere
-*/
-
-extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
-											 voidp buf,
-											 unsigned len));
-/*
-  Read extra field from the current file (opened by unzOpenCurrentFile)
-  This is the local-header version of the extra field (sometimes, there is
-    more info in the local-header version than in the central-header)
-
-  if buf==NULL, it return the size of the local extra field
-
-  if buf!=NULL, len is the size of the buffer, the extra header is copied in
-	buf.
-  the return value is the number of bytes copied in buf, or (if <0)
-	the error code
-*/
-
-#ifdef __cplusplus
-}
-#endif
-
-
-class ZipArchive : Common::Archive {
-	unzFile _zipFile;
-
 public:
-	ZipArchive(const Common::String &name) {
-		_zipFile = unzOpen(name.c_str());
-	}
-	~ZipArchive() {
-		unzClose(_zipFile);
-	}
-
-	virtual bool hasFile(const Common::String &name) {
-		return (_zipFile && unzLocateFile(_zipFile, name.c_str(), 2) == UNZ_OK);
-	}
-
-	virtual int getAllNames(Common::StringList &list) {
-		// TODO
-		return 0;
-	}
-
-	virtual Common::SeekableReadStream *openFile(const Common::String &name) {
-		if (!_zipFile)
-			return 0;
+	ZipArchive(const String &name);
+	~ZipArchive();
 	
-		unzLocateFile(_zipFile, name.c_str(), 2);
+	bool isOpen() const;
 
-		unz_file_info fileInfo;
-		unzOpenCurrentFile(_zipFile);
-		unzGetCurrentFileInfo(_zipFile, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
-		byte *buffer = (byte *)calloc(fileInfo.uncompressed_size+1, 1);
-		assert(buffer);
-		unzReadCurrentFile(_zipFile, buffer, fileInfo.uncompressed_size);
-		unzCloseCurrentFile(_zipFile);
-		return new Common::MemoryReadStream(buffer, fileInfo.uncompressed_size+1, true);
-		
-		// FIXME: instead of reading all into a memory stream, we could
-		// instead create a new ZipStream class. But then we have to be
-		// careful to handle the case where the client code opens multiple
-		// files in the archive and tries to use them indepenendtly.
-	}
+	virtual bool hasFile(const String &name);
+	virtual int getAllNames(StringList &list);
+	virtual Common::SeekableReadStream *openFile(const Common::String &name);
 };
 
+}	// End of namespace Common
+
 #endif // USE_ZLIB
 
 #endif /* _unz_H */

Modified: scummvm/branches/gsoc2008-gui/common/util.h
===================================================================
--- scummvm/branches/gsoc2008-gui/common/util.h	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/util.h	2008-09-29 19:23:36 UTC (rev 34687)
@@ -106,20 +106,20 @@
 	/**
 	 * Generates a random unsigned integer in the interval [0, max].
 	 * @param max	the upper bound
-	 * @return	a random number in the interval [0, max].
+	 * @return	a random number in the interval [0, max]
 	 */
 	uint getRandomNumber(uint max);
 	/**
-	 * Generates a random unsigned integer in the interval [0, 1].
+	 * Generates a random bit, i.e. either 0 or 1.
 	 * Identical to getRandomNumber(1), but faster, hopefully.
-	 * @return	a random number in the interval [0, max].
+	 * @return	a random bit, either 0 or 1
 	 */
 	uint getRandomBit(void);
 	/**
 	 * Generates a random unsigned integer in the interval [min, max].
 	 * @param min	the lower bound
 	 * @param max	the upper bound
-	 * @return	a random number in the interval [min, max].
+	 * @return	a random number in the interval [min, max]
 	 */
 	uint getRandomNumberRng(uint min, uint max);
 };

Modified: scummvm/branches/gsoc2008-gui/common/xmlparser.h
===================================================================
--- scummvm/branches/gsoc2008-gui/common/xmlparser.h	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/common/xmlparser.h	2008-09-29 19:23:36 UTC (rev 34687)
@@ -217,9 +217,9 @@
 		return true;
 	}
 	
-	bool loadStream(MemoryReadStream *stream) {
+	bool loadStream(Common::SeekableReadStream *stream) {
 		_stream = stream;
-		_fileName = "Compressed File Stream";
+		_fileName = "File Stream";
 		return true;
 	}
 	

Modified: scummvm/branches/gsoc2008-gui/engines/agi/predictive.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/agi/predictive.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/agi/predictive.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -491,7 +491,8 @@
 	ConfMan.registerDefault("predictive_dictionary", "pred.dic");
 
 	uint32 time1 = _system->getMillis();
-	if (!inFile.open(ConfMan.get("predictive_dictionary")))
+	Common::String inFileName(ConfMan.get("predictive_dictionary"));
+	if (!inFile.open(inFileName))
 		return;
 
 	char *ptr;
@@ -505,7 +506,7 @@
 	inFile.read(_predictiveDictText, size);
 	_predictiveDictText[size] = 0;
 	uint32 time2 = _system->getMillis();
-	debug("Time to read %s: %d bytes, %d ms", inFile.name(), size, time2-time1);
+	debug("Time to read %s: %d bytes, %d ms", inFileName.c_str(), size, time2-time1);
 	inFile.close();
 
 	ptr = _predictiveDictText;

Modified: scummvm/branches/gsoc2008-gui/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/cruise/cruise_main.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/cruise/cruise_main.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -243,7 +243,7 @@
 		return NULL;
 	}
 
-	return ((ovlData3Struct *) (ovlData->ptr1 + param * 0x1C));
+	return &ovlData->ptr1[param];
 }
 
 void scriptFunc2(int scriptNumber, scriptInstanceStruct * scriptHandle,

Modified: scummvm/branches/gsoc2008-gui/engines/cruise/ctp.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/cruise/ctp.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/cruise/ctp.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -153,8 +153,8 @@
 	int16* a2;
 
 	a1 = a2 = (int16*)str;
-	a2 += 4+sizeof(int16*); // skip header
-
+	a2 += sizeof(int16*) / sizeof(int16) + 6; // skip header
+	
 	int16* XArray = XMIN_XMAX;
 	int minY = *XArray++;
 
@@ -178,8 +178,8 @@
 
 	adrStructPoly = (uint8*)a2;
 
-	*(uint16**)a2 = (uint16*)-1;
-
+	*(uint16**)a2 = (uint16*)-1; //chained list terminator
+	
 	a1+=sizeof(int16*);
 	*a1++=num;
 	*a1++=walkboxColor[num];
@@ -339,20 +339,20 @@
 		makeCtStruct(adrStructPoly, ctp_walkboxTable, i, 0 );
 	}
 
-	polyStructExp = adrStructPoly += 4;
+	polyStructExp = adrStructPoly += sizeof(int16 *);
 
 	for(int i= numberOfWalkboxes-1; i >=0; i--) {
 		makeCtStruct(adrStructPoly, ctp_walkboxTable, i, walkboxZoom[i] * 20 );
 	}
 
-	int ctSize = (adrStructPoly - ptr) + 4; // for now, the +4 is a safe zone
+	int ctSize = (adrStructPoly - ptr) + sizeof(int16 *); // for now, the +sizeof(int16 *) is a safe zone
 	adrStructPoly = polyStructNorm = polyStruct = (uint8 *) malloc(ctSize);
 
 	for(int i= numberOfWalkboxes-1; i >=0; i--) {
 		makeCtStruct(adrStructPoly, ctp_walkboxTable, i, 0);
 	}
 
-	polyStructExp = adrStructPoly += 4;
+	polyStructExp = adrStructPoly += sizeof(int16 *);
 
 	for(int i= numberOfWalkboxes-1; i >=0; i--) {
 		makeCtStruct(adrStructPoly, ctp_walkboxTable, i, walkboxZoom[i] * 20);

Modified: scummvm/branches/gsoc2008-gui/engines/cruise/dataLoader.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/cruise/dataLoader.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/cruise/dataLoader.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -24,6 +24,7 @@
  */
 
 #include "cruise/cruise_main.h"
+#include "common/endian.h"
 
 namespace Cruise {
 
@@ -412,7 +413,6 @@
 }
 
 int loadSetEntry(const char *name, uint8 *ptr, int currentEntryIdx, int currentDestEntry) {
-	uint8 *ptr2;
 	uint8 *ptr3;
 	int offset;
 	int sec = 0;
@@ -422,29 +422,28 @@
 		sec = 1;
 	}
 
-	ptr2 = ptr + 4;
+	numIdx = READ_BE_UINT16(ptr + 4);
 
-	memcpy(&numIdx, ptr2, 2);
-	flipShort(&numIdx);
-
 	ptr3 = ptr + 6;
 
 	offset = currentEntryIdx * 16;
 
 	{
-		uint8 *ptr4;
 		int resourceSize;
 		int fileIndex;
 		setHeaderEntry localBuffer;
 		uint8 *ptr5;
 
-		ptr4 = ptr + offset + 6;
+		Common::MemoryReadStream s4(ptr + offset + 6, 16);
 
-		memcpy(&localBuffer, ptr4, sizeof(setHeaderEntry));
+		localBuffer.field_0 = s4.readUint32BE();
+		localBuffer.width = s4.readUint16BE();
+		localBuffer.height = s4.readUint16BE();
+		localBuffer.type = s4.readUint16BE();
+		localBuffer.transparency = s4.readUint16BE();
+		localBuffer.field_C = s4.readUint16BE();
+		localBuffer.field_E = s4.readUint16BE();
 
-		flipLong((int32 *) & localBuffer.field_0);
-		flipGen(&localBuffer.width, 12);
-
 		if (sec == 1) {
 			localBuffer.width = localBuffer.width - (localBuffer.type * 2);	// Type 1: Width - (1*2) , Type 5: Width - (5*2)
 		}

Modified: scummvm/branches/gsoc2008-gui/engines/cruise/overlay.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/cruise/overlay.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/cruise/overlay.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -23,6 +23,8 @@
  *
  */
 
+#include "common/stream.h"
+
 #include "cruise/cruise_main.h"
 
 namespace Cruise {
@@ -50,8 +52,7 @@
 	char fileName[50];
 	int fileIdx;
 	int unpackedSize;
-	char *unpackedBuffer;
-	char *scriptPtr;
+	byte *unpackedBuffer;
 	ovlDataStruct *ovlData;
 
 	printf("Load overlay: %s\n", scriptName);
@@ -105,7 +106,7 @@
 	unpackedSize = volumePtrToFileDescriptor[fileIdx].extSize + 2;
 
 	// TODO: here, can unpack in gfx module buffer
-	unpackedBuffer = (char *)mallocAndZero(unpackedSize);
+	unpackedBuffer = (byte *)mallocAndZero(unpackedSize);
 
 	if (!unpackedBuffer) {
 		return (-2);
@@ -127,12 +128,13 @@
 
 	printf("OVL loading done...\n");
 
-	scriptPtr = unpackedBuffer;
+	Common::MemoryReadStream s(unpackedBuffer, unpackedSize);
 
 	ovlData = overlayTable[scriptIdx].ovlData;
 
-	memcpy(ovlData, scriptPtr, sizeof(ovlDataStruct));
-
+	// Skip pointers
+	s.skip(60);
+	
 	ovlData->arrayProc = NULL;
 	ovlData->ptr1 = NULL;
 	ovlData->arrayObject = NULL;
@@ -148,25 +150,23 @@
 	ovlData->arrayNameSymbGlob = NULL;
 	ovlData->data4Ptr = NULL;
 	ovlData->ptr8 = NULL;
-	ovlData->numProc = readB16(scriptPtr + 60);
-	ovlData->numRel = readB16(scriptPtr + 62);
-	ovlData->numSymbGlob = readB16(scriptPtr + 64);
-	ovlData->numRelocGlob = readB16(scriptPtr + 66);
-	ovlData->numMsgRelHeader = readB16(scriptPtr + 68);
-	ovlData->numObj = readB16(scriptPtr + 70);
-	ovlData->numStrings = readB16(scriptPtr + 72);
-	ovlData->size8 = readB16(scriptPtr + 74);
-	ovlData->size9 = readB16(scriptPtr + 76);
-	ovlData->nameExportSize = readB16(scriptPtr + 78);
-	ovlData->exportNamesSize = readB16(scriptPtr + 80);
-	ovlData->specialString2Length = readB16(scriptPtr + 82);
-	ovlData->sizeOfData4 = readB16(scriptPtr + 84);
-	ovlData->size12 = readB16(scriptPtr + 86);
-	ovlData->specialString1Length = readB16(scriptPtr + 88);
-	ovlData->scriptNumber = readB16(scriptPtr + 90);
+	ovlData->numProc = s.readUint16BE();
+	ovlData->numRel = s.readUint16BE();
+	ovlData->numSymbGlob = s.readUint16BE();
+	ovlData->numRelocGlob = s.readUint16BE();
+	ovlData->numMsgRelHeader = s.readUint16BE();
+	ovlData->numObj = s.readUint16BE();
+	ovlData->numStrings = s.readUint16BE();
+	ovlData->size8 = s.readUint16BE();
+	ovlData->size9 = s.readUint16BE();
+	ovlData->nameExportSize = s.readUint16BE();
+	ovlData->exportNamesSize = s.readUint16BE();
+	ovlData->specialString2Length = s.readUint16BE();
+	ovlData->sizeOfData4 = s.readUint16BE();
+	ovlData->size12 = s.readUint16BE();
+	ovlData->specialString1Length = s.readUint16BE();
+	ovlData->scriptNumber = s.readUint16BE();
 
-	scriptPtr += 92;
-
 	if (ovlData->numSymbGlob)	{ // export data
 		int i;
 		ovlData->arraySymbGlob =
@@ -177,13 +177,11 @@
 		}
 
 		for (i = 0; i < ovlData->numSymbGlob; i++) {
-			ovlData->arraySymbGlob[i].var0 = readB16(scriptPtr);
-			ovlData->arraySymbGlob[i].var2 = readB16(scriptPtr + 2);
-			ovlData->arraySymbGlob[i].var4 = readB16(scriptPtr + 4);
-			ovlData->arraySymbGlob[i].idx = readB16(scriptPtr + 6);
-			ovlData->arraySymbGlob[i].offsetToName = readB16(scriptPtr + 8);
-
-			scriptPtr += 10;
+			ovlData->arraySymbGlob[i].var0 = s.readUint16BE();
+			ovlData->arraySymbGlob[i].var2 = s.readUint16BE();
+			ovlData->arraySymbGlob[i].var4 = s.readUint16BE();
+			ovlData->arraySymbGlob[i].idx = s.readUint16BE();
+			ovlData->arraySymbGlob[i].offsetToName = s.readUint16BE();
 		}
 	}
 
@@ -194,8 +192,7 @@
 			return (-2);
 		}
 
-		memcpy(ovlData->arrayNameSymbGlob, scriptPtr, ovlData->exportNamesSize);
-		scriptPtr += ovlData->exportNamesSize;
+		s.read(ovlData->arrayNameSymbGlob, ovlData->exportNamesSize);
 	}
 
 	if (ovlData->numRelocGlob) {	// import data
@@ -210,13 +207,11 @@
 		}
 
 		for (i = 0; i < ovlData->numRelocGlob; i++) {
-			ovlData->arrayRelocGlob[i].var0 = readB16(scriptPtr);
-			ovlData->arrayRelocGlob[i].var1 = readB16(scriptPtr + 2);
-			ovlData->arrayRelocGlob[i].linkType = readB16(scriptPtr + 4);
-			ovlData->arrayRelocGlob[i].linkIdx = readB16(scriptPtr + 6);
-			ovlData->arrayRelocGlob[i].nameOffset = readB16(scriptPtr + 8);
-
-			scriptPtr += 10;
+			ovlData->arrayRelocGlob[i].var0 = s.readUint16BE();
+			ovlData->arrayRelocGlob[i].var1 = s.readUint16BE();
+			ovlData->arrayRelocGlob[i].linkType = s.readUint16BE();
+			ovlData->arrayRelocGlob[i].linkIdx = s.readUint16BE();
+			ovlData->arrayRelocGlob[i].nameOffset = s.readUint16BE();
 		}
 	}
 
@@ -226,13 +221,12 @@
 		if (!ovlData->arrayNameRelocGlob) {
 			return (-2);
 		}
-
-		memcpy(ovlData->arrayNameRelocGlob, scriptPtr,
-		    ovlData->nameExportSize);
-		scriptPtr += ovlData->nameExportSize;
+		
+		s.read(ovlData->arrayNameRelocGlob, ovlData->nameExportSize);
 	}
 
 	if (ovlData->numMsgRelHeader) {	// link data
+		int i;
 		ASSERT(sizeof(linkDataStruct) == 0x22);
 
 		ovlData->arrayMsgRelHeader = (linkDataStruct *) mallocAndZero(ovlData->numMsgRelHeader * sizeof(linkDataStruct));
@@ -241,9 +235,30 @@
 			return (-2);
 		}
 
-		memcpy(ovlData->arrayMsgRelHeader, scriptPtr, ovlData->numMsgRelHeader * sizeof(linkDataStruct));
-		scriptPtr += ovlData->numMsgRelHeader * sizeof(linkDataStruct);
-		flipGen(ovlData->arrayMsgRelHeader, ovlData->numMsgRelHeader * sizeof(linkDataStruct));
+		for (i = 0; i < ovlData->numMsgRelHeader; i++) {
+			ovlData->arrayMsgRelHeader[i].type = s.readUint16BE();
+			ovlData->arrayMsgRelHeader[i].id = s.readUint16BE();
+			ovlData->arrayMsgRelHeader[i].offsetVerbeName = s.readUint16BE();
+			ovlData->arrayMsgRelHeader[i].verbOverlay = s.readUint16BE();
+			ovlData->arrayMsgRelHeader[i].verbNumber = s.readUint16BE();
+
+			ovlData->arrayMsgRelHeader[i].obj1Overlay = s.readUint16BE();
+			ovlData->arrayMsgRelHeader[i].obj1Number = s.readUint16BE();
+			ovlData->arrayMsgRelHeader[i].obj2Overlay = s.readUint16BE();
+			ovlData->arrayMsgRelHeader[i].obj2Number = s.readUint16BE();
+
+			ovlData->arrayMsgRelHeader[i].trackX = s.readUint16BE();
+			ovlData->arrayMsgRelHeader[i].trackY = s.readUint16BE();
+
+			ovlData->arrayMsgRelHeader[i].obj1NewState = s.readUint16BE();
+			ovlData->arrayMsgRelHeader[i].obj2NewState = s.readUint16BE();
+
+			ovlData->arrayMsgRelHeader[i].obj1OldState = s.readUint16BE();
+			ovlData->arrayMsgRelHeader[i].obj2OldState = s.readUint16BE();
+
+			ovlData->arrayMsgRelHeader[i].trackDirection = s.readUint16BE();
+			ovlData->arrayMsgRelHeader[i].dialog = s.readUint16BE();
+		}
 	}
 
 	if (ovlData->numProc) {	// script
@@ -251,53 +266,47 @@
 		int i;
 
 		ovlData->arrayProc =
-		    (ovlData3Struct *) mallocAndZero(ovlData->numProc *
-		    sizeof(ovlData3Struct));
+		    (ovlData3Struct *) mallocAndZero(ovlData->numProc * sizeof(ovlData3Struct));
 
 		if (!ovlData->arrayProc) {
-/*      releaseScript(scriptIdx,scriptName);
-
-      if (freeIsNeeded) {
-        freePtr(unpackedBuffer);
-      } */
-
 			return (-2);
 		}
 
-		memcpy(ovlData->arrayProc, scriptPtr,
-		    ovlData->numProc * sizeof(ovlData3Struct));
-		scriptPtr += ovlData->numProc * 0x1C;
+		for (i = 0; i < ovlData->numProc; i++) {
+			s.skip(4);
+			ovlData->arrayProc[i].dataPtr = NULL;
+			ovlData->arrayProc[i].sizeOfData = s.readUint16BE();
+			ovlData->arrayProc[i].offsetToSubData3 = s.readUint16BE();
+			ovlData->arrayProc[i].offsetToImportData = s.readUint16BE();
+			ovlData->arrayProc[i].offsetToSubData2 = s.readUint16BE();
+			ovlData->arrayProc[i].offsetToImportName = s.readUint16BE();
+			ovlData->arrayProc[i].offsetToSubData5 = s.readUint16BE();
+			ovlData->arrayProc[i].sysKey = s.readUint16BE();
+			ovlData->arrayProc[i].var12 = s.readUint16BE();
+			ovlData->arrayProc[i].numRelocGlob = s.readUint16BE();
+			ovlData->arrayProc[i].subData2Size = s.readUint16BE();
+			ovlData->arrayProc[i].var18 = s.readUint16BE();
+			ovlData->arrayProc[i].var1A = s.readUint16BE();
+		}
 
-		flipGen(ovlData->arrayProc,
-		    ovlData->numProc * sizeof(ovlData3Struct));
-
 		tempPtr = ovlData->arrayProc;
 
 		for (i = 0; i < ovlData->numProc; i++) {
-			uint8 *ptr = tempPtr->dataPtr =
-			    (uint8 *) mallocAndZero(tempPtr->sizeOfData);
+			tempPtr->dataPtr = (uint8 *) mallocAndZero(tempPtr->sizeOfData);
 
-			if (!ptr) {
-				/*      releaseScript(scriptIdx,scriptName);
-				 *
-				 * if (freeIsNeeded)
-				 * {
-				 * freePtr(unpackedBuffer);
-				 * } */
-
+			if (!tempPtr->dataPtr) {
 				return (-2);
 			}
 
-			memcpy(ptr, scriptPtr, tempPtr->sizeOfData);
-			scriptPtr += tempPtr->sizeOfData;
+			s.read(tempPtr->dataPtr, tempPtr->sizeOfData);
 
 			if (tempPtr->offsetToImportData) {
-				flipGen(ptr + tempPtr->offsetToImportData,
+				flipGen(tempPtr->dataPtr + tempPtr->offsetToImportData,
 				    tempPtr->numRelocGlob * 10);
 			}
 
 			if (tempPtr->offsetToSubData2) {
-				flipGen(ptr + tempPtr->offsetToImportData,
+				flipGen(tempPtr->dataPtr + tempPtr->offsetToSubData2,
 				    tempPtr->subData2Size * 10);
 			}
 
@@ -310,43 +319,47 @@
 		int i;
 
 		ovlData->ptr1 =
-		    (uint8 *) mallocAndZero(ovlData->numRel * 0x1C);
+		    (ovlData3Struct *) mallocAndZero(ovlData->numRel * sizeof(ovlData3Struct));
 
 		if (!ovlData->ptr1) {
 			return (-2);
 		}
 
-		memcpy(ovlData->ptr1, scriptPtr, ovlData->numRel * 0x1C);
-		scriptPtr += ovlData->numRel * 0x1C;
-		flipGen(ovlData->ptr1, ovlData->numRel * 0x1C);
-
+		for (i = 0; i < ovlData->numRel; i++) {
+			s.skip(4);
+			ovlData->ptr1[i].dataPtr = NULL;
+			ovlData->ptr1[i].sizeOfData = s.readUint16BE();
+			ovlData->ptr1[i].offsetToSubData3 = s.readUint16BE();
+			ovlData->ptr1[i].offsetToImportData = s.readUint16BE();
+			ovlData->ptr1[i].offsetToSubData2 = s.readUint16BE();
+			ovlData->ptr1[i].offsetToImportName = s.readUint16BE();
+			ovlData->ptr1[i].offsetToSubData5 = s.readUint16BE();
+			ovlData->ptr1[i].sysKey = s.readUint16BE();
+			ovlData->ptr1[i].var12 = s.readUint16BE();
+			ovlData->ptr1[i].numRelocGlob = s.readUint16BE();
+			ovlData->ptr1[i].subData2Size = s.readUint16BE();
+			ovlData->ptr1[i].var18 = s.readUint16BE();
+			ovlData->ptr1[i].var1A = s.readUint16BE();
+		}
+		
 		tempPtr = (ovlData3Struct *) ovlData->ptr1;
 
 		for (i = 0; i < ovlData->numRel; i++) {
-			uint8 *ptr = tempPtr->dataPtr =
-			    (uint8 *) mallocAndZero(tempPtr->sizeOfData);
+			tempPtr->dataPtr = (uint8 *) mallocAndZero(tempPtr->sizeOfData);
 
-			if (!ptr) {
-				/*      releaseScript(scriptIdx,scriptName);
-				 *
-				 * if (freeIsNeeded)
-				 * {
-				 * freePtr(unpackedBuffer);
-				 * } */
-
+			if (!tempPtr->dataPtr) {
 				return (-2);
 			}
 
-			memcpy(ptr, scriptPtr, tempPtr->sizeOfData);
-			scriptPtr += tempPtr->sizeOfData;
+			s.read(tempPtr->dataPtr, tempPtr->sizeOfData);
 
 			if (tempPtr->offsetToImportData) {
-				flipGen(ptr + tempPtr->offsetToImportData,
+				flipGen(tempPtr->dataPtr + tempPtr->offsetToImportData,
 				    tempPtr->numRelocGlob * 10);
 			}
 
 			if (tempPtr->offsetToSubData2) {
-				flipGen(ptr + tempPtr->offsetToImportData,
+				flipGen(tempPtr->dataPtr + tempPtr->offsetToSubData2,
 				    tempPtr->subData2Size * 10);
 			}
 
@@ -367,8 +380,7 @@
 			return (-2);
 		}
 
-		memcpy(ovlData->ptr8, scriptPtr, ovlData->size12);
-		scriptPtr += ovlData->size12;
+		s.read(ovlData->ptr8, ovlData->size12);
 	}
 
 	if (ovlData->numObj) {
@@ -378,47 +390,20 @@
 		    sizeof(objDataStruct));
 
 		if (!ovlData->arrayObject) {
-/*      releaseScript(scriptIdx,scriptName);
-
-      if (freeIsNeeded) {
-        freePtr(unpackedBuffer);
-      } */
-
 			return (-2);
 		}
 
 		for (i = 0; i < ovlData->numObj; i++) {
-			ovlData->arrayObject[i]._type = *(int16 *) scriptPtr;
-			scriptPtr += 2;
-			flipShort(&ovlData->arrayObject[i]._type);
-
-			int16 tempClass = *(int16 *) scriptPtr;
-			flipShort(&tempClass);
-			ovlData->arrayObject[i]._class = (eClass)tempClass;
-			scriptPtr += 2;
-
-			ovlData->arrayObject[i]._nameOffset = *(int16 *) scriptPtr;
-			scriptPtr += 2;
-			flipShort(&ovlData->arrayObject[i]._nameOffset);
-
-			ovlData->arrayObject[i]._numStates = *(int16 *) scriptPtr;
-			scriptPtr += 2;
-			flipShort(&ovlData->arrayObject[i]._numStates);
-
-			ovlData->arrayObject[i]._varTableIdx = *(int16 *) scriptPtr;
-			scriptPtr += 2;
-			flipShort(&ovlData->arrayObject[i]._varTableIdx);
-
-			ovlData->arrayObject[i]._firstStateIdx = *(int16 *) scriptPtr;
-			scriptPtr += 2;
-			flipShort(&ovlData->arrayObject[i]._firstStateIdx);
-
-			ovlData->arrayObject[i]._stateTableIdx = *(int16 *) scriptPtr;
-			scriptPtr += 2;
-			flipShort(&ovlData->arrayObject[i]._stateTableIdx);
+			ovlData->arrayObject[i]._type = s.readUint16BE();
+			ovlData->arrayObject[i]._class = (eClass) s.readUint16BE();
+			ovlData->arrayObject[i]._nameOffset = s.readUint16BE();
+			ovlData->arrayObject[i]._numStates = s.readUint16BE();
+			ovlData->arrayObject[i]._varTableIdx = s.readUint16BE();
+			ovlData->arrayObject[i]._firstStateIdx = s.readUint16BE();
+			ovlData->arrayObject[i]._stateTableIdx = s.readUint16BE();	
 		}
 
-		// allocte states for object with multiple states
+		// allocate states for object with multiple states
 
 		if (scriptNotLoadedBefore) {
 			overlayTable[scriptIdx].state = stateID;
@@ -430,38 +415,30 @@
 		ovlData->arrayObjVar =
 		    (objectParams *) mallocAndZero(ovlData->size9 *
 		    sizeof(objectParams));
-		memset(ovlData->arrayObjVar, 0,
-		    ovlData->size9 * sizeof(objectParams));
 
 		if (!ovlData->arrayObjVar) {
-/*      releaseScript(scriptIdx,scriptName);
-
-      if (freeIsNeeded) {
-        freePtr(unpackedBuffer);
-      } */
-
 			return (-2);
 		}
 	}
 
 	if (ovlData->size8) {
+		int i;
 		ovlData->arrayStates =
 		    (objectParams *) mallocAndZero(ovlData->size8 *
 		    sizeof(objectParams));
 
 		if (!ovlData->arrayStates) {
-/*      releaseScript(scriptIdx,scriptName);
-
-      if (freeIsNeeded) {
-        freePtr(unpackedBuffer);
-      } */
-
 			return (-2);
 		}
 
-		memcpy(ovlData->arrayStates, scriptPtr, ovlData->size8 * 12);	// TODO: made read item by item
-		scriptPtr += ovlData->size8 * 12;
-		flipGen(ovlData->arrayStates, ovlData->size8 * 12);
+		for (i = 0; i < ovlData->size8; i++) {
+			ovlData->arrayStates[i].X = s.readUint16BE();
+			ovlData->arrayStates[i].Y = s.readUint16BE();
+			ovlData->arrayStates[i].Z = s.readUint16BE();
+			ovlData->arrayStates[i].frame = s.readUint16BE();
+			ovlData->arrayStates[i].scale = s.readUint16BE();
+			ovlData->arrayStates[i].state = s.readUint16BE();
+		}
 	}
 
 	if (ovlData->numStrings) {
@@ -472,23 +449,15 @@
 		    sizeof(stringEntryStruct));
 
 		for (i = 0; i < ovlData->numStrings; i++) {
-			ovlData->stringTable[i].idx = *(int16 *) scriptPtr;
-			flipShort(&ovlData->stringTable[i].idx);
-			scriptPtr += 2;
+			ovlData->stringTable[i].idx = s.readUint16BE();
 		}
 	}
 
-/*  if (freeIsNeeded) {
-    freePtr(unpackedBuffer);
-  } */
-
 	if (ovlData->sizeOfData4) {
 		ovlData->data4Ptr =
 		    (uint8 *) mallocAndZero(ovlData->sizeOfData4);
-		memset(ovlData->data4Ptr, 0, ovlData->sizeOfData4);
 
 		if (!ovlData->data4Ptr) {
-			//releaseScript(scriptIdx,scriptName);
 			return (-2);
 		}
 	}
@@ -516,7 +485,7 @@
 		unpackedSize = volumePtrToFileDescriptor[fileIdx].extSize + 2;
 
 		// TODO: here, can unpack in gfx module buffer
-		unpackedBuffer = (char *)mallocAndZero(unpackedSize);
+		unpackedBuffer = (byte *)mallocAndZero(unpackedSize);
 
 		if (!unpackedBuffer) {
 			return (-2);
@@ -538,12 +507,9 @@
 			loadPakedFileToMem(fileIdx, (uint8 *) unpackedBuffer);
 		}
 
-		scriptPtr = unpackedBuffer;
+		Common::MemoryReadStream s2(unpackedBuffer, unpackedSize);
 
-		memcpy(&ovlData->specialString1Length, scriptPtr, 2);
-		scriptPtr += 2;
-		flipShort(&ovlData->specialString1Length);	// recheck if needed
-
+		ovlData->specialString1Length = s2.readUint16BE();
 		if (ovlData->specialString1Length) {
 			ovlData->nameVerbGlob = (char *) mallocAndZero(ovlData->specialString1Length);
 
@@ -558,15 +524,10 @@
 				return (-2);
 			}
 
-			memcpy(ovlData->nameVerbGlob, scriptPtr,
-			    ovlData->specialString1Length);
-			scriptPtr += ovlData->specialString1Length;
+			s2.read(ovlData->nameVerbGlob, ovlData->specialString1Length);
 		}
 
-		memcpy(&ovlData->specialString2Length, scriptPtr, 2);
-		scriptPtr += 2;
-		flipShort(&ovlData->specialString2Length);	// recheck if needed
-
+		ovlData->specialString2Length = s2.readUint16BE();
 		if (ovlData->specialString2Length) {
 			ovlData->arrayNameObj = (char *) mallocAndZero(ovlData->specialString2Length);
 
@@ -581,15 +542,11 @@
 				return (-2);
 			}
 
-			memcpy(ovlData->arrayNameObj, scriptPtr,
-			    ovlData->specialString2Length);
-			scriptPtr += ovlData->specialString2Length;
+			s2.read(ovlData->arrayNameObj, ovlData->specialString2Length);
 		}
 
 		for (i = 0; i < ovlData->numStrings; i++) {
-			ovlData->stringTable[i].length = *(int16 *) scriptPtr;
-			scriptPtr += 2;
-			flipShort(&ovlData->stringTable[i].length);
+			ovlData->stringTable[i].length = s2.readUint16BE();
 
 			if (ovlData->stringTable[i].length) {
 				ovlData->stringTable[i].string =
@@ -607,8 +564,7 @@
 					return (-2);
 				}
 
-				memcpy(ovlData->stringTable[i].string, scriptPtr, ovlData->stringTable[i].length);
-				scriptPtr += ovlData->stringTable[i].length;
+				s2.read(ovlData->stringTable[i].string, ovlData->stringTable[i].length);
 			}
 		}
 	}

Modified: scummvm/branches/gsoc2008-gui/engines/cruise/overlay.h
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/cruise/overlay.h	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/cruise/overlay.h	2008-09-29 19:23:36 UTC (rev 34687)
@@ -129,7 +129,7 @@
 struct ovlDataStruct {
 
 	ovlData3Struct *arrayProc;
-	uint8 *ptr1;
+	ovlData3Struct *ptr1;
 	objDataStruct *arrayObject;
 	objectParams *arrayStates;
 	objectParams *arrayObjVar;

Modified: scummvm/branches/gsoc2008-gui/engines/cruise/saveload.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/cruise/saveload.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/cruise/saveload.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -465,8 +465,7 @@
 void loadSavegameDataSub6(Common::InSaveFile& currentSaveFile) {
 	int32 var;
 
-	var = currentSaveFile.readUint32LE();
-	flipLong(&var);
+	var = currentSaveFile.readUint32BE();
 
 	if (var) {
 		int i;

Modified: scummvm/branches/gsoc2008-gui/engines/cruise/vars.h
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/cruise/vars.h	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/cruise/vars.h	2008-09-29 19:23:36 UTC (rev 34687)
@@ -91,8 +91,7 @@
 };
 
 struct setHeaderEntry {
-	int16 field_0;		// offset ptr part 1
-	int16 field_2;		// offset ptr part 2
+	int32 field_0;		// offset ptr
 	int16 width;
 	int16 height;
 	int16 type;		// resource type, ie. sprites 0,1,4,5 and 8

Modified: scummvm/branches/gsoc2008-gui/engines/drascula/drascula.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/drascula/drascula.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/drascula/drascula.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -55,7 +55,7 @@
 DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
 
 	// Setup mixer
-	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
+	_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
 	_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
 
 	_rnd = new Common::RandomSource();
@@ -220,7 +220,7 @@
 
 		allocMemory();
 
-		withVoices = 0;
+		_subtitlesDisabled = !ConfMan.getBool("subtitles");
 		selectionMade = 0;
 
 		if (currentChapter != 3)
@@ -560,12 +560,16 @@
 		} else if (key == Common::KEYCODE_F8) {
 			selectVerb(0);
 		} else if (key == Common::KEYCODE_v) {
-			withVoices = 1;
+			_subtitlesDisabled = true;
+			ConfMan.setBool("subtitles", !_subtitlesDisabled);
+
 			print_abc(_textsys[2], 96, 86);
 			updateScreen();
 			delay(1410);
 		} else if (key == Common::KEYCODE_t) {
-			withVoices = 0;
+			_subtitlesDisabled = false;
+			ConfMan.setBool("subtitles", !_subtitlesDisabled);
+
 			print_abc(_textsys[3], 94, 86);
 			updateScreen();
 			delay(1460);

Modified: scummvm/branches/gsoc2008-gui/engines/drascula/drascula.h
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/drascula/drascula.h	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/drascula/drascula.h	2008-09-29 19:23:36 UTC (rev 34687)
@@ -380,7 +380,7 @@
 	int _destX[40], _destY[40], trackCharacter_alkeva[40], roomExits[40];
 	int x1[40], y1[40], x2[40], y2[40];
 	int takeObject, pickedObject;
-	int withVoices;
+	bool _subtitlesDisabled;
 	int menuBar, menuScreen, hasName;
 	char textName[20];
 	int curExcuseLook;

Modified: scummvm/branches/gsoc2008-gui/engines/drascula/sound.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/drascula/sound.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/drascula/sound.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -26,6 +26,7 @@
 #include "sound/mixer.h"
 #include "sound/voc.h"
 #include "sound/audiocd.h"
+#include "common/config-manager.h"
 
 #include "drascula/drascula.h"
 
@@ -52,7 +53,7 @@
 
 	for (;;) {
 		int masterVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16), 0, 15);
-		int voiceVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16), 0, 15);
+		int voiceVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType) / 16), 0, 15);
 		int musicVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16), 0, 15);
 
 		int masterVolumeY = 72 + 61 - masterVolume * 4;
@@ -82,7 +83,7 @@
 			}
 
 			if (mouseX > 136 && mouseX < 178) {
-				updateVolume(Audio::Mixer::kSFXSoundType, voiceVolumeY);
+				updateVolume(Audio::Mixer::kSpeechSoundType, voiceVolumeY);
 			}
 
 			if (mouseX > 192 && mouseX < 233) {
@@ -173,7 +174,11 @@
 		_arj.read(soundData, soundSize);
 		_arj.close();
 
-		_mixer->playRaw(Audio::Mixer::kSFXSoundType, &_soundHandle, soundData, soundSize - 64,
+		_subtitlesDisabled = !ConfMan.getBool("subtitles");
+		if (ConfMan.getBool("speech_mute"))
+			memset(soundData, 0x80, soundSize); // Mute speech but keep the pause
+
+		_mixer->playRaw(Audio::Mixer::kSpeechSoundType, &_soundHandle, soundData, soundSize - 64,
 						11025, Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_UNSIGNED);
 	} else
 		warning("playFile: Could not open %s", fname);

Modified: scummvm/branches/gsoc2008-gui/engines/drascula/talk.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/drascula/talk.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/drascula/talk.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -82,7 +82,7 @@
 			copyBackground(igorX + 17, igorY, igorX + 17, igorY, 37, 24, bgSurface, screenSurface);
 			copyRect(x_talk0[face], 148, igorX + 17, igorY, 25, 24, frontSurface, screenSurface);
 			updateRefresh();
-			if (withVoices == 0)
+			if (!_subtitlesDisabled)
 				centerText(said, igorX + 26, igorY);
 			updateScreen();
 			pause(3);
@@ -95,13 +95,13 @@
 				copyBackground(igorX, igorY, igorX, igorY, 29, 25, bgSurface, screenSurface);
 			copyRect(x_talk1[face], 173, igorX, igorY, 29, 25, frontSurface, screenSurface);
 			updateRefresh();
-			if (withVoices == 0)
+			if (!_subtitlesDisabled)
 				centerText(said, igorX + 26, igorY);
 			updateScreen();
 			pause(3);
 		} else if (talkerType == kIgorDoor) {
 			updateRoom();
-			if (withVoices == 0)
+			if (!_subtitlesDisabled)
 				centerText(said, 87, 66);
 			updateScreen();
 		} else if (talkerType == kIgorSeated || talkerType == kIgorWig) {
@@ -111,7 +111,7 @@
 				copyBackground(x_talk4[face], 78, 199, 94, 38, 27, drawSurface3, screenSurface);
 			moveCharacters();
 			updateRefresh();
-			if (withVoices == 0)
+			if (!_subtitlesDisabled)
 				centerText(said, 221, 102);
 
 			updateScreen();
@@ -166,7 +166,7 @@
 
 		updateRefresh();
 
-		if (withVoices == 0)
+		if (!_subtitlesDisabled)
 			centerText(said, drasculaX + 19, drasculaY);
 
 		updateScreen();
@@ -211,7 +211,7 @@
 		if (l == 7)
 			l = 0;
 
-		if (withVoices == 0)
+		if (!_subtitlesDisabled)
 			centerText(said, 191, 69);
 
 		updateScreen();
@@ -237,7 +237,7 @@
 		copyBackground();
 
 	do {
-		if (withVoices == 0) {
+		if (!_subtitlesDisabled) {
 			if (currentChapter == 1)
 				centerText(said, 156, 90);
 			else if (currentChapter == 6)
@@ -300,7 +300,7 @@
 		moveCharacters();
 		updateRefresh();
 
-		if (withVoices == 0)
+		if (!_subtitlesDisabled)
 			centerText(said, 132, 45);
 
 		updateScreen();
@@ -339,7 +339,7 @@
 			moveCharacters();
 			updateRefresh();
 
-			if (withVoices == 0)
+			if (!_subtitlesDisabled)
 				centerText(said, bjX + 7, bjY);
 
 			updateScreen();
@@ -348,7 +348,7 @@
 		} else {
 			updateRoom();
 
-			if (withVoices == 0)
+			if (!_subtitlesDisabled)
 				centerText(said, 93, 80);
 
 			updateScreen();
@@ -463,7 +463,7 @@
 			updateRefresh();
 		}
 
-		if (withVoices == 0)
+		if (!_subtitlesDisabled)
 			centerText(said, curX, curY);
 
 		updateScreen();
@@ -555,7 +555,7 @@
 				updateRefresh();
 			}
 
-			if (withVoices == 0)
+			if (!_subtitlesDisabled)
 				centerText(said, vonBraunX, 66);
 
 			updateScreen();
@@ -563,7 +563,7 @@
 		} else {
 			updateRoom();
 
-			if (withVoices == 0)
+			if (!_subtitlesDisabled)
 				centerText(said, 150, 80);
 
 			updateScreen();
@@ -617,7 +617,7 @@
 			copyRect(bX, 2, 73, 1, 126, h, frontSurface, screenSurface);
 		}
 
-		if (withVoices == 0)
+		if (!_subtitlesDisabled)
 			centerText(said, 260, 71);
 
 		updateScreen();
@@ -639,7 +639,7 @@
 	talkInit(filename);
 
 	do {
-		if (withVoices == 0)
+		if (!_subtitlesDisabled)
 			centerText(said, 156, 170);
 		updateScreen();
 	} while (!isTalkFinished());
@@ -700,7 +700,7 @@
 
 		updateRefresh();
 
-		if (withVoices == 0) {
+		if (!_subtitlesDisabled) {
 			if (talkerType == 0)
 				centerText(said, 160, 105);
 			else
@@ -741,7 +741,7 @@
 		moveCharacters();
 		updateRefresh();
 
-		if (withVoices == 0)
+		if (!_subtitlesDisabled)
 			centerText(said, 104, 102);
 
 		updateScreen();
@@ -777,7 +777,7 @@
 		else
 			copyBackground(x_talk[face], 1, 45, 24, 92, 108, backSurface, screenSurface);
 		
-		if (withVoices == 0)
+		if (!_subtitlesDisabled)
 			centerText(said, 90, 50);
 
 		updateScreen();
@@ -857,7 +857,7 @@
 			updateRefresh();
 		}
 
-		if (withVoices == 0)
+		if (!_subtitlesDisabled)
 			centerText(said, curX, curY);
 
 		updateScreen();
@@ -890,7 +890,7 @@
 		flags[19] = face;
 		updateRoom();
 
-		if (withVoices == 0)
+		if (!_subtitlesDisabled)
 			centerText(said, 263, 69);
 
 		updateScreen();
@@ -917,7 +917,7 @@
 		moveCharacters();
 		updateRefresh();
 
-		if (withVoices == 0)
+		if (!_subtitlesDisabled)
 			centerText(said, coords[5], coords[6]);
 
 		updateScreen();
@@ -938,7 +938,7 @@
 	updateRoom();
 	copyBackground(253, 110, 150, 65, 20, 30, drawSurface3, screenSurface);
 
-	if (withVoices == 0)
+	if (!_subtitlesDisabled)
 		centerText("groaaarrrrgghhhh!", 153, 65);
 
 	updateScreen();

Modified: scummvm/branches/gsoc2008-gui/engines/gob/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/gob/detection.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/gob/detection.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -992,6 +992,19 @@
 		kFeaturesAdlib,
 		"intro"
 	},
+	{ // Supplied by goodoldgeorg in bug report #2105220
+		{
+			"lostintime",
+			"",
+			AD_ENTRY1s("intro.stk", "cd322cb3c64ef2ba2f2134aa2122cfe9", 3936700),
+			ES_ESP,
+			kPlatformPC,
+			Common::ADGF_NO_FLAGS
+		},
+		kGameTypeLostInTime,
+		kFeaturesAdlib,
+		"intro"
+	},
 	{
 		{
 			"lostintime",

Modified: scummvm/branches/gsoc2008-gui/engines/made/screen.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/engines/made/screen.cpp	2008-09-29 19:09:56 UTC (rev 34686)
+++ scummvm/branches/gsoc2008-gui/engines/made/screen.cpp	2008-09-29 19:23:36 UTC (rev 34687)
@@ -174,13 +174,15 @@
 	if (_vm->getGameID() != GID_RTZ)
 		maskp = (byte*)_maskDrawCtx.destSurface->getBasePtr(x, y);
 
-	int32 sourcePitch, linePtrAdd;
+	int32 sourcePitch, linePtrAdd, sourceAdd;
 	byte *linePtr;
 
 	if (flipX) {
 		linePtrAdd = -1;

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list