aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/scicore/resource.h
diff options
context:
space:
mode:
authorGreg Frieger2009-03-07 00:59:38 +0000
committerGreg Frieger2009-03-07 00:59:38 +0000
commitf028f53d3e9b077c7a821b244a717124f631ac10 (patch)
treef675cb61147383f07144f17e09a4c2c71254e948 /engines/sci/scicore/resource.h
parentd262073193906c1d60050c2a24a2c3200026581e (diff)
downloadscummvm-rg350-f028f53d3e9b077c7a821b244a717124f631ac10.tar.gz
scummvm-rg350-f028f53d3e9b077c7a821b244a717124f631ac10.tar.bz2
scummvm-rg350-f028f53d3e9b077c7a821b244a717124f631ac10.zip
Map/volume loader and version detection functions cleaned and reworked.
Autodetection still misdetects some SCI1/SCI1.1 games though. svn-id: r39169
Diffstat (limited to 'engines/sci/scicore/resource.h')
-rw-r--r--engines/sci/scicore/resource.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/engines/sci/scicore/resource.h b/engines/sci/scicore/resource.h
index 1e327e003d..415a89cac8 100644
--- a/engines/sci/scicore/resource.h
+++ b/engines/sci/scicore/resource.h
@@ -45,9 +45,6 @@ namespace Sci {
#define SCI_STATUS_ENQUEUED 2 /* In the LRU queue */
#define SCI_STATUS_LOCKED 3 /* Allocated and in use */
-#define SCI_RES_FILE_NR_PATCH -1 /* Resource was read from a patch file rather than from a resource */
-
-
/*** INITIALIZATION RESULT TYPES ***/
#define SCI_ERROR_IO_ERROR 1
#define SCI_ERROR_EMPTY_OBJECT 2
@@ -180,6 +177,8 @@ public:
class ResourceManager {
public:
int _sciVersion; /* SCI resource version to use */
+ int _mapVersion; // RESOURCE.MAP version
+ int _volVersion; // RESOURCE.0xx version
/**
* Creates a new FreeSCI resource manager.
@@ -222,7 +221,7 @@ public:
* used during startup. May be NULL.
* @return One of SCI_ERROR_*.
*/
- int scanNewSources(int *detected_version, ResourceSource *source);
+ int scanNewSources(ResourceSource *source);
//! Looks up a resource's data
/** @param type: The resource type to look for
@@ -270,20 +269,20 @@ protected:
void freeOldResources(int last_invulnerable);
/**--- Resource map decoding functions ---*/
+ int detectMapVersion();
+ int detectVolVersion();
/* Reads the SCI0 resource.map file from a local directory
** Returns : (int) 0 on success, an SCI_ERROR_* code otherwise
*/
- int readResourceMapSCI0(ResourceSource *map, int *sci_version);
+ int readResourceMapSCI0(ResourceSource *map);
/* Reads the SCI1 resource.map file from a local directory
** Returns : (int) 0 on success, an SCI_ERROR_* code otherwise
*/
- int readResourceMapSCI1(ResourceSource *map, ResourceSource *vol, int *sci_version);
+ int readResourceMapSCI1(ResourceSource *map, ResourceSource *vol);
- int isSCI10or11(int *types);
- int detectOddSCI01(Common::File &file);
- int resReadEntry(ResourceSource *map, byte *buf, Resource *res, int sci_version);
+ int resReadEntry(ResourceSource *map, byte *buf, Resource *res);
ResourceType resTypeSCI1(int ofs, int *types, ResourceType lastrt);
int parseHeaderSCI1(Common::ReadStream &stream, int *types, ResourceType *lastrt);