[Scummvm-cvs-logs] SF.net SVN: scummvm:[35260] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Dec 6 15:24:40 CET 2008


Revision: 35260
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35260&view=rev
Author:   thebluegr
Date:     2008-12-06 14:24:40 +0000 (Sat, 06 Dec 2008)

Log Message:
-----------
All the screen drawing functions draw to the back buffer, so there is no point in passing it everywhere

Modified Paths:
--------------
    scummvm/trunk/engines/saga/actor.cpp
    scummvm/trunk/engines/saga/font.cpp
    scummvm/trunk/engines/saga/font.h
    scummvm/trunk/engines/saga/interface.cpp
    scummvm/trunk/engines/saga/interface.h
    scummvm/trunk/engines/saga/isomap.cpp
    scummvm/trunk/engines/saga/isomap.h
    scummvm/trunk/engines/saga/objectmap.cpp
    scummvm/trunk/engines/saga/objectmap.h
    scummvm/trunk/engines/saga/puzzle.cpp
    scummvm/trunk/engines/saga/render.cpp
    scummvm/trunk/engines/saga/scene.cpp
    scummvm/trunk/engines/saga/scene.h
    scummvm/trunk/engines/saga/sprite.cpp
    scummvm/trunk/engines/saga/sprite.h

Modified: scummvm/trunk/engines/saga/actor.cpp
===================================================================
--- scummvm/trunk/engines/saga/actor.cpp	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/actor.cpp	2008-12-06 14:24:40 UTC (rev 35260)
@@ -1046,7 +1046,6 @@
 	CommonObjectDataPointer drawObject;
 	int frameNumber = 0;
 	SpriteList *spriteList = NULL;
-	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 
 	createDrawOrderList();
 
@@ -1058,9 +1057,9 @@
 		}
 
 		if (_vm->_scene->getFlags() & kSceneFlagISO) {
-			_vm->_isoMap->drawSprite(backBuffer, *spriteList, frameNumber, drawObject->_location, drawObject->_screenPosition, drawObject->_screenScale);
+			_vm->_isoMap->drawSprite(*spriteList, frameNumber, drawObject->_location, drawObject->_screenPosition, drawObject->_screenScale);
 		} else {
-			_vm->_sprite->drawOccluded(backBuffer, _vm->_scene->getSceneClip(),*spriteList, frameNumber, drawObject->_screenPosition, drawObject->_screenScale, drawObject->_screenDepth);
+			_vm->_sprite->drawOccluded(_vm->_scene->getSceneClip(),*spriteList, frameNumber, drawObject->_screenPosition, drawObject->_screenScale, drawObject->_screenDepth);
 		}
 	}
 
@@ -1076,7 +1075,6 @@
 	Point textPoint;
 	ActorData *actor;
 	int width, height;
-	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 	int stringLength = strlen(_activeSpeech.strings[0]);
 	char *outputString = (char*)calloc(stringLength + 1, 1);
 
@@ -1100,11 +1098,11 @@
 			else if (_vm->getGameType() == GType_IHNM)
 				textPoint.y = 10; // CLIP(actor->_screenPosition.y - 160, 10, _vm->_scene->getHeight(true) - 10 - height);
 
-			_vm->_font->textDraw(kKnownFontScript, backBuffer, outputString, textPoint,
+			_vm->_font->textDraw(kKnownFontScript, outputString, textPoint,
 				_activeSpeech.speechColor[i], _activeSpeech.outlineColor[i], _activeSpeech.getFontFlags(i));
 		}
 	} else {
-		_vm->_font->textDrawRect(kKnownFontScript, backBuffer, outputString, _activeSpeech.drawRect, _activeSpeech.speechColor[0],
+		_vm->_font->textDrawRect(kKnownFontScript, outputString, _activeSpeech.drawRect, _activeSpeech.speechColor[0],
 			_activeSpeech.outlineColor[0], _activeSpeech.getFontFlags(0));
 	}
 

Modified: scummvm/trunk/engines/saga/font.cpp
===================================================================
--- scummvm/trunk/engines/saga/font.cpp	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/font.cpp	2008-12-06 14:24:40 UTC (rev 35260)
@@ -278,7 +278,7 @@
 }
 
 
