aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo
diff options
context:
space:
mode:
authorArnaud Boutonné2010-08-20 16:35:20 +0000
committerArnaud Boutonné2010-08-20 16:35:20 +0000
commite81eab613374655022a592a055e7afe106765147 (patch)
treed78b2dedd9834b7d039f58762e32cc4e9d85a0f6 /engines/hugo
parent53bf93a8847c47f983a3ee25bffa8f6072ad82d4 (diff)
downloadscummvm-rg350-e81eab613374655022a592a055e7afe106765147.tar.gz
scummvm-rg350-e81eab613374655022a592a055e7afe106765147.tar.bz2
scummvm-rg350-e81eab613374655022a592a055e7afe106765147.zip
Hugo : Style - Add parenthesis around condition when conditional operator is used, as mentioned in Code Formatting Conventions
svn-id: r52230
Diffstat (limited to 'engines/hugo')
-rw-r--r--engines/hugo/detection.cpp2
-rw-r--r--engines/hugo/engine.cpp6
-rw-r--r--engines/hugo/game.h2
-rw-r--r--engines/hugo/mouse.cpp4
-rw-r--r--engines/hugo/schedule.cpp2
-rw-r--r--engines/hugo/util.cpp2
6 files changed, 9 insertions, 9 deletions
diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp
index cf10bbbe0f..51a4ad324f 100644
--- a/engines/hugo/detection.cpp
+++ b/engines/hugo/detection.cpp
@@ -199,7 +199,7 @@ void HugoEngine::initGame(const HugoGameDescription *gd) {
void HugoEngine::initGamePart(const HugoGameDescription *gd) {
char tmpStr[8];
- _gameVariant = _gameType - 1 + (_platform == Common::kPlatformWindows ? 0 : 3);
+ _gameVariant = _gameType - 1 + ((_platform == Common::kPlatformWindows) ? 0 : 3);
//Generate filenames
if (gd->desc.platform == Common::kPlatformWindows)
diff --git a/engines/hugo/engine.cpp b/engines/hugo/engine.cpp
index 59b2e0d9ee..967d75e663 100644
--- a/engines/hugo/engine.cpp
+++ b/engines/hugo/engine.cpp
@@ -262,11 +262,11 @@ void HugoEngine::moveObjects() {
if (abs(dx) <= radius)
obj->vx = 0;
else
- obj->vx = dx > 0 ? MIN(dx, obj->vxPath) : MAX(dx, -obj->vxPath);
+ obj->vx = (dx > 0) ? MIN(dx, obj->vxPath) : MAX(dx, -obj->vxPath);
if (abs(dy) <= radius)
obj->vy = 0;
else
- obj->vy = dy > 0 ? MIN(dy, obj->vyPath) : MAX(dy, -obj->vyPath);
+ obj->vy = (dy > 0) ? MIN(dy, obj->vyPath) : MAX(dy, -obj->vyPath);
// Set first image in sequence (if multi-seq object)
switch (obj->seqNumb) {
@@ -467,7 +467,7 @@ int HugoEngine::deltaY(int x1, int x2, int vy, int y) {
if (vy == 0)
return(0); // Object stationary
- inc = (vy > 0 ? 1 : -1);
+ inc = (vy > 0) ? 1 : -1;
for (j = y + inc; j != (y + vy + inc); j += inc) //Search by byte
for (i = x1 >> 3; i <= x2 >> 3; i++)
if ((b = _boundary[j * XBYTES + i] | _objBound[j * XBYTES + i]) != 0) { // Any bit set
diff --git a/engines/hugo/game.h b/engines/hugo/game.h
index e8eeae75cb..ccac23d3c8 100644
--- a/engines/hugo/game.h
+++ b/engines/hugo/game.h
@@ -109,7 +109,7 @@ namespace Hugo {
#define LOOK_S 8 // Description depends on state of object
// Macros:
-#define TPS (_config.turboFl ? TURBO_TPS : NORMAL_TPS)
+#define TPS ((_config.turboFl) ? TURBO_TPS : NORMAL_TPS)
enum TEXTCOLORS {
diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp
index 329b0b4fc7..dcc4b20730 100644
--- a/engines/hugo/mouse.cpp
+++ b/engines/hugo/mouse.cpp
@@ -167,7 +167,7 @@ void MouseHandler::processLeftClick(int16 objId, int16 cx, int16 cy) {
case LEFT_ARROW: // A scroll arrow - scroll the iconbar
case RIGHT_ARROW:
// Scroll the iconbar and display results
- _vm.inventory().processInventory(objId == LEFT_ARROW ? INV_LEFT : INV_RIGHT);
+ _vm.inventory().processInventory((objId == LEFT_ARROW) ? INV_LEFT : INV_RIGHT);
_vm.screen().moveImage(_vm.screen().getIconBuffer(), 0, 0, XPIX, INV_DY, XPIX, _vm.screen().getFrontBuffer(), 0, DIBOFF_Y, XPIX);
_vm.screen().moveImage(_vm.screen().getIconBuffer(), 0, 0, XPIX, INV_DY, XPIX, _vm.screen().getBackBuffer(), 0, DIBOFF_Y, XPIX);
_vm.screen().displayList(D_ADD, 0, DIBOFF_Y, XPIX, INV_DY);
@@ -281,7 +281,7 @@ void MouseHandler::mouseHandler() {
if (objId >= 0) { // Got a match
// Display object name next to cursor (unless CURSOR_NOCHAR)
// Note test for swapped hero name
- name = _vm._arrayNouns[_vm._objects[objId == HERO ? _vm._heroImage : objId].nounIndex][CURSOR_NAME];
+ name = _vm._arrayNouns[(_vm._objects[objId == HERO) ? _vm._heroImage : objId].nounIndex][CURSOR_NAME];
if (name[0] != CURSOR_NOCHAR)
cursorText(name, cx, cy, U_FONT8, _TBRIGHTWHITE);
diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp
index 9757ace12a..e7ebdfa7a1 100644
--- a/engines/hugo/schedule.cpp
+++ b/engines/hugo/schedule.cpp
@@ -47,7 +47,7 @@
namespace Hugo {
-#define SIGN(X) (X < 0 ? -1 : 1)
+#define SIGN(X) ((X < 0) ? -1 : 1)
Scheduler::Scheduler(HugoEngine &vm) : _vm(vm) {
}
diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp
index f623583fd1..ad7b9fe39e 100644
--- a/engines/hugo/util.cpp
+++ b/engines/hugo/util.cpp
@@ -200,7 +200,7 @@ void Utils::Debug_out(char *format, ...) {
if (HugoEngine::get().getGameStatus().debugFl) {
/* Create/truncate if first call, else append */
- if ((fp = fopen("debug.txt", fp == NULL ? "w" : "a")) == NULL) {
+ if ((fp = fopen("debug.txt", (fp == NULL) ? "w" : "a")) == NULL) {
Error(WRITE_ERR, "debug.txt");
return;
}