[Scummvm-cvs-logs] CVS: scummvm sys.cpp,1.15,1.16 2xsai.cpp,1.6,1.7 boxes.cpp,1.32,1.33 saveload.cpp,1.53,1.54 costume.cpp,1.35,1.36 debug.cpp,1.30,1.31
Max Horn
fingolfin at users.sourceforge.net
Sun Jul 7 13:26:03 CEST 2002
- Previous message: [Scummvm-cvs-logs] CVS: scummvm script.cpp,1.63,1.64 actor.cpp,1.82,1.83 akos.cpp,1.25,1.26 object.cpp,1.75,1.76 verbs.cpp,1.28,1.29 string.cpp,1.47,1.48
- Next message: [Scummvm-cvs-logs] CVS: scummvm/wince pocketpc.cpp,1.22,1.23
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv14319
Modified Files:
sys.cpp 2xsai.cpp boxes.cpp saveload.cpp costume.cpp debug.cpp
Log Message:
indent run
Index: sys.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sys.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- sys.cpp 19 May 2002 12:44:26 -0000 1.15
+++ sys.cpp 7 Jul 2002 20:25:22 -0000 1.16
@@ -42,7 +42,7 @@
void Scumm::fileClose(void *file)
{
if (_fileMode == 1 || _fileMode == 2)
- fclose((FILE *) file);
+ fclose((FILE *)file);
}
bool Scumm::fileReadFailed(void *file)
@@ -57,12 +57,12 @@
bool Scumm::fileEof(void *file)
{
- return feof((FILE *) file) != 0;
+ return feof((FILE *)file) != 0;
}
uint32 Scumm::filePos(void *handle)
{
- return ftell((FILE *) handle);
+ return ftell((FILE *)handle);
}
void Scumm::fileSeek(void *file, long offs, int whence)
@@ -70,8 +70,8 @@
switch (_fileMode) {
case 1:
case 2:
- if (fseek((FILE *) file, offs, whence) != 0)
- clearerr((FILE *) file);
+ if (fseek((FILE *)file, offs, whence) != 0)
+ clearerr((FILE *)file);
return;
case 3:
_whereInResToRead = offs;
@@ -88,8 +88,8 @@
if (size == 0)
return;
- if ((uint32)fread(ptr2, size, 1, (FILE *) file) != 1) {
- clearerr((FILE *) file);
+ if ((uint32)fread(ptr2, size, 1, (FILE *)file) != 1) {
+ clearerr((FILE *)file);
_fileReadFailed = true;
}
@@ -119,8 +119,8 @@
switch (_fileMode) {
case 1:
- if (fread(&b, 1, 1, (FILE *) _fileHandle) != 1) {
- clearerr((FILE *) _fileHandle);
+ if (fread(&b, 1, 1, (FILE *)_fileHandle) != 1) {
+ clearerr((FILE *)_fileHandle);
_fileReadFailed = true;
}
return b ^ _encbyte;
@@ -166,9 +166,9 @@
{
byte b;
- if (fread(&b, 1, 1, (FILE *) handle) != 1) {
- clearerr((FILE *) handle);
- _fileReadFailed = true;
+ if (fread(&b, 1, 1, (FILE *)handle) != 1) {
+ clearerr((FILE *)handle);
+ _fileReadFailed = true;
}
return b ^ _encbyte;
}
@@ -205,7 +205,7 @@
{
if (s) {
int l = strlen(s) + 1;
- char * r = (char *) malloc(l);
+ char *r = (char *)malloc(l);
memcpy(r, s, l);
return r;
}
Index: 2xsai.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/2xsai.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- 2xsai.cpp 5 May 2002 18:05:56 -0000 1.6
+++ 2xsai.cpp 7 Jul 2002 20:25:22 -0000 1.7
@@ -54,8 +54,7 @@
return 1;
}
-static inline int GetResult1(uint32 A, uint32 B, uint32 C, uint32 D,
- uint32 /* E */ )
+static inline int GetResult1(uint32 A, uint32 B, uint32 C, uint32 D, uint32 /* E */ )
{
int x = 0;
int y = 0;
@@ -76,8 +75,7 @@
return r;
}
-static inline int GetResult2(uint32 A, uint32 B, uint32 C, uint32 D,
- uint32 /* E */ )
+static inline int GetResult2(uint32 A, uint32 B, uint32 C, uint32 D, uint32 /* E */ )
{
int x = 0;
int y = 0;
@@ -122,8 +120,7 @@
static inline uint32 INTERPOLATE(uint32 A, uint32 B)
{
if (A != B) {
- return (((A & colorMask) >> 1) + ((B & colorMask) >> 1) +
- (A & B & lowPixelMask));
+ return (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + (A & B & lowPixelMask));
} else
return A;
}
@@ -131,8 +128,7 @@
static inline uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D)
{
register uint32 x = ((A & qcolorMask) >> 2) +
- ((B & qcolorMask) >> 2) +
- ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2);
+ ((B & qcolorMask) >> 2) + ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2);
register uint32 y = (A & qlowpixelMask) +
(B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask);
@@ -149,8 +145,7 @@
#define GREEN_MASK555 0x03E003E0
void Super2xSaI(uint8 *srcPtr, uint32 srcPitch,
- uint8 *deltaPtr, uint8 *dstPtr, uint32 dstPitch,
- int width, int height)
+ uint8 *deltaPtr, uint8 *dstPtr, uint32 dstPitch, int width, int height)
{
uint16 *bP;
uint8 *dP;
@@ -167,8 +162,7 @@
for (uint32 finish = width; finish; finish -= inc_bP) {
uint32 color4, color5, color6;
uint32 color1, color2, color3;
- uint32 colorA0, colorA1, colorA2, colorA3,
- colorB0, colorB1, colorB2, colorB3, colorS1, colorS2;
+ uint32 colorA0, colorA1, colorA2, colorA3, colorB0, colorB1, colorB2, colorB3, colorS1, colorS2;
uint32 product1a, product1b, product2a, product2b;
//--------------------------------------- B1 B2
@@ -217,41 +211,31 @@
product2b = product1b = INTERPOLATE(color5, color6);
}
} else {
- if (color6 == color3 && color3 == colorA1
- && color2 != colorA2 && color3 != colorA0)
+ if (color6 == color3 && color3 == colorA1 && color2 != colorA2 && color3 != colorA0)
product2b = Q_INTERPOLATE(color3, color3, color3, color2);
- else if (color5 == color2 && color2 == colorA2
- && colorA1 != color3 && color2 != colorA3)
+ else if (color5 == color2 && color2 == colorA2 && colorA1 != color3 && color2 != colorA3)
product2b = Q_INTERPOLATE(color2, color2, color2, color3);
else
product2b = INTERPOLATE(color2, color3);
- if (color6 == color3 && color6 == colorB1
- && color5 != colorB2 && color6 != colorB0)
+ if (color6 == color3 && color6 == colorB1 && color5 != colorB2 && color6 != colorB0)
product1b = Q_INTERPOLATE(color6, color6, color6, color5);
- else if (color5 == color2 && color5 == colorB2
- && colorB1 != color6 && color5 != colorB3)
+ else if (color5 == color2 && color5 == colorB2 && colorB1 != color6 && color5 != colorB3)
product1b = Q_INTERPOLATE(color6, color5, color5, color5);
else
product1b = INTERPOLATE(color5, color6);
}
- if (color5 == color3 && color2 != color6 && color4 == color5
- && color5 != colorA2)
+ if (color5 == color3 && color2 != color6 && color4 == color5 && color5 != colorA2)
product2a = INTERPOLATE(color2, color5);
- else
- if (color5 == color1 && color6 == color5
- && color4 != color2 && color5 != colorA0)
+ else if (color5 == color1 && color6 == color5 && color4 != color2 && color5 != colorA0)
product2a = INTERPOLATE(color2, color5);
else
product2a = color2;
- if (color2 == color6 && color5 != color3 && color1 == color2
- && color2 != colorB2)
+ if (color2 == color6 && color5 != color3 && color1 == color2 && color2 != colorB2)
product1a = INTERPOLATE(color2, color5);
- else
- if (color4 == color2 && color3 == color2
- && color1 != color5 && color2 != colorB0)
+ else if (color4 == color2 && color3 == color2 && color1 != color5 && color2 != colorB0)
product1a = INTERPOLATE(color2, color5);
else
product1a = color5;
@@ -420,8 +404,7 @@
register uint32 colorA, colorB;
uint32 colorC, colorD,
- colorE, colorF, colorG, colorH,
- colorI, colorJ, colorK, colorL, colorM, colorN, colorO, colorP;
+ colorE, colorF, colorG, colorH, colorI, colorJ, colorK, colorL, colorM, colorN, colorO, colorP;
uint32 product, product1, product2;
//---------------------------------------
@@ -450,34 +433,34 @@
colorP = *(bP + Nextline + Nextline + 2);
if ((colorA == colorD) && (colorB != colorC)) {
- if (((colorA == colorE) && (colorB == colorL)) ||
- ((colorA == colorC) && (colorA == colorF)
- && (colorB != colorE) && (colorB == colorJ))) {
+ if (((colorA == colorE) && (colorB == colorL)) || ((colorA == colorC) && (colorA == colorF)
+ && (colorB != colorE)
+ && (colorB == colorJ))) {
product = colorA;
} else {
product = INTERPOLATE(colorA, colorB);
}
- if (((colorA == colorG) && (colorC == colorO)) ||
- ((colorA == colorB) && (colorA == colorH)
- && (colorG != colorC) && (colorC == colorM))) {
+ if (((colorA == colorG) && (colorC == colorO)) || ((colorA == colorB) && (colorA == colorH)
+ && (colorG != colorC)
+ && (colorC == colorM))) {
product1 = colorA;
} else {
product1 = INTERPOLATE(colorA, colorC);
}
product2 = colorA;
} else if ((colorB == colorC) && (colorA != colorD)) {
- if (((colorB == colorF) && (colorA == colorH)) ||
- ((colorB == colorE) && (colorB == colorD)
- && (colorA != colorF) && (colorA == colorI))) {
+ if (((colorB == colorF) && (colorA == colorH)) || ((colorB == colorE) && (colorB == colorD)
+ && (colorA != colorF)
+ && (colorA == colorI))) {
product = colorB;
} else {
product = INTERPOLATE(colorA, colorB);
}
- if (((colorC == colorH) && (colorA == colorF)) ||
- ((colorC == colorG) && (colorC == colorD)
- && (colorA != colorH) && (colorA == colorI))) {
+ if (((colorC == colorH) && (colorA == colorF)) || ((colorC == colorG) && (colorC == colorD)
+ && (colorA != colorH)
+ && (colorA == colorI))) {
product1 = colorC;
} else {
product1 = INTERPOLATE(colorA, colorC);
@@ -537,10 +520,10 @@
#endif
#ifdef SCUMM_BIG_ENDIAN
- product = (colorA<<16) | product;
- product1 = (product1<<16) | product2;
+ product = (colorA << 16) | product;
+ product1 = (product1 << 16) | product2;
#endif
- *((int32 *) dP) = product;
+ *((int32 *)dP) = product;
*((uint32 *)(dP + dstPitch)) = product1;
bP += inc_bP;
@@ -574,8 +557,7 @@
}
-static uint32 Bilinear4(uint32 A, uint32 B, uint32 C, uint32 D, uint32 x,
- uint32 y)
+static uint32 Bilinear4(uint32 A, uint32 B, uint32 C, uint32 D, uint32 x, uint32 y)
{
unsigned long areaA, areaB, areaC, areaD;
unsigned long result, xy;
@@ -732,21 +714,22 @@
}
}
-void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, int width, int height)
+void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+ int width, int height)
{
unsigned int nextlineSrc = srcPitch / sizeof(short);
- short* p = (short*)srcPtr;
+ short *p = (short *)srcPtr;
unsigned nextlineDst = dstPitch / sizeof(short);
- short* q = (short*)dstPtr;
+ short *q = (short *)dstPtr;
while (height--) {
- for(int i = 0; i < width; ++i) {
+ for (int i = 0; i < width; ++i) {
// short A = *(p + i - nextlineSrc - 1);
short B = *(p + i - nextlineSrc);
// short C = *(p + i - nextlineSrc + 1);
short D = *(p + i - 1);
- short E = *(p + i );
+ short E = *(p + i);
short F = *(p + i + 1);
// short G = *(p + i + nextlineSrc - 1);
short H = *(p + i + nextlineSrc);
@@ -764,14 +747,15 @@
/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */
-void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, int width, int height)
+void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+ int width, int height)
{
- uint8* r;
+ uint8 *r;
while (height--) {
r = dstPtr;
- for(int i = 0; i < width; ++i, ++r) {
- uint8 color = *(srcPtr + i );
+ for (int i = 0; i < width; ++i, ++r) {
+ uint8 color = *(srcPtr + i);
*r = color;
}
@@ -781,14 +765,15 @@
}
/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */
-void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, int width, int height)
+void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+ int width, int height)
{
- uint8* r;
+ uint8 *r;
while (height--) {
r = dstPtr;
- for(int i = 0; i < width; ++i, r+=2) {
- uint8 color = *(srcPtr + i );
+ for (int i = 0; i < width; ++i, r += 2) {
+ uint8 color = *(srcPtr + i);
*(r) = color;
*(r + 1) = color;
@@ -801,14 +786,15 @@
}
/* Beware! Contrary to the other functions in this file, this blits from 8 to 8 bit! */
-void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, int width, int height)
+void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+ int width, int height)
{
- uint8* r;
+ uint8 *r;
uint32 dstPitch2 = dstPitch << 1;
while (height--) {
r = dstPtr;
- for(int i = 0; i < width; ++i, r+=3) {
+ for (int i = 0; i < width; ++i, r += 3) {
uint8 color = *(srcPtr + i);
*(r + 0) = color;
Index: boxes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/boxes.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- boxes.cpp 23 May 2002 21:22:08 -0000 1.32
+++ boxes.cpp 7 Jul 2002 20:25:22 -0000 1.33
@@ -68,11 +68,11 @@
checkRange(ptr[0] - 1, 0, box, "Illegal box %d");
if (_features & GF_SMALL_HEADER) {
if (_features & GF_OLD256)
- return (Box *) (ptr + box * (SIZEOF_BOX - 2) + 1);
+ return (Box *)(ptr + box * (SIZEOF_BOX - 2) + 1);
else
- return (Box *) (ptr + box * SIZEOF_BOX + 1);
+ return (Box *)(ptr + box * SIZEOF_BOX + 1);
} else
- return (Box *) (ptr + box * SIZEOF_BOX + 2);
+ return (Box *)(ptr + box * SIZEOF_BOX + 2);
}
int Scumm::getSpecialBox(int param1, int param2)
@@ -80,21 +80,20 @@
int i;
int numOfBoxes;
byte flag;
-
+
numOfBoxes = getNumBoxes() - 1;
- for(i=numOfBoxes;i>=0;i--)
- {
+ for (i = numOfBoxes; i >= 0; i--) {
flag = getBoxFlags(i);
- if(!(flag & 0x80) && (flag & 0x20))
- return(-1);
+ if (!(flag & 0x80) && (flag & 0x20))
+ return (-1);
- if(checkXYInBoxBounds(i,param1,param2))
- return(i);
+ if (checkXYInBoxBounds(i, param1, param2))
+ return (i);
}
- return(-1);
+ return (-1);
}
bool Scumm::checkXYInBoxBounds(int b, int x, int y)
@@ -122,8 +121,7 @@
box.ul.y == box.ur.y &&
box.ll.x == box.lr.x &&
box.ll.y == box.lr.y ||
- box.ul.x == box.lr.x &&
- box.ul.y == box.lr.y && box.ur.x == box.ll.x && box.ur.y == box.ll.y) {
+ box.ul.x == box.lr.x && box.ul.y == box.lr.y && box.ur.x == box.ll.x && box.ur.y == box.ll.y) {
ScummPoint pt;
pt = closestPtOnLine(box.ul.x, box.ul.y, box.ll.x, box.ll.y, x, y);
@@ -146,25 +144,25 @@
return 1;
}
-void Scumm::getBoxCoordinates(int boxnum, BoxCoords * box)
+void Scumm::getBoxCoordinates(int boxnum, BoxCoords *box)
{
Box *bp = getBoxBaseAddr(boxnum);
- box->ul.x = (int16) FROM_LE_16(bp->ulx);
- box->ul.y = (int16) FROM_LE_16(bp->uly);
- box->ur.x = (int16) FROM_LE_16(bp->urx);
- box->ur.y = (int16) FROM_LE_16(bp->ury);
+ box->ul.x = (int16)FROM_LE_16(bp->ulx);
+ box->ul.y = (int16)FROM_LE_16(bp->uly);
+ box->ur.x = (int16)FROM_LE_16(bp->urx);
+ box->ur.y = (int16)FROM_LE_16(bp->ury);
if (_features & GF_OLD256) {
- box->ll.x = (int16) FROM_LE_16(bp->lrx);
- box->ll.y = (int16) FROM_LE_16(bp->lry);
- box->lr.x = (int16) FROM_LE_16(bp->llx);
- box->lr.y = (int16) FROM_LE_16(bp->lly);
+ box->ll.x = (int16)FROM_LE_16(bp->lrx);
+ box->ll.y = (int16)FROM_LE_16(bp->lry);
+ box->lr.x = (int16)FROM_LE_16(bp->llx);
+ box->lr.y = (int16)FROM_LE_16(bp->lly);
} else {
- box->ll.x = (int16) FROM_LE_16(bp->llx);
- box->ll.y = (int16) FROM_LE_16(bp->lly);
- box->lr.x = (int16) FROM_LE_16(bp->lrx);
- box->lr.y = (int16) FROM_LE_16(bp->lry);
+ box->ll.x = (int16)FROM_LE_16(bp->llx);
+ box->ll.y = (int16)FROM_LE_16(bp->lly);
+ box->lr.x = (int16)FROM_LE_16(bp->lrx);
+ box->lr.y = (int16)FROM_LE_16(bp->lry);
}
}
@@ -187,8 +185,7 @@
return diffx + diffy;
}
-ScummPoint Scumm::closestPtOnLine(int ulx, int uly, int llx, int lly, int x,
- int y)
+ScummPoint Scumm::closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y)
{
int lydiff, lxdiff;
int32 dist, a, b, c;
@@ -377,7 +374,7 @@
return -1;
}
-int Scumm::findPathTowards(Actor * a, byte box1nr, byte box2nr, byte box3nr)
+int Scumm::findPathTowards(Actor *a, byte box1nr, byte box2nr, byte box3nr)
{
BoxCoords box1;
BoxCoords box2;
@@ -391,8 +388,7 @@
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
- if (box1.ul.x == box1.ur.x &&
- box1.ul.x == box2.ul.x && box1.ul.x == box2.ur.x) {
+ if (box1.ul.x == box1.ur.x && box1.ul.x == box2.ul.x && box1.ul.x == box2.ur.x) {
flag = 0;
if (box1.ul.y > box1.ur.y) {
SWAP(box1.ul.y, box1.ur.y);
@@ -450,8 +446,7 @@
}
}
- if (box1.ul.y == box1.ur.y &&
- box1.ul.y == box2.ul.y && box1.ul.y == box2.ur.y) {
+ if (box1.ul.y == box1.ur.y && box1.ul.y == box2.ul.y && box1.ul.y == box2.ur.y) {
flag = 0;
if (box1.ul.x > box1.ur.x) {
SWAP(box1.ul.x, box1.ur.x);
@@ -666,7 +661,7 @@
nukeResource(rtMatrix, 3);
}
-PathVertex *Scumm::unkMatrixProc1(PathVertex * vtx, PathNode * node)
+PathVertex *Scumm::unkMatrixProc1(PathVertex *vtx, PathNode *node)
{
if (node == NULL || vtx == NULL)
return NULL;
@@ -689,7 +684,7 @@
return NULL;
}
-PathNode *Scumm::unkMatrixProc2(PathVertex * vtx, int i)
+PathNode *Scumm::unkMatrixProc2(PathVertex *vtx, int i)
{
PathNode *node;
@@ -697,14 +692,14 @@
return NULL;
if (!vtx->right) {
- node = (PathNode *) addToBoxVertexHeap(sizeof(PathNode));
+ node = (PathNode *)addToBoxVertexHeap(sizeof(PathNode));
vtx->left = vtx->right = node;
node->index = i;
node->left = 0;
node->right = 0;
} else {
- node = (PathNode *) addToBoxVertexHeap(sizeof(PathNode));
+ node = (PathNode *)addToBoxVertexHeap(sizeof(PathNode));
vtx->right->left = node;
node->right = vtx->right;
@@ -738,8 +733,7 @@
do {
k = 4;
do {
- if (box2.ur.x == box2.ul.x &&
- box.ul.x == box2.ul.x && box.ur.x == box2.ur.x) {
+ if (box2.ur.x == box2.ul.x && box.ul.x == box2.ul.x && box.ur.x == box2.ur.x) {
n = m = 0;
if (box2.ur.y < box2.ul.y) {
n = 1;
@@ -752,8 +746,7 @@
if (box.ur.y < box2.ul.y ||
box.ul.y > box2.ur.y ||
(box.ul.y == box2.ur.y ||
- box.ur.y == box2.ul.y) &&
- box2.ur.y != box2.ul.y && box.ul.y != box.ur.y) {
+ box.ur.y == box2.ul.y) && box2.ur.y != box2.ul.y && box.ul.y != box.ur.y) {
if (n) {
SWAP(box2.ur.y, box2.ul.y);
}
@@ -771,8 +764,7 @@
}
}
- if (box2.ur.y == box2.ul.y &&
- box.ul.y == box2.ul.y && box.ur.y == box2.ur.y) {
+ if (box2.ur.y == box2.ul.y && box.ul.y == box2.ul.y && box.ur.y == box2.ur.y) {
n = m = 0;
if (box2.ur.x < box2.ul.x) {
n = 1;
@@ -785,8 +777,7 @@
if (box.ur.x < box2.ul.x ||
box.ul.x > box2.ur.x ||
(box.ul.x == box2.ur.x ||
- box.ur.x == box2.ul.x) &&
- box2.ur.x != box2.ul.x && box.ul.x != box.ur.x) {
+ box.ur.x == box2.ul.x) && box2.ur.x != box2.ul.x && box.ul.x != box.ur.x) {
if (n) {
SWAP(box2.ur.x, box2.ul.x);
@@ -857,11 +848,10 @@
_boxMatrixPtr4 = getResourceAddress(rtMatrix, 4);
_boxPathVertexHeapIndex = 0;
- return (PathVertex *) addToBoxVertexHeap(sizeof(PathVertex));
+ return (PathVertex *)addToBoxVertexHeap(sizeof(PathVertex));
}
-int Scumm::findPathTowardsOld(Actor * a, byte trap1, byte trap2,
- byte final_trap)
+int Scumm::findPathTowardsOld(Actor *a, byte trap1, byte trap2, byte final_trap)
{
GetGates(trap1, trap2);
ScummPoint pt;
@@ -895,7 +885,7 @@
if (compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[3].x, gateLoc[3].y, gate1ax, gate1ay) ==
compareSlope(gateLoc[1].x, gateLoc[1].y, gateLoc[3].x, gateLoc[3].y, gate1bx, gate1by)) {
closestPtOnLine(gate1ax, gate1ay, gate1bx, gate1by, gateLoc[1].x, gateLoc[1].y);
- gateLoc[2].x = pt.x; /* if point 2 between gates, ignore! */
+ gateLoc[2].x = pt.x; /* if point 2 between gates, ignore! */
gateLoc[2].y = pt.y;
}
Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saveload.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- saveload.cpp 4 Jul 2002 10:05:40 -0000 1.53
+++ saveload.cpp 7 Jul 2002 20:25:23 -0000 1.54
@@ -130,7 +130,7 @@
gdi._mask_left = -1;
initScreens(0, 0, 320, 200);
-
+
// Force a fade to black
int old_screenEffectFlag = _screenEffectFlag;
_screenEffectFlag = true;
@@ -169,9 +169,9 @@
dir = _gameDataPath;
#else
- #if !defined(MACOS_CARBON)
+#if !defined(MACOS_CARBON)
dir = getenv("SCUMMVM_SAVEPATH");
- #endif
+#endif
// If SCUMMVM_SAVEPATH was not specified, try to use game specific savepath from config
if (!dir || dir[0] == 0)
@@ -226,7 +226,7 @@
#define MKARRAY(type,item,saveas,num) {OFFS(type,item),128|saveas,SIZE(type,item)}, {num,0,0}
#define MKEND() {0xFFFF,0xFF,0xFF}
-void Scumm::saveOrLoad(Serializer * s)
+void Scumm::saveOrLoad(Serializer *s)
{
const SaveLoadEntry objectEntries[] = {
MKLINE(ObjectData, offs_obim_to_room, sleUint32),
@@ -442,7 +442,7 @@
MKLINE(Scumm, _cd_track, sleInt16),
MKLINE(Scumm, _cd_loops, sleInt16),
- MKLINE(Scumm, _cd_frame, sleInt16),
+ MKLINE(Scumm, _cd_frame, sleInt16),
MKLINE(Scumm, _cd_end, sleInt16),
MKEND()
@@ -612,7 +612,7 @@
int var120Backup;
int var98Backup;
- if (_current_version == VER_V9)
+ if (_current_version == VER_V9)
s->saveLoadEntries(this, mainEntriesV9);
else
s->saveLoadEntries(this, mainEntriesV8);
@@ -623,33 +623,27 @@
s->saveLoadArrayOf(vm.slot, 25, sizeof(vm.slot[0]), scriptSlotEntries);
else
s->saveLoadArrayOf(vm.slot, NUM_SCRIPT_SLOT, sizeof(vm.slot[0]), scriptSlotEntries);
- s->saveLoadArrayOf(_objs, _numLocalObjects, sizeof(_objs[0]),
- objectEntries);
+ s->saveLoadArrayOf(_objs, _numLocalObjects, sizeof(_objs[0]), objectEntries);
s->saveLoadArrayOf(_verbs, _numVerbs, sizeof(_verbs[0]), verbEntries);
s->saveLoadArrayOf(vm.nest, 16, sizeof(vm.nest[0]), nestedScriptEntries);
s->saveLoadArrayOf(sentence, 6, sizeof(sentence[0]), sentenceTabEntries);
s->saveLoadArrayOf(string, 6, sizeof(string[0]), stringTabEntries);
- s->saveLoadArrayOf(_colorCycle, 16, sizeof(_colorCycle[0]),
- colorCycleEntries);
+ s->saveLoadArrayOf(_colorCycle, 16, sizeof(_colorCycle[0]), colorCycleEntries);
for (i = rtFirst; i <= rtLast; i++)
if (res.mode[i] == 0)
for (j = 1; j < res.num[i]; j++)
saveLoadResource(s, i, j);
- s->saveLoadArrayOf(_objectOwnerTable, _numGlobalObjects,
- sizeof(_objectOwnerTable[0]), sleByte);
- s->saveLoadArrayOf(_objectStateTable, _numGlobalObjects,
- sizeof(_objectStateTable[0]), sleByte);
+ s->saveLoadArrayOf(_objectOwnerTable, _numGlobalObjects, sizeof(_objectOwnerTable[0]), sleByte);
+ s->saveLoadArrayOf(_objectStateTable, _numGlobalObjects, sizeof(_objectStateTable[0]), sleByte);
if (_objectRoomTable)
- s->saveLoadArrayOf(_objectRoomTable, _numGlobalObjects,
- sizeof(_objectRoomTable[0]), sleByte);
+ s->saveLoadArrayOf(_objectRoomTable, _numGlobalObjects, sizeof(_objectRoomTable[0]), sleByte);
if (_shadowPaletteSize)
s->saveLoadArrayOf(_shadowPalette, _shadowPaletteSize, 1, sleByte);
- s->saveLoadArrayOf(_classData, _numGlobalObjects, sizeof(_classData[0]),
- sleUint32);
+ s->saveLoadArrayOf(_classData, _numGlobalObjects, sizeof(_classData[0]), sleUint32);
var120Backup = _vars[120];
var98Backup = _vars[98];
@@ -684,7 +678,7 @@
_imuse->save_or_load(s, this);
}
-void Scumm::saveLoadResource(Serializer * ser, int type, int idx)
+void Scumm::saveLoadResource(Serializer *ser, int type, int idx)
{
byte *ptr;
uint32 size;
@@ -783,8 +777,7 @@
return e;
}
-void Serializer::saveLoadArrayOf(void *b, int len, int datasize,
- byte filetype)
+void Serializer::saveLoadArrayOf(void *b, int len, int datasize, byte filetype)
{
byte *at = (byte *)b;
uint32 data;
@@ -816,7 +809,7 @@
break;
case sleUint16:
case sleInt16:
- saveWord((int16) data);
+ saveWord((int16)data);
break;
case sleInt32:
case sleUint32:
@@ -835,13 +828,13 @@
data = loadWord();
break;
case sleInt16:
- data = (int16) loadWord();
+ data = (int16)loadWord();
break;
case sleUint32:
data = loadUint32();
break;
case sleInt32:
- data = (int32) loadUint32();
+ data = (int32)loadUint32();
break;
default:
error("saveLoadArrayOf: invalid filetype %d", filetype);
@@ -862,8 +855,7 @@
}
}
-void Serializer::saveLoadArrayOf(void *b, int num, int datasize,
- const SaveLoadEntry * sle)
+void Serializer::saveLoadArrayOf(void *b, int num, int datasize, const SaveLoadEntry *sle)
{
byte *data = (byte *)b;
@@ -874,7 +866,7 @@
}
-void Serializer::saveLoadEntries(void *d, const SaveLoadEntry * sle)
+void Serializer::saveLoadEntries(void *d, const SaveLoadEntry *sle)
{
int replen;
byte type;
Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/costume.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- costume.cpp 4 Jun 2002 23:33:49 -0000 1.35
+++ costume.cpp 7 Jul 2002 20:25:23 -0000 1.36
@@ -74,7 +74,7 @@
238, 30, 158, 94, 222, 62, 190, 126, 254
};
-byte CostumeRenderer::mainRoutine(Actor * a, int slot, int frame)
+byte CostumeRenderer::mainRoutine(Actor *a, int slot, int frame)
{
int xmove, ymove, i, b, s;
uint scal;
@@ -94,10 +94,10 @@
_width = _width2;
_height2 = _srcptr[2];
_height = _height2;
- xmove = (int16) READ_LE_UINT16(_srcptr + 4) + _xmove;
- ymove = (int16) READ_LE_UINT16(_srcptr + 6) + _ymove;
- _xmove += (int16) READ_LE_UINT16(_srcptr + 8);
- _ymove -= (int16) READ_LE_UINT16(_srcptr + 10);
+ xmove = (int16)READ_LE_UINT16(_srcptr + 4) + _xmove;
+ ymove = (int16)READ_LE_UINT16(_srcptr + 6) + _ymove;
+ _xmove += (int16)READ_LE_UINT16(_srcptr + 8);
+ _ymove -= (int16)READ_LE_UINT16(_srcptr + 10);
_srcptr += 12;
switch (_loaded._ptr[7] & 0x7F) {
@@ -108,8 +108,7 @@
_srcptr += 2;
if (ex1 != 0xFF || ex2 != 0xFF) {
ex1 = READ_LE_UINT16(_loaded._ptr + _loaded._numColors + 10 + ex1 * 2);
- _srcptr =
- _loaded._ptr + READ_LE_UINT16(_loaded._ptr + ex1 + ex2 * 2) + 14;
+ _srcptr = _loaded._ptr + READ_LE_UINT16(_loaded._ptr + ex1 + ex2 * 2) + 14;
}
}
@@ -274,10 +273,8 @@
CHECK_HEAP return 2;
}
- _bgbak_ptr =
- _vm->getResourceAddress(rtBuffer,5) + _vm->virtscr[0].xstart + _ypos * 320 + _xpos;
- _backbuff_ptr =
- _vm->virtscr[0].screenPtr + _vm->virtscr[0].xstart + _ypos * 320 + _xpos;
+ _bgbak_ptr = _vm->getResourceAddress(rtBuffer, 5) + _vm->virtscr[0].xstart + _ypos * 320 + _xpos;
+ _backbuff_ptr = _vm->virtscr[0].screenPtr + _vm->virtscr[0].xstart + _ypos * 320 + _xpos;
charsetmask =
_vm->hasCharsetMask(_left, _top + _vm->virtscr[0].topline, _right,
_vm->virtscr[0].topline + _bottom);
@@ -286,11 +283,14 @@
if (_vm->_features & GF_SMALL_HEADER)
masking = _zbuf;
else
- masking = _vm->isMaskActiveAt(_left, _top, _right, _bottom,_vm->getResourceAddress(rtBuffer,9) +
- _vm->gdi._imgBufOffs[_zbuf] + _vm->_screenStartStrip);
+ masking =
+ _vm->isMaskActiveAt(_left, _top, _right, _bottom,
+ _vm->getResourceAddress(rtBuffer,
+ 9) + _vm->gdi._imgBufOffs[_zbuf] +
+ _vm->_screenStartStrip);
if (masking || charsetmask) {
- _mask_ptr =_vm->getResourceAddress(rtBuffer,9) + _ypos * 40 + _vm->_screenStartStrip;
+ _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + _ypos * 40 + _vm->_screenStartStrip;
_imgbufoffs = _vm->gdi._imgBufOffs[_zbuf];
if (!charsetmask && _zbuf != 0)
_mask_ptr += _imgbufoffs;
@@ -298,30 +298,30 @@
}
CHECK_HEAP if (a->shadow_mode) {
- proc_special(a,(masking<<1)+charsetmask);
+ proc_special(a, (masking << 1) + charsetmask);
return b;
}
switch ((scaling << 2) | (masking << 1) | charsetmask) {
case 0:
- proc6(); // no scaling, no masking, no charsetmask
+ proc6(); // no scaling, no masking, no charsetmask
break;
case 1:
case 2:
- proc5(); // no scaling, masking or charsetmask
+ proc5(); // no scaling, masking or charsetmask
break;
case 3:
- proc4(); // no scaling, masking and charsetmask
+ proc4(); // no scaling, masking and charsetmask
break;
case 4:
- proc1(); // scaling, no masking, no charsetmask
+ proc1(); // scaling, no masking, no charsetmask
break;
case 5:
case 6:
- proc2(); // scaling, masking or charsetmask
+ proc2(); // scaling, masking or charsetmask
break;
case 7:
- proc3(); // scaling, masking and charsetmask
+ proc3(); // scaling, masking and charsetmask
break;
}
@@ -703,11 +703,11 @@
byte shadow4;
byte shadow5;
- shadow1=a->shadow_mode & 0x80;
- shadow2=a->shadow_mode & 0x40;
- shadow3=a->shadow_mode & 0x20;
- shadow4=a->shadow_mode & 0x10;
- shadow5=a->shadow_mode & 0x0F;
+ shadow1 = a->shadow_mode & 0x80;
+ shadow2 = a->shadow_mode & 0x40;
+ shadow3 = a->shadow_mode & 0x20;
+ shadow4 = a->shadow_mode & 0x10;
+ shadow5 = a->shadow_mode & 0x0F;
mask = _mask_ptr = _mask_ptr_dest;
maskbit = revBitMask[_xpos & 7];
@@ -721,14 +721,14 @@
color = _repcolor;
src = _srcptr;
- if(_mirror == 0)
- shadow5=-shadow5;
+ if (_mirror == 0)
+ shadow5 = -shadow5;
maskbit = revBitMask[_xpos & 7];
dst = _backbuff_ptr;
- if(mask2 !=0 && mask2 < 3)
+ if (mask2 != 0 && mask2 < 3)
_imgbufoffs = 0;
if (_docontinue)
@@ -741,28 +741,25 @@
if (!len)
len = *src++;
- do { // ok
+ do { // ok
if (cost_scaleTable[_scaleIndexY++] < _scaleY) {
if (color && y < _outheight) {
- if (!mask2 || (mask2 && !((*mask | mask[_imgbufoffs]) & maskbit)))
- {
- if(shadow3 == 0)
- {
+ if (!mask2 || (mask2 && !((*mask | mask[_imgbufoffs]) & maskbit))) {
+ if (shadow3 == 0) {
pcolor = _palette[color];
if (pcolor != 13)
goto proc_special_end;
}
- if(shadow2 != 0)
- {
+ if (shadow2 != 0) {
warning("proc_special: shadow2 unimplemented");
pcolor = 0;
- }
- else // we don't need all the random stuff, just the background copy
+ } else // we don't need all the random stuff, just the background copy
{
- pcolor=_vm->_proc_special_palette[*dst];
+ pcolor = _vm->_proc_special_palette[*dst];
}
-proc_special_end:; *dst = pcolor;
+ proc_special_end:;
+ *dst = pcolor;
}
}
dst += 320;
@@ -790,7 +787,7 @@
StartPos:;
} while (--len);
} while (1);
-
+
}
#if 0
@@ -825,7 +822,7 @@
}
#endif
-byte CostumeRenderer::drawOneSlot(Actor * a, int slot)
+byte CostumeRenderer::drawOneSlot(Actor *a, int slot)
{
if (!(_vm->_features & GF_AFTER_V7)) {
@@ -838,8 +835,7 @@
i = cd->curpos[slot] & 0x7FFF;
- _frameptr =
- _loaded._ptr + READ_LE_UINT16(_loaded._ptr + _loaded._numColors + slot * 2 + 10);
+ _frameptr = _loaded._ptr + READ_LE_UINT16(_loaded._ptr + _loaded._numColors + slot * 2 + 10);
code = _loaded._dataptr[i] & 0x7F;
@@ -855,7 +851,7 @@
}
-byte CostumeRenderer::drawCostume(Actor * a)
+byte CostumeRenderer::drawCostume(Actor *a)
{
int i;
byte r = 0;
@@ -866,12 +862,12 @@
return r;
}
-int Scumm::cost_frameToAnim(Actor * a, int frame)
+int Scumm::cost_frameToAnim(Actor *a, int frame)
{
return newDirToOldDir(a->facing) + frame * 4;
}
-void Scumm::loadCostume(LoadedCostume * lc, int costume)
+void Scumm::loadCostume(LoadedCostume *lc, int costume)
{
lc->_ptr = getResourceAddress(rtCostume, costume);
@@ -901,7 +897,7 @@
lc->_dataptr = lc->_ptr + READ_LE_UINT16(lc->_ptr + lc->_numColors + 8);
}
-void Scumm::cost_decodeData(Actor * a, int frame, uint usemask)
+void Scumm::cost_decodeData(Actor *a, int frame, uint usemask)
{
byte *p, *r;
uint mask, j;
@@ -991,8 +987,7 @@
void CostumeRenderer::setFacing(uint16 facing)
{
- _mirror = Scumm::newDirToOldDir(facing) != 0
- || (_loaded._ptr[7] & 0x80);
+ _mirror = Scumm::newDirToOldDir(facing) != 0 || (_loaded._ptr[7] & 0x80);
}
void CostumeRenderer::setCostume(int costume)
@@ -1000,7 +995,7 @@
_vm->loadCostume(&_loaded, costume);
}
-byte Scumm::cost_increaseAnims(LoadedCostume * lc, Actor * a)
+byte Scumm::cost_increaseAnims(LoadedCostume *lc, Actor *a)
{
int i;
byte r = 0;
@@ -1012,7 +1007,7 @@
return r;
}
-byte Scumm::cost_increaseAnim(LoadedCostume * lc, Actor * a, int slot)
+byte Scumm::cost_increaseAnim(LoadedCostume *lc, Actor *a, int slot)
{
int highflag;
int i, end;
Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/debug.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- debug.cpp 14 May 2002 23:32:34 -0000 1.30
+++ debug.cpp 7 Jul 2002 20:25:23 -0000 1.31
@@ -41,7 +41,7 @@
CMD_LOAD_ROOM,
CMD_DUMPBOX,
CMD_VAR,
- CMD_WATCH,
+ CMD_WATCH,
CMD_EXIT
};
@@ -75,8 +75,7 @@
"(s)cripts -> show running scripts\n"
"(b)oxes -> list and draw boxen\n"
"(v)ariable -> set or show a variable value\n"
- "(w)atch [varnum] -> set a variable watch. 0 means all variables.\n"
- "(e)xit -> exit game\n");
+ "(w)atch [varnum] -> set a variable watch. 0 means all variables.\n" "(e)xit -> exit game\n");
return true;
case CMD_QUIT:
@@ -128,18 +127,16 @@
printf("\nWalk boxes:\n");
for (i = 0; i < num; i++) {
warning("BoxTest currently unimplemented in new graphics code\n");
- /*BoxTest(i);*/
+ /*BoxTest(i); */
_s->getBoxCoordinates(i, &box);
printf("%d: [%d x %d] [%d x %d] [%d x %d] [%d x %d]\n", i,
- box.ul.x, box.ul.y, box.ll.x, box.ll.y,
- box.ur.x, box.ur.y, box.lr.x, box.lr.y);
+ box.ul.x, box.ul.y, box.ll.x, box.ll.y, box.ur.x, box.ur.y, box.lr.x, box.lr.y);
}
}
return true;
case CMD_VAR:
if (!_parameters[0]) {
- printf
- ("v 123 will show the value of 123, v 123 456 will set the value of 123 to 456.\n");
+ printf("v 123 will show the value of 123, v 123 456 will set the value of 123 to 456.\n");
} else {
char *tok = strtok(_parameters, " ");
int var = atoi(tok);
@@ -275,9 +272,7 @@
*s = 0;
break;
}
- printf
- ("Invalid command '%s'. Type 'help' for a list of available commands.\n",
- buf);
+ printf("Invalid command '%s'. Type 'help' for a list of available commands.\n", buf);
} while (1);
}
@@ -286,24 +281,19 @@
int i;
Actor *a;
- printf
- ("+--------------------------------------------------------------+\n");
- printf
- ("|# |room| x y |elev|cos|width|box|mov|zp|frame|scale|spd|dir|\n");
- printf
- ("+--+----+--------+----+---+-----+---+---+--+-----+-----+---+---+\n");
+ printf("+--------------------------------------------------------------+\n");
+ printf("|# |room| x y |elev|cos|width|box|mov|zp|frame|scale|spd|dir|\n");
+ printf("+--+----+--------+----+---+-----+---+---+--+-----+-----+---+---+\n");
for (i = 1; i < _s->NUM_ACTORS; i++) {
if (act == -1 || act == i) {
a = &_s->actor[i];
if (a->visible)
printf("|%2d|%4d|%3d %3d|%4d|%3d|%5d|%3d|%3d|%2d|%5d|%5d|%3d|%3d|\n",
i, a->room, a->x, a->y, a->elevation, a->costume, a->width,
- a->walkbox, a->moving, a->forceClip, a->frame, a->scalex,
- a->speedx, a->facing);
+ a->walkbox, a->moving, a->forceClip, a->frame, a->scalex, a->speedx, a->facing);
}
}
- printf
- ("+--------------------------------------------------------------+\n");
+ printf("+--------------------------------------------------------------+\n");
}
void ScummDebugger::printScripts()
- Previous message: [Scummvm-cvs-logs] CVS: scummvm script.cpp,1.63,1.64 actor.cpp,1.82,1.83 akos.cpp,1.25,1.26 object.cpp,1.75,1.76 verbs.cpp,1.28,1.29 string.cpp,1.47,1.48
- Next message: [Scummvm-cvs-logs] CVS: scummvm/wince pocketpc.cpp,1.22,1.23
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list