PRINCE: Resource loading - renaming
This commit is contained in:
parent
f3965bbe5a
commit
115340bc87
12 changed files with 12 additions and 24 deletions
|
@ -49,7 +49,7 @@ void Animation::clear() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Animation::loadFromStream(Common::SeekableReadStream &stream) {
|
bool Animation::loadStream(Common::SeekableReadStream &stream) {
|
||||||
stream.skip(2); // skip not used x and y coord diff
|
stream.skip(2); // skip not used x and y coord diff
|
||||||
_loopCount = stream.readUint16LE();
|
_loopCount = stream.readUint16LE();
|
||||||
_phaseCount = stream.readUint16LE();
|
_phaseCount = stream.readUint16LE();
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Animation {
|
||||||
public:
|
public:
|
||||||
Animation();
|
Animation();
|
||||||
~Animation();
|
~Animation();
|
||||||
bool loadFromStream(Common::SeekableReadStream &stream);
|
bool loadStream(Common::SeekableReadStream &stream);
|
||||||
|
|
||||||
int16 getLoopCount() const;
|
int16 getLoopCount() const;
|
||||||
int32 getPhaseCount() const;
|
int32 getPhaseCount() const;
|
||||||
|
|
|
@ -37,7 +37,7 @@ Cursor::~Cursor() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Cursor::loadFromStream(Common::SeekableReadStream &stream) {
|
bool Cursor::loadStream(Common::SeekableReadStream &stream) {
|
||||||
stream.skip(4);
|
stream.skip(4);
|
||||||
uint16 width = stream.readUint16LE();
|
uint16 width = stream.readUint16LE();
|
||||||
uint16 height = stream.readUint16LE();
|
uint16 height = stream.readUint16LE();
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
Cursor();
|
Cursor();
|
||||||
~Cursor();
|
~Cursor();
|
||||||
|
|
||||||
bool loadFromStream(Common::SeekableReadStream &stream);
|
bool loadStream(Common::SeekableReadStream &stream);
|
||||||
const Graphics::Surface *getSurface() const { return _surface; }
|
const Graphics::Surface *getSurface() const { return _surface; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -39,7 +39,7 @@ Font::~Font() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Font::loadFromStream(Common::SeekableReadStream &stream) {
|
bool Font::loadStream(Common::SeekableReadStream &stream) {
|
||||||
stream.seek(0);
|
stream.seek(0);
|
||||||
uint32 dataSize = stream.size();
|
uint32 dataSize = stream.size();
|
||||||
_fontData = (byte *)malloc(dataSize);
|
_fontData = (byte *)malloc(dataSize);
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
Font();
|
Font();
|
||||||
virtual ~Font();
|
virtual ~Font();
|
||||||
|
|
||||||
bool loadFromStream(Common::SeekableReadStream &stream);
|
bool loadStream(Common::SeekableReadStream &stream);
|
||||||
|
|
||||||
virtual int getFontHeight() const override;
|
virtual int getFontHeight() const override;
|
||||||
|
|
||||||
|
|
|
@ -50,18 +50,6 @@ private:
|
||||||
byte *_palette;
|
byte *_palette;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Resource {
|
|
||||||
template <> inline
|
|
||||||
bool loadFromStream<MhwanhDecoder>(MhwanhDecoder &image, Common::SeekableReadStream &stream) {
|
|
||||||
return image.loadStream(stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <> inline
|
|
||||||
bool loadFromStream<Image::BitmapDecoder>(Image::BitmapDecoder &image, Common::SeekableReadStream &stream) {
|
|
||||||
return image.loadStream(stream);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // End of namespace Prince
|
} // End of namespace Prince
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace Resource {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool loadFromStream(T &resource, Common::SeekableReadStream &stream) {
|
bool loadFromStream(T &resource, Common::SeekableReadStream &stream) {
|
||||||
return resource.loadFromStream(stream);
|
return resource.loadStream(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
@ -96,7 +96,7 @@ Script::~Script() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Script::loadFromStream(Common::SeekableReadStream &stream) {
|
bool Script::loadStream(Common::SeekableReadStream &stream) {
|
||||||
_dataSize = stream.size();
|
_dataSize = stream.size();
|
||||||
if (!_dataSize) {
|
if (!_dataSize) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
int _talk;
|
int _talk;
|
||||||
int _give;
|
int _give;
|
||||||
|
|
||||||
bool loadFromStream(Common::SeekableReadStream &stream);
|
bool loadStream(Common::SeekableReadStream &stream);
|
||||||
bool loadRoom(byte *roomData);
|
bool loadRoom(byte *roomData);
|
||||||
int getOptionOffset(int option);
|
int getOptionOffset(int option);
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ public:
|
||||||
|
|
||||||
ScriptInfo _scriptInfo;
|
ScriptInfo _scriptInfo;
|
||||||
|
|
||||||
bool loadFromStream(Common::SeekableReadStream &stream);
|
bool loadStream(Common::SeekableReadStream &stream);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T read(uint32 address) {
|
T read(uint32 address) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ VariaTxt::~VariaTxt() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool VariaTxt::loadFromStream(Common::SeekableReadStream &stream) {
|
bool VariaTxt::loadStream(Common::SeekableReadStream &stream) {
|
||||||
_dataSize = stream.size();
|
_dataSize = stream.size();
|
||||||
_data = (byte *)malloc(_dataSize);
|
_data = (byte *)malloc(_dataSize);
|
||||||
stream.read(_data, _dataSize);
|
stream.read(_data, _dataSize);
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
VariaTxt();
|
VariaTxt();
|
||||||
~VariaTxt();
|
~VariaTxt();
|
||||||
|
|
||||||
bool loadFromStream(Common::SeekableReadStream &stream);
|
bool loadStream(Common::SeekableReadStream &stream);
|
||||||
byte *getString(uint32 stringId);
|
byte *getString(uint32 stringId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue