[Scummvm-cvs-logs] SF.net SVN: scummvm:[50499] scummvm/trunk/engines/sci/graphics

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Jun 29 16:55:09 CEST 2010


Revision: 50499
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50499&view=rev
Author:   fingolfin
Date:     2010-06-29 14:55:09 +0000 (Tue, 29 Jun 2010)

Log Message:
-----------
SCI: Add some const qualifiers

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/paint16.cpp
    scummvm/trunk/engines/sci/graphics/paint16.h

Modified: scummvm/trunk/engines/sci/graphics/paint16.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-06-29 14:54:47 UTC (rev 50498)
+++ scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-06-29 14:55:09 UTC (rev 50499)
@@ -107,12 +107,12 @@
 }
 
 // This version of drawCel is not supposed to call BitsShow()!
-void GfxPaint16::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) {
+void GfxPaint16::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) {
 	drawCel(_cache->getView(viewId), loopNo, celNo, celRect, priority, paletteNo, scaleX, scaleY);
 }
 
 // This version of drawCel is not supposed to call BitsShow()!
-void GfxPaint16::drawCel(GfxView *view, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) {
+void GfxPaint16::drawCel(GfxView *view, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) {
 	Common::Rect clipRect = celRect;
 	clipRect.clip(_ports->_curPort->rect);
 	if (clipRect.isEmpty()) // nothing to draw
@@ -389,19 +389,19 @@
 	}
 }
 
-void GfxPaint16::kernelGraphFillBoxForeground(Common::Rect rect) {
+void GfxPaint16::kernelGraphFillBoxForeground(const Common::Rect &rect) {
 	paintRect(rect);
 }
 
-void GfxPaint16::kernelGraphFillBoxBackground(Common::Rect rect) {
+void GfxPaint16::kernelGraphFillBoxBackground(const Common::Rect &rect) {
 	eraseRect(rect);
 }
 
-void GfxPaint16::kernelGraphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control) {
+void GfxPaint16::kernelGraphFillBox(const Common::Rect &rect, uint16 colorMask, int16 color, int16 priority, int16 control) {
 	fillRect(rect, colorMask, color, priority, control);
 }
 
-void GfxPaint16::kernelGraphFrameBox(Common::Rect rect, int16 color) {
+void GfxPaint16::kernelGraphFrameBox(const Common::Rect &rect, int16 color) {
 	int16 oldColor = _ports->getPort()->penClr;
 	_ports->penColor(color);
 	frameRect(rect);
@@ -413,11 +413,11 @@
 	_screen->drawLine(startPoint.x, startPoint.y, endPoint.x, endPoint.y, color, priority, control);
 }
 
-reg_t GfxPaint16::kernelGraphSaveBox(Common::Rect rect, uint16 screenMask) {
+reg_t GfxPaint16::kernelGraphSaveBox(const Common::Rect &rect, uint16 screenMask) {
 	return bitsSave(rect, screenMask);
 }
 
-reg_t GfxPaint16::kernelGraphSaveUpscaledHiresBox(Common::Rect rect) {
+reg_t GfxPaint16::kernelGraphSaveUpscaledHiresBox(const Common::Rect &rect) {
 	return bitsSave(rect, GFX_SCREEN_MASK_DISPLAY);
 }
 
@@ -425,7 +425,7 @@
 	bitsRestore(handle);
 }
 
-void GfxPaint16::kernelGraphUpdateBox(Common::Rect rect, bool hiresMode) {
+void GfxPaint16::kernelGraphUpdateBox(const Common::Rect &rect, bool hiresMode) {
 	// some calls are hiresMode even under kq6 DOS, that's why we check for upscaled hires here
 	if ((!hiresMode) || (!_screen->getUpscaledHires()))
 		bitsShow(rect);
@@ -597,12 +597,12 @@
 	}
 }
 
-reg_t GfxPaint16::kernelPortraitLoad(Common::String resourceName) {
+reg_t GfxPaint16::kernelPortraitLoad(const Common::String &resourceName) {
 	//Portrait *myPortrait = new Portrait(g_sci->getResMan(), _screen, _palette, resourceName);
 	return NULL_REG;
 }
 
-void GfxPaint16::kernelPortraitShow(Common::String resourceName, Common::Point position, uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq) {
+void GfxPaint16::kernelPortraitShow(const Common::String &resourceName, Common::Point position, uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq) {
 	Portrait *myPortrait = new Portrait(g_sci->getResMan(), g_sci->getEventManager(), _screen, _palette, _audio, resourceName);
 	// TODO: cache portraits
 	// adjust given coordinates to curPort (but dont adjust coordinates on upscaledHires_Save_Box and give us hires coordinates

Modified: scummvm/trunk/engines/sci/graphics/paint16.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.h	2010-06-29 14:54:47 UTC (rev 50498)
+++ scummvm/trunk/engines/sci/graphics/paint16.h	2010-06-29 14:55:09 UTC (rev 50499)
@@ -53,8 +53,8 @@
 
 	void drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId);
 	void drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
-	void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
-	void drawCel(GfxView *view, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
+	void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
+	void drawCel(GfxView *view, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
 	void drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, reg_t upscaledHiresHandle, uint16 scaleX = 128, uint16 scaleY = 128);
 
 	void clearScreen(byte color = 255);
@@ -75,23 +75,23 @@
 	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 kernelGraphFillBoxForeground(Common::Rect rect);
-	void kernelGraphFillBoxBackground(Common::Rect rect);
-	void kernelGraphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control);
-	void kernelGraphFrameBox(Common::Rect rect, int16 color);
+	void kernelGraphFillBoxForeground(const Common::Rect &rect);
+	void kernelGraphFillBoxBackground(const Common::Rect &rect);
+	void kernelGraphFillBox(const Common::Rect &rect, uint16 colorMask, int16 color, int16 priority, int16 control);
+	void kernelGraphFrameBox(const Common::Rect &rect, int16 color);
 	void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
-	reg_t kernelGraphSaveBox(Common::Rect rect, uint16 flags);
-	reg_t kernelGraphSaveUpscaledHiresBox(Common::Rect rect);
+	reg_t kernelGraphSaveBox(const Common::Rect &rect, uint16 flags);
+	reg_t kernelGraphSaveUpscaledHiresBox(const Common::Rect &rect);
 	void kernelGraphRestoreBox(reg_t handle);
-	void kernelGraphUpdateBox(Common::Rect rect, bool hiresMode);
+	void kernelGraphUpdateBox(const Common::Rect &rect, bool hiresMode);
 	void kernelGraphRedrawBox(Common::Rect rect);
 
 	reg_t kernelDisplay(const char *text, int argc, reg_t *argv);
 
 	void kernelShakeScreen(uint16 shakeCount, uint16 directions);
 
-	reg_t kernelPortraitLoad(Common::String resourceName);
-	void kernelPortraitShow(Common::String resourceName, Common::Point position, uint16 resourceNum, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
+	reg_t kernelPortraitLoad(const Common::String &resourceName);
+	void kernelPortraitShow(const Common::String &resourceName, Common::Point position, uint16 resourceNum, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
 	void kernelPortraitUnload(uint16 portraitId);
 
 private:


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