[Scummvm-cvs-logs] SF.net SVN: scummvm:[41907] scummvm/branches/gsoc2009-draci/engines/draci

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Sat Jun 27 03:04:24 CEST 2009


Revision: 41907
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41907&view=rev
Author:   dkasak13
Date:     2009-06-27 01:04:24 +0000 (Sat, 27 Jun 2009)

Log Message:
-----------
Added Game's constructor. Added the Person struct and made Game constructor read in the list of persons from INIT.DFW. Added Game instance to DraciEngine.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/draci.h
    scummvm/branches/gsoc2009-draci/engines/draci/game.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/game.h

Modified: scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp	2009-06-26 23:34:06 UTC (rev 41906)
+++ scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp	2009-06-27 01:04:24 UTC (rev 41907)
@@ -69,6 +69,7 @@
 	_screen = new Screen(this);
 	_font = new Font();
 	_mouse = new Mouse(this);
+	_game = new Game();
 
 	// Load default font
 	_font->setFont(kFontBig);

Modified: scummvm/branches/gsoc2009-draci/engines/draci/draci.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/draci.h	2009-06-26 23:34:06 UTC (rev 41906)
+++ scummvm/branches/gsoc2009-draci/engines/draci/draci.h	2009-06-27 01:04:24 UTC (rev 41907)
@@ -30,6 +30,7 @@
 #include "engines/engine.h"
 #include "engines/advancedDetector.h"
 
+#include "draci/game.h"
 #include "draci/mouse.h"
 #include "draci/screen.h"
 #include "draci/font.h"
@@ -50,6 +51,7 @@
 	Font *_font;
 	Screen *_screen;
 	Mouse *_mouse;
+	Game *_game;
 
 private:
 	Common::RandomSource _rnd;

Modified: scummvm/branches/gsoc2009-draci/engines/draci/game.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/game.cpp	2009-06-26 23:34:06 UTC (rev 41906)
+++ scummvm/branches/gsoc2009-draci/engines/draci/game.cpp	2009-06-27 01:04:24 UTC (rev 41907)
@@ -23,4 +23,31 @@
  *
  */
 
+#include "common/stream.h"
+
+#include "draci/draci.h"
 #include "draci/game.h"
+#include "draci/barchive.h"
+
+namespace Draci {
+
+Game::Game() {
+	Common::String path("INIT.DFW");
+	
+	BArchive initArchive(path);
+	BAFile *file;
+	
+	file = initArchive[5];
+	Common::MemoryReadStream reader(file->_data, file->_length);
+	
+	unsigned int numPersons = file->_length / personSize;
+	_persons = new Person[numPersons];
+	
+	for (unsigned int i = 0; i < numPersons; ++i) {
+		_persons[i]._x = reader.readByte();
+		_persons[i]._y = reader.readByte();
+		_persons[i]._fontColour = reader.readUint16LE();
+	}
+}
+
+} 

Modified: scummvm/branches/gsoc2009-draci/engines/draci/game.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/game.h	2009-06-26 23:34:06 UTC (rev 41906)
+++ scummvm/branches/gsoc2009-draci/engines/draci/game.h	2009-06-27 01:04:24 UTC (rev 41907)
@@ -26,9 +26,27 @@
 #ifndef DRACI_GAME_H
 #define DRACI_GAME_H
 
+#include "common/str.h"
+
 namespace Draci {
 
+enum StructSizes {
+	personSize = 3
+};
+
+struct Person {
+	uint16 _x, _y;
+	byte _fontColour;
+};
+
 class Game {
+
+public:
+	Game();
+	~Game();
+
+private:
+	Person *_persons;
 };
 
 } // End of namespace Draci


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