-void Font::draw(FontId fontId, Surface *ds, const char *text, size_t count, const Common::Point &point,
+void Font::draw(FontId fontId, const char *text, size_t count, const Common::Point &point,
 			   int color, int effectColor, FontEffectFlags flags) {
 	FontData *font;
 	Point offsetPoint(point);
@@ -288,19 +288,19 @@
 	if (flags & kFontOutline) {
 		offsetPoint.x--;
 		offsetPoint.y--;
-		outFont(font->outline, ds, text, count, offsetPoint, effectColor, flags);
-		outFont(font->normal, ds, text, count, point, color, flags);
+		outFont(font->outline, text, count, offsetPoint, effectColor, flags);
+		outFont(font->normal, text, count, point, color, flags);
 	} else if (flags & kFontShadow) {
 		offsetPoint.x--;
 		offsetPoint.y++;
-		outFont(font->normal, ds, text, count, offsetPoint, effectColor, flags);
-		outFont(font->normal, ds, text, count, point, color, flags);
+		outFont(font->normal, text, count, offsetPoint, effectColor, flags);
+		outFont(font->normal, text, count, point, color, flags);
 	} else { // FONT_NORMAL
-		outFont(font->normal, ds, text, count, point, color, flags);
+		outFont(font->normal, text, count, point, color, flags);
 	}
 }
 
-void Font::outFont(const FontStyle &drawFont, Surface *ds, const char *text, size_t count, const Common::Point &point, int color, FontEffectFlags flags) {
+void Font::outFont(const FontStyle &drawFont, const char *text, size_t count, const Common::Point &point, int color, FontEffectFlags flags) {
 	const byte *textPointer;
 	byte *c_dataPointer;
 	int c_code;
@@ -310,6 +310,7 @@
 	byte *outputPointer;
 	byte *outputPointer_min;
 	byte *outputPointer_max;
+	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 
 	int row;
 	int rowLimit;
@@ -319,7 +320,7 @@
 	int c_bit;
 	int ct;
 
-	if ((point.x > ds->w) || (point.y > ds->h)) {
+	if ((point.x > backBuffer->w) || (point.y > backBuffer->h)) {
 		// Output string can't be visible
 		return;
 	}
@@ -372,7 +373,7 @@
 
 		// Get length of character in bytes
 		c_byte_len = ((drawFont.fontCharEntry[c_code].width - 1) / 8) + 1;
-		rowLimit = (ds->h < (textPoint.y + drawFont.header.charHeight)) ? ds->h : textPoint.y + drawFont.header.charHeight;
+		rowLimit = (backBuffer->h < (textPoint.y + drawFont.header.charHeight)) ? backBuffer->h : textPoint.y + drawFont.header.charHeight;
 		charRow = 0;
 
 		for (row = textPoint.y; row < rowLimit; row++, charRow++) {
@@ -381,9 +382,9 @@
 				continue;
 			}
 
-			outputPointer = (byte *)ds->pixels + (ds->pitch * row) + textPoint.x;
-			outputPointer_min = (byte *)ds->pixels + (ds->pitch * row) + (textPoint.x > 0 ? textPoint.x : 0);
-			outputPointer_max = outputPointer + (ds->pitch - textPoint.x);
+			outputPointer = (byte *)backBuffer->pixels + (backBuffer->pitch * row) + textPoint.x;
+			outputPointer_min = (byte *)backBuffer->pixels + (backBuffer->pitch * row) + (textPoint.x > 0 ? textPoint.x : 0);
+			outputPointer_max = outputPointer + (backBuffer->pitch - textPoint.x);
 
 			// If character starts off the screen, jump to next character
 			if (outputPointer < outputPointer_min) {
@@ -409,17 +410,18 @@
 }
 
 
-void Font::textDraw(FontId fontId, Surface *ds, const char *text, const Common::Point &point, int color, int effectColor, FontEffectFlags flags) {
+void Font::textDraw(FontId fontId, const char *text, const Common::Point &point, int color, int effectColor, FontEffectFlags flags) {
 	int textWidth;
 	int textLength;
 	int fitWidth;
 	Common::Point textPoint(point);
+	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 
 	textLength = strlen(text);
 
 	if (!(flags & kFontCentered)) {
 		// Text is not centered; No formatting required
-		draw(fontId, ds, text, textLength, point, color, effectColor, flags);
+		draw(fontId, text, textLength, point, color, effectColor, flags);
 		return;
 	}
 
@@ -429,8 +431,8 @@
 		textPoint.x = TEXT_CENTERLIMIT;
 	}
 
-	if (textPoint.x > ds->w - TEXT_CENTERLIMIT) {
-		textPoint.x = ds->w - TEXT_CENTERLIMIT;
+	if (textPoint.x > backBuffer->w - TEXT_CENTERLIMIT) {
+		textPoint.x = backBuffer->w - TEXT_CENTERLIMIT;
 	}
 
 	if (textPoint.x < (TEXT_MARGIN * 2)) {
@@ -440,12 +442,12 @@
 
 	textWidth = getStringWidth(fontId, text, textLength, flags);
 
-	if (textPoint.x < (ds->w / 2)) {
+	if (textPoint.x < (backBuffer->w / 2)) {
 		// Fit to right side
 		fitWidth = (textPoint.x - TEXT_MARGIN) * 2;
 	} else {
 		// Fit to left side
-		fitWidth = ((ds->w - TEXT_MARGIN) - textPoint.x) * 2;
+		fitWidth = ((backBuffer->w - TEXT_MARGIN) - textPoint.x) * 2;
 	}
 
 	if (fitWidth < textWidth) {
@@ -454,7 +456,7 @@
 	}
 	// Entire string fits, draw it
 	textPoint.x = textPoint.x - (textWidth / 2);
-	draw(fontId, ds, text, textLength, textPoint, color, effectColor, flags);
+	draw(fontId, text, textLength, textPoint, color, effectColor, flags);
 }
 
 int Font::getHeight(FontId fontId, const char *text, int width, FontEffectFlags flags) {
@@ -541,7 +543,7 @@
 	}
 }
 
-void Font::textDrawRect(FontId fontId, Surface *ds, const char *text, const Common::Rect &rect, int color, int effectColor, FontEffectFlags flags) {
+void Font::textDrawRect(FontId fontId, const char *text, const Common::Rect &rect, int color, int effectColor, FontEffectFlags flags) {
 	int textWidth;
 	int textLength;
 	int fitWidth;
@@ -570,7 +572,7 @@
 	if (fitWidth >= textWidth) {
 		// Entire string fits, draw it
 		textPoint.x -= (textWidth / 2);
-		draw(fontId, ds, text, textLength, textPoint, color, effectColor, flags);
+		draw(fontId, text, textLength, textPoint, color, effectColor, flags);
 		return;
 	}
 
@@ -607,7 +609,7 @@
 			// Wrap what we've got and restart
 			textPoint2.x = textPoint.x - (w_total / 2);
 			textPoint2.y = textPoint.y;
-			draw(fontId, ds, startPointer, len_total, textPoint2, color, effectColor, flags);
+			draw(fontId, startPointer, len_total, textPoint2, color, effectColor, flags);
 			textPoint.y += h + TEXT_LINESPACING;
 			if (textPoint.y >= rect.bottom) {
 				return;
@@ -642,7 +644,7 @@
 				// Since word hit NULL but fit, we are done
 				textPoint2.x = textPoint.x - (w_total / 2);
 				textPoint2.y = textPoint.y;
-				draw(fontId, ds, startPointer, len_total, textPoint2, color,
+				draw(fontId, startPointer, len_total, textPoint2, color,
 					effectColor, flags);
 				return;
 			}

Modified: scummvm/trunk/engines/saga/font.h
===================================================================
--- scummvm/trunk/engines/saga/font.h	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/font.h	2008-12-06 14:24:40 UTC (rev 35260)
@@ -136,11 +136,11 @@
 	int getHeight(KnownFont font, const char *text, int width, FontEffectFlags flags) {
 		return getHeight(knownFont2FontIdx(font), text, width, flags);
 	}
-	void textDraw(KnownFont font, Surface *ds, const char *string, const Common::Point &point, int color, int effectColor, FontEffectFlags flags) {
-		textDraw(knownFont2FontIdx(font), ds, string, point, color, effectColor, flags);
+	void textDraw(KnownFont font, const char *string, const Common::Point &point, int color, int effectColor, FontEffectFlags flags) {
+		textDraw(knownFont2FontIdx(font), string, point, color, effectColor, flags);
 	}
-	void textDrawRect(KnownFont font, Surface *ds, const char *text, const Common::Rect &rect, int color, int effectColor, FontEffectFlags flags) {
-		textDrawRect(knownFont2FontIdx(font), ds, text, rect, color, effectColor, flags);
+	void textDrawRect(KnownFont font, const char *text, const Common::Rect &rect, int color, int effectColor, FontEffectFlags flags) {
+		textDrawRect(knownFont2FontIdx(font), text, rect, color, effectColor, flags);
 	}
 	void setFontMapping(int mapping) {
 		_fontMapping = mapping;
@@ -162,13 +162,13 @@
 
 	 int getStringWidth(FontId fontId, const char *text, size_t count, FontEffectFlags flags);
 	 int getHeight(FontId fontId, const char *text, int width, FontEffectFlags flags);
-	 void textDrawRect(FontId fontId, Surface *ds, const char *text, const Common::Rect &rect, int color, int effectColor, FontEffectFlags flags);
-	 void textDraw(FontId fontId, Surface *ds, const char *string, const Common::Point &point, int color, int effectColor, FontEffectFlags flags);
+	 void textDrawRect(FontId fontId, const char *text, const Common::Rect &rect, int color, int effectColor, FontEffectFlags flags);
+	 void textDraw(FontId fontId, const char *string, const Common::Point &point, int color, int effectColor, FontEffectFlags flags);
 
 	 void loadFont(uint32 fontResourceId);
 	 void createOutline(FontData *font);
-	 void draw(FontId fontId, Surface *ds, const char *text, size_t count, const Common::Point &point, int color, int effectColor, FontEffectFlags flags);
-	 void outFont(const FontStyle &drawFont, Surface *ds, const char *text, size_t count, const Common::Point &point, int color, FontEffectFlags flags);
+	 void draw(FontId fontId, const char *text, size_t count, const Common::Point &point, int color, int effectColor, FontEffectFlags flags);
+	 void outFont(const FontStyle &drawFont, const char *text, size_t count, const Common::Point &point, int color, FontEffectFlags flags);
 
 	 FontData *getFont(FontId fontId) {
 		 validate(fontId);

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/interface.cpp	2008-12-06 14:24:40 UTC (rev 35260)
@@ -755,7 +755,7 @@
 	_vm->_sprite->loadList(resourceId, _scenePortraits);
 }
 
-void Interface::drawVerbPanel(Surface *backBuffer, PanelButton* panelButton) {
+void Interface::drawVerbPanel(PanelButton* panelButton) {
 	PanelButton * rightButtonVerbPanelButton;
 	PanelButton * currentVerbPanelButton;
 	KnownColor textColor;
@@ -781,13 +781,12 @@
 	point.x = _mainPanel.x + panelButton->xOffset;
 	point.y = _mainPanel.y + panelButton->yOffset;
 
-	_vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), _mainPanel.sprites, spriteNumber, point, 256);
+	_vm->_sprite->draw(_vm->getDisplayClip(), _mainPanel.sprites, spriteNumber, point, 256);
 
-	drawVerbPanelText(backBuffer, panelButton, textColor, kKnownColorVerbTextShadow);
+	drawVerbPanelText(panelButton, textColor, kKnownColorVerbTextShadow);
 }
 
 void Interface::draw() {
-	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 	Point leftPortraitPoint;
 	Point rightPortraitPoint;
 	Rect rect;
@@ -800,17 +799,17 @@
 	if (_panelMode == kPanelMain || _panelMode == kPanelMap ||
 		(_panelMode == kPanelNull && _vm->getGameId() == GID_IHNM_DEMO)) {
 		_mainPanel.getRect(rect);
-		backBuffer->blit(rect, _mainPanel.image);
+		_vm->_gfx->getBackBuffer()->blit(rect, _mainPanel.image);
 
 		for (int i = 0; i < kVerbTypeIdsMax; i++) {
 			if (_verbTypeToPanelButton[i] != NULL) {
-				drawVerbPanel(backBuffer, _verbTypeToPanelButton[i]);
+				drawVerbPanel(_verbTypeToPanelButton[i]);
 			}
 		}
 	} else if (_panelMode == kPanelConverse) {
 		_conversePanel.getRect(rect);
-		backBuffer->blit(rect, _conversePanel.image);
-		converseDisplayTextLines(backBuffer);
+		_vm->_gfx->getBackBuffer()->blit(rect, _conversePanel.image);
+		converseDisplayTextLines();
 	}
 
 	if (_panelMode == kPanelMain || _panelMode == kPanelConverse ||
@@ -818,7 +817,7 @@
 		(_panelMode == kPanelNull && _vm->getGameId() == GID_IHNM_DEMO)) {
 		leftPortraitPoint.x = _mainPanel.x + _vm->getDisplayInfo().leftPortraitXOffset;
 		leftPortraitPoint.y = _mainPanel.y + _vm->getDisplayInfo().leftPortraitYOffset;
-		_vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), _defPortraits, _leftPortrait, leftPortraitPoint, 256);
+		_vm->_sprite->draw(_vm->getDisplayClip(), _defPortraits, _leftPortrait, leftPortraitPoint, 256);
 	}
 
 	if (!_inMainMode && _vm->getDisplayInfo().rightPortraitXOffset >= 0) { //FIXME: should we change !_inMainMode to _panelMode == kPanelConverse ?
@@ -833,10 +832,10 @@
 		if (_rightPortrait >= _scenePortraits.spriteCount)
 			_rightPortrait = 0;
 
-		_vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), _scenePortraits, _rightPortrait, rightPortraitPoint, 256);
+		_vm->_sprite->draw(_vm->getDisplayClip(), _scenePortraits, _rightPortrait, rightPortraitPoint, 256);
 	}
 
-	drawInventory(backBuffer);
+	drawInventory();
 }
 
 void Interface::calcOptionSaveSlider() {
@@ -879,7 +878,7 @@
 	_optionSaveRectBottom.right--;
 }
 
-void Interface::drawPanelText(Surface *ds, InterfacePanel *panel, PanelButton *panelButton) {
+void Interface::drawPanelText(InterfacePanel *panel, PanelButton *panelButton) {
 	const char *text;
 	int textWidth;
 	Rect rect;
@@ -925,7 +924,8 @@
 	textPoint.x = rect.left;
 	textPoint.y = rect.top + 1;
 
-	_vm->_font->textDraw(textFont, ds, text, textPoint, _vm->KnownColor2ColorId(kKnownColorVerbText), _vm->KnownColor2ColorId(textShadowKnownColor), kFontShadow);
+	_vm->_font->textDraw(textFont, text, textPoint, 
+						_vm->KnownColor2ColorId(kKnownColorVerbText), _vm->KnownColor2ColorId(textShadowKnownColor), kFontShadow);
 }
 
 void Interface::drawOption() {
@@ -951,14 +951,14 @@
 
 		if (panelButton->type == kPanelButtonOption) {
 			if (_vm->getGameType() == GType_ITE) {
-				drawPanelButtonText(backBuffer, &_optionPanel, panelButton);
+				drawPanelButtonText(&_optionPanel, panelButton);
 			} else {
-				drawPanelButtonText(backBuffer, &_optionPanel, panelButton, spritenum);
+				drawPanelButtonText(&_optionPanel, panelButton, spritenum);
 				spritenum += 2; // 2 sprites per button (lit and unlit)
 			}
 		}
 		if (panelButton->type == kPanelButtonOptionText) {
-			drawPanelText(backBuffer, &_optionPanel, panelButton);
+			drawPanelText(&_optionPanel, panelButton);
 		}
 	}
 
@@ -968,12 +968,12 @@
 	}
 
 	if (_vm->getGameType() == GType_ITE) {
-		drawButtonBox(backBuffer, _optionSaveRectSlider, kSlider, _optionSaveFileSlider->state > 0);
+		drawButtonBox(_optionSaveRectSlider, kSlider, _optionSaveFileSlider->state > 0);
 	} else {
 		panelButton = &_optionPanel.buttons[0];
 		sliderPoint.x = _optionPanel.x + panelButton->xOffset;
 		sliderPoint.y = _optionSaveRectSlider.top;
-		_vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), _optionPanel.sprites, 0 + _optionSaveFileSlider->state, sliderPoint, 256);
+		_vm->_sprite->draw(_vm->getDisplayClip(), _optionPanel.sprites, 0 + _optionSaveFileSlider->state, sliderPoint, 256);
 
 	}
 
@@ -1004,9 +1004,9 @@
 			textPoint.x = rect.left + 1;
 			textPoint.y = rect2.top;
 			if (_vm->getGameType() == GType_ITE)
-				_vm->_font->textDraw(kKnownFontSmall, backBuffer, text, textPoint, fgColor, 0, kFontNormal);
+				_vm->_font->textDraw(kKnownFontSmall, text, textPoint, fgColor, 0, kFontNormal);
 			else
-				_vm->_font->textDraw(kKnownFontVerb, backBuffer, text, textPoint, fgColor, 0, kFontNormal);
+				_vm->_font->textDraw(kKnownFontVerb, text, textPoint, fgColor, 0, kFontNormal);
 		}
 	}
 
@@ -1020,17 +1020,17 @@
 
 	_quitPanel.getRect(rect);
 	if (_vm->getGameType() == GType_ITE)
-		drawButtonBox(backBuffer, rect, kButton, false);
+		drawButtonBox(rect, kButton, false);
 	else
 		backBuffer->blit(rect, _quitPanel.image);
 
 	for (i = 0; i < _quitPanel.buttonsCount; i++) {
 		panelButton = &_quitPanel.buttons[i];
 		if (panelButton->type == kPanelButtonQuit) {
-			drawPanelButtonText(backBuffer, &_quitPanel, panelButton);
+			drawPanelButtonText(&_quitPanel, panelButton);
 		}
 		if (panelButton->type == kPanelButtonQuitText) {
-			drawPanelText(backBuffer, &_quitPanel, panelButton);
+			drawPanelText(&_quitPanel, panelButton);
 		}
 	}
 }
@@ -1085,17 +1085,17 @@
 
 	_loadPanel.getRect(rect);
 	if (_vm->getGameType() == GType_ITE)
-		drawButtonBox(backBuffer, rect, kButton, false);
+		drawButtonBox(rect, kButton, false);
 	else
 		backBuffer->blit(rect, _loadPanel.image);
 
 	for (i = 0; i < _loadPanel.buttonsCount; i++) {
 		panelButton = &_loadPanel.buttons[i];
 		if (panelButton->type == kPanelButtonLoad) {
-			drawPanelButtonText(backBuffer, &_loadPanel, panelButton);
+			drawPanelButtonText(&_loadPanel, panelButton);
 		}
 		if (panelButton->type == kPanelButtonLoadText) {
-			drawPanelText(backBuffer, &_loadPanel, panelButton);
+			drawPanelText(&_loadPanel, panelButton);
 		}
 	}
 }
@@ -1262,16 +1262,17 @@
 	return true;
 }
 
