aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-26 04:12:58 +0200
committerEinar Johan Trøan Sømåen2012-07-26 04:12:58 +0200
commit38507fa9895620639d8733dbb4e085dfb2282a33 (patch)
tree2b246fa93ce4ec173ac3db77e8cbacc562c6bb20 /engines/wintermute
parent1ad859a468415cc7fd93adaa84beba02aae29ad8 (diff)
downloadscummvm-rg350-38507fa9895620639d8733dbb4e085dfb2282a33.tar.gz
scummvm-rg350-38507fa9895620639d8733dbb4e085dfb2282a33.tar.bz2
scummvm-rg350-38507fa9895620639d8733dbb4e085dfb2282a33.zip
WINTERMUTE: AStyle-formatting.
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/ad/ad_actor.cpp2
-rw-r--r--engines/wintermute/ad/ad_game.h4
-rw-r--r--engines/wintermute/ad/ad_item.cpp2
-rw-r--r--engines/wintermute/ad/ad_node_state.cpp35
-rw-r--r--engines/wintermute/ad/ad_response_box.h6
-rw-r--r--engines/wintermute/ad/ad_talk_holder.cpp4
-rw-r--r--engines/wintermute/ad/ad_types.h36
-rw-r--r--engines/wintermute/base/base_file_manager.cpp10
-rw-r--r--engines/wintermute/base/base_file_manager.h2
-rw-r--r--engines/wintermute/base/base_frame.cpp2
-rw-r--r--engines/wintermute/base/base_game.cpp28
-rw-r--r--engines/wintermute/base/base_game.h14
-rw-r--r--engines/wintermute/base/base_keyboard_state.cpp48
-rw-r--r--engines/wintermute/base/base_parser.cpp2
-rw-r--r--engines/wintermute/base/base_parser.h2
-rw-r--r--engines/wintermute/base/base_persistence_manager.cpp4
-rw-r--r--engines/wintermute/base/base_registry.cpp4
-rw-r--r--engines/wintermute/base/base_sprite.cpp2
-rw-r--r--engines/wintermute/base/base_sub_frame.cpp8
-rw-r--r--engines/wintermute/base/base_transition_manager.cpp2
-rw-r--r--engines/wintermute/base/file/base_disk_file.cpp8
-rw-r--r--engines/wintermute/base/file/base_disk_file.h2
-rw-r--r--engines/wintermute/base/file/base_file_entry.cpp10
-rw-r--r--engines/wintermute/base/file/base_package.cpp40
-rw-r--r--engines/wintermute/base/file/base_package.h6
-rw-r--r--engines/wintermute/base/file/base_resources.cpp2
-rw-r--r--engines/wintermute/base/file/base_resources.h2
-rw-r--r--engines/wintermute/base/file/dcpackage.h4
-rw-r--r--engines/wintermute/base/font/base_font_truetype.cpp4
-rw-r--r--engines/wintermute/base/gfx/base_renderer.h4
-rw-r--r--engines/wintermute/base/gfx/base_surface.h2
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.cpp74
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.h4
-rw-r--r--engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp4
-rw-r--r--engines/wintermute/base/particles/part_emitter.h32
-rw-r--r--engines/wintermute/base/sound/base_sound.cpp2
-rw-r--r--engines/wintermute/base/sound/base_sound_buffer.cpp4
-rw-r--r--engines/wintermute/base/sound/base_sound_manager.cpp2
-rw-r--r--engines/wintermute/dcscript.h16
-rw-r--r--engines/wintermute/dctypes.h118
-rw-r--r--engines/wintermute/detection.cpp116
-rw-r--r--engines/wintermute/math/math_util.cpp4
-rw-r--r--engines/wintermute/math/math_util.h4
-rw-r--r--engines/wintermute/math/matrix4.cpp4
-rw-r--r--engines/wintermute/math/matrix4.h4
-rw-r--r--engines/wintermute/math/rect32.h36
-rw-r--r--engines/wintermute/math/vector2.cpp4
-rw-r--r--engines/wintermute/math/vector2.h4
-rw-r--r--engines/wintermute/utils/path_util.cpp14
-rw-r--r--engines/wintermute/utils/string_util.cpp2
-rw-r--r--engines/wintermute/utils/utils.cpp8
-rw-r--r--engines/wintermute/wintermute.cpp126
-rw-r--r--engines/wintermute/wintermute.h4
-rw-r--r--engines/wintermute/wintypes.h4
54 files changed, 452 insertions, 439 deletions
diff --git a/engines/wintermute/ad/ad_actor.cpp b/engines/wintermute/ad/ad_actor.cpp
index fc28293ac8..fe1948d3a8 100644
--- a/engines/wintermute/ad/ad_actor.cpp
+++ b/engines/wintermute/ad/ad_actor.cpp
@@ -790,7 +790,7 @@ void AdActor::getNextStep() {
maxStepX--;
}
- if (((AdGame *)_gameRef)->_scene->isBlockedAt((int)_pFX,(int) _pFY, true, this)) {
+ if (((AdGame *)_gameRef)->_scene->isBlockedAt((int)_pFX, (int) _pFY, true, this)) {
if (_pFCount == 0) {
_state = _nextState;
_nextState = STATE_READY;
diff --git a/engines/wintermute/ad/ad_game.h b/engines/wintermute/ad/ad_game.h
index 5136ed09d3..49c48de0bb 100644
--- a/engines/wintermute/ad/ad_game.h
+++ b/engines/wintermute/ad/ad_game.h
@@ -151,10 +151,10 @@ private:
BaseArray<AdItem *, AdItem *> _items;
BaseArray<AdSentence *, AdSentence *> _sentences;
-
+
BaseArray<AdSceneState *, AdSceneState *> _sceneStates;
BaseArray<char *, char *> _dlgPendingBranches;
-
+
BaseArray<AdResponseContext *, AdResponseContext *> _responsesBranch;
BaseArray<AdResponseContext *, AdResponseContext *> _responsesGame;
diff --git a/engines/wintermute/ad/ad_item.cpp b/engines/wintermute/ad/ad_item.cpp
index e9a1bb4353..cae974e152 100644
--- a/engines/wintermute/ad/ad_item.cpp
+++ b/engines/wintermute/ad/ad_item.cpp
@@ -375,7 +375,7 @@ bool AdItem::update() {
}
}
default:
- break;
+ break;
}
_ready = (_state == STATE_READY);
diff --git a/engines/wintermute/ad/ad_node_state.cpp b/engines/wintermute/ad/ad_node_state.cpp
index 6212274d03..444373ea75 100644
--- a/engines/wintermute/ad/ad_node_state.cpp
+++ b/engines/wintermute/ad/ad_node_state.cpp
@@ -44,7 +44,8 @@ IMPLEMENT_PERSISTENT(AdNodeState, false)
AdNodeState::AdNodeState(BaseGame *inGame): BaseClass(inGame) {
_name = NULL;
_active = false;
- for (int i = 0; i < 7; i++) _caption[i] = NULL;
+ for (int i = 0; i < 7; i++)
+ _caption[i] = NULL;
_alphaColor = 0;
_filename = NULL;
_cursor = NULL;
@@ -99,7 +100,8 @@ bool AdNodeState::persist(BasePersistenceManager *persistMgr) {
persistMgr->transfer(TMEMBER(_filename));
persistMgr->transfer(TMEMBER(_cursor));
persistMgr->transfer(TMEMBER(_alphaColor));
- for (int i = 0; i < 7; i++) persistMgr->transfer(TMEMBER(_caption[i]));
+ for (int i = 0; i < 7; i++)
+ persistMgr->transfer(TMEMBER(_caption[i]));
return STATUS_OK;
}
@@ -107,23 +109,27 @@ bool AdNodeState::persist(BasePersistenceManager *persistMgr) {
//////////////////////////////////////////////////////////////////////////
void AdNodeState::setCaption(const char *caption, int caseVal) {
- if (caseVal== 0) caseVal= 1;
- if (caseVal< 1 || caseVal> 7) return;
-
- delete[] _caption[caseVal- 1];
- _caption[caseVal- 1] = new char[strlen(caption) + 1];
- if (_caption[caseVal- 1]) {
- strcpy(_caption[caseVal- 1], caption);
- _gameRef->_stringTable->expand(&_caption[caseVal- 1]);
+ if (caseVal == 0)
+ caseVal = 1;
+ if (caseVal < 1 || caseVal > 7)
+ return;
+
+ delete[] _caption[caseVal - 1];
+ _caption[caseVal - 1] = new char[strlen(caption) + 1];
+ if (_caption[caseVal - 1]) {
+ strcpy(_caption[caseVal - 1], caption);
+ _gameRef->_stringTable->expand(&_caption[caseVal - 1]);
}
}
//////////////////////////////////////////////////////////////////////////
char *AdNodeState::getCaption(int caseVal) {
- if (caseVal== 0) caseVal= 1;
- if (caseVal< 1 || caseVal> 7 || _caption[caseVal- 1] == NULL) return "";
- else return _caption[caseVal- 1];
+ if (caseVal == 0) caseVal = 1;
+ if (caseVal < 1 || caseVal > 7 || _caption[caseVal - 1] == NULL)
+ return "";
+ else
+ return _caption[caseVal - 1];
}
@@ -132,7 +138,8 @@ bool AdNodeState::transferEntity(AdEntity *entity, bool includingSprites, bool s
if (!entity) return STATUS_FAILED;
// HACK!
- if (this->_gameRef != entity->_gameRef) this->_gameRef = entity->_gameRef;
+ if (this->_gameRef != entity->_gameRef)
+ this->_gameRef = entity->_gameRef;
if (saving) {
for (int i = 0; i < 7; i++) {
diff --git a/engines/wintermute/ad/ad_response_box.h b/engines/wintermute/ad/ad_response_box.h
index f77ff3360c..5dc22cbebe 100644
--- a/engines/wintermute/ad/ad_response_box.h
+++ b/engines/wintermute/ad/ad_response_box.h
@@ -52,9 +52,9 @@ public:
ScScript *_waitingScript;
virtual bool listen(BaseScriptHolder *param1, uint32 param2);
typedef enum {
- EVENT_PREV,
- EVENT_NEXT,
- EVENT_RESPONSE
+ EVENT_PREV,
+ EVENT_NEXT,
+ EVENT_RESPONSE
} TResponseEvent;
bool weedResponses();
diff --git a/engines/wintermute/ad/ad_talk_holder.cpp b/engines/wintermute/ad/ad_talk_holder.cpp
index 359215ee8f..d47cbb446e 100644
--- a/engines/wintermute/ad/ad_talk_holder.cpp
+++ b/engines/wintermute/ad/ad_talk_holder.cpp
@@ -222,7 +222,7 @@ bool AdTalkHolder::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisS
} else {
for (int i = 0; i < _talkSprites.getSize(); i++) {
if (scumm_stricmp(_talkSprites[i]->getFilename(), filename) == 0) {
- if (_currentSprite == _talkSprites[i])
+ if (_currentSprite == _talkSprites[i])
setCurrent = true;
if (_tempSprite2 == _talkSprites[i])
setTemp2 = true;
@@ -282,7 +282,7 @@ bool AdTalkHolder::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisS
// set new
if (ex)
_talkSpritesEx.add(spr);
- else
+ else
_talkSprites.add(spr);
stack->pushBool(true);
diff --git a/engines/wintermute/ad/ad_types.h b/engines/wintermute/ad/ad_types.h
index b88d6fe259..18892919c6 100644
--- a/engines/wintermute/ad/ad_types.h
+++ b/engines/wintermute/ad/ad_types.h
@@ -33,19 +33,19 @@ namespace WinterMute {
typedef enum {
GAME_NORMAL,
- GAME_WAITING_RESPONSE
+ GAME_WAITING_RESPONSE
} TGameStateEx;
typedef enum {
OBJECT_ENTITY,
- OBJECT_REGION,
- OBJECT_ACTOR,
- OBJECT_NONE
+ OBJECT_REGION,
+ OBJECT_ACTOR,
+ OBJECT_NONE
} TObjectType;
typedef enum {
ENTITY_NORMAL,
- ENTITY_SOUND
+ ENTITY_SOUND
} TEntityType;
typedef enum {
@@ -66,40 +66,40 @@ typedef enum {
typedef enum {
DIRECT_WALK_NONE,
- DIRECT_WALK_FW,
- DIRECT_WALK_BK
+ DIRECT_WALK_FW,
+ DIRECT_WALK_BK
} TDirectWalkMode;
typedef enum {
DIRECT_TURN_NONE,
- DIRECT_TURN_CW,
- DIRECT_TURN_CCW
+ DIRECT_TURN_CW,
+ DIRECT_TURN_CCW
} TDirectTurnMode;
typedef enum {
RESPONSE_TEXT,
- RESPONSE_ICON
+ RESPONSE_ICON
} TResponseStyle;
typedef enum {
RESPONSE_ALWAYS,
- RESPONSE_ONCE,
- RESPONSE_ONCE_GAME
+ RESPONSE_ONCE,
+ RESPONSE_ONCE_GAME
} TResponseType;
typedef enum {
TALK_SKIP_LEFT = 0,
- TALK_SKIP_RIGHT = 1,
- TALK_SKIP_BOTH = 2,
- TALK_SKIP_NONE = 3
+ TALK_SKIP_RIGHT = 1,
+ TALK_SKIP_BOTH = 2,
+ TALK_SKIP_NONE = 3
} TTalkSkipButton;
typedef enum {
GEOM_WAYPOINT,
- GEOM_WALKPLANE,
- GEOM_BLOCKED,
- GEOM_GENERIC
+ GEOM_WALKPLANE,
+ GEOM_BLOCKED,
+ GEOM_GENERIC
} TGeomNodeType;
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp
index b25bbf024d..c296f88699 100644
--- a/engines/wintermute/base/base_file_manager.cpp
+++ b/engines/wintermute/base/base_file_manager.cpp
@@ -119,7 +119,7 @@ bool BaseFileManager::addPath(TPathType type, const Common::FSNode &path) {
switch (type) {
case PATH_SINGLE:
- // _singlePaths.push_back(path);
+ // _singlePaths.push_back(path);
error("TODO: Allow adding single-paths");
break;
case PATH_PACKAGE:
@@ -154,7 +154,7 @@ bool BaseFileManager::initPaths() {
Common::String path = entries->nextToken();
if (path.size() > 0) {
error("BaseFileManager::initPaths - Game wants to add customPath: %s", path.c_str()); // TODO
- // addPath(PATH_SINGLE, path);
+ // addPath(PATH_SINGLE, path);
}
}
delete entries;
@@ -170,7 +170,7 @@ bool BaseFileManager::initPaths() {
Common::String path = entries->nextToken();
if (path.size() > 0) {
error("BaseFileManager::initPaths - Game wants to add packagePath: %s", path.c_str()); // TODO
- // addPath(PATH_SINGLE, path);
+ // addPath(PATH_SINGLE, path);
}
}
delete entries;
@@ -244,7 +244,7 @@ Common::SeekableReadStream *BaseFileManager::openPkgFile(const Common::String &f
Common::SeekableReadStream *file = NULL;
char fileName[MAX_PATH_LENGTH];
strcpy(fileName, upcName.c_str());
-
+
// correct slashes
for (int32 i = 0; i < upcName.size(); i++) {
if (upcName[i] == '/')
@@ -300,7 +300,7 @@ Common::SeekableReadStream *BaseFileManager::openFileRaw(const Common::String &f
BaseSaveThumbFile *SaveThumbFile = new BaseSaveThumbFile(_gameRef);
if (DID_SUCCEED(SaveThumbFile->open(filename))) {
ret = SaveThumbFile->getMemStream();
- }
+ }
delete SaveThumbFile;
return ret;
}
diff --git a/engines/wintermute/base/base_file_manager.h b/engines/wintermute/base/base_file_manager.h
index e3c20378bb..c49bbe3815 100644
--- a/engines/wintermute/base/base_file_manager.h
+++ b/engines/wintermute/base/base_file_manager.h
@@ -52,7 +52,7 @@ public:
private:
typedef enum {
PATH_PACKAGE,
- PATH_SINGLE
+ PATH_SINGLE
} TPathType;
bool reloadPaths();
bool initPaths();
diff --git a/engines/wintermute/base/base_frame.cpp b/engines/wintermute/base/base_frame.cpp
index 77e959f11b..67edccd041 100644
--- a/engines/wintermute/base/base_frame.cpp
+++ b/engines/wintermute/base/base_frame.cpp
@@ -61,7 +61,7 @@ BaseFrame::~BaseFrame() {
delete _sound;
_sound = NULL;
- for (int i = 0; i < _subframes.getSize(); i++)
+ for (int i = 0; i < _subframes.getSize(); i++)
delete _subframes[i];
_subframes.removeAll();
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp
index 63040f2db2..b2b92d6de4 100644
--- a/engines/wintermute/base/base_game.cpp
+++ b/engines/wintermute/base/base_game.cpp
@@ -259,10 +259,10 @@ BaseGame::BaseGame(): BaseObject(this) {
_autoSaveSlot = 999;
_cursorHidden = false;
-/*#ifdef __IPHONEOS__
- _touchInterface = true;
- _constrainedMemory = true; // TODO differentiate old and new iOS devices
-#else*/
+ /*#ifdef __IPHONEOS__
+ _touchInterface = true;
+ _constrainedMemory = true; // TODO differentiate old and new iOS devices
+ #else*/
_touchInterface = false;
_constrainedMemory = false;
//#endif
@@ -460,7 +460,7 @@ bool BaseGame::initialize1() {
if (_fader == NULL)
break;
registerObject(_fader);
-
+
loaded = true;
}
if (loaded == true) {
@@ -2120,9 +2120,9 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "ShowStatusLine") == 0) {
stack->correctParams(0);
-/*#ifdef __IPHONEOS__
- IOS_ShowStatusLine(TRUE);
-#endif*/
+ /*#ifdef __IPHONEOS__
+ IOS_ShowStatusLine(TRUE);
+ #endif*/
stack->pushNULL();
return STATUS_OK;
@@ -2133,9 +2133,9 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "HideStatusLine") == 0) {
stack->correctParams(0);
-/*#ifdef __IPHONEOS__
- IOS_ShowStatusLine(FALSE);
-#endif*/
+ /*#ifdef __IPHONEOS__
+ IOS_ShowStatusLine(FALSE);
+ #endif*/
stack->pushNULL();
return STATUS_OK;
@@ -3919,9 +3919,9 @@ bool BaseGame::getCurrentViewportRect(Rect32 *rect, bool *custom) {
if (custom) *custom = true;
} else {
BasePlatform::setRect(rect, _renderer->_drawOffsetX,
- _renderer->_drawOffsetY,
- _renderer->_width + _renderer->_drawOffsetX,
- _renderer->_height + _renderer->_drawOffsetY);
+ _renderer->_drawOffsetY,
+ _renderer->_width + _renderer->_drawOffsetX,
+ _renderer->_height + _renderer->_drawOffsetY);
if (custom) *custom = false;
}
diff --git a/engines/wintermute/base/base_game.h b/engines/wintermute/base/base_game.h
index 34dec89d20..8da62af40a 100644
--- a/engines/wintermute/base/base_game.h
+++ b/engines/wintermute/base/base_game.h
@@ -212,7 +212,7 @@ public:
virtual bool loadGame(const char *filename);
virtual bool saveGame(int slot, const char *desc, bool quickSave = false);
virtual bool showCursor();
-
+
BaseObject *_activeObject;
bool _interactive;
@@ -296,21 +296,21 @@ private:
int _indicatorY;
int _indicatorWidth;
int _indicatorHeight;
-
+
char *_localSaveDir;
bool _saveDirChecked;
bool _richSavedGames;
char *_savedGameExt;
-
+
char *_loadImageName;
char *_saveImageName;
int _saveImageX;
int _saveImageY;
int _loadImageX;
int _loadImageY;
-
+
BaseSurface *_saveLoadImage;
-
+
bool _reportTextureFormat;
// FPS stuff
@@ -328,7 +328,7 @@ private:
bool _compressedSavegames;
bool _personalizedSave;
-
+
bool emptySaveSlot(int slot);
bool isSaveSlotUsed(int slot);
bool getSaveSlotDescription(int slot, char *buffer);
@@ -353,7 +353,7 @@ private:
uint32 _fps;
bool updateMusicCrossfade();
-
+
bool isVideoPlaying();
bool stopVideo();
diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp
index a85ec3e972..03f9929eee 100644
--- a/engines/wintermute/base/base_keyboard_state.cpp
+++ b/engines/wintermute/base/base_keyboard_state.cpp
@@ -266,36 +266,36 @@ uint32 BaseKeyboardState::keyCodeToVKey(Common::Event *event) {
}
enum VKeyCodes {
- VK_SPACE = 32,
- VK_LEFT = 37,
- VK_UP = 38,
- VK_RIGHT = 39,
- VK_DOWN = 40
+ VK_SPACE = 32,
+ VK_LEFT = 37,
+ VK_UP = 38,
+ VK_RIGHT = 39,
+ VK_DOWN = 40
};
//////////////////////////////////////////////////////////////////////////
Common::KeyCode BaseKeyboardState::vKeyToKeyCode(uint32 vkey) {
// todo
switch (vkey) {
- case VK_SPACE:
- return Common::KEYCODE_SPACE;
- break;
- case VK_LEFT:
- return Common::KEYCODE_LEFT;
- break;
- case VK_RIGHT:
- return Common::KEYCODE_RIGHT;
- break;
- case VK_UP:
- return Common::KEYCODE_UP;
- break;
- case VK_DOWN:
- return Common::KEYCODE_DOWN;
- break;
- default:
- warning("Unknown VKEY: %d", vkey);
- return (Common::KeyCode)vkey;
- break;
+ case VK_SPACE:
+ return Common::KEYCODE_SPACE;
+ break;
+ case VK_LEFT:
+ return Common::KEYCODE_LEFT;
+ break;
+ case VK_RIGHT:
+ return Common::KEYCODE_RIGHT;
+ break;
+ case VK_UP:
+ return Common::KEYCODE_UP;
+ break;
+ case VK_DOWN:
+ return Common::KEYCODE_DOWN;
+ break;
+ default:
+ warning("Unknown VKEY: %d", vkey);
+ return (Common::KeyCode)vkey;
+ break;
}
}
diff --git a/engines/wintermute/base/base_parser.cpp b/engines/wintermute/base/base_parser.cpp
index 588d210134..12ed67ba2a 100644
--- a/engines/wintermute/base/base_parser.cpp
+++ b/engines/wintermute/base/base_parser.cpp
@@ -180,7 +180,7 @@ char *BaseParser::getAssignmentText(char **buf) {
break;
++*buf;
}
- **buf = 0; // null terminate it
+ **buf = 0; // null terminate it
if (theChar) // skip the terminator
++*buf;
}
diff --git a/engines/wintermute/base/base_parser.h b/engines/wintermute/base/base_parser.h
index a5c55ceb41..03ca71b48d 100644
--- a/engines/wintermute/base/base_parser.h
+++ b/engines/wintermute/base/base_parser.h
@@ -60,7 +60,7 @@ namespace WinterMute {
class BaseParser : public BaseClass {
public:
struct TokenDesc {
- int32 id;
+ int32 id;
const char *token;
};
diff --git a/engines/wintermute/base/base_persistence_manager.cpp b/engines/wintermute/base/base_persistence_manager.cpp
index 3f9e8de855..cf7deb2970 100644
--- a/engines/wintermute/base/base_persistence_manager.cpp
+++ b/engines/wintermute/base/base_persistence_manager.cpp
@@ -420,12 +420,12 @@ Common::String BasePersistenceManager::getStringObj() {
_loadStream->read(ret, len);
ret[len] = '\0';
- Common::String retString = ret;
+ Common::String retString = ret;
delete[] ret;
if (retString == "(null)") {
retString = "";
- }
+ }
return retString;
}
diff --git a/engines/wintermute/base/base_registry.cpp b/engines/wintermute/base/base_registry.cpp
index dfab1b5076..7eb2685746 100644
--- a/engines/wintermute/base/base_registry.cpp
+++ b/engines/wintermute/base/base_registry.cpp
@@ -103,7 +103,7 @@ int BaseRegistry::readInt(const AnsiString &subKey, const AnsiString &key, int i
return init;
}
}
- }
+ }
AnsiString val = readString(subKey, key, "");
if (val.empty()) return init;
else return atoi(val.c_str());
@@ -126,7 +126,7 @@ bool BaseRegistry::writeInt(const AnsiString &subKey, const AnsiString &key, int
error("This key shouldn't be read by the scripts");
return true;
}
- }
+ }
writeString(subKey, key, StringUtil::toString(value));
return true;
}
diff --git a/engines/wintermute/base/base_sprite.cpp b/engines/wintermute/base/base_sprite.cpp
index 03b0ef3615..c2e57f9fd6 100644
--- a/engines/wintermute/base/base_sprite.cpp
+++ b/engines/wintermute/base/base_sprite.cpp
@@ -583,7 +583,7 @@ bool BaseSprite::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSta
else if (strcmp(name, "InsertFrame") == 0) {
stack->correctParams(2);
int index = stack->pop()->getInt();
- if (index < 0)
+ if (index < 0)
index = 0;
ScValue *val = stack->pop();
diff --git a/engines/wintermute/base/base_sub_frame.cpp b/engines/wintermute/base/base_sub_frame.cpp
index 0b87dd2b7a..523bbed866 100644
--- a/engines/wintermute/base/base_sub_frame.cpp
+++ b/engines/wintermute/base/base_sub_frame.cpp
@@ -239,10 +239,10 @@ bool BaseSubFrame::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, flo
float ratioY = scaleY / 100.0f;
BasePlatform::setRect(rect,
- (int)(x - _hotspotX * ratioX),
- (int)(y - _hotspotY * ratioY),
- (int)(x - _hotspotX * ratioX + (_rect.right - _rect.left) * ratioX),
- (int)(y - _hotspotY * ratioY + (_rect.bottom - _rect.top) * ratioY));
+ (int)(x - _hotspotX * ratioX),
+ (int)(y - _hotspotY * ratioY),
+ (int)(x - _hotspotX * ratioX + (_rect.right - _rect.left) * ratioX),
+ (int)(y - _hotspotY * ratioY + (_rect.bottom - _rect.top) * ratioY));
return true;
}
diff --git a/engines/wintermute/base/base_transition_manager.cpp b/engines/wintermute/base/base_transition_manager.cpp
index 53dd99aac2..eeaacd2063 100644
--- a/engines/wintermute/base/base_transition_manager.cpp
+++ b/engines/wintermute/base/base_transition_manager.cpp
@@ -69,7 +69,7 @@ bool BaseTransitionMgr::start(TTransitionType type, bool nonInteractive) {
_origInteractive = _gameRef->_interactive;
_gameRef->_interactive = false;
} /*else _preserveInteractive */;
-
+
_type = type;
_state = TRANS_MGR_RUNNING;
diff --git a/engines/wintermute/base/file/base_disk_file.cpp b/engines/wintermute/base/file/base_disk_file.cpp
index 1598101036..bb8504d2f4 100644
--- a/engines/wintermute/base/file/base_disk_file.cpp
+++ b/engines/wintermute/base/file/base_disk_file.cpp
@@ -46,7 +46,7 @@ void correctSlashes(char *fileName) {
}
// Parse a relative path in the game-folder, and if it exists, return a FSNode to it.
-static Common::FSNode getNodeForRelativePath(const Common::String& filename) {
+static Common::FSNode getNodeForRelativePath(const Common::String &filename) {
// The filename can be an explicit path, thus we need to chop it up, expecting the path the game
// specifies to follow the Windows-convention of folder\subfolder\file (absolute paths should not happen)
@@ -88,11 +88,11 @@ static Common::FSNode getNodeForRelativePath(const Common::String& filename) {
return Common::FSNode();
}
-bool diskFileExists(const Common::String& filename) {
+bool diskFileExists(const Common::String &filename) {
// Try directly from SearchMan first
Common::ArchiveMemberList files;
SearchMan.listMatchingMembers(files, filename);
-
+
for (Common::ArchiveMemberList::iterator it = files.begin(); it != files.end(); it++) {
if ((*it)->getName() == filename) {
return true;
@@ -112,7 +112,7 @@ Common::SeekableReadStream *openDiskFile(const Common::String &filename) {
// Try directly from SearchMan first
Common::ArchiveMemberList files;
SearchMan.listMatchingMembers(files, filename);
-
+
for (Common::ArchiveMemberList::iterator it = files.begin(); it != files.end(); it++) {
if ((*it)->getName() == filename) {
file = (*it)->createReadStream();
diff --git a/engines/wintermute/base/file/base_disk_file.h b/engines/wintermute/base/file/base_disk_file.h
index 0653b2e854..99a9e8b9a3 100644
--- a/engines/wintermute/base/file/base_disk_file.h
+++ b/engines/wintermute/base/file/base_disk_file.h
@@ -34,7 +34,7 @@
namespace WinterMute {
Common::SeekableReadStream *openDiskFile(const Common::String &filename);
-bool diskFileExists(const Common::String& filename);
+bool diskFileExists(const Common::String &filename);
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/file/base_file_entry.cpp b/engines/wintermute/base/file/base_file_entry.cpp
index 5032650704..8282079c86 100644
--- a/engines/wintermute/base/file/base_file_entry.cpp
+++ b/engines/wintermute/base/file/base_file_entry.cpp
@@ -62,11 +62,11 @@ public:
Common::SeekableReadStream *BaseFileEntry::createReadStream() const {
Common::SeekableReadStream *file = _package->getFilePointer();
if (!file) return NULL;
-
+
// TODO: Cleanup
bool compressed = (_compressedLength != 0);
/* _size = fileEntry->_length; */
-
+
if (compressed) {
// TODO: Really, most of this logic might be doable directly in the fileEntry?
// But for now, this should get us rolling atleast.
@@ -77,14 +77,14 @@ Common::SeekableReadStream *BaseFileEntry::createReadStream() const {
if (file->size() == 0) {
file = new CBPkgFile(file, _length);
}
-
+
file->seek(0);
-
+
return file;
}
//////////////////////////////////////////////////////////////////////////
-BaseFileEntry::BaseFileEntry(){
+BaseFileEntry::BaseFileEntry() {
_package = NULL;
_length = _compressedLength = _offset = _flags = 0;
_filename = "";
diff --git a/engines/wintermute/base/file/base_package.cpp b/engines/wintermute/base/file/base_package.cpp
index 90bb027042..f2d2378c6a 100644
--- a/engines/wintermute/base/file/base_package.cpp
+++ b/engines/wintermute/base/file/base_package.cpp
@@ -51,33 +51,33 @@ Common::SeekableReadStream *BasePackage::getFilePointer() {
static bool findPackageSignature(Common::SeekableReadStream *f, uint32 *offset) {
byte buf[32768];
-
+
byte signature[8];
((uint32 *)signature)[0] = PACKAGE_MAGIC_1;
((uint32 *)signature)[1] = PACKAGE_MAGIC_2;
-
+
uint32 fileSize = (uint32)f->size();
uint32 startPos = 1024 * 1024;
uint32 bytesRead = startPos;
-
+
while (bytesRead < fileSize - 16) {
uint32 toRead = MIN((unsigned int)32768, fileSize - bytesRead);
f->seek((int32)startPos, SEEK_SET);
uint32 actuallyRead = f->read(buf, toRead);
if (actuallyRead != toRead) return false;
-
+
for (uint32 i = 0; i < toRead - 8; i++)
if (!memcmp(buf + i, signature, 8)) {
*offset = startPos + i;
return true;
}
-
+
bytesRead = bytesRead + toRead - 16;
startPos = startPos + toRead - 16;
-
+
}
return false;
-
+
}
PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool searchSignature) {
@@ -98,7 +98,7 @@ PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool
boundToExe = true;
}
}
-
+
TPackageHeader hdr;
hdr.readFromStream(stream);
if (hdr._magic1 != PACKAGE_MAGIC_1 || hdr._magic2 != PACKAGE_MAGIC_2 || hdr._packageVersion > PACKAGE_VERSION) {
@@ -106,7 +106,7 @@ PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool
delete stream;
return;
}
-
+
if (hdr._packageVersion != PACKAGE_VERSION) {
debugC(kWinterMuteDebugFileAccess | kWinterMuteDebugLog, " Warning: package file '%s' is outdated.", filename.c_str());
}
@@ -125,7 +125,7 @@ PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool
pkg->_fsnode = file;
pkg->_boundToExe = boundToExe;
-
+
// read package info
byte nameLength = stream->readByte();
char *pkgName = new char[nameLength];
@@ -141,15 +141,15 @@ PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool
// read file entries
uint32 numFiles = stream->readUint32LE();
-
+
for (uint32 j = 0; j < numFiles; j++) {
char *name;
uint32 offset, length, compLength, flags, timeDate1, timeDate2;
-
+
nameLength = stream->readByte();
name = new char[nameLength];
stream->read(name, nameLength);
-
+
// v2 - xor name
if (hdr._packageVersion == PACKAGE_VERSION) {
for (int k = 0; k < nameLength; k++) {
@@ -157,18 +157,18 @@ PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool
}
}
debugC(kWinterMuteDebugFileAccess, "Package contains %s", name);
-
+
Common::String upcName = name;
upcName.toUppercase();
delete[] name;
name = NULL;
-
+
offset = stream->readUint32LE();
offset += absoluteOffset;
length = stream->readUint32LE();
compLength = stream->readUint32LE();
flags = stream->readUint32LE();
-
+
if (hdr._packageVersion == PACKAGE_VERSION) {
timeDate1 = stream->readUint32LE();
timeDate2 = stream->readUint32LE();
@@ -181,12 +181,12 @@ PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool
fileEntry->_length = length;
fileEntry->_compressedLength = compLength;
fileEntry->_flags = flags;
-
+
_files[upcName] = Common::ArchiveMemberPtr(fileEntry);
} else {
// current package has higher priority than the registered
// TODO: This cast might be a bit ugly.
- BaseFileEntry *filePtr = (BaseFileEntry*) &*(_filesIter->_value);
+ BaseFileEntry *filePtr = (BaseFileEntry *) &*(_filesIter->_value);
if (pkg->_priority > filePtr->_package->_priority) {
filePtr->_package = pkg;
filePtr->_offset = offset;
@@ -198,12 +198,12 @@ PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool
}
}
debugC(kWinterMuteDebugFileAccess, " Registered %d files in %d package(s)", _files.size(), _packages.size());
-
+
delete stream;
}
PackageSet::~PackageSet() {
- for (Common::Array<BasePackage*>::iterator it = _packages.begin(); it != _packages.end(); it++) {
+ for (Common::Array<BasePackage *>::iterator it = _packages.begin(); it != _packages.end(); it++) {
delete *it;
}
_packages.clear();
diff --git a/engines/wintermute/base/file/base_package.h b/engines/wintermute/base/file/base_package.h
index b9a7bc5934..a562229f65 100644
--- a/engines/wintermute/base/file/base_package.h
+++ b/engines/wintermute/base/file/base_package.h
@@ -48,7 +48,7 @@ public:
class PackageSet : public Common::Archive {
public:
virtual ~PackageSet();
-
+
PackageSet(Common::FSNode package, const Common::String &filename = "", bool searchSignature = false);
/**
* Check if a member with the given name is present in the Archive.
@@ -64,12 +64,12 @@ public:
* @return the number of names added to list
*/
virtual int listMembers(Common::ArchiveMemberList &list) const;
-
+
/**
* Returns a ArchiveMember representation of the given file.
*/
virtual const Common::ArchiveMemberPtr getMember(const Common::String &name) const;
-
+
/**
* Create a stream bound to a member with the specified name in the
* archive. If no member with this name exists, 0 is returned.
diff --git a/engines/wintermute/base/file/base_resources.cpp b/engines/wintermute/base/file/base_resources.cpp
index 73c06271d7..aac5436071 100644
--- a/engines/wintermute/base/file/base_resources.cpp
+++ b/engines/wintermute/base/file/base_resources.cpp
@@ -2816,7 +2816,7 @@ Common::SeekableReadStream *BaseResources::getFile(const Common::String &filenam
return NULL;
}
-bool BaseResources::hasFile(const Common::String& filename) {
+bool BaseResources::hasFile(const Common::String &filename) {
if (scumm_stricmp(filename.c_str(), "invalid.bmp") == 0) {
return true;
} else if (scumm_stricmp(filename.c_str(), "invalid_debug.bmp") == 0) {
diff --git a/engines/wintermute/base/file/base_resources.h b/engines/wintermute/base/file/base_resources.h
index 2959f9882f..2ccab6996f 100644
--- a/engines/wintermute/base/file/base_resources.h
+++ b/engines/wintermute/base/file/base_resources.h
@@ -37,7 +37,7 @@ namespace WinterMute {
class BaseResources {
public:
static Common::SeekableReadStream *getFile(const Common::String &filename);
- static bool hasFile(const Common::String& filename);
+ static bool hasFile(const Common::String &filename);
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/file/dcpackage.h b/engines/wintermute/base/file/dcpackage.h
index 5e47edba56..4a51683260 100644
--- a/engines/wintermute/base/file/dcpackage.h
+++ b/engines/wintermute/base/file/dcpackage.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp
index dd5d006556..0a97370cb7 100644
--- a/engines/wintermute/base/font/base_font_truetype.cpp
+++ b/engines/wintermute/base/font/base_font_truetype.cpp
@@ -646,8 +646,8 @@ bool BaseFontTT::initFont() {
AnsiString fontFileName = PathUtil::combine(BasePlatform::getSystemFontPath(), PathUtil::getFileName(_fontFile));
file = _gameRef->_fileManager->openFile(fontFileName.c_str(), false);
if (!file) {
- _gameRef->LOG(0, "Error loading TrueType font '%s'", _fontFile);
- //return STATUS_FAILED;
+ _gameRef->LOG(0, "Error loading TrueType font '%s'", _fontFile);
+ //return STATUS_FAILED;
}*/
}
diff --git a/engines/wintermute/base/gfx/base_renderer.h b/engines/wintermute/base/gfx/base_renderer.h
index 90a1e378ca..83b5ad0e16 100644
--- a/engines/wintermute/base/gfx/base_renderer.h
+++ b/engines/wintermute/base/gfx/base_renderer.h
@@ -74,7 +74,7 @@ public:
virtual void fade(uint16 alpha) = 0;
/**
* Fade a portion of the screen to a specific color
- *
+ *
* @param r the red component to fade too.
* @param g the green component to fade too.
* @param b the blue component to fade too.
@@ -93,7 +93,7 @@ public:
virtual bool windowedBlt();
/**
* Fill a portion of the screen with a specified color
- *
+ *
* @param r the red component to fill with.
* @param g the green component to fill with.
* @param b the blue component to fill with.
diff --git a/engines/wintermute/base/gfx/base_surface.h b/engines/wintermute/base/gfx/base_surface.h
index cb98bde722..66a3460d48 100644
--- a/engines/wintermute/base/gfx/base_surface.h
+++ b/engines/wintermute/base/gfx/base_surface.h
@@ -86,7 +86,7 @@ protected:
byte _ckRed;
byte _ckGreen;
byte _ckBlue;
-
+
bool _keepLoaded;
Common::String _filename;
int _height;
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index 09ee62c3b8..43cf66d053 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
@@ -43,11 +43,11 @@ namespace WinterMute {
RenderTicket::RenderTicket(BaseSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, bool mirrorX, bool mirrorY) : _owner(owner),
_srcRect(*srcRect), _dstRect(*dstRect), _drawNum(0), _isValid(true), _wantsDraw(true), _hasAlpha(true) {
_colorMod = 0;
- _mirror = TransparentSurface::FLIP_NONE;
- if (mirrorX)
- _mirror |= TransparentSurface::FLIP_V;
- if (mirrorY)
- _mirror |= TransparentSurface::FLIP_H;
+ _mirror = TransparentSurface::FLIP_NONE;
+ if (mirrorX)
+ _mirror |= TransparentSurface::FLIP_V;
+ if (mirrorY)
+ _mirror |= TransparentSurface::FLIP_H;
if (surf) {
_surface = new Graphics::Surface();
_surface->create((uint16)srcRect->width(), (uint16)srcRect->height(), surf->format);
@@ -78,13 +78,13 @@ RenderTicket::~RenderTicket() {
bool RenderTicket::operator==(RenderTicket &t) {
if ((t._srcRect != _srcRect) ||
- (t._dstRect != _dstRect) ||
- (t._mirror != _mirror) ||
- (t._owner != _owner) ||
- (t._hasAlpha != _hasAlpha) ||
- (t._colorMod != _colorMod)) {
- return false;
- }
+ (t._dstRect != _dstRect) ||
+ (t._mirror != _mirror) ||
+ (t._owner != _owner) ||
+ (t._hasAlpha != _hasAlpha) ||
+ (t._colorMod != _colorMod)) {
+ return false;
+ }
return true;
}
@@ -137,22 +137,22 @@ bool BaseRenderOSystem::initRenderer(int width, int height, bool windowed) {
// find suitable resolution
-/*#ifdef __IPHONEOS__
- _realWidth = 480;
- _realHeight = 320;
-
- int numModes = SDL_GetNumDisplayModes(0);
- for (int i = 0; i < numModes; i++) {
- SDL_DisplayMode mode;
- SDL_GetDisplayMode(0, i, &mode);
-
- if (mode.w > mode.h) {
- _realWidth = mode.w;
- _realHeight = mode.h;
- break;
- }
- }
-#else*/
+ /*#ifdef __IPHONEOS__
+ _realWidth = 480;
+ _realHeight = 320;
+
+ int numModes = SDL_GetNumDisplayModes(0);
+ for (int i = 0; i < numModes; i++) {
+ SDL_DisplayMode mode;
+ SDL_GetDisplayMode(0, i, &mode);
+
+ if (mode.w > mode.h) {
+ _realWidth = mode.w;
+ _realHeight = mode.h;
+ break;
+ }
+ }
+ #else*/
_realWidth = _gameRef->_registry->readInt("Debug", "ForceResWidth", _width);
_realHeight = _gameRef->_registry->readInt("Debug", "ForceResHeight", _height);
//#endif
@@ -257,7 +257,7 @@ bool BaseRenderOSystem::flip() {
if (_disableDirtyRects) {
g_system->copyRectToScreen((byte *)_renderSurface->pixels, _renderSurface->pitch, 0, 0, _renderSurface->w, _renderSurface->h);
}
- // g_system->copyRectToScreen((byte *)_renderSurface->pixels, _renderSurface->pitch, _dirtyRect->left, _dirtyRect->top, _dirtyRect->width(), _dirtyRect->height());
+ // g_system->copyRectToScreen((byte *)_renderSurface->pixels, _renderSurface->pitch, _dirtyRect->left, _dirtyRect->top, _dirtyRect->width(), _dirtyRect->height());
delete _dirtyRect;
_dirtyRect = NULL;
g_system->updateScreen();
@@ -347,7 +347,7 @@ void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::S
if (_disableDirtyRects) {
RenderTicket renderTicket(owner, surf, srcRect, dstRect, mirrorX, mirrorY);
// HINT: The surface-data contains other info than it should.
- // drawFromSurface(renderTicket._surface, srcRect, dstRect, NULL, mirrorX, mirrorY);
+ // drawFromSurface(renderTicket._surface, srcRect, dstRect, NULL, mirrorX, mirrorY);
drawFromSurface(renderTicket.getSurface(), &renderTicket._srcRect, &renderTicket._dstRect, NULL, renderTicket._mirror);
return;
}
@@ -355,8 +355,8 @@ void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::S
if ((dstRect->left < 0 && dstRect->right < 0) || (dstRect->top < 0 && dstRect->bottom < 0)) {
return;
}
-
- RenderTicket compare(owner, NULL, srcRect, dstRect, mirrorX, mirrorY);
+
+ RenderTicket compare(owner, NULL, srcRect, dstRect, mirrorX, mirrorY);
compare._colorMod = _colorMod;
RenderQueueIterator it;
for (it = _renderQueue.begin(); it != _renderQueue.end(); it++) {
@@ -397,14 +397,14 @@ void BaseRenderOSystem::drawFromTicket(RenderTicket *renderTicket) {
addDirtyRect(renderTicket->_dstRect);
} else {
// Before something
- Common::List<RenderTicket*>::iterator pos;
+ Common::List<RenderTicket *>::iterator pos;
for (pos = _renderQueue.begin(); pos != _renderQueue.end(); pos++) {
if ((*pos)->_drawNum >= _drawNum) {
break;
}
}
_renderQueue.insert(pos, renderTicket);
- Common::List<RenderTicket*>::iterator it;
+ Common::List<RenderTicket *>::iterator it;
renderTicket->_drawNum = _drawNum++;
// Increment the following tickets, so they still are in line
for (it = pos; it != _renderQueue.end(); it++) {
@@ -432,7 +432,7 @@ void BaseRenderOSystem::drawFromTicket(RenderTicket *renderTicket) {
// Decreement the following tickets.
for (; it != _renderQueue.end(); it++) {
(*it)->_drawNum--;
- }
+ }
}
// Is not in order, so readd it as if it was a new ticket
renderTicket->_drawNum = 0;
@@ -457,7 +457,7 @@ void BaseRenderOSystem::drawTickets() {
int decrement = 0;
while (it != _renderQueue.end()) {
if ((*it)->_wantsDraw == false || (*it)->_isValid == false) {
- RenderTicket* ticket = *it;
+ RenderTicket *ticket = *it;
addDirtyRect((*it)->_dstRect);
//warning("Discarding Rect: %d %d %d %d Width: %d Height: %d", (*it)->_dstRect.left, (*it)->_dstRect.top, (*it)->_dstRect.right, (*it)->_dstRect.bottom, (*it)->_dstRect.width() , (*it)->_dstRect.height());
it = _renderQueue.erase(it);
@@ -474,7 +474,7 @@ void BaseRenderOSystem::drawTickets() {
// draw, we need to keep track of what it was prior to draw.
uint32 oldColorMod = _colorMod;
// warning("DirtyRect: %d %d %d %d Width: %d Height: %d", _dirtyRect->left, _dirtyRect->top, _dirtyRect->right, _dirtyRect->bottom, _dirtyRect->width(), _dirtyRect->height());
-
+
// Apply the clear-color to the dirty rect.
_renderSurface->fillRect(*_dirtyRect, _clearColor);
_drawNum = 1;
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.h b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
index b7507098da..0d00b1b427 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.h
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
@@ -102,9 +102,9 @@ private:
void addDirtyRect(const Common::Rect &rect);
void drawTickets();
void drawFromSurface(const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect, uint32 mirror);
- typedef Common::List<RenderTicket*>::iterator RenderQueueIterator;
+ typedef Common::List<RenderTicket *>::iterator RenderQueueIterator;
Common::Rect *_dirtyRect;
- Common::List<RenderTicket*> _renderQueue;
+ Common::List<RenderTicket *> _renderQueue;
bool _needsFlip;
uint32 _drawNum;
Common::Rect _renderRect;
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
index c8cbe99f73..36213dfde1 100644
--- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
@@ -190,7 +190,7 @@ bool BaseSurfaceOSystem::finishLoad() {
delete image;
_loaded = true;
-
+
return true;
}
@@ -529,7 +529,7 @@ bool BaseSurfaceOSystem::putSurface(const Graphics::Surface &surface, bool hasAl
_hasAlpha = hasAlpha;
BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_gameRef->_renderer);
renderer->invalidateTicketsFromSurface(this);
-
+
return STATUS_OK;
}
diff --git a/engines/wintermute/base/particles/part_emitter.h b/engines/wintermute/base/particles/part_emitter.h
index 198e415cc4..fc557a9512 100644
--- a/engines/wintermute/base/particles/part_emitter.h
+++ b/engines/wintermute/base/particles/part_emitter.h
@@ -72,57 +72,57 @@ public:
private:
int _width;
int _height;
-
+
int _angle1;
int _angle2;
-
+
float _rotation1;
float _rotation2;
-
+
float _angVelocity1;
float _angVelocity2;
-
+
float _growthRate1;
float _growthRate2;
bool _exponentialGrowth;
-
+
float _velocity1;
float _velocity2;
bool _velocityZBased;
-
+
float _scale1;
float _scale2;
bool _scaleZBased;
-
+
int _maxParticles;
-
+
int _lifeTime1;
int _lifeTime2;
bool _lifeTimeZBased;
-
+
int _genInterval;
int _genAmount;
-
+
bool _running;
int _overheadTime;
-
+
int _maxBatches;
int _batchesGenerated;
-
+
Rect32 _border;
int _borderThicknessLeft;
int _borderThicknessRight;
int _borderThicknessTop;
int _borderThicknessBottom;
-
+
int _fadeInTime;
-
+
int _alpha1;
int _alpha2;
bool _alphaTimeBased;
-
+
bool _useRegion;
-
+
char *_emitEvent;
BaseScriptHolder *_owner;
diff --git a/engines/wintermute/base/sound/base_sound.cpp b/engines/wintermute/base/sound/base_sound.cpp
index 1853d7abfd..8cc8c21948 100644
--- a/engines/wintermute/base/sound/base_sound.cpp
+++ b/engines/wintermute/base/sound/base_sound.cpp
@@ -229,7 +229,7 @@ bool BaseSound::setVolume(int volume) {
//////////////////////////////////////////////////////////////////////////
bool BaseSound::setPrivateVolume(int volume) {
- if (!_sound)
+ if (!_sound)
return STATUS_FAILED;
else return _sound->_privateVolume = volume;
}
diff --git a/engines/wintermute/base/sound/base_sound_buffer.cpp b/engines/wintermute/base/sound/base_sound_buffer.cpp
index 27276f4fa7..f2db0a18fb 100644
--- a/engines/wintermute/base/sound/base_sound_buffer.cpp
+++ b/engines/wintermute/base/sound/base_sound_buffer.cpp
@@ -110,7 +110,7 @@ bool BaseSoundBuffer::loadFromFile(const char *filename, bool forceReload) {
int waveSize, waveRate;
byte waveFlags;
uint16 waveType;
-
+
if (Audio::loadWAVFromStream(*_file, waveSize, waveRate, waveFlags, &waveType)) {
if (waveType == 1) {
// We need to wrap the file in a substream to make sure the size is right.
@@ -208,7 +208,7 @@ bool BaseSoundBuffer::play(bool looping, uint32 startSample) {
} else {
g_system->getMixer()->playStream(_type, _handle, _stream, -1, _volume, 0, DisposeAfterUse::NO);
}
- }
+ }
return STATUS_OK;
}
diff --git a/engines/wintermute/base/sound/base_sound_manager.cpp b/engines/wintermute/base/sound/base_sound_manager.cpp
index a73b20e404..cebc3a3765 100644
--- a/engines/wintermute/base/sound/base_sound_manager.cpp
+++ b/engines/wintermute/base/sound/base_sound_manager.cpp
@@ -80,7 +80,7 @@ void BaseSoundMgr::saveSettings() {
//////////////////////////////////////////////////////////////////////////
bool BaseSoundMgr::initialize() {
_soundAvailable = false;
-
+
if (!g_system->getMixer()->isReady()) {
return STATUS_FAILED;
}
diff --git a/engines/wintermute/dcscript.h b/engines/wintermute/dcscript.h
index 36d84b45d9..9610ebf94c 100644
--- a/engines/wintermute/dcscript.h
+++ b/engines/wintermute/dcscript.h
@@ -50,14 +50,14 @@ typedef enum {
// script states
typedef enum {
SCRIPT_RUNNING,
- SCRIPT_WAITING,
- SCRIPT_SLEEPING,
- SCRIPT_FINISHED,
- SCRIPT_PERSISTENT,
- SCRIPT_ERROR,
- SCRIPT_PAUSED,
- SCRIPT_WAITING_SCRIPT,
- SCRIPT_THREAD_FINISHED
+ SCRIPT_WAITING,
+ SCRIPT_SLEEPING,
+ SCRIPT_FINISHED,
+ SCRIPT_PERSISTENT,
+ SCRIPT_ERROR,
+ SCRIPT_PAUSED,
+ SCRIPT_WAITING_SCRIPT,
+ SCRIPT_THREAD_FINISHED
} TScriptState;
// opcodes
diff --git a/engines/wintermute/dctypes.h b/engines/wintermute/dctypes.h
index 4d56ac1459..edca18a6ed 100644
--- a/engines/wintermute/dctypes.h
+++ b/engines/wintermute/dctypes.h
@@ -52,44 +52,44 @@ typedef Common::Array<AnsiString> AnsiStringArray;
enum TGameState {
GAME_RUNNING,
- GAME_FROZEN,
- GAME_SEMI_FROZEN
+ GAME_FROZEN,
+ GAME_SEMI_FROZEN
};
-enum TImageType {
- IMG_PALETTED8,
- IMG_TRUECOLOR
+enum TImageType {
+ IMG_PALETTED8,
+ IMG_TRUECOLOR
};
enum TTextAlign {
TAL_LEFT = 0,
- TAL_RIGHT,
- TAL_CENTER,
- NUM_TEXT_ALIGN
+ TAL_RIGHT,
+ TAL_CENTER,
+ NUM_TEXT_ALIGN
};
enum TVerticalAlign {
VAL_TOP = 0,
- VAL_CENTER,
- VAL_BOTTOM,
- NUM_VERTICAL_ALIGN
+ VAL_CENTER,
+ VAL_BOTTOM,
+ NUM_VERTICAL_ALIGN
};
enum TDirection {
- DI_UP = 0,
- DI_UPRIGHT = 1,
- DI_RIGHT = 2,
- DI_DOWNRIGHT = 3,
- DI_DOWN = 4,
- DI_DOWNLEFT = 5,
- DI_LEFT = 6,
- DI_UPLEFT = 7,
- NUM_DIRECTIONS = 8,
- DI_NONE = 9
+ DI_UP = 0,
+ DI_UPRIGHT = 1,
+ DI_RIGHT = 2,
+ DI_DOWNRIGHT = 3,
+ DI_DOWN = 4,
+ DI_DOWNLEFT = 5,
+ DI_LEFT = 6,
+ DI_UPLEFT = 7,
+ NUM_DIRECTIONS = 8,
+ DI_NONE = 9
};
@@ -113,20 +113,20 @@ enum TEventType {
enum TUIObjectType {
UI_UNKNOWN,
- UI_BUTTON,
- UI_WINDOW,
- UI_STATIC,
- UI_EDIT,
- UI_HTML,
- UI_CUSTOM
+ UI_BUTTON,
+ UI_WINDOW,
+ UI_STATIC,
+ UI_EDIT,
+ UI_HTML,
+ UI_CUSTOM
};
enum TRendererState {
RSTATE_3D,
- RSTATE_2D,
- RSTATE_LINES,
- RSTATE_NONE
+ RSTATE_2D,
+ RSTATE_LINES,
+ RSTATE_NONE
};
@@ -137,29 +137,29 @@ enum TDynamicConstructor {
enum TVideoMode {
VIDEO_WINDOW,
- VIDEO_FULLSCREEN,
- VIDEO_ANY
+ VIDEO_FULLSCREEN,
+ VIDEO_ANY
};
enum TVideoPlayback {
- VID_PLAY_POS = 0,
- VID_PLAY_STRETCH = 1,
- VID_PLAY_CENTER = 2
+ VID_PLAY_POS = 0,
+ VID_PLAY_STRETCH = 1,
+ VID_PLAY_CENTER = 2
};
enum TMouseEvent {
MOUSE_CLICK,
- MOUSE_RELEASE,
- MOUSE_DBLCLICK
+ MOUSE_RELEASE,
+ MOUSE_DBLCLICK
};
enum TMouseButton {
MOUSE_BUTTON_LEFT,
- MOUSE_BUTTON_RIGHT,
- MOUSE_BUTTON_MIDDLE
+ MOUSE_BUTTON_RIGHT,
+ MOUSE_BUTTON_MIDDLE
};
@@ -169,56 +169,56 @@ enum TTransMgrState {
enum TTransitionType {
- TRANSITION_NONE = 0,
+ TRANSITION_NONE = 0,
TRANSITION_FADE_OUT = 1,
- TRANSITION_FADE_IN = 2,
+ TRANSITION_FADE_IN = 2,
NUM_TRANSITION_TYPES
};
enum TWindowMode {
WINDOW_NORMAL,
- WINDOW_EXCLUSIVE,
- WINDOW_SYSTEM_EXCLUSIVE
+ WINDOW_EXCLUSIVE,
+ WINDOW_SYSTEM_EXCLUSIVE
};
enum TSFXType {
SFX_NONE,
- SFX_ECHO,
- SFX_REVERB
+ SFX_ECHO,
+ SFX_REVERB
};
enum TSpriteCacheType {
CACHE_ALL,
- CACHE_HALF
+ CACHE_HALF
};
enum TTextEncoding {
TEXT_ANSI = 0,
- TEXT_UTF8 = 1,
- NUM_TEXT_ENCODINGS
+ TEXT_UTF8 = 1,
+ NUM_TEXT_ENCODINGS
};
enum TSpriteBlendMode {
- BLEND_UNKNOWN = -1,
- BLEND_NORMAL = 0,
- BLEND_ADDITIVE = 1,
- BLEND_SUBTRACTIVE = 2,
- NUM_BLEND_MODES
+ BLEND_UNKNOWN = -1,
+ BLEND_NORMAL = 0,
+ BLEND_ADDITIVE = 1,
+ BLEND_SUBTRACTIVE = 2,
+ NUM_BLEND_MODES
};
enum TTTSType {
TTS_CAPTION = 0,
- TTS_TALK,
- TTS_KEYPRESS
+ TTS_TALK,
+ TTS_KEYPRESS
};
enum TShadowType {
- SHADOW_NONE = 0,
- SHADOW_SIMPLE = 1,
- SHADOW_FLAT = 2,
- SHADOW_STENCIL = 3
+ SHADOW_NONE = 0,
+ SHADOW_SIMPLE = 1,
+ SHADOW_FLAT = 2,
+ SHADOW_STENCIL = 3
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/detection.cpp b/engines/wintermute/detection.cpp
index 85b8dcf429..92ffcf3154 100644
--- a/engines/wintermute/detection.cpp
+++ b/engines/wintermute/detection.cpp
@@ -64,55 +64,55 @@ public:
return "Copyright (c) 2011 Jan Nedoma";
}
-/* virtual GameList getSupportedGames() const {
- GameList games;
- const PlainGameDescriptor *g = wintermuteGames;
- while (g->gameid) {
- games.push_back(*g);
- g++;
- }
-
- return games;
- }
+ /* virtual GameList getSupportedGames() const {
+ GameList games;
+ const PlainGameDescriptor *g = wintermuteGames;
+ while (g->gameid) {
+ games.push_back(*g);
+ g++;
+ }
+
+ return games;
+ }
+
+ virtual GameDescriptor findGame(const char *gameid) const {
+ const PlainGameDescriptor *g = wintermuteGames;
+ while (g->gameid) {
+ if (0 == scumm_stricmp(gameid, g->gameid))
+ break;
+ g++;
+ }
+ return GameDescriptor(g->gameid, g->description);
+ }*/
+
+ /* virtual GameList detectGames(const Common::FSList &fslist) const {
+ GameList detectedGames;
+
+ // Iterate over all files in the given directory
+ for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
+ if (!file->isDirectory()) {
+ const char *gameName = file->getName().c_str();
+
+ if (0 == scumm_stricmp("data.dcp", gameName)) {
+ // You could check the contents of the file now if you need to.
+ detectedGames.push_back(WinterMute_setting[0]);
+ break;
+ }
+ }
+ }
+ return detectedGames;
+ }*/
- virtual GameDescriptor findGame(const char *gameid) const {
- const PlainGameDescriptor *g = wintermuteGames;
- while (g->gameid) {
- if (0 == scumm_stricmp(gameid, g->gameid))
- break;
- g++;
- }
- return GameDescriptor(g->gameid, g->description);
- }*/
-/* virtual GameList detectGames(const Common::FSList &fslist) const {
- GameList detectedGames;
-
- // Iterate over all files in the given directory
- for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
- if (!file->isDirectory()) {
- const char *gameName = file->getName().c_str();
-
- if (0 == scumm_stricmp("data.dcp", gameName)) {
- // You could check the contents of the file now if you need to.
- detectedGames.push_back(WinterMute_setting[0]);
- break;
- }
- }
- }
- return detectedGames;
- }*/
-
-
virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const {
// Set some defaults
s_fallbackDesc.extra = "";
s_fallbackDesc.language = Common::UNK_LANG;
s_fallbackDesc.flags = ADGF_UNSTABLE;
- s_fallbackDesc.platform = Common::kPlatformWindows; // default to Windows
+ s_fallbackDesc.platform = Common::kPlatformWindows; // default to Windows
s_fallbackDesc.gameid = "wintermute";
s_fallbackDesc.guioptions = GUIO0();
-
+
if (allFiles.contains("data.dcp")) {
Common::String name, caption;
if (WinterMuteEngine::getGameInfo(fslist, name, caption)) {
@@ -139,7 +139,7 @@ public:
}
return 0;
}
-
+
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
assert(syst);
assert(engine);
@@ -150,20 +150,20 @@ public:
bool hasFeature(MetaEngineFeature f) const {
switch (f) {
- case MetaEngine::kSupportsListSaves:
- return true;
- case MetaEngine::kSupportsLoadingDuringStartup:
- return true;
- case MetaEngine::kSupportsDeleteSave:
- return true;
- case MetaEngine::kSavesSupportCreationDate:
- return true;
- case MetaEngine::kSavesSupportMetaInfo:
- return true;
- case MetaEngine::kSavesSupportThumbnail:
- return true;
- default:
- return false;
+ case MetaEngine::kSupportsListSaves:
+ return true;
+ case MetaEngine::kSupportsLoadingDuringStartup:
+ return true;
+ case MetaEngine::kSupportsDeleteSave:
+ return true;
+ case MetaEngine::kSavesSupportCreationDate:
+ return true;
+ case MetaEngine::kSavesSupportMetaInfo:
+ return true;
+ case MetaEngine::kSavesSupportThumbnail:
+ return true;
+ default:
+ return false;
}
}
@@ -179,16 +179,16 @@ public:
}
return saves;
}
-
+
int getMaximumSaveSlot() const {
return 100;
}
-
+
void removeSaveState(const char *target, int slot) const {
WinterMute::BasePersistenceManager pm(NULL, target);
pm.deleteSaveSlot(slot);
}
-
+
virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const {
WinterMute::BasePersistenceManager pm(NULL, target);
SaveStateDescriptor retVal;
diff --git a/engines/wintermute/math/math_util.cpp b/engines/wintermute/math/math_util.cpp
index d9449294fb..fe7325baa4 100644
--- a/engines/wintermute/math/math_util.cpp
+++ b/engines/wintermute/math/math_util.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/engines/wintermute/math/math_util.h b/engines/wintermute/math/math_util.h
index db814a59ac..258d9bd67b 100644
--- a/engines/wintermute/math/math_util.h
+++ b/engines/wintermute/math/math_util.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/engines/wintermute/math/matrix4.cpp b/engines/wintermute/math/matrix4.cpp
index a716e937f4..379c219ec3 100644
--- a/engines/wintermute/math/matrix4.cpp
+++ b/engines/wintermute/math/matrix4.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/engines/wintermute/math/matrix4.h b/engines/wintermute/math/matrix4.h
index 5def8dfe97..4f65fe5779 100644
--- a/engines/wintermute/math/matrix4.h
+++ b/engines/wintermute/math/matrix4.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/engines/wintermute/math/rect32.h b/engines/wintermute/math/rect32.h
index e0babcbbb9..428d49290c 100644
--- a/engines/wintermute/math/rect32.h
+++ b/engines/wintermute/math/rect32.h
@@ -8,18 +8,18 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-
+
#ifndef WINTERMUTE_RECT32_H
#define WINTERMUTE_RECT32_H
@@ -33,24 +33,32 @@ struct Point32 {
};
struct Rect32 {
- int32 top, left; ///< The point at the top left of the rectangle (part of the rect).
- int32 bottom, right; ///< The point at the bottom right of the rectangle (not part of the rect).
-
+ int32 top, left; ///< The point at the top left of the rectangle (part of the rect).
+ int32 bottom, right; ///< The point at the bottom right of the rectangle (not part of the rect).
+
Rect32() : top(0), left(0), bottom(0), right(0) {}
Rect32(int16 w, int16 h) : top(0), left(0), bottom(h), right(w) {}
Rect32(int16 x1, int16 y1, int16 x2, int16 y2) : top(y1), left(x1), bottom(y2), right(x2) {
assert(isValidRect());
}
- bool operator==(const Rect32 &rhs) const { return equals(rhs); }
- bool operator!=(const Rect32 &rhs) const { return !equals(rhs); }
-
- int16 width() const { return right - left; }
- int16 height() const { return bottom - top; }
-
+ bool operator==(const Rect32 &rhs) const {
+ return equals(rhs);
+ }
+ bool operator!=(const Rect32 &rhs) const {
+ return !equals(rhs);
+ }
+
+ int16 width() const {
+ return right - left;
+ }
+ int16 height() const {
+ return bottom - top;
+ }
+
void setWidth(int16 aWidth) {
right = left + aWidth;
}
-
+
void setHeight(int16 aHeight) {
bottom = top + aHeight;
}
@@ -75,7 +83,7 @@ struct Rect32 {
bool equals(const Rect32 &r) const {
return (left == r.left) && (right == r.right) && (top == r.top) && (bottom == r.bottom);
}
-
+
bool isValidRect() const {
return (left <= right && top <= bottom);
}
diff --git a/engines/wintermute/math/vector2.cpp b/engines/wintermute/math/vector2.cpp
index 9906a59429..ecf2f1e8e4 100644
--- a/engines/wintermute/math/vector2.cpp
+++ b/engines/wintermute/math/vector2.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/engines/wintermute/math/vector2.h b/engines/wintermute/math/vector2.h
index 96d3a3827d..ca4f499794 100644
--- a/engines/wintermute/math/vector2.h
+++ b/engines/wintermute/math/vector2.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/engines/wintermute/utils/path_util.cpp b/engines/wintermute/utils/path_util.cpp
index d97b9bedab..27b2b0b727 100644
--- a/engines/wintermute/utils/path_util.cpp
+++ b/engines/wintermute/utils/path_util.cpp
@@ -118,15 +118,15 @@ AnsiString PathUtil::getExtension(const AnsiString &path) {
AnsiString PathUtil::getSafeLogFileName() {
AnsiString logFileName = getUserDirectory();
-/*#ifdef __WIN32__
- char moduleName[MAX_PATH_LENGTH];
- ::GetModuleFileName(NULL, moduleName, MAX_PATH_LENGTH);
+ /*#ifdef __WIN32__
+ char moduleName[MAX_PATH_LENGTH];
+ ::GetModuleFileName(NULL, moduleName, MAX_PATH_LENGTH);
- AnsiString fileName = GetFileNameWithoutExtension(moduleName) + ".log";
- fileName = Combine("/Wintermute Engine/Logs/", fileName);
- logFileName = Combine(logFileName, fileName);
+ AnsiString fileName = GetFileNameWithoutExtension(moduleName) + ".log";
+ fileName = Combine("/Wintermute Engine/Logs/", fileName);
+ logFileName = Combine(logFileName, fileName);
-#else*/
+ #else*/
// !PORTME
logFileName = combine(logFileName, "/Wintermute Engine/wme.log");
//#endif
diff --git a/engines/wintermute/utils/string_util.cpp b/engines/wintermute/utils/string_util.cpp
index be6207c3b8..748016d9c4 100644
--- a/engines/wintermute/utils/string_util.cpp
+++ b/engines/wintermute/utils/string_util.cpp
@@ -170,7 +170,7 @@ WideString StringUtil::ansiToWide(const AnsiString &str) {
/*Common::String converted = "";
uint32 index = 0;
while (index != str.size()) {
- converted += simpleAnsiToWide(str, index);
+ converted += simpleAnsiToWide(str, index);
}*/
// using default os locale!
diff --git a/engines/wintermute/utils/utils.cpp b/engines/wintermute/utils/utils.cpp
index ee723cf80a..a4751ef11b 100644
--- a/engines/wintermute/utils/utils.cpp
+++ b/engines/wintermute/utils/utils.cpp
@@ -57,11 +57,11 @@ float BaseUtils::normalizeAngle(float angle) {
////////////////////////////////////////////////////////////////////////////////
void BaseUtils::createPath(const char *path, bool pathOnly) {
-/* AnsiString pathStr;
+ /* AnsiString pathStr;
- if (!pathOnly) pathStr = PathUtil::getDirectoryName(path);
- else pathStr = path;
-*/
+ if (!pathOnly) pathStr = PathUtil::getDirectoryName(path);
+ else pathStr = path;
+ */
// try {
warning("BaseUtils::CreatePath - not implemented: %s", path);
// boost::filesystem::create_directories(path);
diff --git a/engines/wintermute/wintermute.cpp b/engines/wintermute/wintermute.cpp
index 55204bcc74..ac9c3b7fbf 100644
--- a/engines/wintermute/wintermute.cpp
+++ b/engines/wintermute/wintermute.cpp
@@ -51,7 +51,7 @@ WinterMuteEngine::WinterMuteEngine() : Engine(g_system) {
g_wintermute = this;
_classReg = new SystemClassRegistry();
_classReg->registerClasses();
-
+
_game = new AdGame();
_rnd = NULL;
}
@@ -79,7 +79,7 @@ WinterMuteEngine::WinterMuteEngine(OSystem *syst, const ADGameDescription *desc)
debug("WinterMuteEngine::WinterMuteEngine");
_game = NULL;
-
+
g_wintermute = this;
_classReg = NULL;
}
@@ -97,12 +97,12 @@ WinterMuteEngine::~WinterMuteEngine() {
DebugMan.clearAllDebugChannels();
}
-bool WinterMuteEngine::hasFeature(EngineFeature f) const {
+bool WinterMuteEngine::hasFeature(EngineFeature f) const {
switch (f) {
- case kSupportsRTL:
- return true;
- default:
- return false;
+ case kSupportsRTL:
+ return true;
+ default:
+ return false;
}
return false;
}
@@ -144,7 +144,7 @@ Common::Error WinterMuteEngine::run() {
debugC(2, kWinterMuteDebugSaveGame , "Savegame debugging-enabled");
int ret = 1;
-
+
ret = init();
if (ret == 0) {
@@ -163,92 +163,90 @@ int WinterMuteEngine::init() {
BasePlatform::initialize(_game, 0, NULL);
bool windowedMode = !ConfMan.getBool("fullscreen");
-
+
// parse command line
char *saveGame = NULL;
-/* for (int i = 0; i < argc; i++) {
- strcpy(param, argv[i]);
-
- if (scumm_stricmp(param, "-project") == 0) {
- if (argc > i) strcpy(param, argv[i + 1]);
- else param[0] = '\0';
-
- if (strcmp(param, "") != 0) {
- char *IniDir = BaseUtils::GetPath(param);
- char *IniName = BaseUtils::GetFilename(param);
-
- // switch to ini's dir
- warning("TODO: Place ini-files somewhere");
- // chdir(IniDir);
-
- // set ini name
- sprintf(param, "./%s", IniName);
- _game->_registry->SetIniName(param);
-
- delete[] IniDir;
- delete[] IniName;
- }
- } else if (scumm_stricmp(param, "-windowed") == 0) windowedMode = true;
- }*/
-
-
+ /* for (int i = 0; i < argc; i++) {
+ strcpy(param, argv[i]);
+
+ if (scumm_stricmp(param, "-project") == 0) {
+ if (argc > i) strcpy(param, argv[i + 1]);
+ else param[0] = '\0';
+
+ if (strcmp(param, "") != 0) {
+ char *IniDir = BaseUtils::GetPath(param);
+ char *IniName = BaseUtils::GetFilename(param);
+
+ // switch to ini's dir
+ warning("TODO: Place ini-files somewhere");
+ // chdir(IniDir);
+
+ // set ini name
+ sprintf(param, "./%s", IniName);
+ _game->_registry->SetIniName(param);
+
+ delete[] IniDir;
+ delete[] IniName;
+ }
+ } else if (scumm_stricmp(param, "-windowed") == 0) windowedMode = true;
+ }*/
+
+
if (_game->_registry->readBool("Debug", "DebugMode")) _game->DEBUG_DebugEnable("./wme.log");
-
+
_game->_debugShowFPS = _game->_registry->readBool("Debug", "ShowFPS");
-
+
if (_game->_registry->readBool("Debug", "DisableSmartCache")) {
_game->LOG(0, "Smart cache is DISABLED");
_game->_smartCache = false;
}
-
- /* bool AllowDirectDraw = _game->_registry->readBool("Debug", "AllowDirectDraw", false);*/
-
+
+ /* bool AllowDirectDraw = _game->_registry->readBool("Debug", "AllowDirectDraw", false);*/
+
// load general game settings
_game->initialize1();
-
+
// set gameId, for savegame-naming:
_game->setGameId(_targetName);
-
+
if (DID_FAIL(_game->loadSettings("startup.settings"))) {
_game->LOG(0, "Error loading game settings.");
delete _game;
_game = NULL;
-
+
warning("Some of the essential files are missing. Please reinstall.");
return 2;
}
-
+
_game->initialize2();
-
+
_game->getDebugMgr()->onGameInit();
_game->_scEngine->loadBreakpoints();
-
-
-
+
bool ret;
-
+
// initialize the renderer
ret = _game->_renderer->initRenderer(_game->_settingsResWidth, _game->_settingsResHeight, windowedMode);
if (DID_FAIL(ret)) {
_game->LOG(ret, "Error initializing renderer. Exiting.");
-
+
delete _game;
_game = NULL;
return 3;
}
-
+
_game->initialize3();
-
+
// initialize sound manager (non-fatal if we fail)
ret = _game->_soundMgr->initialize();
if (DID_FAIL(ret)) {
_game->LOG(ret, "Sound is NOT available.");
}
-
-
+
+
// load game
uint32 DataInitStart = g_system->getMillis();
-
+
if (DID_FAIL(_game->loadFile(_game->_settingsGameFile ? _game->_settingsGameFile : "default.game"))) {
_game->LOG(ret, "Error loading game file. Exiting.");
delete _game;
@@ -258,21 +256,21 @@ int WinterMuteEngine::init() {
//_game->setWindowTitle();
_game->_renderer->_ready = true;
_game->_miniUpdateEnabled = true;
-
+
_game->LOG(0, "Engine initialized in %d ms", g_system->getMillis() - DataInitStart);
_game->LOG(0, "");
-
+
if (ConfMan.hasKey("save_slot")) {
int slot = ConfMan.getInt("save_slot");
Common::String str = Common::String::format("save00%d.DirtySplitSav", slot);
_game->loadGame(str.c_str());
}
-
+
if (saveGame) {
_game->loadGame(saveGame);
delete[] saveGame;
}
-
+
// all set, ready to go
return 0;
}
@@ -285,13 +283,13 @@ int WinterMuteEngine::messageLoop() {
uint32 diff = 0;
const uint32 maxFPS = 60;
- const uint32 frameTime = (uint32)((1.0/maxFPS) * 1000);
+ const uint32 frameTime = (uint32)((1.0 / maxFPS) * 1000);
while (!done) {
Common::Event event;
while (_system->getEventManager()->pollEvent(event)) {
BasePlatform::handleEvent(&event);
}
-
+
if (_game && _game->_renderer->_active && _game->_renderer->_ready) {
_game->displayContent();
_game->displayQuickMsg();
@@ -310,7 +308,7 @@ int WinterMuteEngine::messageLoop() {
}
if (_game->_quitting) break;
}
-
+
if (_game) {
// remember previous window position
/*
@@ -322,13 +320,13 @@ int WinterMuteEngine::messageLoop() {
int PosY = _game->_renderer->_windowRect.top;
PosX -= _game->_renderer->_monitorRect.left;
PosY -= _game->_renderer->_monitorRect.top;
-
+
_game->_registry->writeInt("Video", "WindowPosX", PosX);
_game->_registry->writeInt("Video", "WindowPosY", PosY);
}
}
*/
-
+
delete _game;
_game = NULL;
}
diff --git a/engines/wintermute/wintermute.h b/engines/wintermute/wintermute.h
index 5d5edb66de..14c2ba2ab5 100644
--- a/engines/wintermute/wintermute.h
+++ b/engines/wintermute/wintermute.h
@@ -38,8 +38,8 @@ enum {
kWinterMuteDebugLog = 1 << 0, // The debug-logs from the original engine
kWinterMuteDebugSaveGame = 1 << 1,
kWinterMuteDebugFont = 1 << 2, // next new channel must be 1 << 2 (4)
- kWinterMuteDebugFileAccess = 1 << 3, // the current limitation is 32 debug channels (1 << 31 is the last one)
- kWinterMuteDebugAudio = 1 << 4
+ kWinterMuteDebugFileAccess = 1 << 3, // the current limitation is 32 debug channels (1 << 31 is the last one)
+ kWinterMuteDebugAudio = 1 << 4
};
class WinterMuteEngine : public Engine {
diff --git a/engines/wintermute/wintypes.h b/engines/wintermute/wintypes.h
index 8db55e2a37..4b2fc5bada 100644
--- a/engines/wintermute/wintypes.h
+++ b/engines/wintermute/wintypes.h
@@ -43,8 +43,8 @@ namespace WinterMute {
#define DID_SUCCEED(hr) ((bool)(hr))
#define DID_FAIL(hr) (!((bool)(hr)))
-#define STATUS_OK (true)
-#define STATUS_FAILED (false)
+#define STATUS_OK (true)
+#define STATUS_FAILED (false)
#define MAX_PATH_LENGTH 512