[Scummvm-cvs-logs] SF.net SVN: scummvm:[48084] scummvm/trunk/engines/sci

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Feb 18 00:37:32 CET 2010


Revision: 48084
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48084&view=rev
Author:   fingolfin
Date:     2010-02-17 23:37:32 +0000 (Wed, 17 Feb 2010)

Log Message:
-----------
SCI: Cleanup resource.h

Modified Paths:
--------------
    scummvm/trunk/engines/sci/detection.cpp
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kernel32.cpp
    scummvm/trunk/engines/sci/engine/kpathing.cpp
    scummvm/trunk/engines/sci/graphics/controls.cpp
    scummvm/trunk/engines/sci/graphics/cursor.cpp
    scummvm/trunk/engines/sci/graphics/paint16.cpp
    scummvm/trunk/engines/sci/graphics/palette.cpp
    scummvm/trunk/engines/sci/graphics/picture.cpp
    scummvm/trunk/engines/sci/graphics/screen.cpp
    scummvm/trunk/engines/sci/graphics/transitions.cpp
    scummvm/trunk/engines/sci/resource.cpp
    scummvm/trunk/engines/sci/resource.h

Modified: scummvm/trunk/engines/sci/detection.cpp
===================================================================
--- scummvm/trunk/engines/sci/detection.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/detection.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -26,6 +26,7 @@
 #include "engines/advancedDetector.h"
 #include "base/plugins.h"
 #include "common/savefile.h"
+#include "common/system.h"
 #include "graphics/thumbnail.h"
 
 #include "sci/sci.h"

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -30,6 +30,8 @@
 #include "sci/engine/state.h"
 #include "sci/engine/kernel_types.h"
 