-void Interface::drawTextInput(Surface *ds, InterfacePanel *panel, PanelButton *panelButton) {
+void Interface::drawTextInput(InterfacePanel *panel, PanelButton *panelButton) {
 	Point textPoint;
 	Rect rect;
 	char ch[2];
 	int fgColor;
 	uint i;
+	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 
 	ch[1] = 0;
 	panel->calcPanelButtonRect(panelButton, rect);
-	drawButtonBox(ds, rect, kEdit, _textInput);
+	drawButtonBox(rect, kEdit, _textInput);
 	rect.left += 4;
 	rect.top += 4;
 	rect.setHeight(_vm->_font->getHeight(kKnownFontSmall));
@@ -1281,20 +1282,20 @@
 		rect.setWidth(_vm->_font->getStringWidth(kKnownFontSmall, ch, 0, kFontNormal));
 		if ((i == _textInputPos) && _textInput) {
 			fgColor = _vm->KnownColor2ColorId(kKnownColorBlack);
-			ds->fillRect(rect, _vm->KnownColor2ColorId(kKnownColorWhite));
+			backBuffer->fillRect(rect, _vm->KnownColor2ColorId(kKnownColorWhite));
 		} else {
 			fgColor = _vm->KnownColor2ColorId(kKnownColorWhite);
 		}
 		textPoint.x = rect.left;
 		textPoint.y = rect.top + 1;
 
-		_vm->_font->textDraw(kKnownFontSmall, ds, ch, textPoint, fgColor, 0, kFontNormal);
+		_vm->_font->textDraw(kKnownFontSmall, ch, textPoint, fgColor, 0, kFontNormal);
 		rect.left += rect.width();
 	}
 	if (_textInput && (_textInputPos >= i)) {
 		ch[0] = ' ';
 		rect.setWidth(_vm->_font->getStringWidth(kKnownFontSmall, ch, 0, kFontNormal));
-		ds->fillRect(rect, _vm->KnownColor2ColorId(kKnownColorWhite));
+		backBuffer->fillRect(rect, _vm->KnownColor2ColorId(kKnownColorWhite));
 	}
 }
 
@@ -1306,21 +1307,21 @@
 
 	_savePanel.getRect(rect);
 	if (_vm->getGameType() == GType_ITE)
-		drawButtonBox(backBuffer, rect, kButton, false);
+		drawButtonBox(rect, kButton, false);
 	else
 		backBuffer->blit(rect, _savePanel.image);
 
 	for (i = 0; i < _savePanel.buttonsCount; i++) {
 		panelButton = &_savePanel.buttons[i];
 		if (panelButton->type == kPanelButtonSave) {
-			drawPanelButtonText(backBuffer, &_savePanel, panelButton);
+			drawPanelButtonText(&_savePanel, panelButton);
 		}
 		if (panelButton->type == kPanelButtonSaveText) {
-			drawPanelText(backBuffer, &_savePanel, panelButton);
+			drawPanelText(&_savePanel, panelButton);
 		}
 	}
 
-	drawTextInput(backBuffer, &_savePanel, _saveEdit);
+	drawTextInput(&_savePanel, _saveEdit);
 }
 
 void Interface::drawProtect() {
@@ -1330,15 +1331,15 @@
 	PanelButton *panelButton;
 
 	_protectPanel.getRect(rect);
-	drawButtonBox(backBuffer, rect, kButton, false);
+	drawButtonBox(rect, kButton, false);
 
 	for (i = 0; i < _protectPanel.buttonsCount; i++) {
 		panelButton = &_protectPanel.buttons[i];
 		if (panelButton->type == kPanelButtonProtectText) {
-			drawPanelText(backBuffer, &_protectPanel, panelButton);
+			drawPanelText(&_protectPanel, panelButton);
 		}
 	}
-	drawTextInput(backBuffer, &_protectPanel, _protectEdit);
+	drawTextInput(&_protectPanel, _protectEdit);
 }
 
 void Interface::handleSaveUpdate(const Point& mousePoint) {
@@ -1863,7 +1864,6 @@
 }
 
 void Interface::drawStatusBar() {
-	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 	Rect rect;
 	Point textPoint;
 	int stringWidth;
@@ -1886,7 +1886,7 @@
 	rect.right = rect.left + _vm->getDisplayWidth();
 	rect.bottom = rect.top + _vm->getDisplayInfo().statusHeight;
 
-	backBuffer->drawRect(rect, _vm->getDisplayInfo().statusBGColor - offset);
+	_vm->_gfx->getBackBuffer()->drawRect(rect, _vm->getDisplayInfo().statusBGColor - offset);
 
 	stringWidth = _vm->_font->getStringWidth(kKnownFontSmall, _statusText, 0, kFontNormal);
 
@@ -1898,9 +1898,9 @@
 	textPoint.x = _vm->getDisplayInfo().statusXOffset + (_vm->getDisplayInfo().statusWidth - stringWidth) / 2;
 	textPoint.y = _vm->getDisplayInfo().statusYOffset + _vm->getDisplayInfo().statusTextY;
 	if (_vm->getGameType() == GType_ITE)
-		_vm->_font->textDraw(kKnownFontSmall, backBuffer, _statusText, textPoint, color, 0, kFontNormal);
+		_vm->_font->textDraw(kKnownFontSmall, _statusText, textPoint, color, 0, kFontNormal);
 	else
-		_vm->_font->textDraw(kKnownFontVerb, backBuffer, _statusText, textPoint, color, 0, kFontNormal);
+		_vm->_font->textDraw(kKnownFontVerb, _statusText, textPoint, color, 0, kFontNormal);
 
 	if (_saveReminderState > 0) {
 		rect.left = _vm->getDisplayInfo().saveReminderXOffset;
@@ -1908,7 +1908,7 @@
 
 		rect.right = rect.left + _vm->getDisplayInfo().saveReminderWidth;
 		rect.bottom = rect.top + _vm->getDisplayInfo().saveReminderHeight;
-		_vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), _vm->_sprite->_saveReminderSprites,
+		_vm->_sprite->draw(_vm->getDisplayClip(), _vm->_sprite->_saveReminderSprites,
 			_vm->getDisplayInfo().saveReminderFirstSpriteNumber + _saveReminderState - 1,
 			rect, 256);
 
@@ -2094,23 +2094,23 @@
 	return -1;
 }
 
