diff options
author | Nicola Mettifogo | 2008-07-27 13:43:40 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2008-07-27 13:43:40 +0000 |
commit | d223e90002d5e95c1dccd14aa81c7090138abbd1 (patch) | |
tree | 9aec94f76780332a7642f9262bebe929951cf743 /engines | |
parent | 7e7468b322d928a28243a3e03bc64e87dda4fadc (diff) | |
download | scummvm-rg350-d223e90002d5e95c1dccd14aa81c7090138abbd1.tar.gz scummvm-rg350-d223e90002d5e95c1dccd14aa81c7090138abbd1.tar.bz2 scummvm-rg350-d223e90002d5e95c1dccd14aa81c7090138abbd1.zip |
Inventory icons are now loaded correctly (not yet displayed). BRA doesn't crash anymore when pressing the right button. :)
svn-id: r33335
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/disk.h | 1 | ||||
-rw-r--r-- | engines/parallaction/disk_br.cpp | 10 | ||||
-rw-r--r-- | engines/parallaction/font.cpp | 43 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 2 |
4 files changed, 54 insertions, 2 deletions
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index 24f80e1a44..b98e5d0cae 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -211,6 +211,7 @@ protected: Font *createFont(const char *name, Common::ReadStream &stream); Sprites* createSprites(Common::ReadStream &stream); void loadBitmap(Common::SeekableReadStream &stream, Graphics::Surface &surf, byte *palette); + GfxObj* createInventoryObjects(Common::SeekableReadStream &stream); public: DosDisk_br(Parallaction *vm); diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index aec605dbcd..54a1261936 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -237,7 +237,15 @@ Font* DosDisk_br::loadFont(const char* name) { GfxObj* DosDisk_br::loadObjects(const char *name) { debugC(5, kDebugDisk, "DosDisk_br::loadObjects"); - return 0; + + char path[PATH_LEN]; + sprintf(path, "%s/%s", _partPath, name); + + Common::File stream; + if (!stream.open(path)) + errorFileNotFound(path); + + return createInventoryObjects(stream); } void genSlidePath(char *path, const char* name) { diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp index 91848b30a4..6b65f19298 100644 --- a/engines/parallaction/font.cpp +++ b/engines/parallaction/font.cpp @@ -35,6 +35,7 @@ extern byte _amigaTopazFont[]; class BraFont : public Font { +protected: byte *_cp; uint _bufPitch; @@ -173,6 +174,42 @@ byte BraFont::_charMap[] = { }; +class BraInventoryObjects : public BraFont, public Frames { + +public: + BraInventoryObjects(Common::ReadStream &stream) : BraFont(stream) { + } + + // Frames implementation + uint16 getNum() { + return _numGlyphs; + } + + byte* getData(uint16 index) { + assert(index < _numGlyphs); + return _data + _height * index + _widths[index]; + } + + void getRect(uint16 index, Common::Rect &r) { + assert(index < _numGlyphs); + r.left = 0; + r.top = 0; + r.setWidth(_widths[index]); + r.setHeight(_height); + } + + uint getRawSize(uint16 index) { + assert(index < _numGlyphs); + return _widths[index] * _height; + } + + uint getSize(uint16 index) { + assert(index < _numGlyphs); + return _widths[index] * _height; + } + +}; + class DosFont : public Font { protected: @@ -545,6 +582,12 @@ Font *AmigaDisk_br::createFont(const char *name, Common::SeekableReadStream &str return new AmigaFont(stream); } +GfxObj* DosDisk_br::createInventoryObjects(Common::SeekableReadStream &stream) { + Frames *frames = new BraInventoryObjects(stream); + return new GfxObj(0, frames, "inventoryobjects"); +} + + void Parallaction_ns::initFonts() { if (getPlatform() == Common::kPlatformPC) { diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 04036eb4aa..020dfa6df5 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -174,7 +174,7 @@ void Parallaction_br::initPart() { _objectsNames = _disk->loadTable("objects"); _countersNames = _disk->loadTable("counters"); -// _disk->loadObjects("icone.ico"); + _char._objs = _disk->loadObjects("icone.ico"); } |