+#include "common/system.h"
+
 namespace Sci {
 
 // Default kernel name table

Modified: scummvm/trunk/engines/sci/engine/kernel32.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel32.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/engine/kernel32.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -34,6 +34,8 @@
 #include "sci/graphics/gui32.h"
 #include "sci/graphics/frameout.h"
 
+#include "common/system.h"
+
 namespace Sci {
 
 // NOTE: 0x72-0x79, 0x85-0x86, 0x88 are from the GK2 demo (which has debug support) and are

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -32,6 +32,7 @@
 #include "sci/graphics/screen.h"
 
 #include "common/list.h"
+#include "common/system.h"
 
 namespace Sci {
 

Modified: scummvm/trunk/engines/sci/graphics/controls.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/controls.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/graphics/controls.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -25,6 +25,7 @@
 
 #include "common/util.h"
 #include "common/stack.h"
+#include "common/system.h"
 #include "graphics/primitives.h"
 
 #include "sci/sci.h"

Modified: scummvm/trunk/engines/sci/graphics/cursor.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/cursor.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/graphics/cursor.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -26,6 +26,7 @@
 #include "graphics/cursorman.h"
 #include "common/util.h"
 #include "common/events.h"
+#include "common/system.h"
 
 #include "sci/sci.h"
 #include "sci/event.h"

Modified: scummvm/trunk/engines/sci/graphics/paint16.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -25,6 +25,7 @@
 
 #include "common/util.h"
 #include "common/stack.h"
+#include "common/system.h"
 #include "graphics/primitives.h"
 
 #include "sci/sci.h"

Modified: scummvm/trunk/engines/sci/graphics/palette.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/palette.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/graphics/palette.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -25,6 +25,7 @@
 
 #include "common/timer.h"
 #include "common/util.h"
+#include "common/system.h"
 
 #include "sci/sci.h"
 #include "sci/engine/state.h"

Modified: scummvm/trunk/engines/sci/graphics/picture.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/picture.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/graphics/picture.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -24,6 +24,8 @@
  */
 
 #include "common/stack.h"
+#include "common/system.h"
+
 #include "sci/sci.h"
 #include "sci/engine/state.h"
 #include "sci/graphics/screen.h"

Modified: scummvm/trunk/engines/sci/graphics/screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/screen.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/graphics/screen.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -25,6 +25,7 @@
 
 #include "common/timer.h"
 #include "common/util.h"
+#include "common/system.h"
 #include "graphics/surface.h"
 
 #include "sci/sci.h"

Modified: scummvm/trunk/engines/sci/graphics/transitions.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/transitions.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/graphics/transitions.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -26,6 +26,7 @@
 #include "common/events.h"
 #include "common/util.h"
 #include "common/stack.h"
+#include "common/system.h"
 #include "graphics/surface.h"
 
 #include "sci/sci.h"

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/resource.cpp	2010-02-17 23:37:32 UTC (rev 48084)
@@ -37,8 +37,31 @@
 
 namespace Sci {
 
-static SciVersion s_sciVersion = SCI_VERSION_NONE;
+enum {
+	SCI0_RESMAP_ENTRIES_SIZE = 6,
+	SCI1_RESMAP_ENTRIES_SIZE = 6,
+	SCI11_RESMAP_ENTRIES_SIZE = 5
+};
 
+/** resource type for SCI1 resource.map file */
+struct resource_index_t {
+	uint16 wOffset;
+	uint16 wSize;
+};
+
+struct ResourceSource {
+	ResSourceType source_type;
+	bool scanned;
+	Common::String location_name;	// FIXME: Replace by FSNode ?
+	const Common::FSNode *resourceFile;
+	int volume_number;
+	ResourceSource *associated_map;
+};
+
+//////////////////////////////////////////////////////////////////////
+
+static SciVersion s_sciVersion = SCI_VERSION_NONE;	// FIXME: Move this inside a suitable class, e.g. SciEngine
+
 SciVersion getSciVersion() {
 	assert(s_sciVersion != SCI_VERSION_NONE);
 	return s_sciVersion;
@@ -75,6 +98,9 @@
 	}
 }
 
+//////////////////////////////////////////////////////////////////////
+
+
 #undef SCI_REQUIRE_RESOURCE_FILES
 
 //#define SCI_VERBOSE_resMan 1
@@ -539,7 +565,7 @@
 	return 1;
 }
 
-void ResourceManager::addNewGMPatch(Common::String gameId) {
+void ResourceManager::addNewGMPatch(const Common::String &gameId) {
 	Common::String gmPatchFile;
 
 	if (gameId == "ecoquest")
@@ -1555,6 +1581,10 @@
 	scanNewSources();
 }
 
+int ResourceManager::getAudioLanguage() const {
+	return (_audioMapSCI1 ? _audioMapSCI1->volume_number : 0);
+}
+
 int ResourceManager::readResourceInfo(Resource *res, Common::File *file,
                                       uint32&szPacked, ResourceCompression &compression) {
 	// SCI0 volume format:  {wResId wPacked+4 wUnpacked wCompression} = 8 bytes

Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h	2010-02-17 23:36:50 UTC (rev 48083)
+++ scummvm/trunk/engines/sci/resource.h	2010-02-17 23:37:32 UTC (rev 48084)
@@ -27,26 +27,23 @@
 #define SCI_SCICORE_RESOURCE_H
 
 #include "common/str.h"
-#include "common/file.h"
-#include "common/fs.h"
-#include "common/archive.h"
 
-#include "sound/audiostream.h"
-#include "sound/mixer.h"			// for SoundHandle
-
-#include "graphics/helpers.h"		// for ViewType
-
+#include "sci/graphics/helpers.h"		// for ViewType
 #include "sci/decompressor.h"
 #include "sci/sci.h"
 
 namespace Common {
 class ReadStream;
+class File;
+class FSNode;
 }
 
 namespace Sci {
 
-/** The maximum allowed size for a compressed or decompressed resource */
-#define SCI_MAX_RESOURCE_SIZE 0x0400000
+enum {
+	/** The maximum allowed size for a compressed or decompressed resource */
+	SCI_MAX_RESOURCE_SIZE = 0x0400000
+};
 
 /** Resource status types */
 enum ResourceStatus {
@@ -70,7 +67,7 @@
 };
 
 enum {
-	MAX_OPENED_VOLUMES = 5 // Max number of simultaneously opened volumes
+	MAX_OPENED_VOLUMES = 5 ///< Max number of simultaneously opened volumes
 };
 
 enum ResSourceType {
@@ -84,12 +81,6 @@
 	kSourceWave
 };
 
-enum {
-	SCI0_RESMAP_ENTRIES_SIZE = 6,
-	SCI1_RESMAP_ENTRIES_SIZE = 6,
-	SCI11_RESMAP_ENTRIES_SIZE = 5
-};
-
 enum ResourceType {
 	kResourceTypeView = 0,
 	kResourceTypePic,
@@ -119,27 +110,9 @@
 
 const char *getResourceTypeName(ResourceType restype);
 
-#define sci0_last_resource kResourceTypePatch
-#define sci1_last_resource kResourceTypeHeap
-/* Used for autodetection */
 
-
-/** resource type for SCI1 resource.map file */
-struct resource_index_t {
-	uint16 wOffset;
-	uint16 wSize;
-};
-
-struct ResourceSource {
-	ResSourceType source_type;
-	bool scanned;
-	Common::String location_name;	// FIXME: Replace by FSNode ?
-	const Common::FSNode *resourceFile;
-	int volume_number;
-	ResourceSource *associated_map;
-};
-
 class ResourceManager;
+struct ResourceSource;
 
 class ResourceId {
 public:
@@ -270,7 +243,7 @@
 	Common::List<ResourceId> *listResources(ResourceType type, int mapNumber = -1);
 
 	void setAudioLanguage(int language);
-	int getAudioLanguage() const { return (_audioMapSCI1 ? _audioMapSCI1->volume_number : 0); }
+	int getAudioLanguage() const;
 	bool isVGA() const { return (_viewType == kViewVga) || (_viewType == kViewVga11); }
 	bool isAmiga32color() const { return _viewType == kViewAmiga; }
 	ViewType getViewType() const { return _viewType; }
@@ -283,7 +256,7 @@
 	 * archive can be extracted in the extras directory, and the GM patches can be
 	 * applied per game, if applicable
 	 */
-	void addNewGMPatch(Common::String gameId);
+	void addNewGMPatch(const Common::String &gameId);
 
 	bool detectHires();
 


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