-void Interface::drawInventory(Surface *backBuffer) {
+void Interface::drawInventory() {
 	if (!isInMainMode())
 		return;
 
-	int i;
 	Rect rect;
-	int ci;
+	int ci = _inventoryStart;
 	ObjectData *obj;
-	ci = _inventoryStart;
+	Surface *backBuffer = _vm->_gfx->getBackBuffer();
+
 	if (_inventoryStart != 0) {
-		drawPanelButtonArrow(backBuffer, &_mainPanel, _inventoryUpButton);
+		drawPanelButtonArrow(&_mainPanel, _inventoryUpButton);
 	}
 	if (_inventoryStart != _inventoryEnd) {
-		drawPanelButtonArrow(backBuffer, &_mainPanel, _inventoryDownButton);
+		drawPanelButtonArrow(&_mainPanel, _inventoryDownButton);
 	}
 
-	for (i = 0; i < _mainPanel.buttonsCount; i++) {
+	for (int i = 0; i < _mainPanel.buttonsCount; i++) {
 		if (_mainPanel.buttons[i].type != kPanelButtonInventory) {
 			continue;
 		}
@@ -2123,7 +2123,7 @@
 
 		if (ci < _inventoryCount) {
 			obj = _vm->_actor->getObj(_inventory[ci]);
-			_vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), _vm->_sprite->_inventorySprites, obj->_spriteListResourceId, rect, 256);
+			_vm->_sprite->draw(_vm->getDisplayClip(), _vm->_sprite->_inventorySprites, obj->_spriteListResourceId, rect, 256);
 		}
 
 		ci++;
@@ -2140,12 +2140,13 @@
 	draw();
 }
 
-void Interface::drawButtonBox(Surface *ds, const Rect& rect, ButtonKind kind, bool down) {
+void Interface::drawButtonBox(const Rect& rect, ButtonKind kind, bool down) {
 	byte cornerColor;
 	byte frameColor;
 	byte fillColor;
 	byte solidColor;
 	byte odl, our, idl, iur;
+	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 
 	switch (kind ) {
 		case kSlider:
@@ -2193,14 +2194,14 @@
 	int xe = rect.right - 1;
 	int ye = rect.bottom - 1;
 
-	((byte *)ds->getBasePtr(x, y))[0] = cornerColor;
-	((byte *)ds->getBasePtr(x, ye))[0] = cornerColor;
-	((byte *)ds->getBasePtr(xe, y))[0] = cornerColor;
-	((byte *)ds->getBasePtr(xe, ye))[0] = cornerColor;
-	ds->hLine(x + 1, y, x + w - 2, frameColor);
-	ds->hLine(x + 1, ye, x + w - 2, frameColor);
-	ds->vLine(x, y + 1, y + h - 2, frameColor);
-	ds->vLine(xe, y + 1, y + h - 2, frameColor);
+	((byte *)backBuffer->getBasePtr(x, y))[0] = cornerColor;
+	((byte *)backBuffer->getBasePtr(x, ye))[0] = cornerColor;
+	((byte *)backBuffer->getBasePtr(xe, y))[0] = cornerColor;
+	((byte *)backBuffer->getBasePtr(xe, ye))[0] = cornerColor;
+	backBuffer->hLine(x + 1, y, x + w - 2, frameColor);
+	backBuffer->hLine(x + 1, ye, x + w - 2, frameColor);
+	backBuffer->vLine(x, y + 1, y + h - 2, frameColor);
+	backBuffer->vLine(xe, y + 1, y + h - 2, frameColor);
 
 	x++;
 	y++;
@@ -2208,10 +2209,10 @@
 	ye--;
 	w -= 2;
 	h -= 2;
-	ds->vLine(x, y, y + h - 1, odl);
-	ds->hLine(x, ye, x + w - 1, odl);
-	ds->vLine(xe, y, y + h - 2, our);
-	ds->hLine(x + 1, y, x + 1 + w - 2, our);
+	backBuffer->vLine(x, y, y + h - 1, odl);
+	backBuffer->hLine(x, ye, x + w - 1, odl);
+	backBuffer->vLine(xe, y, y + h - 2, our);
+	backBuffer->hLine(x + 1, y, x + 1 + w - 2, our);
 
 	x++;
 	y++;
@@ -2219,23 +2220,23 @@
 	ye--;
 	w -= 2;
 	h -= 2;
-	((byte *)ds->getBasePtr(x, y))[0] = fillColor;
-	((byte *)ds->getBasePtr(xe, ye))[0] = fillColor;
-	ds->vLine(x, y + 1, y + 1 + h - 2, idl);
-	ds->hLine(x + 1, ye, x + 1 + w - 2, idl);
-	ds->vLine(xe, y, y + h - 2, iur);
-	ds->hLine(x + 1, y, x + 1 + w - 2, iur);
+	((byte *)backBuffer->getBasePtr(x, y))[0] = fillColor;
+	((byte *)backBuffer->getBasePtr(xe, ye))[0] = fillColor;
+	backBuffer->vLine(x, y + 1, y + 1 + h - 2, idl);
+	backBuffer->hLine(x + 1, ye, x + 1 + w - 2, idl);
+	backBuffer->vLine(xe, y, y + h - 2, iur);
+	backBuffer->hLine(x + 1, y, x + 1 + w - 2, iur);
 
 	x++; y++;
 	w -= 2; h -= 2;
 
 	Common::Rect fill(x, y, x + w, y + h);
-	ds->fillRect(fill, solidColor);
+	backBuffer->fillRect(fill, solidColor);
 }
 
 static const int readingSpeeds[] = { kTextClick, kTextSlow, kTextMid, kTextFast };
 
-void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelButton *panelButton, int spritenum) {
+void Interface::drawPanelButtonText(InterfacePanel *panel, PanelButton *panelButton, int spritenum) {
 	const char *text;
 	int textId;
 	int textWidth;
@@ -2314,41 +2315,41 @@
 
 	panel->calcPanelButtonRect(panelButton, rect);
 	if (_vm->getGameType() == GType_ITE) {
-		drawButtonBox(ds, rect, kButton, panelButton->state > 0);
+		drawButtonBox(rect, kButton, panelButton->state > 0);
 	} else {
 		litButton = panelButton->state > 0;
 
 		if (panel == &_optionPanel) {
 			texturePoint.x = _optionPanel.x + panelButton->xOffset - 1;
 			texturePoint.y = _optionPanel.y + panelButton->yOffset - 1;
-			_vm->_sprite->draw(ds, _vm->getDisplayClip(), _optionPanel.sprites, spritenum + 2 + litButton, texturePoint, 256);
+			_vm->_sprite->draw(_vm->getDisplayClip(), _optionPanel.sprites, spritenum + 2 + litButton, texturePoint, 256);
 		} else if (panel == &_quitPanel) {
 			texturePoint.x = _quitPanel.x + panelButton->xOffset - 3;
 			texturePoint.y = _quitPanel.y + panelButton->yOffset - 3;
-			_vm->_sprite->draw(ds, _vm->getDisplayClip(), _quitPanel.sprites, litButton, texturePoint, 256);
+			_vm->_sprite->draw(_vm->getDisplayClip(), _quitPanel.sprites, litButton, texturePoint, 256);
 		} else if (panel == &_savePanel) {
 			texturePoint.x = _savePanel.x + panelButton->xOffset - 3;
 			texturePoint.y = _savePanel.y + panelButton->yOffset - 3;
-			_vm->_sprite->draw(ds, _vm->getDisplayClip(), _savePanel.sprites, litButton, texturePoint, 256);
+			_vm->_sprite->draw(_vm->getDisplayClip(), _savePanel.sprites, litButton, texturePoint, 256);
 			// Input text box sprite
 			texturePoint.x = _savePanel.x + _saveEdit->xOffset - 2;
 			texturePoint.y = _savePanel.y + _saveEdit->yOffset - 2;
-			_vm->_sprite->draw(ds, _vm->getDisplayClip(), _savePanel.sprites, 2, texturePoint, 256);
+			_vm->_sprite->draw(_vm->getDisplayClip(), _savePanel.sprites, 2, texturePoint, 256);
 		} else if (panel == &_loadPanel) {
 			texturePoint.x = _loadPanel.x + panelButton->xOffset - 3;
 			texturePoint.y = _loadPanel.y + panelButton->yOffset - 3;
-			_vm->_sprite->draw(ds, _vm->getDisplayClip(), _loadPanel.sprites, litButton, texturePoint, 256);
+			_vm->_sprite->draw(_vm->getDisplayClip(), _loadPanel.sprites, litButton, texturePoint, 256);
 		} else {
 			// revert to default behavior
-			drawButtonBox(ds, rect, kButton, panelButton->state > 0);
+			drawButtonBox(rect, kButton, panelButton->state > 0);
 		}
 	}
 
-	_vm->_font->textDraw(textFont, ds, text, point,
+	_vm->_font->textDraw(textFont, text, point,
 		_vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(textShadowKnownColor), kFontShadow);
 }
 
-void Interface::drawPanelButtonArrow(Surface *ds, InterfacePanel *panel, PanelButton *panelButton) {
+void Interface::drawPanelButtonArrow(InterfacePanel *panel, PanelButton *panelButton) {
 	Point point;
 	int spriteNumber;
 
@@ -2366,12 +2367,12 @@
 	point.y = panel->y + panelButton->yOffset;
 
 	if (_vm->getGameType() == GType_ITE)
-		_vm->_sprite->draw(ds, _vm->getDisplayClip(), _vm->_sprite->_mainSprites, spriteNumber, point, 256);
+		_vm->_sprite->draw(_vm->getDisplayClip(), _vm->_sprite->_mainSprites, spriteNumber, point, 256);
 	else
-		_vm->_sprite->draw(ds, _vm->getDisplayClip(), _vm->_sprite->_arrowSprites, spriteNumber, point, 256);
+		_vm->_sprite->draw(_vm->getDisplayClip(), _vm->_sprite->_arrowSprites, spriteNumber, point, 256);
 }
 
-void Interface::drawVerbPanelText(Surface *ds, PanelButton *panelButton, KnownColor textKnownColor, KnownColor textShadowKnownColor) {
+void Interface::drawVerbPanelText(PanelButton *panelButton, KnownColor textKnownColor, KnownColor textShadowKnownColor) {
 	const char *text;
 	int textWidth;
 	Point point;
@@ -2396,7 +2397,9 @@
 		point.y = _mainPanel.y + panelButton->yOffset + 12;
 	}
 
-	_vm->_font->textDraw(kKnownFontVerb, ds, text, point, _vm->KnownColor2ColorId(textKnownColor),_vm->KnownColor2ColorId(textShadowKnownColor), (textShadowKnownColor != kKnownColorTransparent) ? kFontShadow : kFontNormal);
+	_vm->_font->textDraw(kKnownFontVerb, text, point, 
+						_vm->KnownColor2ColorId(textKnownColor), _vm->KnownColor2ColorId(textShadowKnownColor), 
+						(textShadowKnownColor != kKnownColorTransparent) ? kFontShadow : kFontNormal);
 }
 
 
@@ -2508,7 +2511,7 @@
 	}
 }
 
-void Interface::converseDisplayTextLines(Surface *ds) {
+void Interface::converseDisplayTextLines() {
 	int relPos;
 	byte foregnd;
 	byte backgnd;
@@ -2520,6 +2523,7 @@
 	};
 	Rect rect(8, _vm->getDisplayInfo().converseTextLines * _vm->getDisplayInfo().converseTextHeight);
 	Point textPoint;
+	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 
 	assert(_conversePanel.buttonsCount >= 6);
 
@@ -2536,9 +2540,9 @@
 		_conversePanel.y + _conversePanel.buttons[0].yOffset);
 
 	if (_vm->getGameType() == GType_ITE)
-		ds->drawRect(rect, kITEColorDarkGrey);	//fill bullet place
+		backBuffer->drawRect(rect, kITEColorDarkGrey);	//fill bullet place
 	else
-		ds->drawRect(rect, _vm->KnownColor2ColorId(kKnownColorBlack));	//fill bullet place
+		backBuffer->drawRect(rect, _vm->KnownColor2ColorId(kKnownColorBlack));	//fill bullet place
 
 	for (int i = 0; i < _vm->getDisplayInfo().converseTextLines; i++) {
 		relPos = _converseStartPos + i;
@@ -2567,7 +2571,7 @@
 
 		_conversePanel.calcPanelButtonRect(&_conversePanel.buttons[i], rect);
 		rect.left += 8;
-		ds->drawRect(rect, backgnd);
+		backBuffer->drawRect(rect, backgnd);
 
 		str = _converseText[relPos].text;
 
@@ -2576,24 +2580,24 @@
 			textPoint.y = rect.top;
 
 			if (_vm->getGameType() == GType_ITE)
-				_vm->_font->textDraw(kKnownFontSmall, ds, bullet, textPoint, bulletForegnd, bulletBackgnd, (FontEffectFlags)(kFontShadow | kFontDontmap));
+				_vm->_font->textDraw(kKnownFontSmall, bullet, textPoint, bulletForegnd, bulletBackgnd, (FontEffectFlags)(kFontShadow | kFontDontmap));
 			else
-				_vm->_font->textDraw(kKnownFontVerb, ds, bullet, textPoint, bulletForegnd, bulletBackgnd, (FontEffectFlags)(kFontShadow | kFontDontmap));
+				_vm->_font->textDraw(kKnownFontVerb, bullet, textPoint, bulletForegnd, bulletBackgnd, (FontEffectFlags)(kFontShadow | kFontDontmap));
 		}
 		textPoint.x = rect.left + 1;
 		textPoint.y = rect.top;
 		if (_vm->getGameType() == GType_ITE)
-			_vm->_font->textDraw(kKnownFontSmall, ds, str, textPoint, foregnd, kITEColorBlack, kFontShadow);
+			_vm->_font->textDraw(kKnownFontSmall, str, textPoint, foregnd, kITEColorBlack, kFontShadow);
 		else
-			_vm->_font->textDraw(kKnownFontVerb, ds, str, textPoint, foregnd, _vm->KnownColor2ColorId(kKnownColorBlack), kFontShadow);
+			_vm->_font->textDraw(kKnownFontVerb, str, textPoint, foregnd, _vm->KnownColor2ColorId(kKnownColorBlack), kFontShadow);
 	}
 
 	if (_converseStartPos != 0) {
-		drawPanelButtonArrow(ds, &_conversePanel, _converseUpButton);
+		drawPanelButtonArrow(&_conversePanel, _converseUpButton);
 	}
 
 	if (_converseStartPos != _converseEndPos) {
-		drawPanelButtonArrow(ds, &_conversePanel, _converseDownButton);
+		drawPanelButtonArrow(&_conversePanel, _converseDownButton);
 	}
 }
 
@@ -2792,7 +2796,7 @@
 	Rect screen(_vm->getDisplayWidth(), _vm->_scene->getHeight());
 
 	if (screen.contains(mapPosition)) {
-		_vm->_sprite->draw(_vm->_gfx->getBackBuffer(), _vm->getDisplayClip(), _vm->_sprite->_mainSprites,
+		_vm->_sprite->draw(_vm->getDisplayClip(), _vm->_sprite->_mainSprites,
 						   _mapPanelCrossHairState? RID_ITE_SPR_CROSSHAIR : RID_ITE_SPR_CROSSHAIR + 1,
 						   mapPosition, 256);
 	}

Modified: scummvm/trunk/engines/saga/interface.h
===================================================================
--- scummvm/trunk/engines/saga/interface.h	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/interface.h	2008-12-06 14:24:40 UTC (rev 35260)
@@ -256,7 +256,7 @@
 	}
 
 private:
-	void drawInventory(Surface *backBuffer);
+	void drawInventory();
 	void updateInventory(int pos);
 	void inventoryChangePos(int chg);
 	void inventorySetPos(int key);
@@ -339,18 +339,18 @@
 	void setLoad(PanelButton *panelButton);
 	void setSave(PanelButton *panelButton);
 
-	void drawTextInput(Surface *ds, InterfacePanel *panel, PanelButton *panelButton);
-	void drawPanelText(Surface *ds, InterfacePanel *panel, PanelButton *panelButton);
-	void drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelButton *panelButton, int spritenum = 0);
+	void drawTextInput(InterfacePanel *panel, PanelButton *panelButton);
+	void drawPanelText(InterfacePanel *panel, PanelButton *panelButton);
+	void drawPanelButtonText(InterfacePanel *panel, PanelButton *panelButton, int spritenum = 0);
 	enum ButtonKind {
 		kButton,
 		kSlider,
 		kEdit
 	};
