[Scummvm-cvs-logs] scummvm master -> 98efd444074e3c9d42a4a646ffb2445348c6a0e8

wjp wjp at usecode.org
Wed Oct 2 10:56:27 CEST 2013


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

Summary:
9bbbcf268d SAGA: Clean up variable scope
98efd44407 WINTERMUTE: Remove unused _drawNum


Commit: 9bbbcf268d72261d7d82a13d0652c9fa59abc7d7
    https://github.com/scummvm/scummvm/commit/9bbbcf268d72261d7d82a13d0652c9fa59abc7d7
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-10-02T01:52:40-07:00

Commit Message:
SAGA: Clean up variable scope

Changed paths:
    engines/saga/sprite.cpp



diff --git a/engines/saga/sprite.cpp b/engines/saga/sprite.cpp
index fe281af..bf55065 100644
--- a/engines/saga/sprite.cpp
+++ b/engines/saga/sprite.cpp
@@ -71,17 +71,7 @@ Sprite::~Sprite() {
 }
 
 void Sprite::loadList(int resourceId, SpriteList &spriteList) {
-	SpriteInfo *spriteInfo;
 	ByteArray spriteListData;
-	uint16 oldSpriteCount;
-	uint16 newSpriteCount;
-	uint16 spriteCount;
-	uint i;
-	int outputLength, inputLength;
-	uint32 offset;
-	const byte *spritePointer;
-	const byte *spriteDataPointer;
-
 	_vm->_resource->loadResource(_spriteContext, resourceId, spriteListData);
 
 	if (spriteListData.empty()) {
@@ -90,18 +80,19 @@ void Sprite::loadList(int resourceId, SpriteList &spriteList) {
 
 	ByteArrayReadStreamEndian readS(spriteListData, _spriteContext->isBigEndian());
 
-	spriteCount = readS.readUint16();
+	uint16 spriteCount = readS.readUint16();
 
 	debug(9, "Sprites: %d", spriteCount);
 
-	oldSpriteCount = spriteList.size();
-	newSpriteCount = oldSpriteCount + spriteCount;
+	uint16 oldSpriteCount = spriteList.size();
+	uint16 newSpriteCount = oldSpriteCount + spriteCount;
 
 	spriteList.resize(newSpriteCount);
 
 	bool bigHeader = _vm->getGameId() == GID_IHNM || _vm->isMacResources();
 
-	for (i = oldSpriteCount; i < spriteList.size(); i++) {
+	for (uint i = oldSpriteCount; i < spriteList.size(); i++) {
+		uint32 offset;
 		if (bigHeader)
 			offset = readS.readUint32();
 		else
@@ -114,10 +105,11 @@ void Sprite::loadList(int resourceId, SpriteList &spriteList) {
 			return;
 		}
 
-		spritePointer = spriteListData.getBuffer();
+		const byte *spritePointer = spriteListData.getBuffer();
 		spritePointer += offset;
-		spriteInfo = &spriteList[i];
 
+		const byte *spriteDataPointer;
+		SpriteInfo *spriteInfo = &spriteList[i];
 		if (bigHeader) {
 			Common::MemoryReadStreamEndian readS2(spritePointer, 8, _spriteContext->isBigEndian());
 
@@ -139,8 +131,8 @@ void Sprite::loadList(int resourceId, SpriteList &spriteList) {
 			spriteDataPointer = spritePointer + readS2.pos();
 		}
 
-		outputLength = spriteInfo->width * spriteInfo->height;
-		inputLength = spriteListData.size() - (spriteDataPointer - spriteListData.getBuffer());
+		int outputLength = spriteInfo->width * spriteInfo->height;
+		int inputLength = spriteListData.size() - (spriteDataPointer - spriteListData.getBuffer());
 		spriteInfo->decodedBuffer.resize(outputLength);
 		if (outputLength > 0) {
 			decodeRLEBuffer(spriteDataPointer, inputLength, outputLength);


Commit: 98efd444074e3c9d42a4a646ffb2445348c6a0e8
    https://github.com/scummvm/scummvm/commit/98efd444074e3c9d42a4a646ffb2445348c6a0e8
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-10-02T01:54:43-07:00

Commit Message:
WINTERMUTE: Remove unused _drawNum

Changed paths:
    engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
    engines/wintermute/base/gfx/osystem/base_render_osystem.h



diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index 3eba3b3..b53aef8 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
@@ -51,7 +51,6 @@ BaseRenderer *makeOSystemRenderer(BaseGame *inGame) {
 BaseRenderOSystem::BaseRenderOSystem(BaseGame *inGame) : BaseRenderer(inGame) {
 	_renderSurface = new Graphics::Surface();
 	_blankSurface = new Graphics::Surface();
-	_drawNum = 1;
 	_lastFrameIter = _renderQueue.end();
 	_needsFlip = true;
 	_skipThisFrame = false;
@@ -159,7 +158,6 @@ bool BaseRenderOSystem::flip() {
 		_needsFlip = false;
 
 		// Reset ticketing state
-		_drawNum = 1;
 		_lastFrameIter = _renderQueue.end();
 		RenderQueueIterator it;
 		for (it = _renderQueue.begin(); it != _renderQueue.end(); ++it) {
@@ -195,7 +193,6 @@ bool BaseRenderOSystem::flip() {
 		g_system->updateScreen();
 		_needsFlip = false;
 	}
-	_drawNum = 1;
 	_lastFrameIter = _renderQueue.end();
 
 	return STATUS_OK;
@@ -326,7 +323,6 @@ void BaseRenderOSystem::invalidateTicketsFromSurface(BaseSurfaceOSystem *surf) {
 void BaseRenderOSystem::drawFromTicket(RenderTicket *renderTicket) {
 	renderTicket->_wantsDraw = true;
 
-	_drawNum++;
 	++_lastFrameIter;
 	// In-order
 	if (_renderQueue.empty() || _lastFrameIter == _renderQueue.end()) {
@@ -349,10 +345,8 @@ void BaseRenderOSystem::drawFromQueuedTicket(const RenderQueueIterator &ticket)
 	renderTicket->_wantsDraw = true;
 
 	++_lastFrameIter;
-	// Was drawn last round, still in the same order
-	if (*_lastFrameIter == renderTicket) {
-		_drawNum++;
-	} else {
+	// Not in the same order?
+	if (*_lastFrameIter != renderTicket) {
 		--_lastFrameIter;
 		// Remove the ticket from the list
 		assert(*_lastFrameIter != renderTicket);
@@ -399,11 +393,9 @@ void BaseRenderOSystem::drawTickets() {
 
 	// Apply the clear-color to the dirty rect.
 	_renderSurface->fillRect(*_dirtyRect, _clearColor);
-	_drawNum = 1;
 	_lastFrameIter = _renderQueue.end();
 	for (it = _renderQueue.begin(); it != _renderQueue.end(); ++it) {
 		RenderTicket *ticket = *it;
-		++_drawNum;
 		if (ticket->_dstRect.intersects(*_dirtyRect)) {
 			// dstClip is the area we want redrawn.
 			Common::Rect dstClip(ticket->_dstRect);
@@ -561,7 +553,6 @@ void BaseRenderOSystem::endSaveLoad() {
 	// HACK: After a save the buffer will be drawn before the scripts get to update it,
 	// so just skip this single frame.
 	_skipThisFrame = true;
-	_drawNum = 1;
 	_lastFrameIter = _renderQueue.end();
 
 	_renderSurface->fillRect(Common::Rect(0, 0, _renderSurface->h, _renderSurface->w), _renderSurface->format.ARGBToColor(255, 0, 0, 0));
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.h b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
index 6dc8948..fa0b2af 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.h
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
@@ -130,7 +130,6 @@ private:
 	Common::List<RenderTicket *> _renderQueue;
 
 	bool _needsFlip;
-	uint32 _drawNum; ///< The global number of the current draw-operation.
 	RenderQueueIterator _lastFrameIter;
 	Common::Rect _renderRect;
 	Graphics::Surface *_renderSurface;






More information about the Scummvm-git-logs mailing list