aboutsummaryrefslogtreecommitdiff
path: root/engines/cine
diff options
context:
space:
mode:
authorTorbjörn Andersson2012-08-14 09:09:08 +0200
committerTorbjörn Andersson2012-08-14 09:09:08 +0200
commit629d55cdfad91a993eff7406fa2ca2b09d0d295d (patch)
tree3850a9551fa1b995f5f8da1dc65f0520f18c0008 /engines/cine
parent8fff7e29de2663e961c4be92f5f433f69313030b (diff)
downloadscummvm-rg350-629d55cdfad91a993eff7406fa2ca2b09d0d295d.tar.gz
scummvm-rg350-629d55cdfad91a993eff7406fa2ca2b09d0d295d.tar.bz2
scummvm-rg350-629d55cdfad91a993eff7406fa2ca2b09d0d295d.zip
CINE: Apply some ScummVM formatting conventions
Diffstat (limited to 'engines/cine')
-rw-r--r--engines/cine/gfx.cpp59
1 files changed, 23 insertions, 36 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 3fac973855..cce8154d84 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;
}
{