-	void drawButtonBox(Surface *ds, const Rect &rect, ButtonKind kind, bool down);
-	void drawPanelButtonArrow(Surface *ds, InterfacePanel *panel, PanelButton *panelButton);
-	void drawVerbPanelText(Surface *ds, PanelButton *panelButton, KnownColor textKnownColor, KnownColor textShadowKnownColor);
-	void drawVerbPanel(Surface *backBuffer, PanelButton* panelButton);
+	void drawButtonBox(const Rect &rect, ButtonKind kind, bool down);
+	void drawPanelButtonArrow(InterfacePanel *panel, PanelButton *panelButton);
+	void drawVerbPanelText(PanelButton *panelButton, KnownColor textKnownColor, KnownColor textShadowKnownColor);
+	void drawVerbPanel(PanelButton* panelButton);
 	void calcOptionSaveSlider();
 	bool processTextInput(Common::KeyState keystate);
 	void processStatusTextInput(Common::KeyState keystate);
@@ -365,7 +365,7 @@
 	void converseSetPos(int key);
 
 private:
-	void converseDisplayTextLines(Surface *ds);
+	void converseDisplayTextLines();
 	PanelButton *getPanelButtonByVerbType(int verb) {
 		if ((verb < 0) || (verb >= kVerbTypeIdsMax)) {
 			error("Interface::getPanelButtonByVerbType wrong verb");

Modified: scummvm/trunk/engines/saga/isomap.cpp
===================================================================
--- scummvm/trunk/engines/saga/isomap.cpp	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/isomap.cpp	2008-12-06 14:24:40 UTC (rev 35260)
@@ -377,10 +377,9 @@
 }
 
 void IsoMap::draw(Surface *ds) {
-
 	_tileClip = _vm->_scene->getSceneClip();
 	ds->drawRect(_tileClip, 0);
-	drawTiles(ds, NULL);
+	drawTiles(NULL);
 }
 
 void IsoMap::setMapPosition(int x, int y) {
@@ -388,7 +387,7 @@
 	_mapPosition.y = y;
 }
 
-void IsoMap::drawSprite(Surface *ds, SpriteList &spriteList, int spriteNumber, const Location &location, const Point &screenPosition, int scale) {
+void IsoMap::drawSprite(SpriteList &spriteList, int spriteNumber, const Location &location, const Point &screenPosition, int scale) {
 	int width;
 	int height;
 	int xAlign;
@@ -407,12 +406,12 @@
 	_tileClip.top = CLIP<int>(spritePointer.y, 0, _vm->_scene->getHeight());
 	_tileClip.bottom = CLIP<int>(spritePointer.y + height, 0, _vm->_scene->getHeight());
 
-	_vm->_sprite->drawClip(ds, clip, spritePointer, width, height, spriteBuffer);
-	drawTiles(ds, &location);
+	_vm->_sprite->drawClip(clip, spritePointer, width, height, spriteBuffer);
+	drawTiles(&location);
 }
 
 
-void IsoMap::drawTiles(Surface *ds, const Location *location) {
+void IsoMap::drawTiles(const Location *location) {
 	Point view1;
 	Point fineScroll;
 	Point tileScroll;
@@ -480,9 +479,9 @@
 				rLocation.u() = location->u() - (u2 << 7);
 				rLocation.v() = location->v() - (v2 << 7);
 				rLocation.z = location->z;
-				drawSpriteMetaTile(ds, metaTileIndex, metaTileX, rLocation, u2 << 3, v2 << 3);
+				drawSpriteMetaTile(metaTileIndex, metaTileX, rLocation, u2 << 3, v2 << 3);
 			} else {
-				drawMetaTile(ds, metaTileIndex, metaTileX, u2 << 3, v2 << 3);
+				drawMetaTile(metaTileIndex, metaTileX, u2 << 3, v2 << 3);
 			}
 		}
 
@@ -524,9 +523,9 @@
 				rLocation.u() = location->u() - (u2 << 7);
 				rLocation.v() = location->v() - (v2 << 7);
 				rLocation.z = location->z;
-				drawSpriteMetaTile(ds, metaTileIndex, metaTileX, rLocation, u2 << 3, v2 << 3);
+				drawSpriteMetaTile(metaTileIndex, metaTileX, rLocation, u2 << 3, v2 << 3);
 			} else {
-				drawMetaTile(ds, metaTileIndex, metaTileX, u2 << 3, v2 << 3);
+				drawMetaTile(metaTileIndex, metaTileX, u2 << 3, v2 << 3);
 			}
 		}
 		metaTileY.y += 64;
