[Scummvm-cvs-logs] SF.net SVN: scummvm:[45579] scummvm/trunk

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Oct 31 20:48:28 CET 2009


Revision: 45579
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45579&view=rev
Author:   m_kiewitz
Date:     2009-10-31 19:48:28 +0000 (Sat, 31 Oct 2009)

Log Message:
-----------
SCI/newgui: SciGuiPortrait created

Modified Paths:
--------------
    scummvm/trunk/dists/msvc8/sci.vcproj
    scummvm/trunk/dists/msvc9/sci.vcproj
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui/gui.h
    scummvm/trunk/engines/sci/module.mk

Added Paths:
-----------
    scummvm/trunk/engines/sci/gui/gui_portrait.cpp
    scummvm/trunk/engines/sci/gui/gui_portrait.h

Modified: scummvm/trunk/dists/msvc8/sci.vcproj
===================================================================
--- scummvm/trunk/dists/msvc8/sci.vcproj	2009-10-31 19:34:27 UTC (rev 45578)
+++ scummvm/trunk/dists/msvc8/sci.vcproj	2009-10-31 19:48:28 UTC (rev 45579)
@@ -101,6 +101,8 @@
 			<File RelativePath="..\..\engines\sci\gui\gui_palette.h" />
 			<File RelativePath="..\..\engines\sci\gui\gui_picture.cpp" />
 			<File RelativePath="..\..\engines\sci\gui\gui_picture.h" />
+			<File RelativePath="..\..\engines\sci\gui\gui_portrait.cpp" />
+			<File RelativePath="..\..\engines\sci\gui\gui_portrait.h" />	
 			<File RelativePath="..\..\engines\sci\gui\gui_screen.cpp" />
 			<File RelativePath="..\..\engines\sci\gui\gui_screen.h" />
 			<File RelativePath="..\..\engines\sci\gui\gui_text.cpp" />

Modified: scummvm/trunk/dists/msvc9/sci.vcproj
===================================================================
--- scummvm/trunk/dists/msvc9/sci.vcproj	2009-10-31 19:34:27 UTC (rev 45578)
+++ scummvm/trunk/dists/msvc9/sci.vcproj	2009-10-31 19:48:28 UTC (rev 45579)
@@ -102,6 +102,8 @@
 			<File RelativePath="..\..\engines\sci\gui\gui_palette.h" />
 			<File RelativePath="..\..\engines\sci\gui\gui_picture.cpp" />
 			<File RelativePath="..\..\engines\sci\gui\gui_picture.h" />
