aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
authorTarek Soliman2012-02-15 09:53:31 -0600
committerTarek Soliman2012-02-15 10:07:10 -0600
commita4798602d7a025dc13fd253d584dbf29dbec488d (patch)
treed6e764535eb4eef6d3c313e00a7eaea8b1724a2d /engines/cruise
parent921f602ab8631a9d10e0a173b6b331dbafda564a (diff)
downloadscummvm-rg350-a4798602d7a025dc13fd253d584dbf29dbec488d.tar.gz
scummvm-rg350-a4798602d7a025dc13fd253d584dbf29dbec488d.tar.bz2
scummvm-rg350-a4798602d7a025dc13fd253d584dbf29dbec488d.zip
JANITORIAL: Fix missing whitespace in pointer cast
find -name '*.h' -or -name '*.cpp' | xargs sed -r -i 's@\(([A-Za-z0-9]+)\*\)@(\1 *)@g' This seems to have caught some params as well which is not undesirable IMO. It also caught some strings containing this which is undesirable so I excluded them manually. (engines/sci/engine/kernel_tables.h)
Diffstat (limited to 'engines/cruise')
-rw-r--r--engines/cruise/background.cpp2
-rw-r--r--engines/cruise/backgroundIncrust.cpp6
-rw-r--r--engines/cruise/cruise_main.cpp4
-rw-r--r--engines/cruise/dataLoader.cpp2
-rw-r--r--engines/cruise/font.cpp2
-rw-r--r--engines/cruise/function.cpp10
-rw-r--r--engines/cruise/mainDraw.cpp8
-rw-r--r--engines/cruise/saveload.cpp4
-rw-r--r--engines/cruise/script.cpp4
9 files changed, 21 insertions, 21 deletions
diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp
index 4d1284a802..9da5413013 100644
--- a/engines/cruise/background.cpp
+++ b/engines/cruise/background.cpp
@@ -129,7 +129,7 @@ int loadBackground(const char *name, int idx) {
flagSpeed = 0;
}
- if (!strcmp((char*)ptr, "PAL")) {
+ if (!strcmp((char *)ptr, "PAL")) {
memcpy(palScreen[idx], ptr + 4, 256*3);
gfxModuleData_setPal256(palScreen[idx]);
} else {
diff --git a/engines/cruise/backgroundIncrust.cpp b/engines/cruise/backgroundIncrust.cpp
index 39286670ed..ddda8dee45 100644
--- a/engines/cruise/backgroundIncrust.cpp
+++ b/engines/cruise/backgroundIncrust.cpp
@@ -46,7 +46,7 @@ void backupBackground(backgroundIncrustStruct *pIncrust, int X, int Y, int width
pIncrust->savedX = X;
pIncrust->savedY = Y;
- pIncrust->ptr = (uint8*)MemAlloc(width * height);
+ pIncrust->ptr = (uint8 *)MemAlloc(width * height);
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
int xp = j + X;
@@ -169,7 +169,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx, int16 objectIdx,
int sizeTable[4]; // 0 = left, 1 = right, 2 = bottom, 3 = top
// this function checks if the dataPtr is not 0, else it retrives the data for X, Y, scale and DataPtr again (OLD: mainDrawSub1Sub1)
- flipPoly(params.fileIdx, (int16*)filesDatabase[params.fileIdx].subData.ptr, params.scale, &newFrame, newElement->X, newElement->Y, &newX, &newY, &newScale);
+ flipPoly(params.fileIdx, (int16 *)filesDatabase[params.fileIdx].subData.ptr, params.scale, &newFrame, newElement->X, newElement->Y, &newX, &newY, &newScale);
// this function fills the sizeTable for the poly (OLD: mainDrawSub1Sub2)
getPolySize(newX, newY, newScale, sizeTable, (unsigned char*)newFrame);
@@ -213,7 +213,7 @@ void regenerateBackgroundIncrust(backgroundIncrustStruct *pHead) {
drawSprite(width, height, NULL, filesDatabase[frame].subData.ptr, pl->Y, pl->X, backgroundScreens[pl->backgroundIdx], filesDatabase[frame].subData.ptrMask);
} else {
// Poly
- addBackgroundIncrustSub1(frame, pl->X, pl->Y, NULL, pl->scale, (char*)backgroundScreens[pl->backgroundIdx], (char *)filesDatabase[frame].subData.ptr);
+ addBackgroundIncrustSub1(frame, pl->X, pl->Y, NULL, pl->scale, (char *)backgroundScreens[pl->backgroundIdx], (char *)filesDatabase[frame].subData.ptr);
}
backgroundChanged[pl->backgroundIdx] = true;
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index 7ce9b4ec78..6e2847d6d7 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -691,7 +691,7 @@ int findObject(int mouseX, int mouseY, int *outObjOvl, int *outObjIdx) {
if ((filesDatabase[j].subData.resourceType == OBJ_TYPE_POLY) && (filesDatabase[j].subData.ptr)) {
int zoom = params.scale;
- int16* dataPtr = (int16*)filesDatabase[j].subData.ptr;
+ int16* dataPtr = (int16 *)filesDatabase[j].subData.ptr;
if (*dataPtr == 0) {
int16 offset;
@@ -723,7 +723,7 @@ int findObject(int mouseX, int mouseY, int *outObjOvl, int *outObjIdx) {
y -= newY;
}
- if (dataPtr && findPoly((char*)dataPtr, x, y, zoom, mouseX, mouseY)) {
+ if (dataPtr && findPoly((char *)dataPtr, x, y, zoom, mouseX, mouseY)) {
*outObjOvl = linkedObjOvl;
*outObjIdx = linkedObjIdx;
diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp
index 76479d7a10..94d075ecc3 100644
--- a/engines/cruise/dataLoader.cpp
+++ b/engines/cruise/dataLoader.cpp
@@ -420,7 +420,7 @@ int loadSetEntry(const char *name, uint8 *ptr, int currentEntryIdx, int currentD
int sec = 0;
uint16 numIdx;
- if (!strcmp((char*)ptr, "SEC")) {
+ if (!strcmp((char *)ptr, "SEC")) {
sec = 1;
}
diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp
index a6680f7a02..2fd86a11b7 100644
--- a/engines/cruise/font.cpp
+++ b/engines/cruise/font.cpp
@@ -106,7 +106,7 @@ void loadFNT(const char *fileName) {
fontFileHandle.read(header, 4);
- if (strcmp((char*)header, "FNT") == 0) {
+ if (strcmp((char *)header, "FNT") == 0) {
uint32 fontSize = fontFileHandle.readUint32BE();
_systemFNT = (uint8 *)mallocAndZero(fontSize);
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index 27b9be7e79..610465e962 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -142,7 +142,7 @@ int16 Op_AddProc() {
if (procBss) {
for (long int i = 0; i < pop1; i++) {
- int16* ptr = (int16*)(procBss + i * 2);
+ int16* ptr = (int16 *)(procBss + i * 2);
*ptr = param[i];
bigEndianShortToNative(ptr);
}
@@ -1046,7 +1046,7 @@ int16 Op_ComputeLine() {
int y1 = popVar();
int x1 = popVar();
- point* pDest = (point*)popPtr();
+ point* pDest = (point *)popPtr();
int maxValue = cor_droite(x1, y1, x2, y2, pDest);
@@ -1334,7 +1334,7 @@ int16 Op_TrackAnim() { // setup actor position
}
int16 Op_BgName() {
- char* bgName = (char*)popPtr();
+ char* bgName = (char *)popPtr();
int bgIdx = popVar();
if ((bgIdx >= 0) && (bgIdx < NBSCREENS) && bgName) {
@@ -1524,7 +1524,7 @@ int16 Op_Itoa() {
param[i] = popVar();
int val = popVar();
- char* pDest = (char*)popPtr();
+ char* pDest = (char *)popPtr();
if (!nbp)
sprintf(txt, "%d", val);
@@ -1645,7 +1645,7 @@ int16 Op_SetVolume() {
}
int16 Op_SongExist() {
- const char *songName = (char*)popPtr();
+ const char *songName = (char *)popPtr();
if (songName) {
char name[33];
diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp
index 9a5df69cae..24f65500db 100644
--- a/engines/cruise/mainDraw.cpp
+++ b/engines/cruise/mainDraw.cpp
@@ -185,7 +185,7 @@ void flipPoly(int fileId, int16 *dataPtr, int scale, char** newFrame, int X, int
Y -= newY;
}
- *newFrame = (char*)dataPtr;
+ *newFrame = (char *)dataPtr;
*outX = X;
*outY = Y;
*outScale = scale;
@@ -1077,7 +1077,7 @@ void mainDrawPolygons(int fileIndex, cellStruct *plWork, int X, int scale, int Y
int sizeTable[4]; // 0 = left, 1 = right, 2 = bottom, 3 = top
// this function checks if the dataPtr is not 0, else it retrives the data for X, Y, scale and DataPtr again (OLD: mainDrawSub1Sub1)
- flipPoly(fileIndex, (int16*)dataPtr, scale, &newFrame, X, Y, &newX, &newY, &newScale);
+ flipPoly(fileIndex, (int16 *)dataPtr, scale, &newFrame, X, Y, &newX, &newY, &newScale);
// this function fills the sizeTable for the poly (OLD: mainDrawSub1Sub2)
getPolySize(newX, newY, newScale, sizeTable, (unsigned char*)newFrame);
@@ -1143,7 +1143,7 @@ void mainDrawPolygons(int fileIndex, cellStruct *plWork, int X, int scale, int Y
}
// this function builds the poly model and then calls the draw functions (OLD: mainDrawSub1Sub5)
- buildPolyModel(newX, newY, newScale, (char*)polygonMask, destBuffer, newFrame);
+ buildPolyModel(newX, newY, newScale, (char *)polygonMask, destBuffer, newFrame);
}
void drawMessage(const gfxEntryStruct *pGfxPtr, int globalX, int globalY, int width, int newColor, uint8 *ouputPtr) {
@@ -1419,7 +1419,7 @@ void mainDraw(int16 param) {
currentObjPtr = cellHead.next;
#ifdef _DEBUG
- /* polyOutputBuffer = (char*)bgPtr;
+ /* polyOutputBuffer = (char *)bgPtr;
drawCtp(); */
#endif
diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp
index e2bd1ebc34..26bea0441c 100644
--- a/engines/cruise/saveload.cpp
+++ b/engines/cruise/saveload.cpp
@@ -924,10 +924,10 @@ Common::Error loadSavegameData(int saveGameIdx) {
if (ptr) {
ASSERT(0);
- //*(int16*)(currentcellHead->datas+0x2E) = getSprite(ptr,*(int16*)(currentcellHead->datas+0xE));
+ //*(int16 *)(currentcellHead->datas+0x2E) = getSprite(ptr,*(int16 *)(currentcellHead->datas+0xE));
} else {
ASSERT(0);
- //*(int16*)(currentcellHead->datas+0x2E) = 0;
+ //*(int16 *)(currentcellHead->datas+0x2E) = 0;
}
}
diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp
index cf28548e7d..d753d938bd 100644
--- a/engines/cruise/script.cpp
+++ b/engines/cruise/script.cpp
@@ -33,7 +33,7 @@ scriptInstanceStruct procHead;
scriptInstanceStruct *currentScriptPtr;
int8 getByteFromScript() {
- int8 var = *(int8*)(currentData3DataPtr + currentScriptPtr->scriptOffset);
+ int8 var = *(int8 *)(currentData3DataPtr + currentScriptPtr->scriptOffset);
++currentScriptPtr->scriptOffset;
return (var);
@@ -202,7 +202,7 @@ int32 opcodeType1() {
di = currentScriptPtr->overlayNumber;
}
- if ((var == 0x85) && !strcmp((char*)currentCtpName, "S26.CTP") && !di && mode == 1) { // patch in bar
+ if ((var == 0x85) && !strcmp((char *)currentCtpName, "S26.CTP") && !di && mode == 1) { // patch in bar
var = 0x87;
}