@@ -534,7 +533,7 @@
 
 }
 
-void IsoMap::drawSpriteMetaTile(Surface *ds, uint16 metaTileIndex, const Point &point, Location &location, int16 absU, int16 absV) {
+void IsoMap::drawSpriteMetaTile(uint16 metaTileIndex, const Point &point, Location &location, int16 absU, int16 absV) {
 	MetaTileData * metaTile;
 	uint16 high;
 	int16 platformIndex;
@@ -556,12 +555,12 @@
 		platformIndex = metaTile->stack[high];
 
 		if (platformIndex >= 0) {
-			drawSpritePlatform( ds, platformIndex, platformPoint, location, absU, absV, high );
+			drawSpritePlatform(platformIndex, platformPoint, location, absU, absV, high);
 		}
 	}
 }
 
-void IsoMap::drawMetaTile(Surface *ds, uint16 metaTileIndex, const Point &point, int16 absU, int16 absV) {
+void IsoMap::drawMetaTile(uint16 metaTileIndex, const Point &point, int16 absU, int16 absV) {
 	MetaTileData * metaTile;
 	uint16 high;
 	int16 platformIndex;
@@ -583,12 +582,12 @@
 		platformIndex = metaTile->stack[high];
 
 		if (platformIndex >= 0) {
-			drawPlatform( ds, platformIndex, platformPoint, absU, absV, high );
+			drawPlatform(platformIndex, platformPoint, absU, absV, high);
 		}
 	}
 }
 
-void IsoMap::drawSpritePlatform(Surface *ds, uint16 platformIndex, const Point &point, const Location &location, int16 absU, int16 absV, int16 absH) {
+void IsoMap::drawSpritePlatform(uint16 platformIndex, const Point &point, const Location &location, int16 absU, int16 absV, int16 absH) {
 	TilePlatformData *tilePlatform;
 	int16 u, v;
 	Point s;
@@ -636,14 +635,14 @@
 						tileIndex = findMulti(tileIndex, absU + u, absV + v, absH);
 					}
 
-					drawTile(ds, tileIndex, s, &copyLocation);
+					drawTile(tileIndex, s, &copyLocation);
 				}
 			}
 		}
 	}
 }
 
-void IsoMap::drawPlatform(Surface *ds, uint16 platformIndex, const Point &point, int16 absU, int16 absV, int16 absH) {
+void IsoMap::drawPlatform(uint16 platformIndex, const Point &point, int16 absU, int16 absV, int16 absH) {
 	TilePlatformData *tilePlatform;
 	int16 u, v;
 	Point s;
@@ -688,7 +687,7 @@
 						tileIndex = findMulti(tileIndex, absU + u, absV + v, absH);
 					}
 
-					drawTile(ds, tileIndex, s, NULL);
+					drawTile(tileIndex, s, NULL);
 				}
 			}
 		}
@@ -699,7 +698,7 @@
 #define THRESH8			8
 #define THRESH16		16
 
