aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2007-12-11 23:06:12 +0000
committerFilippos Karapetis2007-12-11 23:06:12 +0000
commitf5a537d6f81f60bc2a0bb5f2d6ea61098f08ed99 (patch)
treedc3042149cb368940cb38b81a5697f6e61d8cb36
parent9ec7588e4956dd7ea5092ec738aad49a90319c51 (diff)
downloadscummvm-rg350-f5a537d6f81f60bc2a0bb5f2d6ea61098f08ed99.tar.gz
scummvm-rg350-f5a537d6f81f60bc2a0bb5f2d6ea61098f08ed99.tar.bz2
scummvm-rg350-f5a537d6f81f60bc2a0bb5f2d6ea61098f08ed99.zip
Changed some swaps to use the template SWAP
svn-id: r29829
-rw-r--r--engines/cruise/font.cpp31
-rw-r--r--engines/cruise/mainDraw.cpp6
2 files changed, 8 insertions, 29 deletions
diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp
index a5f200b54c..561d750509 100644
--- a/engines/cruise/font.cpp
+++ b/engines/cruise/font.cpp
@@ -24,6 +24,7 @@
*/
#include "common/file.h"
+#include "common/util.h"
#include "cruise/cruise_main.h"
@@ -194,44 +195,26 @@ void loadSystemFont(void) {
void flipShort(int16 *var) {
uint8 *varPtr = (uint8 *) var;
- uint8 temp = varPtr[0];
- varPtr[0] = varPtr[1];
- varPtr[1] = temp;
+ SWAP(varPtr[0], varPtr[1]);
}
void flipShort(uint16 *var) {
uint8 *varPtr = (uint8 *) var;
- uint8 temp = varPtr[0];
- varPtr[0] = varPtr[1];
- varPtr[1] = temp;
+ SWAP(varPtr[0], varPtr[1]);
}
void flipLong(int32 *var) {
- char swap1;
- char swap2;
char *varPtr = (char *)var;
- swap1 = varPtr[0];
- varPtr[0] = varPtr[3];
- varPtr[3] = swap1;
-
- swap2 = varPtr[1];
- varPtr[1] = varPtr[2];
- varPtr[2] = swap2;
+ SWAP(varPtr[0], varPtr[3]);
+ SWAP(varPtr[1], varPtr[2]);
}
void flipLong(uint32 *var) {
- char swap1;
- char swap2;
char *varPtr = (char *)var;
- swap1 = varPtr[0];
- varPtr[0] = varPtr[3];
- varPtr[3] = swap1;
-
- swap2 = varPtr[1];
- varPtr[1] = varPtr[2];
- varPtr[2] = swap2;
+ SWAP(varPtr[0], varPtr[3]);
+ SWAP(varPtr[1], varPtr[2]);
}
void flipGen(void *var, int32 length) {
diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp
index 687f27a2dd..3e4c6644af 100644
--- a/engines/cruise/mainDraw.cpp
+++ b/engines/cruise/mainDraw.cpp
@@ -82,11 +82,7 @@ void freeAutoCell(void) {
}
void flipScreen(void) {
- uint8 *swapPtr;
-
- swapPtr = gfxModuleData.pPage00;
- gfxModuleData.pPage00 = gfxModuleData.pPage10;
- gfxModuleData.pPage10 = swapPtr;
+ SWAP(gfxModuleData.pPage00, gfxModuleData.pPage10);
gfxModuleData_flipScreen();