aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/wintermute/Ad/AdEntity.cpp33
-rw-r--r--engines/wintermute/Ad/AdGame.cpp12
-rw-r--r--engines/wintermute/Ad/AdRegion.cpp2
-rw-r--r--engines/wintermute/Ad/AdScene.cpp8
-rw-r--r--engines/wintermute/Ad/AdSentence.cpp2
-rw-r--r--engines/wintermute/Base/BFileManager.cpp2
-rw-r--r--engines/wintermute/Base/BFontStorage.cpp4
-rw-r--r--engines/wintermute/Base/BFrame.cpp3
-rw-r--r--engines/wintermute/Base/BGame.cpp39
-rw-r--r--engines/wintermute/Base/BKeyboardState.cpp4
-rw-r--r--engines/wintermute/Base/BPersistMgr.cpp2
-rw-r--r--engines/wintermute/Base/BRenderer.cpp5
12 files changed, 51 insertions, 65 deletions
diff --git a/engines/wintermute/Ad/AdEntity.cpp b/engines/wintermute/Ad/AdEntity.cpp
index ccd520a543..b7d93d6bd3 100644
--- a/engines/wintermute/Ad/AdEntity.cpp
+++ b/engines/wintermute/Ad/AdEntity.cpp
@@ -507,8 +507,7 @@ HRESULT CAdEntity::Display() {
}
DisplaySpriteAttachments(true);
- if(_theora && (_theora->isPlaying() || _theora->isPaused()))
- {
+ if (_theora && (_theora->isPlaying() || _theora->isPaused())) {
_theora->display(Alpha);
} else if (_currentSprite) {
_currentSprite->Display(_posX,
@@ -602,16 +601,14 @@ HRESULT CAdEntity::Update() {
UpdateBlockRegion();
_ready = (_state == STATE_READY);
- if(_theora)
- {
+ if (_theora) {
int OffsetX, OffsetY;
Game->GetOffset(&OffsetX, &OffsetY);
_theora->_posX = _posX - OffsetX;
_theora->_posY = _posY - OffsetY;
_theora->update();
- if(_theora->isFinished())
- {
+ if (_theora->isFinished()) {
_theora->stop();
delete _theora;
}
@@ -651,8 +648,8 @@ HRESULT CAdEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
delete _theora;
_theora = new CVidTheoraPlayer(Game);
- if(_theora && SUCCEEDED(_theora->initialize(Filename))) {
- if(!ValAlpha->IsNULL()) _theora->setAlphaImage(ValAlpha->GetString());
+ if (_theora && SUCCEEDED(_theora->initialize(Filename))) {
+ if (!ValAlpha->IsNULL()) _theora->setAlphaImage(ValAlpha->GetString());
_theora->play(VID_PLAY_POS, 0, 0, false, false, Looping, StartTime, _scale >= 0.0f ? _scale : -1.0f, _sFXVolume);
//if(m_Scale>=0) m_Theora->m_PlayZoom = m_Scale;
Stack->PushBool(true);
@@ -669,13 +666,12 @@ HRESULT CAdEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "StopTheora") == 0) {
Stack->CorrectParams(0);
- if(_theora) {
+ if (_theora) {
_theora->stop();
delete _theora;
_theora = NULL;
Stack->PushBool(true);
- }
- else Stack->PushBool(false);
+ } else Stack->PushBool(false);
return S_OK;
}
@@ -685,7 +681,7 @@ HRESULT CAdEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "IsTheoraPlaying") == 0) {
Stack->CorrectParams(0);
- if(_theora && _theora->isPlaying()) Stack->PushBool(true);
+ if (_theora && _theora->isPlaying()) Stack->PushBool(true);
else Stack->PushBool(false);
return S_OK;
@@ -696,11 +692,10 @@ HRESULT CAdEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "PauseTheora") == 0) {
Stack->CorrectParams(0);
- if(_theora && _theora->isPlaying()) {
+ if (_theora && _theora->isPlaying()) {
_theora->pause();
Stack->PushBool(true);
- }
- else Stack->PushBool(false);
+ } else Stack->PushBool(false);
return S_OK;
}
@@ -710,11 +705,10 @@ HRESULT CAdEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "ResumeTheora") == 0) {
Stack->CorrectParams(0);
- if(_theora && _theora->isPaused()) {
+ if (_theora && _theora->isPaused()) {
_theora->resume();
Stack->PushBool(true);
- }
- else Stack->PushBool(false);
+ } else Stack->PushBool(false);
return S_OK;
}
@@ -724,7 +718,7 @@ HRESULT CAdEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "IsTheoraPaused") == 0) {
Stack->CorrectParams(0);
- if(_theora && _theora->isPaused()) Stack->PushBool(true);
+ if (_theora && _theora->isPaused()) Stack->PushBool(true);
else Stack->PushBool(false);
return S_OK;
@@ -871,7 +865,6 @@ HRESULT CAdEntity::ScSetProperty(const char *Name, CScValue *Value) {
return S_OK;
}
-
else return CAdTalkHolder::ScSetProperty(Name, Value);
}
diff --git a/engines/wintermute/Ad/AdGame.cpp b/engines/wintermute/Ad/AdGame.cpp
index 5c87278217..26cbc299bf 100644
--- a/engines/wintermute/Ad/AdGame.cpp
+++ b/engines/wintermute/Ad/AdGame.cpp
@@ -1693,15 +1693,15 @@ HRESULT CAdGame::DisplayContent(bool Update, bool DisplayAll) {
if (!_editorMode) _renderer->SetScreenViewport();
// playing exclusive video?
- if(_videoPlayer->isPlaying()) {
- if(Update) _videoPlayer->update();
+ if (_videoPlayer->isPlaying()) {
+ if (Update) _videoPlayer->update();
_videoPlayer->display();
- } else if(_theoraPlayer) {
- if(_theoraPlayer->isPlaying()) {
- if(Update) _theoraPlayer->update();
+ } else if (_theoraPlayer) {
+ if (_theoraPlayer->isPlaying()) {
+ if (Update) _theoraPlayer->update();
_theoraPlayer->display();
}
- if(_theoraPlayer->isFinished()) {
+ if (_theoraPlayer->isFinished()) {
delete _theoraPlayer;
_theoraPlayer = NULL;
}
diff --git a/engines/wintermute/Ad/AdRegion.cpp b/engines/wintermute/Ad/AdRegion.cpp
index 5ed3097b30..b6735f72ff 100644
--- a/engines/wintermute/Ad/AdRegion.cpp
+++ b/engines/wintermute/Ad/AdRegion.cpp
@@ -226,7 +226,7 @@ HRESULT CAdRegion::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th
//////////////////////////////////////////////////////////////////////////
// SkipTo
//////////////////////////////////////////////////////////////////////////
- if(strcmp(Name, "SkipTo")==0){
+ if (strcmp(Name, "SkipTo")==0) {
Stack->CorrectParams(2);
_posX = Stack->Pop()->GetInt();
_posY = Stack->Pop()->GetInt();
diff --git a/engines/wintermute/Ad/AdScene.cpp b/engines/wintermute/Ad/AdScene.cpp
index 8ebc674c63..3400fba145 100644
--- a/engines/wintermute/Ad/AdScene.cpp
+++ b/engines/wintermute/Ad/AdScene.cpp
@@ -340,7 +340,7 @@ bool CAdScene::IsBlockedAt(int X, int Y, bool CheckFreeObjects, CBObject *Reques
for (int i = 0; i < _mainLayer->_nodes.GetSize(); i++) {
CAdSceneNode *Node = _mainLayer->_nodes[i];
/*
- if(Node->_type == OBJECT_REGION && Node->_region->_active && Node->_region->_blocked && Node->_region->PointInRegion(X, Y))
+ if (Node->_type == OBJECT_REGION && Node->_region->_active && Node->_region->_blocked && Node->_region->PointInRegion(X, Y))
{
ret = true;
break;
@@ -883,7 +883,7 @@ HRESULT CAdScene::TraverseNodes(bool Update) {
// *** adjust scroll offset
if (Update) {
/*
- if(_autoScroll && Game->_mainObject != NULL)
+ if (_autoScroll && Game->_mainObject != NULL)
{
ScrollToObject(Game->_mainObject);
}
@@ -2217,7 +2217,7 @@ HRESULT CAdScene::CorrectTargetPoint2(int StartX, int StartY, int *TargetX, int
if (xLength > yLength) {
/*
- if(X1 > X2)
+ if (X1 > X2)
{
Swap(&X1, &X2);
Swap(&Y1, &Y2);
@@ -2237,7 +2237,7 @@ HRESULT CAdScene::CorrectTargetPoint2(int StartX, int StartY, int *TargetX, int
}
} else {
/*
- if(Y1 > Y2) {
+ if (Y1 > Y2) {
Swap(&X1, &X2);
Swap(&Y1, &Y2);
}
diff --git a/engines/wintermute/Ad/AdSentence.cpp b/engines/wintermute/Ad/AdSentence.cpp
index e513d1f3ed..468f8a49c1 100644
--- a/engines/wintermute/Ad/AdSentence.cpp
+++ b/engines/wintermute/Ad/AdSentence.cpp
@@ -277,7 +277,7 @@ HRESULT CAdSentence::Update(TDirection Dir) {
// if sound is available, synchronize with sound, otherwise use timer
/*
- if(_sound) CurrentTime = _sound->GetPositionTime();
+ if (_sound) CurrentTime = _sound->GetPositionTime();
else CurrentTime = Game->_timer - _startTime;
*/
CurrentTime = Game->_timer - _startTime;
diff --git a/engines/wintermute/Base/BFileManager.cpp b/engines/wintermute/Base/BFileManager.cpp
index 9b0789fd1b..ecccb04493 100644
--- a/engines/wintermute/Base/BFileManager.cpp
+++ b/engines/wintermute/Base/BFileManager.cpp
@@ -127,7 +127,7 @@ byte *CBFileManager::ReadWholeFile(const Common::String &Filename, uint32 *Size,
}
/*
- if(File->GetSize()>MAX_FILE_SIZE){
+ if (File->GetSize() > MAX_FILE_SIZE) {
Game->LOG(0, "File '%s' exceeds the maximum size limit (%d bytes)", Filename, MAX_FILE_SIZE);
CloseFile(File);
return NULL;
diff --git a/engines/wintermute/Base/BFontStorage.cpp b/engines/wintermute/Base/BFontStorage.cpp
index b34e24c286..0d00f89e60 100644
--- a/engines/wintermute/Base/BFontStorage.cpp
+++ b/engines/wintermute/Base/BFontStorage.cpp
@@ -102,9 +102,9 @@ CBFont *CBFontStorage::AddFont(const char *Filename) {
/*
CBFont* font = new CBFont(Game);
- if(!font) return NULL;
+ if (!font) return NULL;
- if(FAILED(font->LoadFile(Filename))){
+ if (FAILED(font->LoadFile(Filename))) {
delete font;
return NULL;
}
diff --git a/engines/wintermute/Base/BFrame.cpp b/engines/wintermute/Base/BFrame.cpp
index 6fa61b5d51..fa1ed5484e 100644
--- a/engines/wintermute/Base/BFrame.cpp
+++ b/engines/wintermute/Base/BFrame.cpp
@@ -93,8 +93,7 @@ HRESULT CBFrame::OneTimeDisplay(CBObject *Owner, bool Muted) {
if (Owner) Owner->UpdateOneSound(_sound);
_sound->Play();
/*
- if(Game->_state==GAME_FROZEN)
- {
+ if (Game->_state == GAME_FROZEN) {
_sound->Pause(true);
}
*/
diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp
index 24dc8d357a..f5ac836624 100644
--- a/engines/wintermute/Base/BGame.cpp
+++ b/engines/wintermute/Base/BGame.cpp
@@ -459,7 +459,7 @@ HRESULT CBGame::Initialize1() {
if (_scEngine == NULL) goto init_fail;
_videoPlayer = new CVidPlayer(this);
- if(_videoPlayer==NULL) goto init_fail;
+ if (_videoPlayer==NULL) goto init_fail;
_transMgr = new CBTransitionMgr(this);
if (_transMgr == NULL) goto init_fail;
@@ -1420,7 +1420,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
warning("PlayVideo: %s - not implemented yet", Filename);
CScValue* valType = Stack->Pop();
int Type;
- if(valType->IsNULL()) Type = (int)VID_PLAY_STRETCH;
+ if (valType->IsNULL()) Type = (int)VID_PLAY_STRETCH;
else Type = valType->GetInt();
int X = Stack->Pop()->GetInt();
@@ -1430,12 +1430,11 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
CScValue* valSub = Stack->Pop();
const char* SubtitleFile = valSub->IsNULL()?NULL:valSub->GetString();
- if(Type < (int)VID_PLAY_POS || Type > (int)VID_PLAY_CENTER) Type = (int)VID_PLAY_STRETCH;
+ if (Type < (int)VID_PLAY_POS || Type > (int)VID_PLAY_CENTER)
+ Type = (int)VID_PLAY_STRETCH;
- if(SUCCEEDED(Game->_videoPlayer->initialize(Filename, SubtitleFile)))
- {
- if(SUCCEEDED(Game->_videoPlayer->play((TVideoPlayback)Type, X, Y, FreezeMusic)))
- {
+ if (SUCCEEDED(Game->_videoPlayer->initialize(Filename, SubtitleFile))) {
+ if (SUCCEEDED(Game->_videoPlayer->play((TVideoPlayback)Type, X, Y, FreezeMusic))) {
Stack->PushBool(true);
Script->Sleep(0);
}
@@ -1461,7 +1460,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
warning("PlayTheora: %s - not implemented yet", Filename);
CScValue* valType = Stack->Pop();
int Type;
- if(valType->IsNULL()) Type = (int)VID_PLAY_STRETCH;
+ if (valType->IsNULL())
+ Type = (int)VID_PLAY_STRETCH;
else Type = valType->GetInt();
int X = Stack->Pop()->GetInt();
@@ -1471,17 +1471,14 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
CScValue* valSub = Stack->Pop();
const char* SubtitleFile = valSub->IsNULL()?NULL:valSub->GetString();
-
-
- if(Type < (int)VID_PLAY_POS || Type > (int)VID_PLAY_CENTER) Type = (int)VID_PLAY_STRETCH;
+
+ if (Type < (int)VID_PLAY_POS || Type > (int)VID_PLAY_CENTER) Type = (int)VID_PLAY_STRETCH;
delete _theoraPlayer;
_theoraPlayer = new CVidTheoraPlayer(this);
- if(_theoraPlayer && SUCCEEDED(_theoraPlayer->initialize(Filename, SubtitleFile)))
- {
+ if (_theoraPlayer && SUCCEEDED(_theoraPlayer->initialize(Filename, SubtitleFile))) {
_theoraPlayer->_dontDropFrames = !DropFrames;
- if(SUCCEEDED(_theoraPlayer->play((TVideoPlayback)Type, X, Y, true, FreezeMusic)))
- {
+ if (SUCCEEDED(_theoraPlayer->play((TVideoPlayback)Type, X, Y, true, FreezeMusic))) {
Stack->PushBool(true);
Script->Sleep(0);
}
@@ -4239,17 +4236,16 @@ HRESULT CBGame::SetWaitCursor(const char *Filename) {
//////////////////////////////////////////////////////////////////////////
bool CBGame::IsVideoPlaying()
{
- if(_videoPlayer->isPlaying()) return true;
- if(_theoraPlayer && _theoraPlayer->isPlaying()) return true;
+ if (_videoPlayer->isPlaying()) return true;
+ if (_theoraPlayer && _theoraPlayer->isPlaying()) return true;
return false;
}
//////////////////////////////////////////////////////////////////////////
HRESULT CBGame::StopVideo()
{
- if(_videoPlayer->isPlaying()) _videoPlayer->stop();
- if(_theoraPlayer && _theoraPlayer->isPlaying())
- {
+ if (_videoPlayer->isPlaying()) _videoPlayer->stop();
+ if (_theoraPlayer && _theoraPlayer->isPlaying()) {
_theoraPlayer->stop();
delete _theoraPlayer;
_theoraPlayer = NULL;
@@ -4484,8 +4480,7 @@ void CBGame::GetMousePos(POINT *Pos) {
/*
// Windows can squish maximized window if it's larger than desktop
// so we need to modify mouse position appropriately (tnx mRax)
- if(_renderer->_windowed && ::IsZoomed(_renderer->_window))
- {
+ if (_renderer->_windowed && ::IsZoomed(_renderer->_window)) {
RECT rc;
::GetClientRect(_renderer->_window, &rc);
Pos->x *= Game->_renderer->_realWidth;
diff --git a/engines/wintermute/Base/BKeyboardState.cpp b/engines/wintermute/Base/BKeyboardState.cpp
index b81803e0ce..17d27712ad 100644
--- a/engines/wintermute/Base/BKeyboardState.cpp
+++ b/engines/wintermute/Base/BKeyboardState.cpp
@@ -163,9 +163,9 @@ HRESULT CBKeyboardState::ScSetProperty(const char *Name, CScValue *Value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if(strcmp(Name, "Name")==0){
+ if (strcmp(Name, "Name") == 0) {
SetName(Value->GetString());
- if(_renderer) SetWindowText(_renderer->_window, _name);
+ if (_renderer) SetWindowText(_renderer->_window, _name);
return S_OK;
}
diff --git a/engines/wintermute/Base/BPersistMgr.cpp b/engines/wintermute/Base/BPersistMgr.cpp
index 7c5505bd4a..3372e05ba1 100644
--- a/engines/wintermute/Base/BPersistMgr.cpp
+++ b/engines/wintermute/Base/BPersistMgr.cpp
@@ -267,7 +267,7 @@ HRESULT CBPersistMgr::InitLoad(const char *Filename) {
}
/*
- if( _savedVerMajor != DCGF_VER_MAJOR || _savedVerMinor != DCGF_VER_MINOR)
+ if ( _savedVerMajor != DCGF_VER_MAJOR || _savedVerMinor != DCGF_VER_MINOR)
{
Game->LOG(0, "ERROR: Saved game is created by other WME version");
goto init_fail;
diff --git a/engines/wintermute/Base/BRenderer.cpp b/engines/wintermute/Base/BRenderer.cpp
index c8de494097..fa9bec5f4f 100644
--- a/engines/wintermute/Base/BRenderer.cpp
+++ b/engines/wintermute/Base/BRenderer.cpp
@@ -221,8 +221,7 @@ CBImage *CBRenderer::TakeScreenshot() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBRenderer::ClipCursor() {
/*
- if(!_windowed)
- {
+ if (!_windowed) {
RECT rc;
GetWindowRect(_window, &rc);
@@ -241,7 +240,7 @@ HRESULT CBRenderer::ClipCursor() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBRenderer::UnclipCursor() {
/*
- if(!_windowed) ::ClipCursor(NULL);
+ if (!_windowed) ::ClipCursor(NULL);
*/
return S_OK;
}