-void IsoMap::drawTile(Surface *ds, uint16 tileIndex, const Point &point, const Location *location) {
+void IsoMap::drawTile(uint16 tileIndex, const Point &point, const Location *location) {
 	const byte *tilePointer;
 	const byte *readPointer;
 	byte *drawPointer;
@@ -709,8 +708,8 @@
 	int row, col, count, lowBound;
 	int bgRunCount;
 	int fgRunCount;
+	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 
-
 	if (tileIndex >= _tilesCount) {
 		error("IsoMap::drawTile wrong tileIndex");
 	}
@@ -833,7 +832,7 @@
 	for (row = drawPoint.y; row < lowBound; row++) {
 		widthCount = 0;
 		if (row >= _tileClip.top) {
-			drawPointer = (byte *)ds->pixels + drawPoint.x + (row * ds->pitch);
+			drawPointer = (byte *)backBuffer->pixels + drawPoint.x + (row * backBuffer->pitch);
 			col = drawPoint.x;
 			for (;;) {
 				bgRunCount = *readPointer++;
@@ -853,8 +852,8 @@
 					col++;
 				}
 				while ((col < _tileClip.right) && (count < fgRunCount)) {
-					assert((byte *)ds->pixels <= (byte *)(drawPointer + count));
-					assert((byte *)((byte *)ds->pixels + (_vm->getDisplayWidth() *
+					assert((byte *)backBuffer->pixels <= (byte *)(drawPointer + count));
+					assert((byte *)((byte *)backBuffer->pixels + (_vm->getDisplayWidth() *
 								 _vm->getDisplayHeight())) > (byte *)(drawPointer + count));
 					drawPointer[count] = readPointer[count];
 					count++;

Modified: scummvm/trunk/engines/saga/isomap.h
===================================================================
--- scummvm/trunk/engines/saga/isomap.h	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/isomap.h	2008-12-06 14:24:40 UTC (rev 35260)
@@ -163,7 +163,7 @@
 	void loadMulti(const byte * resourcePointer, size_t resourceLength);
 	void freeMem();
 	void draw(Surface *ds);
-	void drawSprite(Surface *ds, SpriteList &spriteList, int spriteNumber, const Location &location, const Point &screenPosition, int scale);
+	void drawSprite(SpriteList &spriteList, int spriteNumber, const Location &location, const Point &screenPosition, int scale);
 	void adjustScroll(bool jump);
 	void tileCoordsToScreenPoint(const Location &location, Point &position) {
 		position.x = location.u() - location.v() + (128 * SAGA_TILEMAP_W) - _viewScroll.x + 16;
@@ -181,12 +181,12 @@
 	int16 getTileIndex(int16 u, int16 v, int16 z);
 
 private:
-	void drawTiles(Surface *ds, const Location *location);
-	void drawMetaTile(Surface *ds, uint16 metaTileIndex, const Point &point, int16 absU, int16 absV);
-	void drawSpriteMetaTile(Surface *ds, uint16 metaTileIndex, const Point &point, Location &location, int16 absU, int16 absV);
-	void drawPlatform(Surface *ds, uint16 platformIndex, const Point &point, int16 absU, int16 absV, int16 absH);
-	void drawSpritePlatform(Surface *ds, uint16 platformIndex, const Point &point, const Location &location, int16 absU, int16 absV, int16 absH);
-	void drawTile(Surface *ds, uint16 tileIndex, const Point &point, const Location *location);
+	void drawTiles(const Location *location);
+	void drawMetaTile(uint16 metaTileIndex, const Point &point, int16 absU, int16 absV);
+	void drawSpriteMetaTile(uint16 metaTileIndex, const Point &point, Location &location, int16 absU, int16 absV);
+	void drawPlatform(uint16 platformIndex, const Point &point, int16 absU, int16 absV, int16 absH);
+	void drawSpritePlatform(uint16 platformIndex, const Point &point, const Location &location, int16 absU, int16 absV, int16 absH);
+	void drawTile(uint16 tileIndex, const Point &point, const Location *location);
 	int16 smoothSlide(int16 value, int16 min, int16 max) {
 		if (value < min) {
 			if (value < min - 100 || value > min - 4) {

Modified: scummvm/trunk/engines/saga/objectmap.cpp
===================================================================
--- scummvm/trunk/engines/saga/objectmap.cpp	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/objectmap.cpp	2008-12-06 14:24:40 UTC (rev 35260)
@@ -142,7 +142,7 @@
 }
 
 #ifdef SAGA_DEBUG
-void HitZone::draw(SagaEngine *vm, Surface *ds, int color) {
+void HitZone::draw(SagaEngine *vm, int color) {
 	int i, pointsCount, j;
 	Location location;
 	HitZone::ClickArea *clickArea;
@@ -237,7 +237,7 @@
 
 
 #ifdef SAGA_DEBUG
-void ObjectMap::draw(Surface *ds, const Point& testPoint, int color, int color2) {
+void ObjectMap::draw(const Point& testPoint, int color, int color2) {
 	int i;
 	int hitZoneIndex;
 	char txtBuf[32];
@@ -255,14 +255,14 @@
 	hitZoneIndex = hitTest(pickPoint);
 
 	for (i = 0; i < _hitZoneListCount; i++) {
-		_hitZoneList[i]->draw(_vm, ds, (hitZoneIndex == i) ? color2 : color);
+		_hitZoneList[i]->draw(_vm, (hitZoneIndex == i) ? color2 : color);
 	}
 
 	if (hitZoneIndex != -1) {
 		snprintf(txtBuf, sizeof(txtBuf), "hitZone %d", hitZoneIndex);
 		textPoint.x = 2;
 		textPoint.y = 2;
-		_vm->_font->textDraw(kKnownFontSmall, ds, txtBuf, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
+		_vm->_font->textDraw(kKnownFontSmall, txtBuf, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
 	}
 }
 #endif

Modified: scummvm/trunk/engines/saga/objectmap.h
===================================================================
--- scummvm/trunk/engines/saga/objectmap.h	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/objectmap.h	2008-12-06 14:24:40 UTC (rev 35260)
@@ -77,7 +77,7 @@
 	}
 	bool getSpecialPoint(Point &specialPoint) const;
 #ifdef SAGA_DEBUG
-	void draw(SagaEngine *vm, Surface *ds, int color);
+	void draw(SagaEngine *vm, int color);
 #endif
 	bool hitTest(const Point &testPoint);
 

Modified: scummvm/trunk/engines/saga/puzzle.cpp
===================================================================
--- scummvm/trunk/engines/saga/puzzle.cpp	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/puzzle.cpp	2008-12-06 14:24:40 UTC (rev 35260)
@@ -189,14 +189,13 @@
 	ActorData *puzzle = _vm->_actor->getActor(_vm->_actor->actorIndexToId(ITE_ACTOR_PUZZLE));
 	int frameNumber;
 	SpriteList *spriteList;
-	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 	_vm->_actor->getSpriteParams(puzzle, frameNumber, spriteList);
 
 	for (int j = PUZZLE_PIECES - 1 ; j >= 0; j--) {
 		int num = _piecePriority[j];
 
 		if (_puzzlePiece != num) {
-			_vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), *spriteList, num, Point(_pieceInfo[num].curX, _pieceInfo[num].curY), 256);
+			_vm->_sprite->draw(_vm->getDisplayClip(), *spriteList, num, Point(_pieceInfo[num].curX, _pieceInfo[num].curY), 256);
 		}
 	}
 }
@@ -207,7 +206,7 @@
 	SpriteList *spriteList;
 	_vm->_actor->getSpriteParams(puzzle, frameNumber, spriteList);
 
-	_vm->_sprite->draw(_vm->_gfx->getBackBuffer(), _vm->_scene->getSceneClip(), *spriteList, _puzzlePiece,
+	_vm->_sprite->draw(_vm->_scene->getSceneClip(), *spriteList, _puzzlePiece,
 			   Point(_pieceInfo[_puzzlePiece].curX, _pieceInfo[_puzzlePiece].curY), 256);
 }
 

Modified: scummvm/trunk/engines/saga/render.cpp
===================================================================
--- scummvm/trunk/engines/saga/render.cpp	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/render.cpp	2008-12-06 14:24:40 UTC (rev 35260)
@@ -155,7 +155,7 @@
 	}
 
 	// Draw queued text strings
-	_vm->_scene->drawTextList(backBufferSurface);
+	_vm->_scene->drawTextList();
 
 	// Handle user input
 	_vm->processInput();
@@ -178,7 +178,7 @@
 		textPoint.x = (backBufferSurface->w - _vm->_font->getStringWidth(kKnownFontPause, pauseString, 0, kFontOutline)) / 2;
 		textPoint.y = 90;
 
-		_vm->_font->textDraw(kKnownFontPause, backBufferSurface, pauseString, textPoint, 
+		_vm->_font->textDraw(kKnownFontPause, pauseString, textPoint, 
 							_vm->KnownColor2ColorId(kKnownColorBrightWhite), _vm->KnownColor2ColorId(kKnownColorBlack), kFontOutline);
 	}
 
@@ -189,7 +189,7 @@
 	// Display text formatting test, if applicable
 	if (_flags & RF_TEXT_TEST) {
 		Rect rect(mousePoint.x, mousePoint.y, mousePoint.x + 100, mousePoint.y + 50);
-		_vm->_font->textDrawRect(kKnownFontMedium, backBufferSurface, test_txt, rect,
+		_vm->_font->textDrawRect(kKnownFontMedium, test_txt, rect,
 				kITEColorBrightWhite, kITEColorBlack, (FontEffectFlags)(kFontOutline | kFontCentered));
 	}
 

Modified: scummvm/trunk/engines/saga/scene.cpp
===================================================================
--- scummvm/trunk/engines/saga/scene.cpp	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/scene.cpp	2008-12-06 14:24:40 UTC (rev 35260)
@@ -233,7 +233,7 @@
 	}
 }
 
-void Scene::drawTextList(Surface *ds) {
+void Scene::drawTextList() {
 	TextListEntry *entry;
 
 	for (TextList::iterator textIterator = _textList.begin(); textIterator != _textList.end(); ++textIterator) {
@@ -241,9 +241,9 @@
 		if (entry->display) {
 
 			if (entry->useRect) {
-				_vm->_font->textDrawRect(entry->font, ds, entry->text, entry->rect, _vm->KnownColor2ColorId(entry->knownColor), _vm->KnownColor2ColorId(entry->effectKnownColor), entry->flags);
+				_vm->_font->textDrawRect(entry->font, entry->text, entry->rect, _vm->KnownColor2ColorId(entry->knownColor), _vm->KnownColor2ColorId(entry->effectKnownColor), entry->flags);
 			} else {
-				_vm->_font->textDraw(entry->font, ds, entry->text, entry->point, _vm->KnownColor2ColorId(entry->knownColor), _vm->KnownColor2ColorId(entry->effectKnownColor), entry->flags);
+				_vm->_font->textDraw(entry->font, entry->text, entry->point, _vm->KnownColor2ColorId(entry->knownColor), _vm->KnownColor2ColorId(entry->effectKnownColor), entry->flags);
 			}
 		}
 	}
@@ -455,7 +455,6 @@
 	if (_vm->getFeatures() & GF_SCENE_SUBSTITUTES) {
 		for (int i = 0; i < ARRAYSIZE(sceneSubstitutes); i++) {
 			if (sceneSubstitutes[i].sceneId == sceneNumber) {
-				Surface *backBuffer = _vm->_gfx->getBackBuffer();
 				Surface bbmBuffer;
 				byte *pal, *colors;
 				Common::File file;
@@ -469,7 +468,7 @@
 					colors = pal;
 					rect.setWidth(bbmBuffer.w);
 					rect.setHeight(bbmBuffer.h);
-					backBuffer->blit(rect, (const byte*)bbmBuffer.pixels);
+					_vm->_gfx->getBackBuffer()->blit(rect, (const byte*)bbmBuffer.pixels);
 					for (int j = 0; j < PAL_ENTRIES; j++) {
 						cPal[j].red = *pal++;
 						cPal[j].green = *pal++;
@@ -481,9 +480,9 @@
 				}
 
 				_vm->_interface->setStatusText("Click or Press Return to continue. Press Q to quit.", 96);
-				_vm->_font->textDrawRect(kKnownFontMedium, backBuffer, sceneSubstitutes[i].title,
+				_vm->_font->textDrawRect(kKnownFontMedium, sceneSubstitutes[i].title,
 					 Common::Rect(0, 7, _vm->getDisplayWidth(), 27), _vm->KnownColor2ColorId(kKnownColorBrightWhite), _vm->KnownColor2ColorId(kKnownColorBlack), kFontOutline);
-				_vm->_font->textDrawRect(kKnownFontMedium, backBuffer, sceneSubstitutes[i].message,
+				_vm->_font->textDrawRect(kKnownFontMedium, sceneSubstitutes[i].message,
 					 Common::Rect(24, getHeight() - 33, _vm->getDisplayWidth() - 11,
 								  getHeight()), _vm->KnownColor2ColorId(kKnownColorBrightWhite), _vm->KnownColor2ColorId(kKnownColorBlack), kFontOutline);
 				return;

Modified: scummvm/trunk/engines/saga/scene.h
===================================================================
--- scummvm/trunk/engines/saga/scene.h	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/scene.h	2008-12-06 14:24:40 UTC (rev 35260)
@@ -345,7 +345,7 @@
 			_vm->_framesEsc = 1;
 	}
 
-	void drawTextList(Surface *ds);
+	void drawTextList();
 
 	int getHeight(bool speech = false) const {
 		if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8 && !speech)

Modified: scummvm/trunk/engines/saga/sprite.cpp
===================================================================
--- scummvm/trunk/engines/saga/sprite.cpp	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/sprite.cpp	2008-12-06 14:24:40 UTC (rev 35260)
@@ -211,15 +211,16 @@
 	}
 }
 
-void Sprite::drawClip(Surface *ds, const Rect &clipRect, const Point &spritePointer, int width, int height, const byte *spriteBuffer) {
+void Sprite::drawClip(const Rect &clipRect, const Point &spritePointer, int width, int height, const byte *spriteBuffer) {
 	int clipWidth;
 	int clipHeight;
 
 	int i, j, jo, io;
 	byte *bufRowPointer;
 	const byte *srcRowPointer;
+	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 
-	bufRowPointer = (byte *)ds->pixels + ds->pitch * spritePointer.y;
+	bufRowPointer = (byte *)backBuffer->pixels + backBuffer->pitch * spritePointer.y;
 	srcRowPointer = spriteBuffer;
 
 	clipWidth = CLIP(width, 0, clipRect.right - spritePointer.x);
@@ -232,14 +233,14 @@
 	}
 	if (spritePointer.y < clipRect.top) {
 		io = clipRect.top - spritePointer.y;
-		bufRowPointer += ds->pitch * io;
+		bufRowPointer += backBuffer->pitch * io;
 		srcRowPointer += width * io;
 	}
 
 	for (i = io; i < clipHeight; i++) {
 		for (j = jo; j < clipWidth; j++) {
-			assert((byte *)ds->pixels <= (byte *)(bufRowPointer + j + spritePointer.x));
-			assert(((byte *)ds->pixels + (_vm->getDisplayWidth() *
+			assert((byte *)backBuffer->pixels <= (byte *)(bufRowPointer + j + spritePointer.x));
+			assert(((byte *)backBuffer->pixels + (_vm->getDisplayWidth() *
 				 _vm->getDisplayHeight())) > (byte *)(bufRowPointer + j + spritePointer.x));
 			assert((const byte *)spriteBuffer <= (const byte *)(srcRowPointer + j));
 			assert(((const byte *)spriteBuffer + (width * height)) > (const byte *)(srcRowPointer + j));
@@ -248,12 +249,12 @@
 				*(bufRowPointer + j + spritePointer.x) = *(srcRowPointer + j);
 			}
 		}
-		bufRowPointer += ds->pitch;
+		bufRowPointer += backBuffer->pitch;
 		srcRowPointer += width;
 	}
 }
 
-void Sprite::draw(Surface *ds, const Rect &clipRect, SpriteList &spriteList, int32 spriteNumber, const Point &screenCoord, int scale) {
+void Sprite::draw(const Rect &clipRect, SpriteList &spriteList, int32 spriteNumber, const Point &screenCoord, int scale) {
 	const byte *spriteBuffer = NULL;
 	int width  = 0;
 	int height = 0;
@@ -266,10 +267,10 @@
 	spritePointer.x = screenCoord.x + xAlign;
 	spritePointer.y = screenCoord.y + yAlign;
 
-	drawClip(ds, clipRect, spritePointer, width, height, spriteBuffer);
+	drawClip(clipRect, spritePointer, width, height, spriteBuffer);
 }
 
-void Sprite::draw(Surface *ds, const Rect &clipRect, SpriteList &spriteList, int32 spriteNumber, const Rect &screenRect, int scale) {
+void Sprite::draw(const Rect &clipRect, SpriteList &spriteList, int32 spriteNumber, const Rect &screenRect, int scale) {
 	const byte *spriteBuffer = NULL;
 	int width  = 0;
 	int height = 0;
@@ -290,7 +291,7 @@
 	}
 	spritePointer.x = screenRect.left + xAlign + spw;
 	spritePointer.y = screenRect.top + yAlign + sph;
-	drawClip(ds, clipRect, spritePointer, width, height, spriteBuffer);
+	drawClip(clipRect, spritePointer, width, height, spriteBuffer);
 }
 
 bool Sprite::hitTest(SpriteList &spriteList, int spriteNumber, const Point &screenCoord, int scale, const Point &testPoint) {
@@ -320,7 +321,7 @@
 	return *srcRowPointer != 0;
 }
 
-void Sprite::drawOccluded(Surface *ds, const Rect &clipRect, SpriteList &spriteList, int spriteNumber, const Point &screenCoord, int scale, int depth) {
+void Sprite::drawOccluded(const Rect &clipRect, SpriteList &spriteList, int spriteNumber, const Point &screenCoord, int scale, int depth) {
 	const byte *spriteBuffer = NULL;
 	int x, y;
 	byte *destRowPointer;
@@ -332,6 +333,7 @@
 	int height = 0;
 	int xAlign = 0;
 	int yAlign = 0;
+	Surface *backBuffer = _vm->_gfx->getBackBuffer();
 
 	ClipData clipData;
 
@@ -344,7 +346,7 @@
 	int maskZ;
 
 	if (!_vm->_scene->isBGMaskPresent()) {
-		draw(ds, clipRect, spriteList, spriteNumber, screenCoord, scale);
+		draw(clipRect, spriteList, spriteNumber, screenCoord, scale);
 		return;
 	}
 
@@ -369,7 +371,7 @@
 	// Finally, draw the occluded sprite
 
 	sourceRowPointer = spriteBuffer + clipData.drawSource.x + (clipData.drawSource.y * width);
-	destRowPointer = (byte *)ds->pixels + clipData.drawDest.x + (clipData.drawDest.y * ds->pitch);
+	destRowPointer = (byte *)backBuffer->pixels + clipData.drawDest.x + (clipData.drawDest.y * backBuffer->pitch);
 	maskRowPointer = maskBuffer + clipData.drawDest.x + (clipData.drawDest.y * maskWidth);
 
 	for (y = 0; y < clipData.drawHeight; y++) {
@@ -387,7 +389,7 @@
 			destPointer++;
 			maskPointer++;
 		}
-		destRowPointer += ds->pitch;
+		destRowPointer += backBuffer->pitch;
 		maskRowPointer += maskWidth;
 		sourceRowPointer += width;
 	}

Modified: scummvm/trunk/engines/saga/sprite.h
===================================================================
--- scummvm/trunk/engines/saga/sprite.h	2008-12-06 13:35:27 UTC (rev 35259)
+++ scummvm/trunk/engines/saga/sprite.h	2008-12-06 14:24:40 UTC (rev 35260)
@@ -74,15 +74,15 @@
 	~Sprite(void);
 
 	// draw scaled sprite using background scene mask
-	void drawOccluded(Surface *ds, const Rect &clipRect, SpriteList &spriteList, int spriteNumber, const Point &screenCoord, int scale, int depth);
+	void drawOccluded(const Rect &clipRect, SpriteList &spriteList, int spriteNumber, const Point &screenCoord, int scale, int depth);
 
 	// draw scaled sprite using background scene mask
-	void draw(Surface *ds, const Rect &clipRect, SpriteList &spriteList, int32 spriteNumber, const Point &screenCoord, int scale);
+	void draw(const Rect &clipRect, SpriteList &spriteList, int32 spriteNumber, const Point &screenCoord, int scale);
 
 	// main function
-	void drawClip(Surface *ds, const Rect &clipRect, const Point &spritePointer, int width, int height, const byte *spriteBuffer);
+	void drawClip(const Rect &clipRect, const Point &spritePointer, int width, int height, const byte *spriteBuffer);
 
-	void draw(Surface *ds, const Rect &clipRect, SpriteList &spriteList, int32 spriteNumber, const Rect &screenRect, int scale);
+	void draw(const Rect &clipRect, SpriteList &spriteList, int32 spriteNumber, const Rect &screenRect, int scale);
 
 	void loadList(int resourceId, SpriteList &spriteList); // load or append spriteList
 	bool hitTest(SpriteList &spriteList, int spriteNumber, const Point &screenCoord, int scale, const Point &testPoint);


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