diff options
author | Max Horn | 2009-06-04 22:16:31 +0000 |
---|---|---|
committer | Max Horn | 2009-06-04 22:16:31 +0000 |
commit | fa02e0df7b48a3d24984d78117dc2952d0b6c5b4 (patch) | |
tree | 602d44f287d601db94f7810cbf8860e53547211f /engines/sci/resource.h | |
parent | 29cc1efe3cc6dd344383a8b8b6e9a59b4e78ece1 (diff) | |
download | scummvm-rg350-fa02e0df7b48a3d24984d78117dc2952d0b6c5b4.tar.gz scummvm-rg350-fa02e0df7b48a3d24984d78117dc2952d0b6c5b4.tar.bz2 scummvm-rg350-fa02e0df7b48a3d24984d78117dc2952d0b6c5b4.zip |
SCI: Made some members of class Resource protected; some cleanup
svn-id: r41180
Diffstat (limited to 'engines/sci/resource.h')
-rw-r--r-- | engines/sci/resource.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/engines/sci/resource.h b/engines/sci/resource.h index b1ae3d23ba..eade4acbd0 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -88,7 +88,6 @@ enum ResSourceType { #define SCI1_RESMAP_ENTRIES_SIZE 6 #define SCI11_RESMAP_ENTRIES_SIZE 5 -extern const char *sci_error_types[]; extern const char *sci_version_types[]; extern const int sci_max_resource_nr[]; /**< Highest possible resource numbers */ @@ -118,8 +117,6 @@ enum ResourceType { }; const char *getResourceTypeName(ResourceType restype); -// Suffixes for SCI1 patch files -const char *getResourceTypeSuffix(ResourceType restype); #define sci0_last_resource kResourceTypePatch #define sci1_last_resource kResourceTypeHeap @@ -141,8 +138,11 @@ struct ResourceSource { ResourceSource *next; }; +class ResourceManager; + /** Class for storing resources in memory */ class Resource { + friend class ResourceManager; public: Resource(); ~Resource(); @@ -155,10 +155,11 @@ public: uint16 number; ResourceType type; uint32 id; //!< contains number and type. - unsigned int size; - unsigned int file_offset; /**< Offset in file */ + uint32 size; +protected: + uint32 file_offset; /**< Offset in file */ ResourceStatus status; - unsigned short lockers; /**< Number of places where this resource was locked */ + uint16 lockers; /**< Number of places where this resource was locked */ ResourceSource *source; }; @@ -191,7 +192,7 @@ public: * @note Locked resources are guaranteed not to have their contents freed until * they are unlocked explicitly (by unlockResource). */ - Resource *findResource(ResourceType type, int number, int lock); + Resource *findResource(ResourceType type, int number, bool lock); /* Unlocks a previously locked resource ** (Resource *) res: The resource to free @@ -291,6 +292,8 @@ protected: void printLRU(); void addToLRU(Resource *res); void removeFromLRU(Resource *res); + + int guessSciVersion(); }; /** |