[Scummvm-cvs-logs] scummvm master -> fe04339909ad9a78cd49a057d3188cc5f54aa713

bluegr md5 at scummvm.org
Sat Feb 26 18:08:20 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
fe04339909 SCI: Removed the SCI32 version of kernelDrawCel() and placed its code inside the debug function cmdDrawCel, as it was ha


Commit: fe04339909ad9a78cd49a057d3188cc5f54aa713
    https://github.com/scummvm/scummvm/commit/fe04339909ad9a78cd49a057d3188cc5f54aa713
Author: md5 (md5 at scummvm.org)
Date: 2011-02-26T09:07:31-08:00

Commit Message:
SCI: Removed the SCI32 version of kernelDrawCel() and placed its code inside the debug function cmdDrawCel, as it was hacked together to be used specifically in that command (thanks to salty-horse for spotting this)

Changed paths:
    engines/sci/console.cpp
    engines/sci/graphics/paint.cpp
    engines/sci/graphics/paint.h
    engines/sci/graphics/paint32.cpp
    engines/sci/graphics/paint32.h



diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index d77ac85..f63f0cb 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -40,12 +40,14 @@
 #include "sci/sound/music.h"
 #include "sci/sound/drivers/mididriver.h"
 #include "sci/sound/drivers/map-mt32-to-gm.h"
+#include "sci/graphics/cache.h"
 #include "sci/graphics/cursor.h"
 #include "sci/graphics/screen.h"
 #include "sci/graphics/paint.h"
 #include "sci/graphics/paint16.h"
 #include "sci/graphics/paint32.h"
 #include "sci/graphics/palette.h"
+#include "sci/graphics/view.h"
 
 #include "sci/parser/vocabulary.h"
 
@@ -1503,7 +1505,17 @@ bool Console::cmdDrawCel(int argc, const char **argv) {
 	uint16 loopNo = atoi(argv[2]);
 	uint16 celNo = atoi(argv[3]);
 
-	_engine->_gfxPaint->kernelDrawCel(resourceId, loopNo, celNo, 50, 50, 0, 0, false, NULL_REG);
+	if (_engine->_gfxPaint16) {
+		_engine->_gfxPaint16->kernelDrawCel(resourceId, loopNo, celNo, 50, 50, 0, 0, 128, 128, false, NULL_REG);
+	} else {
+		GfxView *view = _engine->_gfxCache->getView(resourceId);
+		Common::Rect celRect(50, 50, 50, 50);
+		Common::Rect translatedRect;
+		celRect.bottom += view->getHeight(loopNo, celNo);
+		celRect.right += view->getWidth(loopNo, celNo);
+		view->draw(celRect, celRect, celRect, loopNo, celNo, 255, 0, false);
+		_engine->_gfxScreen->copyRectToScreen(celRect);
+	}
 	return true;
 }
 
diff --git a/engines/sci/graphics/paint.cpp b/engines/sci/graphics/paint.cpp
index 50b0534..c347da3 100644
--- a/engines/sci/graphics/paint.cpp
+++ b/engines/sci/graphics/paint.cpp
@@ -43,9 +43,6 @@ GfxPaint::~GfxPaint() {
 void GfxPaint::kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) {
 }
 
-void GfxPaint::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle) {
-}
-
 void GfxPaint::kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) {
 }
 
diff --git a/engines/sci/graphics/paint.h b/engines/sci/graphics/paint.h
index 994bc4e..a79e899 100644
--- a/engines/sci/graphics/paint.h
+++ b/engines/sci/graphics/paint.h
@@ -36,7 +36,6 @@ public:
 	virtual ~GfxPaint();
 
 	virtual void kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
-	virtual void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle);
 	virtual void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
 };
 
diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp
index aa3bf8d..69a278e 100644
--- a/engines/sci/graphics/paint32.cpp
+++ b/engines/sci/graphics/paint32.cpp
@@ -65,17 +65,6 @@ void GfxPaint32::kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, b
 	delete picture;
 }
 
-// This is "hacked" together, because its only used by debug command
-void GfxPaint32::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle) {
-	GfxView *view = _cache->getView(viewId);
-	Common::Rect celRect(50, 50, 50, 50);
-	Common::Rect translatedRect;
-	celRect.bottom += view->getHeight(loopNo, celNo);
-	celRect.right += view->getWidth(loopNo, celNo);
-	view->draw(celRect, celRect, celRect, loopNo, celNo, 255, 0, false);
-	_screen->copyRectToScreen(celRect);
-}
-
 void GfxPaint32::kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) {
 	_screen->drawLine(startPoint.x, startPoint.y, endPoint.x, endPoint.y, color, priority, control);
 }
diff --git a/engines/sci/graphics/paint32.h b/engines/sci/graphics/paint32.h
index 3fa9d11..e412bdf 100644
--- a/engines/sci/graphics/paint32.h
+++ b/engines/sci/graphics/paint32.h
@@ -45,7 +45,6 @@ public:
 	void fillRect(Common::Rect rect, byte color);
 
 	void kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
-	void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle);
 	void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
 
 private:






More information about the Scummvm-git-logs mailing list