aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions
diff options
context:
space:
mode:
authorEric Fry2018-06-28 22:50:20 +1000
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit8e43261d13a81131e0be0bfc75627f7395f78a90 (patch)
treee6f2d38900233da689bb59d3ec293f14b510a4b6 /engines/illusions
parentfee1f3d8cb065182322bc80aba39a66a1b4b0cfb (diff)
downloadscummvm-rg350-8e43261d13a81131e0be0bfc75627f7395f78a90.tar.gz
scummvm-rg350-8e43261d13a81131e0be0bfc75627f7395f78a90.tar.bz2
scummvm-rg350-8e43261d13a81131e0be0bfc75627f7395f78a90.zip
ILLUSIONS: Formatting fixes
Simplified some point arithmetic Lock fixedpoint calcs to float rather than double
Diffstat (limited to 'engines/illusions')
-rw-r--r--engines/illusions/actor.cpp2
-rw-r--r--engines/illusions/bbdou/bbdou_specialcode.cpp5
-rw-r--r--engines/illusions/detection.cpp2
-rw-r--r--engines/illusions/duckman/illusions_duckman.cpp5
-rw-r--r--engines/illusions/duckman/menusystem_duckman.h16
-rw-r--r--engines/illusions/fixedpoint.cpp2
-rw-r--r--engines/illusions/graphics.cpp3
-rw-r--r--engines/illusions/illusions.cpp2
-rw-r--r--engines/illusions/menusystem.h5
-rw-r--r--engines/illusions/pathfinder.cpp2
-rw-r--r--engines/illusions/scriptopcodes.h2
-rw-r--r--engines/illusions/threads/talkthread_duckman.cpp6
12 files changed, 19 insertions, 33 deletions
diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp
index 568a1cca5e..bd0d7247a3 100644
--- a/engines/illusions/actor.cpp
+++ b/engines/illusions/actor.cpp
@@ -618,7 +618,6 @@ void Control::startTalkActor(uint32 sequenceId, byte *entryTblPtr, uint32 thread
}
void Control::sequenceActor() {
-
if (_actor->_pauseCtr > 0)
return;
@@ -665,7 +664,6 @@ void Control::sequenceActor() {
//debug(1, "Sequence has finished");
_actor->_seqCodeIp = 0;
}
-
}
void Control::setActorIndex(int actorIndex) {
diff --git a/engines/illusions/bbdou/bbdou_specialcode.cpp b/engines/illusions/bbdou/bbdou_specialcode.cpp
index 2d8df43f23..c7e79a722b 100644
--- a/engines/illusions/bbdou/bbdou_specialcode.cpp
+++ b/engines/illusions/bbdou/bbdou_specialcode.cpp
@@ -531,10 +531,7 @@ void BbdouSpecialCode::setCursorControlRoutine(uint32 objectId, int num) {
}
Common::Point BbdouSpecialCode::getBackgroundCursorPos(Common::Point cursorPos) {
- Common::Point pt = _vm->_camera->getScreenOffset();
- pt.x += cursorPos.x;
- pt.y += cursorPos.y;
- return pt;
+ return _vm->_camera->getScreenOffset() + cursorPos;
}
void BbdouSpecialCode::showBubble(uint32 objectId, uint32 overlappedObjectId, uint32 holdingObjectId,
diff --git a/engines/illusions/detection.cpp b/engines/illusions/detection.cpp
index 63aea79ba6..89fa429457 100644
--- a/engines/illusions/detection.cpp
+++ b/engines/illusions/detection.cpp
@@ -140,7 +140,6 @@ SaveStateList IllusionsMetaEngine::listSaves(const char *target) const {
pattern += ".???";
Common::StringArray filenames;
filenames = saveFileMan->listSavefiles(pattern.c_str());
- Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
SaveStateList saveList;
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
// Obtain the last 3 digits of the filename, since they correspond to the save slot
@@ -155,6 +154,7 @@ SaveStateList IllusionsMetaEngine::listSaves(const char *target) const {
}
}
}
+ Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator());
return saveList;
}
diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp
index 56c997dd1f..c30b8ce318 100644
--- a/engines/illusions/duckman/illusions_duckman.cpp
+++ b/engines/illusions/duckman/illusions_duckman.cpp
@@ -983,10 +983,7 @@ uint32 IllusionsEngine_Duckman::getObjectActorTypeId(uint32 objectId) {
}
Common::Point IllusionsEngine_Duckman::convertMousePos(Common::Point mousePos) {
- Common::Point screenOffsPt = _camera->getScreenOffset();
- mousePos.x += screenOffsPt.x;
- mousePos.y += screenOffsPt.y;
- return mousePos;
+ return mousePos + _camera->getScreenOffset();
}
void IllusionsEngine_Duckman::startCursorSequence() {
diff --git a/engines/illusions/duckman/menusystem_duckman.h b/engines/illusions/duckman/menusystem_duckman.h
index edf8620020..ee53543550 100644
--- a/engines/illusions/duckman/menusystem_duckman.h
+++ b/engines/illusions/duckman/menusystem_duckman.h
@@ -27,14 +27,14 @@
namespace Illusions {
- enum SliderActionType {
- SFX,
- MUSIC,
- VOICE,
- TEXT_DURATION
- };
+enum SliderActionType {
+ SFX,
+ MUSIC,
+ VOICE,
+ TEXT_DURATION
+};
- enum {
+enum {
kDuckmanMainMenu,
kDuckmanLoadGameMenu,
kDuckmanLoadGameFailedMenu,
@@ -52,7 +52,7 @@ namespace Illusions {
class IllusionsEngine_Duckman;
class MenuActionUpdateSlider;
- class DuckmanMenuSystem : public BaseMenuSystem {
+class DuckmanMenuSystem : public BaseMenuSystem {
public:
DuckmanMenuSystem(IllusionsEngine_Duckman *vm);
~DuckmanMenuSystem();
diff --git a/engines/illusions/fixedpoint.cpp b/engines/illusions/fixedpoint.cpp
index f240b14ab1..18c76df0d9 100644
--- a/engines/illusions/fixedpoint.cpp
+++ b/engines/illusions/fixedpoint.cpp
@@ -52,7 +52,7 @@ int16 fixedTrunc(FixedPoint16 value) {
FixedPoint16 fixedDistance(FixedPoint16 x1, FixedPoint16 y1, FixedPoint16 x2, FixedPoint16 y2) {
float xd = fixedToFloat(x1) - fixedToFloat(x2);
float yd = fixedToFloat(y1) - fixedToFloat(y2);
- if (xd != 0.0 || yd != 0.0)
+ if (xd != 0.0f || yd != 0.0f)
return floatToFixed(sqrt(xd * xd + yd * yd));
return 0;
}
diff --git a/engines/illusions/graphics.cpp b/engines/illusions/graphics.cpp
index 772d6271be..e359683da8 100644
--- a/engines/illusions/graphics.cpp
+++ b/engines/illusions/graphics.cpp
@@ -76,8 +76,7 @@ void NamedPoints::load(uint count, Common::SeekableReadStream &stream) {
void loadPoint(Common::SeekableReadStream &stream, Common::Point &pt) {
pt.x = stream.readSint16LE();
pt.y = stream.readSint16LE();
- debug(0, "loadPoint() x: %d; y: %d",
- pt.x, pt.y);
+ debug(0, "loadPoint() x: %d; y: %d", pt.x, pt.y);
}
} // End of namespace Illusions
diff --git a/engines/illusions/illusions.cpp b/engines/illusions/illusions.cpp
index 14fddc50dc..1108681f9c 100644
--- a/engines/illusions/illusions.cpp
+++ b/engines/illusions/illusions.cpp
@@ -242,7 +242,7 @@ int IllusionsEngine::convertPanXCoord(int16 x) {
int16 diff = x - _camera->getCurrentPan().x;
int16 absX = ABS(diff);
int newX = 0;
- if ( absX < 160) {
+ if (absX < 160) {
newX = (diff << 7) / 320;
} else if (diff < 0) {
newX = -64;
diff --git a/engines/illusions/menusystem.h b/engines/illusions/menusystem.h
index dd4512900d..ce5b1361e9 100644
--- a/engines/illusions/menusystem.h
+++ b/engines/illusions/menusystem.h
@@ -171,11 +171,6 @@ protected:
virtual void playSoundEffect(int sfxId) = 0;
};
-/*
-
-
-*/
-
class MenuTextBuilder {
public:
MenuTextBuilder();
diff --git a/engines/illusions/pathfinder.cpp b/engines/illusions/pathfinder.cpp
index 936e855cdb..f021b2d5c5 100644
--- a/engines/illusions/pathfinder.cpp
+++ b/engines/illusions/pathfinder.cpp
@@ -30,7 +30,7 @@ PointArray *PathFinder::findPath(Camera *camera, Common::Point sourcePt, Common:
PointArray *walkPoints, PathLines *walkRects, WidthHeight bgDimensions) {
Common::Point cameraPt = camera->getScreenOffset();
_screenRect.p0 = cameraPt;
- _screenRect.p1.x = cameraPt.x + 320; //TODO fix me get screen dimentions here.
+ _screenRect.p1.x = cameraPt.x + 320; //TODO fix me get screen dimensions here.
_screenRect.p1.y = cameraPt.y + 200;
_walkPoints = walkPoints;
_walkRects = walkRects;
diff --git a/engines/illusions/scriptopcodes.h b/engines/illusions/scriptopcodes.h
index 9314a60e00..e2192101fa 100644
--- a/engines/illusions/scriptopcodes.h
+++ b/engines/illusions/scriptopcodes.h
@@ -60,7 +60,7 @@ protected:
};
// Convenience macros
-#define ARG_SKIP(x) opCall.skip(x);
+#define ARG_SKIP(x) opCall.skip(x);
#define ARG_BYTE(name) byte name = opCall.readByte(); debug(5, "ARG_BYTE(" #name " = %d)", name);
#define ARG_INT16(name) int16 name = opCall.readSint16(); debug(5, "ARG_INT16(" #name " = %d)", name);
#define ARG_UINT32(name) uint32 name = opCall.readUint32(); debug(5, "ARG_UINT32(" #name " = %08X)", name);
diff --git a/engines/illusions/threads/talkthread_duckman.cpp b/engines/illusions/threads/talkthread_duckman.cpp
index a2e9ebaec6..36911597ff 100644
--- a/engines/illusions/threads/talkthread_duckman.cpp
+++ b/engines/illusions/threads/talkthread_duckman.cpp
@@ -74,7 +74,7 @@ int TalkThread_Duckman::onUpdate() {
if (_vm->checkActiveTalkThreads())
return kTSYield;
_status = 3;
- // Fallthrough to status 2
+ // fall through
case 2:
talkEntry = getTalkResourceEntry(_talkId);
@@ -101,13 +101,13 @@ int TalkThread_Duckman::onUpdate() {
if (_objectId == 0 || _durationMult == 0)
_flags |= 8;
_status = 3;
- // Fallthrough to status 3
+ // fall through
case 3:
if (!(_flags & 4) && !_vm->_soundMan->isVoiceCued())
return kTSYield;
_status = 4;
- // Fallthrough to status 4
+ // fall through
case 4:
if (!(_flags & 8) ) {