[Scummvm-cvs-logs] scummvm master -> 629d55cdfad91a993eff7406fa2ca2b09d0d295d

eriktorbjorn eriktorbjorn at telia.com
Tue Aug 14 09:10:04 CEST 2012


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:
629d55cdfa CINE: Apply some ScummVM formatting conventions


Commit: 629d55cdfad91a993eff7406fa2ca2b09d0d295d
    https://github.com/scummvm/scummvm/commit/629d55cdfad91a993eff7406fa2ca2b09d0d295d
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2012-08-14T00:09:08-07:00

Commit Message:
CINE: Apply some ScummVM formatting conventions

Changed paths:
    engines/cine/gfx.cpp



diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 3fac973..cce8154 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -249,8 +249,7 @@ void FWRenderer::drawCommand() {
 	unsigned int i;
 	int x = 10, y = _cmdY;
 
-	if(disableSystemMenu == 0)
-	{
+	if(disableSystemMenu == 0) {
 		drawPlainBox(x, y, 301, 11, 0);
 		drawBorder(x - 1, y - 1, 302, 12, 2);
 
@@ -304,7 +303,8 @@ void FWRenderer::drawMessage(const char *str, int x, int y, int width, int color
 	for (i = 0; str[i]; i++, line--) {
 		// Fit line of text into textbox
 		if (!line) {
-			while (str[i] == ' ') i++;
+			while (str[i] == ' ')
+				i++;
 			line = fitLine(str + i, tw, words, cw);
 
 			if ( str[i + line] != '\0' && str[i + line] != 0x7C && words) {
@@ -1745,68 +1745,55 @@ void drawSpriteRaw(const byte *spritePtr, const byte *maskPtr, int16 width, int1
 	}
 }
 
-void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 width, int16 height, byte *page, int16 x, int16 y, byte transparentColor, byte bpp)
-{
-	byte* pMask = NULL;
+void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 width, int16 height, byte *page, int16 x, int16 y, byte transparentColor, byte bpp) {
+	byte *pMask = NULL;
 
 	// draw the mask based on next objects in the list
 	Common::List<overlay>::iterator it;
-	for (it = g_cine->_overlayList.begin(); it != g_cine->_overlayList.end(); ++it)
-	{
-		if(&(*it) == overlayPtr)
-		{
+	for (it = g_cine->_overlayList.begin(); it != g_cine->_overlayList.end(); ++it)	{
+		if(&(*it) == overlayPtr) {
 			break;
 		}
 	}
 
-	while(it != g_cine->_overlayList.end())
-	{
-		overlay* pCurrentOverlay = &(*it);
-		if((pCurrentOverlay->type==5) || ((pCurrentOverlay->type==21) && (pCurrentOverlay->x==overlayPtr->objIdx)))
-		{
-			AnimData* sprite = &g_cine->_animDataTable[g_cine->_objectTable[it->objIdx].frame];
+	while(it != g_cine->_overlayList.end())	{
+		overlay *pCurrentOverlay = &(*it);
+		if ((pCurrentOverlay->type == 5) || ((pCurrentOverlay->type == 21) && (pCurrentOverlay->x == overlayPtr->objIdx))) {
+			AnimData *sprite = &g_cine->_animDataTable[g_cine->_objectTable[it->objIdx].frame];
 
-			if(pMask == NULL)
-			{
+			if (pMask == NULL) {
 				pMask = new byte[width*height];
 
 				for (int i = 0; i < height; i++) {
 					for (int j = 0; j < width; j++) {
-						byte spriteColor= spritePtr[width*i+j];
-						pMask[width*i+j] = spriteColor;
+						byte spriteColor= spritePtr[width * i + j];
+						pMask[width * i + j] = spriteColor;
 					}
 				}
 			}
 
 			for (int i = 0; i < sprite->_realWidth; i++) {
 				for (int j = 0; j < sprite->_height; j++) {
-					int inMaskX = (g_cine->_objectTable[it->objIdx].x+i) - x;
-					int inMaskY = (g_cine->_objectTable[it->objIdx].y+j) - y;
-
-					if(inMaskX >=0 && inMaskX < width)
-					{
-						if(inMaskY >=0 && inMaskY < height)
-						{
-							if(sprite->_bpp == 1)
-							{
-								if(!sprite->getColor(i, j))
-								{
-									pMask[inMaskY*width+inMaskX] = page[x + y * 320 + inMaskX + inMaskY * 320];
+					int inMaskX = (g_cine->_objectTable[it->objIdx].x + i) - x;
+					int inMaskY = (g_cine->_objectTable[it->objIdx].y + j) - y;
+
+					if (inMaskX >=0 && inMaskX < width) {
+						if (inMaskY >= 0 && inMaskY < height) {
+							if (sprite->_bpp == 1) {
+								if (!sprite->getColor(i, j)) {
+									pMask[inMaskY * width + inMaskX] = page[x + y * 320 + inMaskX + inMaskY * 320];
 								}
 							}
 						}
 					}
 				}
 			}
-
-
 		}
 		it++;
 	}
 
 	// now, draw with the mask we created
-	if(pMask)
-	{
+	if(pMask) {
 		spritePtr = pMask;
 	}
 	{






More information about the Scummvm-git-logs mailing list