aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2010-02-17 23:37:32 +0000
committerMax Horn2010-02-17 23:37:32 +0000
commit903b694574a08ce9e3b4186eebbe06197157daaa (patch)
tree8dcf7d23e5fdf847cabc7ca8ae7e61426e807105
parent26b7f0bbb95dad5fc05fc5aec8d675ab7fab9041 (diff)
downloadscummvm-rg350-903b694574a08ce9e3b4186eebbe06197157daaa.tar.gz
scummvm-rg350-903b694574a08ce9e3b4186eebbe06197157daaa.tar.bz2
scummvm-rg350-903b694574a08ce9e3b4186eebbe06197157daaa.zip
SCI: Cleanup resource.h
svn-id: r48084
-rw-r--r--engines/sci/detection.cpp1
-rw-r--r--engines/sci/engine/kernel.cpp2
-rw-r--r--engines/sci/engine/kernel32.cpp2
-rw-r--r--engines/sci/engine/kpathing.cpp1
-rw-r--r--engines/sci/graphics/controls.cpp1
-rw-r--r--engines/sci/graphics/cursor.cpp1
-rw-r--r--engines/sci/graphics/paint16.cpp1
-rw-r--r--engines/sci/graphics/palette.cpp1
-rw-r--r--engines/sci/graphics/picture.cpp2
-rw-r--r--engines/sci/graphics/screen.cpp1
-rw-r--r--engines/sci/graphics/transitions.cpp1
-rw-r--r--engines/sci/resource.cpp34
-rw-r--r--engines/sci/resource.h49
13 files changed, 57 insertions, 40 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 62099c1b6b..768f514804 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -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"
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 9c47e8458f..fc5c771b18 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -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
diff --git a/engines/sci/engine/kernel32.cpp b/engines/sci/engine/kernel32.cpp
index f37631ec80..382200355d 100644
--- a/engines/sci/engine/kernel32.cpp
+++ b/engines/sci/engine/kernel32.cpp
@@ -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
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index 74f084467b..e2c9ef2444 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -32,6 +32,7 @@
#include "sci/graphics/screen.h"
#include "common/list.h"
+#include "common/system.h"
namespace Sci {
diff --git a/engines/sci/graphics/controls.cpp b/engines/sci/graphics/controls.cpp
index 5572d04ec5..8a2c3275be 100644
--- a/engines/sci/graphics/controls.cpp
+++ b/engines/sci/graphics/controls.cpp
@@ -25,6 +25,7 @@
#include "common/util.h"
#include "common/stack.h"
+#include "common/system.h"
#include "graphics/primitives.h"
#include "sci/sci.h"
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp
index ac4ef0a227..13968974f0 100644
--- a/engines/sci/graphics/cursor.cpp
+++ b/engines/sci/graphics/cursor.cpp
@@ -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"
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index 7747c5f8f3..650b2b5ce6 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -25,6 +25,7 @@
#include "common/util.h"
#include "common/stack.h"
+#include "common/system.h"
#include "graphics/primitives.h"
#include "sci/sci.h"
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 09b51117e0..0294c21c0c 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -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"
diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp
index eba41baa63..447ab63369 100644
--- a/engines/sci/graphics/picture.cpp
+++ b/engines/sci/graphics/picture.cpp
@@ -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"
diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp
index 211d91d67e..4d39ca45e3 100644
--- a/engines/sci/graphics/screen.cpp
+++ b/engines/sci/graphics/screen.cpp
@@ -25,6 +25,7 @@
#include "common/timer.h"
#include "common/util.h"
+#include "common/system.h"
#include "graphics/surface.h"
#include "sci/sci.h"
diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp
index e242d2f2db..0a2bd067a7 100644
--- a/engines/sci/graphics/transitions.cpp
+++ b/engines/sci/graphics/transitions.cpp
@@ -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"
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 9f16e1cc2a..9aaff7433a 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -37,7 +37,30 @@
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);
@@ -75,6 +98,9 @@ const char *getSciVersionDesc(SciVersion version) {
}
}
+//////////////////////////////////////////////////////////////////////
+
+
#undef SCI_REQUIRE_RESOURCE_FILES
//#define SCI_VERBOSE_resMan 1
@@ -539,7 +565,7 @@ int ResourceManager::addInternalSources() {
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 @@ void ResourceManager::setAudioLanguage(int language) {
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
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index 2b6519a950..43b4b37f4a 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -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 {
};
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 @@ enum ResSourceType {
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 @@ enum ResourceType {
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 @@ public:
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 @@ public:
* 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();