+			<File RelativePath="..\..\engines\sci\gui\gui_portrait.cpp" />
+			<File RelativePath="..\..\engines\sci\gui\gui_portrait.h" />
 			<File RelativePath="..\..\engines\sci\gui\gui_screen.cpp" />
 			<File RelativePath="..\..\engines\sci\gui\gui_screen.h" />
 			<File RelativePath="..\..\engines\sci\gui\gui_text.cpp" />

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-31 19:34:27 UTC (rev 45578)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-31 19:48:28 UTC (rev 45579)
@@ -640,21 +640,19 @@
 	uint16 operation = argv[0].toUint16();
 
 	switch (operation) {
-	case 0: { // load resource (the corresponding .BIN file from the ACTORS directory)
+	case 0: { // load
 		if (argc == 2) {
 			Common::String resourceName = s->_segMan->getString(argv[1]);
-
-			// TODO: implement this
-
+			return s->_gui->portraitLoad(resourceName);
 		} else {
 			warning("kPortrait(loadResource) called with unsupported argc %d", argc);
 		}
 		break;
 	}
-	case 1: { // show portrait
+	case 1: { // show
 		if (argc == 10) {
 			Common::String resourceName = s->_segMan->getString(argv[1]);
-			Common::Point portraitPos = Common::Point(argv[2].toUint16(), argv[3].toUint16());
+			Common::Point position = Common::Point(argv[2].toUint16(), argv[3].toUint16());
 			/*uint resourceNum = argv[4].toUint16() & 0xff;
 			uint noun = argv[5].toUint16() & 0xff;
 			uint verb = argv[6].toUint16() & 0xff;
@@ -662,20 +660,18 @@
 			uint seq = argv[8].toUint16() & 0xff;*/
 			// argv[9] is usually 0??!!
 
+			s->_gui->portraitShow(resourceName, position, resourceNum, noun, verb, cond, seq);
+			return SIGNAL_REG;
 			// TODO: implement this. Looks to be a modified version of kDoSync
-
-			warning("kPortrait(show) %s at %d, %d", resourceName.c_str(), portraitPos.x, portraitPos.y);
 		} else {
 			warning("kPortrait(show) called with unsupported argc %d", argc);
 		}
 		break;
 	}
-	case 2: { // unload resource
+	case 2: { // unload
 		if (argc == 2) {
 			//uint16 portraitId = argv[1].toUint16();
-
-			// TODO: implement this
-
+			s->_gui->portraitUnload(portraitId);
 		} else {
 			warning("kPortrait(unload) called with unsupported argc %d", argc);
 		}

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-31 19:34:27 UTC (rev 45578)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-31 19:48:28 UTC (rev 45579)
@@ -747,6 +747,16 @@
 	return _gfx->getView(viewId)->getLoopInfo(loopNo)->celCount;
 }
 
+reg_t SciGui::portraitLoad(Common::String resourceName) {
+	return NULL_REG;
+}
+
+void SciGui::portraitShow(Common::String resourceName, Common::Point position, uint16 resourceNum, uint16 noun, uint16 verb, uint16 cond, uint16 seq) {
+}
+
+void SciGui::portraitUnload(uint16 portraitId) {
+}
+
 bool SciGui::debugUndither(bool flag) {
 	_screen->unditherSetState(flag);
 	return false;

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-31 19:34:27 UTC (rev 45578)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-31 19:48:28 UTC (rev 45579)
@@ -134,6 +134,10 @@
 	virtual int16 getLoopCount(GuiResourceId viewId);
 	virtual int16 getCelCount(GuiResourceId viewId, int16 loopNo);
 
+	virtual reg_t portraitLoad(Common::String resourceName);
+	virtual void portraitShow(Common::String resourceName, Common::Point position, uint16 resourceNum, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
+	virtual void portraitUnload(uint16 portraitId);
+
 	virtual bool debugUndither(bool flag);
 	virtual bool debugShowMap(int mapNo);
 

Copied: scummvm/trunk/engines/sci/gui/gui_portrait.cpp (from rev 45568, scummvm/trunk/engines/sci/gui/gui_controls.cpp)
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_portrait.cpp	                        (rev 0)
+++ scummvm/trunk/engines/sci/gui/gui_portrait.cpp	2009-10-31 19:48:28 UTC (rev 45579)
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/util.h"
+#include "common/stack.h"
+#include "graphics/primitives.h"
+
+#include "sci/sci.h"
+#include "sci/engine/state.h"
+#include "sci/gui/gui_screen.h"
+#include "sci/gui/gui_palette.h"
+#include "sci/gui/gui_portrait.h"
+
+namespace Sci {
+
+SciGuiPortrait::SciGuiPortrait(ResourceManager *resMan, SciGuiScreen *screen, SciGuiPalette *palette, Common::String resourceName)
+	: _resMan(resMan), _screen(screen), _palette(palette), _resourceName(resourceName) {
+	init();
+}
+
+SciGuiPortrait::~SciGuiPortrait() {
+}
+
+void SciGuiPortrait::init() {
+	// .BIN files are loaded from actors directory and from .\ directory
+	// seem to have 98 byte header
+}
+
+} // End of namespace Sci

Copied: scummvm/trunk/engines/sci/gui/gui_portrait.h (from rev 45568, scummvm/trunk/engines/sci/gui/gui_controls.h)
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_portrait.h	                        (rev 0)
+++ scummvm/trunk/engines/sci/gui/gui_portrait.h	2009-10-31 19:48:28 UTC (rev 45579)
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef SCI_GUI_PORTRAITS_H
+#define SCI_GUI_PORTRAITS_H
+
+namespace Sci {
+
+class SciGuiPortrait {
+public:
+	SciGuiPortrait(ResourceManager *resMan, SciGuiScreen *screen, SciGuiPalette *palette, Common::String resourceName);
+	~SciGuiPortrait();
+
+private:
+	void init(void);
+
+	ResourceManager *_resMan;
+	SciGuiScreen *_screen;
+	SciGuiPalette *_palette;
+
+	Common::String _resourceName;
+	byte *_resourceData;
+};
+
+} // End of namespace Sci
+
+#endif

Modified: scummvm/trunk/engines/sci/module.mk
===================================================================
--- scummvm/trunk/engines/sci/module.mk	2009-10-31 19:34:27 UTC (rev 45578)
+++ scummvm/trunk/engines/sci/module.mk	2009-10-31 19:48:28 UTC (rev 45579)
@@ -54,6 +54,7 @@
 	gui/gui_gfx.o \
 	gui/gui_palette.o \
 	gui/gui_picture.o \
+	gui/gui_portrait.o \
 	gui/gui_screen.o \
 	gui/gui_text.o \
 	gui/gui_transitions.o \


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