Skip to content

Commit

Permalink
PRINCE: Resource loading - renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslw committed Oct 7, 2014
1 parent f3965bb commit 115340b
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion engines/prince/animation.cpp
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion engines/prince/animation.h
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion engines/prince/cursor.cpp
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion engines/prince/cursor.h
Expand Up @@ -34,7 +34,7 @@ class Cursor {
Cursor();
~Cursor();

bool loadFromStream(Common::SeekableReadStream &stream);
bool loadStream(Common::SeekableReadStream &stream);
const Graphics::Surface *getSurface() const { return _surface; }

private:
Expand Down
2 changes: 1 addition & 1 deletion engines/prince/font.cpp
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion engines/prince/font.h
Expand Up @@ -35,7 +35,7 @@ class Font : public Graphics::Font {
Font();
virtual ~Font();

bool loadFromStream(Common::SeekableReadStream &stream);
bool loadStream(Common::SeekableReadStream &stream);

virtual int getFontHeight() const override;

Expand Down
12 changes: 0 additions & 12 deletions engines/prince/mhwanh.h
Expand Up @@ -50,18 +50,6 @@ class MhwanhDecoder : public Image::ImageDecoder {
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
2 changes: 1 addition & 1 deletion engines/prince/resource.h
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion engines/prince/script.cpp
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions engines/prince/script.h
Expand Up @@ -64,7 +64,7 @@ class Room {
int _talk;
int _give;

bool loadFromStream(Common::SeekableReadStream &stream);
bool loadStream(Common::SeekableReadStream &stream);
bool loadRoom(byte *roomData);
int getOptionOffset(int option);

Expand Down Expand Up @@ -123,7 +123,7 @@ class Script {

ScriptInfo _scriptInfo;

bool loadFromStream(Common::SeekableReadStream &stream);
bool loadStream(Common::SeekableReadStream &stream);

template <typename T>
T read(uint32 address) {
Expand Down
2 changes: 1 addition & 1 deletion engines/prince/variatxt.cpp
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion engines/prince/variatxt.h
Expand Up @@ -29,7 +29,7 @@ class VariaTxt {
VariaTxt();
~VariaTxt();

bool loadFromStream(Common::SeekableReadStream &stream);
bool loadStream(Common::SeekableReadStream &stream);
byte *getString(uint32 stringId);

private:
Expand Down

0 comments on commit 115340b

Please sign in to comment.