[Scummvm-cvs-logs] SF.net SVN: scummvm:[33335] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Jul 27 15:43:41 CEST 2008


Revision: 33335
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33335&view=rev
Author:   peres001
Date:     2008-07-27 13:43:40 +0000 (Sun, 27 Jul 2008)

Log Message:
-----------
Inventory icons are now loaded correctly (not yet displayed). BRA doesn't crash anymore when pressing the right button. :)

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/disk.h
    scummvm/trunk/engines/parallaction/disk_br.cpp
    scummvm/trunk/engines/parallaction/font.cpp
    scummvm/trunk/engines/parallaction/parallaction_br.cpp

Modified: scummvm/trunk/engines/parallaction/disk.h
===================================================================
--- scummvm/trunk/engines/parallaction/disk.h	2008-07-27 12:12:40 UTC (rev 33334)
+++ scummvm/trunk/engines/parallaction/disk.h	2008-07-27 13:43:40 UTC (rev 33335)
@@ -211,6 +211,7 @@
 	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);

Modified: scummvm/trunk/engines/parallaction/disk_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_br.cpp	2008-07-27 12:12:40 UTC (rev 33334)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp	2008-07-27 13:43:40 UTC (rev 33335)
@@ -237,7 +237,15 @@
 
 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) {

Modified: scummvm/trunk/engines/parallaction/font.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/font.cpp	2008-07-27 12:12:40 UTC (rev 33334)
+++ scummvm/trunk/engines/parallaction/font.cpp	2008-07-27 13:43:40 UTC (rev 33335)
@@ -35,6 +35,7 @@
 
 class BraFont : public Font {
 
+protected:
 	byte	*_cp;
 	uint	_bufPitch;
 
@@ -173,6 +174,42 @@
 };
 
 
+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 @@
 	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) {

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-07-27 12:12:40 UTC (rev 33334)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-07-27 13:43:40 UTC (rev 33335)
@@ -174,7 +174,7 @@
 	_objectsNames = _disk->loadTable("objects");
 	_countersNames = _disk->loadTable("counters");
 
-//	_disk->loadObjects("icone.ico");
+	_char._objs = _disk->loadObjects("icone.ico");
 
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list