PRINCE: Resource loading - renaming

This commit is contained in:
lukaslw 2014-10-07 02:14:12 +02:00
parent f3965bbe5a
commit 115340bc87
12 changed files with 12 additions and 24 deletions

View file

@ -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
_loopCount = stream.readUint16LE();
_phaseCount = stream.readUint16LE();

View file

@ -34,7 +34,7 @@ class Animation {
public:
Animation();
~Animation();
bool loadFromStream(Common::SeekableReadStream &stream);
bool loadStream(Common::SeekableReadStream &stream);
int16 getLoopCount() const;
int32 getPhaseCount() const;

View file

@ -37,7 +37,7 @@ Cursor::~Cursor() {
}
}
bool Cursor::loadFromStream(Common::SeekableReadStream &stream) {
bool Cursor::loadStream(Common::SeekableReadStream &stream) {
stream.skip(4);
uint16 width = stream.readUint16LE();
uint16 height = stream.readUint16LE();

View file

@ -34,7 +34,7 @@ public:
Cursor();
~Cursor();
bool loadFromStream(Common::SeekableReadStream &stream);
bool loadStream(Common::SeekableReadStream &stream);
const Graphics::Surface *getSurface() const { return _surface; }
private:

View file

@ -39,7 +39,7 @@ Font::~Font() {
}
}
bool Font::loadFromStream(Common::SeekableReadStream &stream) {
bool Font::loadStream(Common::SeekableReadStream &stream) {
stream.seek(0);
uint32 dataSize = stream.size();
_fontData = (byte *)malloc(dataSize);

View file

@ -35,7 +35,7 @@ public:
Font();
virtual ~Font();
bool loadFromStream(Common::SeekableReadStream &stream);
bool loadStream(Common::SeekableReadStream &stream);
virtual int getFontHeight() const override;

View file

@ -50,18 +50,6 @@ private:
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
#endif

View file

@ -34,7 +34,7 @@ namespace Resource {
template <typename T>
bool loadFromStream(T &resource, Common::SeekableReadStream &stream) {
return resource.loadFromStream(stream);
return resource.loadStream(stream);
}
template<typename T>

View file

@ -96,7 +96,7 @@ Script::~Script() {
}
}
bool Script::loadFromStream(Common::SeekableReadStream &stream) {
bool Script::loadStream(Common::SeekableReadStream &stream) {
_dataSize = stream.size();
if (!_dataSize) {
return false;

View file

@ -64,7 +64,7 @@ public:
int _talk;
int _give;
bool loadFromStream(Common::SeekableReadStream &stream);
bool loadStream(Common::SeekableReadStream &stream);
bool loadRoom(byte *roomData);
int getOptionOffset(int option);
@ -123,7 +123,7 @@ public:
ScriptInfo _scriptInfo;
bool loadFromStream(Common::SeekableReadStream &stream);
bool loadStream(Common::SeekableReadStream &stream);
template <typename T>
T read(uint32 address) {

View file

@ -37,7 +37,7 @@ VariaTxt::~VariaTxt() {
}
bool VariaTxt::loadFromStream(Common::SeekableReadStream &stream) {
bool VariaTxt::loadStream(Common::SeekableReadStream &stream) {
_dataSize = stream.size();
_data = (byte *)malloc(_dataSize);
stream.read(_data, _dataSize);

View file

@ -29,7 +29,7 @@ public:
VariaTxt();
~VariaTxt();
bool loadFromStream(Common::SeekableReadStream &stream);
bool loadStream(Common::SeekableReadStream &stream);
byte *getString(uint32 stringId);
private: