diff options
| author | Einar Johan Trøan Sømåen | 2012-06-22 14:10:08 +0200 | 
|---|---|---|
| committer | Einar Johan Trøan Sømåen | 2012-06-22 14:10:08 +0200 | 
| commit | 4e33b8ea75719cbeaf9b62c527fd49e94abd6e3e (patch) | |
| tree | 80108256f0cd627c6d17913fbce7aa8420fab987 | |
| parent | b06f4ac72c2ea3d4b05ece81a60f699b0bf70086 (diff) | |
| download | scummvm-rg350-4e33b8ea75719cbeaf9b62c527fd49e94abd6e3e.tar.gz scummvm-rg350-4e33b8ea75719cbeaf9b62c527fd49e94abd6e3e.tar.bz2 scummvm-rg350-4e33b8ea75719cbeaf9b62c527fd49e94abd6e3e.zip | |
WINTERMUTE: Run astyle on the source-files.
49 files changed, 401 insertions, 377 deletions
| diff --git a/engines/wintermute/Ad/AdActor.cpp b/engines/wintermute/Ad/AdActor.cpp index 3d4e77565a..68d173102e 100644 --- a/engines/wintermute/Ad/AdActor.cpp +++ b/engines/wintermute/Ad/AdActor.cpp @@ -1255,7 +1255,7 @@ int CAdActor::GetHeight() {  //////////////////////////////////////////////////////////////////////////
  CAdSpriteSet *CAdActor::GetAnimByName(const Common::String &animName) {
  	for (int i = 0; i < _anims.GetSize(); i++) {
 -		if (animName.compareToIgnoreCase(_anims[i]->_name) == 0) 
 +		if (animName.compareToIgnoreCase(_anims[i]->_name) == 0)
  			return _anims[i];
  	}
  	return NULL;
 diff --git a/engines/wintermute/Ad/AdEntity.cpp b/engines/wintermute/Ad/AdEntity.cpp index f54f26d466..62b3156842 100644 --- a/engines/wintermute/Ad/AdEntity.cpp +++ b/engines/wintermute/Ad/AdEntity.cpp @@ -66,7 +66,7 @@ CAdEntity::CAdEntity(CBGame *inGame): CAdTalkHolder(inGame) {  	_walkToX = _walkToY = 0;
  	_walkToDir = DI_NONE;
 -	
 +
  	_theora = NULL;
  }
 @@ -606,7 +606,7 @@ HRESULT CAdEntity::Update() {  		Game->GetOffset(&OffsetX, &OffsetY);
  		_theora->_posX = _posX - OffsetX;
  		_theora->_posY = _posY - OffsetY;
 -		
 +
  		_theora->update();
  		if (_theora->isFinished()) {
  			_theora->stop();
 @@ -642,15 +642,15 @@ HRESULT CAdEntity::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(Name, "PlayTheora") == 0) {
  		Stack->CorrectParams(4);
 -		const char* Filename = Stack->Pop()->GetString();
 +		const char *Filename = Stack->Pop()->GetString();
  		bool Looping = Stack->Pop()->GetBool(false);
 -		CScValue* ValAlpha = Stack->Pop();
 +		CScValue *ValAlpha = Stack->Pop();
  		int StartTime = Stack->Pop()->GetInt();
 -		
 +
  		delete _theora;
  		_theora = new CVidTheoraPlayer(Game);
  		if (_theora && SUCCEEDED(_theora->initialize(Filename))) {
 -			if (!ValAlpha->IsNULL())	_theora->setAlphaImage(ValAlpha->GetString());
 +			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);
 diff --git a/engines/wintermute/Ad/AdEntity.h b/engines/wintermute/Ad/AdEntity.h index e8a55a16aa..6590007021 100644 --- a/engines/wintermute/Ad/AdEntity.h +++ b/engines/wintermute/Ad/AdEntity.h @@ -35,7 +35,7 @@ namespace WinterMute {  class CVidTheoraPlayer;
  class CAdEntity : public CAdTalkHolder {
  public:
 -	CVidTheoraPlayer* _theora;
 +	CVidTheoraPlayer *_theora;
  	HRESULT SetSprite(const char *Filename);
  	int _walkToX;
  	int _walkToY;
 diff --git a/engines/wintermute/Ad/AdGame.cpp b/engines/wintermute/Ad/AdGame.cpp index 938ad66b12..c20bf721de 100644 --- a/engines/wintermute/Ad/AdGame.cpp +++ b/engines/wintermute/Ad/AdGame.cpp @@ -1690,7 +1690,7 @@ HRESULT CAdGame::DisplayContent(bool Update, bool DisplayAll) {  	// fill black
  	_renderer->Fill(0, 0, 0);
  	if (!_editorMode) _renderer->SetScreenViewport();
 -	
 +
  	// playing exclusive video?
  	if (_videoPlayer->isPlaying()) {
  		if (Update) _videoPlayer->update();
 diff --git a/engines/wintermute/Ad/AdObject.cpp b/engines/wintermute/Ad/AdObject.cpp index 5cafa399e7..4f93a30a8e 100644 --- a/engines/wintermute/Ad/AdObject.cpp +++ b/engines/wintermute/Ad/AdObject.cpp @@ -834,7 +834,7 @@ void CAdObject::Talk(const char *Text, const char *Sound, uint32 Duration, const  		_forcedTalkAnimUsed = false;
  	}
 -	delete (_sentence->_sound);
 +	delete(_sentence->_sound);
  	_sentence->_sound = NULL;
  	_sentence->SetText(Text);
 diff --git a/engines/wintermute/Ad/AdResponseBox.cpp b/engines/wintermute/Ad/AdResponseBox.cpp index afceaf8a31..26590af65f 100644 --- a/engines/wintermute/Ad/AdResponseBox.cpp +++ b/engines/wintermute/Ad/AdResponseBox.cpp @@ -502,7 +502,7 @@ HRESULT CAdResponseBox::Listen(CBScriptHolder *param1, uint32 param2) {  			ClearResponses();
  		} else return CBObject::Listen(param1, param2);
  		break;
 -		default:
 +	default:
  		error("AdResponseBox::Listen - Unhandled enum");
  	}
 diff --git a/engines/wintermute/Ad/AdScene.cpp b/engines/wintermute/Ad/AdScene.cpp index 31d30356bd..cc51ddef22 100644 --- a/engines/wintermute/Ad/AdScene.cpp +++ b/engines/wintermute/Ad/AdScene.cpp @@ -2555,8 +2555,8 @@ float CAdScene::GetRotationAt(int X, int Y) {  	CAdRotLevel *next = NULL;
  	for (int i = 0; i < _rotLevels.GetSize(); i++) {
 -	/*	CAdRotLevel *xxx = _rotLevels[i];
 -		int j = _rotLevels.GetSize();*/
 +		/*  CAdRotLevel *xxx = _rotLevels[i];
 +		    int j = _rotLevels.GetSize();*/
  		if (_rotLevels[i]->_posX < X) prev = _rotLevels[i];
  		else {
  			next = _rotLevels[i];
 diff --git a/engines/wintermute/Base/BFileManager.cpp b/engines/wintermute/Base/BFileManager.cpp index 990375ef73..90c0fffc39 100644 --- a/engines/wintermute/Base/BFileManager.cpp +++ b/engines/wintermute/Base/BFileManager.cpp @@ -168,7 +168,7 @@ Common::SeekableReadStream *CBFileManager::loadSaveGame(const Common::String &fi  HRESULT CBFileManager::SaveFile(const Common::String &Filename, byte *Buffer, uint32 BufferSize, bool Compressed, byte *PrefixBuffer, uint32 PrefixSize) {
  	// TODO
  	warning("Implement SaveFile");
 -	
 +
  	Common::SaveFileManager *saveMan = g_wintermute->getSaveFileMan();
  	Common::OutSaveFile *file = saveMan->openForSaving(Filename);
  	file->write(PrefixBuffer, PrefixSize);
 @@ -770,15 +770,15 @@ CBFileEntry *CBFileManager::GetPackageEntry(const Common::String &Filename) {  Common::SeekableReadStream *CBFileManager::OpenFile(const Common::String &filename, bool AbsPathWarning, bool keepTrackOf) {
  	if (strcmp(filename.c_str(), "") == 0) return NULL;
  	//Game->LOG(0, "open file: %s", Filename);
 -/*#ifdef __WIN32__
 -	if (Game->_dEBUG_DebugMode && Game->_dEBUG_AbsolutePathWarning && AbsPathWarning) {
 -		char Drive[_MAX_DRIVE];
 -		_splitpath(Filename, Drive, NULL, NULL, NULL);
 -		if (Drive[0] != '\0') {
 -			Game->LOG(0, "WARNING: Referencing absolute path '%s'. The game will NOT work on another computer.", Filename);
 -		}
 -	}
 -#endif*/
 +	/*#ifdef __WIN32__
 +	    if (Game->_dEBUG_DebugMode && Game->_dEBUG_AbsolutePathWarning && AbsPathWarning) {
 +	        char Drive[_MAX_DRIVE];
 +	        _splitpath(Filename, Drive, NULL, NULL, NULL);
 +	        if (Drive[0] != '\0') {
 +	            Game->LOG(0, "WARNING: Referencing absolute path '%s'. The game will NOT work on another computer.", Filename);
 +	        }
 +	    }
 +	#endif*/
  	Common::SeekableReadStream *File = OpenFileRaw(filename);
  	if (File && keepTrackOf) _openFiles.Add(File);
 @@ -813,13 +813,13 @@ Common::SeekableReadStream *CBFileManager::OpenFileRaw(const Common::String &Fil  	}
  	Common::SeekableReadStream *ret = NULL;
 -	
 +
  	ret = openDiskFile(Filename, this);
  	if (ret) return ret;
  	ret = openPkgFile(Filename, this);
  	if (ret) return ret;
 -	
 +
  	ret = CBResources::getFile(Filename);
  	if (ret) return ret;
 diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp index 7592eff3bf..9f0e9e3b36 100644 --- a/engines/wintermute/Base/BFontTT.cpp +++ b/engines/wintermute/Base/BFontTT.cpp @@ -129,7 +129,7 @@ int CBFontTT::GetTextWidth(byte  *Text, int MaxLength) {  	WideString text;
  	if (Game->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
 -	    else text = StringUtil::AnsiToWide((char *)Text);
 +	else text = StringUtil::AnsiToWide((char *)Text);
  	if (MaxLength >= 0 && text.size() > MaxLength)
  		text = Common::String(text.c_str(), MaxLength);
 @@ -146,7 +146,7 @@ int CBFontTT::GetTextHeight(byte  *Text, int Width) {  	WideString text;
  	if (Game->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
 -	    else text = StringUtil::AnsiToWide((char *)Text);
 +	else text = StringUtil::AnsiToWide((char *)Text);
  	int textWidth, textHeight;
 @@ -160,11 +160,11 @@ int CBFontTT::GetTextHeight(byte  *Text, int Width) {  void CBFontTT::DrawText(byte  *Text, int X, int Y, int Width, TTextAlign Align, int MaxHeight, int MaxLength) {
  	if (Text == NULL || strcmp((char *)Text, "") == 0) return;
 -	WideString text = (char*)Text;
 +	WideString text = (char *)Text;
  	// TODO: Why do we still insist on Widestrings everywhere?
 -/*	if (Game->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
 -	    else text = StringUtil::AnsiToWide((char *)Text);*/
 +	/*  if (Game->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
 +	        else text = StringUtil::AnsiToWide((char *)Text);*/
  	if (MaxLength >= 0 && text.size() > MaxLength)
  		text = Common::String(text.c_str(), MaxLength);
 @@ -262,7 +262,7 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex  		hasWarned = true;
  		warning("CBFontTT::RenderTextToTexture - Not fully ported yet");
  	}
 -	warning("%s %d %d %d %d", text.c_str(), D3DCOLGetR(_layers[0]->_color), D3DCOLGetG(_layers[0]->_color),D3DCOLGetB(_layers[0]->_color),D3DCOLGetA(_layers[0]->_color));
 +	warning("%s %d %d %d %d", text.c_str(), D3DCOLGetR(_layers[0]->_color), D3DCOLGetG(_layers[0]->_color), D3DCOLGetB(_layers[0]->_color), D3DCOLGetA(_layers[0]->_color));
  //	void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const;
  	Graphics::Surface *surface = new Graphics::Surface();
  	surface->create(width, _lineHeight * lines.size(), Graphics::PixelFormat(2, 5, 5, 5, 1, 10, 5, 0, 15));
 @@ -271,12 +271,12 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex  	Common::Array<Common::String>::iterator it;
  	int heightOffset = 0;
  	for (it = lines.begin(); it != lines.end(); it++) {
 -		_font->drawString(surface, *it, 0, heightOffset, width, useColor, alignment);	
 +		_font->drawString(surface, *it, 0, heightOffset, width, useColor, alignment);
  		heightOffset += _lineHeight;
  	}
  	CBSurfaceSDL *retSurface = new CBSurfaceSDL(Game);
 -	Graphics::Surface *convertedSurface = surface->convertTo(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8 ,0));
 +	Graphics::Surface *convertedSurface = surface->convertTo(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8 , 0));
  	retSurface->putSurface(*convertedSurface, true);
  	convertedSurface->free();
  	surface->free();
 @@ -655,10 +655,10 @@ HRESULT CBFontTT::InitFont() {  	if (file) {
  #ifdef USE_FREETYPE2
 -		_deletableFont = Graphics::loadTTFFont(*file, _fontHeight * 4/3); // Compensate for the difference in dpi (96 vs 72).
 +		_deletableFont = Graphics::loadTTFFont(*file, _fontHeight * 4 / 3); // Compensate for the difference in dpi (96 vs 72).
  		_font = _deletableFont;
  #endif
 -	} 
 +	}
  	if (!_font) {
  		_font = _fallbackFont = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
  		warning("BFontTT::InitFont - Couldn't load %s", _fontFile);
 @@ -854,7 +854,7 @@ void CBFontTT::MeasureText(const WideString &text, int maxWidth, int maxHeight,  		for (it = lines.begin(); it != lines.end(); it++) {
  			textWidth = MAX(textWidth, _font->getStringWidth(*it));
  		}
 -	
 +
  		//WrapText(text, maxWidth, maxHeight, lines);
  		textHeight = (int)(lines.size() * GetLineHeight());
 @@ -862,14 +862,14 @@ void CBFontTT::MeasureText(const WideString &text, int maxWidth, int maxHeight,  		textWidth = _font->getStringWidth(text);
  		textHeight = _fontHeight;
  	}
 -/*
 -	TextLineList::iterator it;
 -	for (it = lines.begin(); it != lines.end(); ++it) {
 -		TextLine *line = (*it);
 -		textWidth = MAX(textWidth, line->GetWidth());
 -		delete line;
 -		line = NULL;
 -	}*/
 +	/*
 +	    TextLineList::iterator it;
 +	    for (it = lines.begin(); it != lines.end(); ++it) {
 +	        TextLine *line = (*it);
 +	        textWidth = MAX(textWidth, line->GetWidth());
 +	        delete line;
 +	        line = NULL;
 +	    }*/
  }
  #if 0
 diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp index 4c545b7a1c..def8c5137e 100644 --- a/engines/wintermute/Base/BGame.cpp +++ b/engines/wintermute/Base/BGame.cpp @@ -446,9 +446,9 @@ HRESULT CBGame::Initialize1() {  	_scEngine = new CScEngine(this);
  	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;
 @@ -525,21 +525,21 @@ void CBGame::DEBUG_DebugEnable(const char *Filename) {  	warning("BGame::DEBUG_DebugEnable - No logfile is currently created"); //TODO: Use a dumpfile?
  #endif
 -/*	time_t timeNow;
 -	time(&timeNow);
 -	struct tm *tm = localtime(&timeNow);
 +	/*  time_t timeNow;
 +	    time(&timeNow);
 +	    struct tm *tm = localtime(&timeNow);
 -#ifdef _DEBUG
 -	LOG(0, "********** DEBUG LOG OPENED %02d-%02d-%04d (Debug Build) *******************", tm->tm_mday, tm->tm_mon, tm->tm_year + 1900);
 -#else
 -	LOG(0, "********** DEBUG LOG OPENED %02d-%02d-%04d (Release Build) *****************", tm->tm_mday, tm->tm_mon, tm->tm_year + 1900);
 -#endif*/
 +	#ifdef _DEBUG
 +	    LOG(0, "********** DEBUG LOG OPENED %02d-%02d-%04d (Debug Build) *******************", tm->tm_mday, tm->tm_mon, tm->tm_year + 1900);
 +	#else
 +	    LOG(0, "********** DEBUG LOG OPENED %02d-%02d-%04d (Release Build) *****************", tm->tm_mday, tm->tm_mon, tm->tm_year + 1900);
 +	#endif*/
  	int secs = g_system->getMillis() / 1000;
  	int hours = secs / 3600;
  	secs = secs % 3600;
  	int mins = secs / 60;
  	secs = secs % 60;
 -	
 +
  #ifdef _DEBUG
  	LOG(0, "********** DEBUG LOG OPENED %02d-%02d-%02d (Debug Build) *******************", hours, mins, secs);
  #else
 @@ -571,9 +571,9 @@ void CBGame::LOG(HRESULT res, LPCSTR fmt, ...) {  #ifndef __IPHONEOS__
  	if (!_dEBUG_DebugMode) return;
  #endif
 -/*	time_t timeNow;
 -	time(&timeNow);
 -	struct tm *tm = localtime(&timeNow);*/
 +	/*  time_t timeNow;
 +	    time(&timeNow);
 +	    struct tm *tm = localtime(&timeNow);*/
  	int secs = g_system->getMillis() / 1000;
  	int hours = secs / 3600;
  	secs = secs % 3600;
 @@ -1395,42 +1395,40 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS  	// PlayVideo
  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(Name, "PlayVideo") == 0) {
 -/*		Stack->CorrectParams(0);
 -		Stack->PushBool(false);
 +		/*      Stack->CorrectParams(0);
 +		        Stack->PushBool(false);
 +
 +		        return S_OK;
 +		        // TODO: ADDVIDEO
 +		        */
 -		return S_OK;
 -		// TODO: ADDVIDEO
 -		*/
 -		
  		Game->LOG(0, "Warning: Game.PlayVideo() is now deprecated. Use Game.PlayTheora() instead.");
 -		
 +
  		Stack->CorrectParams(6);
 -		const char* Filename = Stack->Pop()->GetString();
 +		const char *Filename = Stack->Pop()->GetString();
  		warning("PlayVideo: %s - not implemented yet", Filename);
 -		CScValue* valType = Stack->Pop();
 +		CScValue *valType = Stack->Pop();
  		int Type;
  		if (valType->IsNULL()) Type = (int)VID_PLAY_STRETCH;
  		else Type = valType->GetInt();
 -		
 +
  		int X = Stack->Pop()->GetInt();
  		int Y = Stack->Pop()->GetInt();
  		bool FreezeMusic = Stack->Pop()->GetBool(true);
 -		
 -		CScValue* valSub = Stack->Pop();
 -		const char* SubtitleFile = valSub->IsNULL()?NULL:valSub->GetString();
 -		
 -		if (Type < (int)VID_PLAY_POS || Type > (int)VID_PLAY_CENTER) 
 +
 +		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 (SUCCEEDED(Game->_videoPlayer->initialize(Filename, SubtitleFile))) {
  			if (SUCCEEDED(Game->_videoPlayer->play((TVideoPlayback)Type, X, Y, FreezeMusic))) {
  				Stack->PushBool(true);
  				Script->Sleep(0);
 -			}
 -			else Stack->PushBool(false);
 -		}
 -		else Stack->PushBool(false);
 -		
 +			} else Stack->PushBool(false);
 +		} else Stack->PushBool(false);
 +
  		return S_OK;
  	}
 @@ -1438,27 +1436,27 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS  	// PlayTheora
  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(Name, "PlayTheora") == 0) {
 -/*		Stack->CorrectParams(0);
 -		Stack->PushBool(false);
 +		/*      Stack->CorrectParams(0);
 +		        Stack->PushBool(false);
 -		return S_OK;*/
 +		        return S_OK;*/
  		// TODO: ADDVIDEO
  		Stack->CorrectParams(7);
 -		const char* Filename = Stack->Pop()->GetString();
 -		CScValue* valType = Stack->Pop();
 +		const char *Filename = Stack->Pop()->GetString();
 +		CScValue *valType = Stack->Pop();
  		int Type;
 -		if (valType->IsNULL()) 
 +		if (valType->IsNULL())
  			Type = (int)VID_PLAY_STRETCH;
  		else Type = valType->GetInt();
 -		
 +
  		int X = Stack->Pop()->GetInt();
  		int Y = Stack->Pop()->GetInt();
  		bool FreezeMusic = Stack->Pop()->GetBool(true);
  		bool DropFrames = Stack->Pop()->GetBool(true);
 -		
 -		CScValue* valSub = Stack->Pop();
 -		const char* SubtitleFile = valSub->IsNULL()?NULL:valSub->GetString();
 +
 +		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;
 @@ -1469,15 +1467,13 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS  			if (SUCCEEDED(_theoraPlayer->play((TVideoPlayback)Type, X, Y, true, FreezeMusic))) {
  				Stack->PushBool(true);
  				Script->Sleep(0);
 -			}
 -			else Stack->PushBool(false);
 -		}
 -		else {
 +			} else Stack->PushBool(false);
 +		} else {
  			Stack->PushBool(false);
  			delete _theoraPlayer;
  			_theoraPlayer = NULL;
  		}
 -		
 +
  		return S_OK;
  	}
 @@ -1813,7 +1809,7 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS  		warning("BGame::ScCallMethod - Screenshot not reimplemented"); //TODO
  		int FileNum = 0;
 -		
 +
  		while (true) {
  			sprintf(Filename, "%s%03d.bmp", Val->IsNULL() ? _name : Val->GetString(), FileNum);
  			if (!Common::File::exists(Filename))
 @@ -2052,8 +2048,10 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(Name, "AccOutputText") == 0) {
  		Stack->CorrectParams(2);
 -		/* const char *Str = */ Stack->Pop()->GetString();
 -		/* int Type = */ Stack->Pop()->GetInt();
 +		/* const char *Str = */
 +		Stack->Pop()->GetString();
 +		/* int Type = */
 +		Stack->Pop()->GetInt();
  		// do nothing
  		Stack->PushNULL();
 @@ -3388,7 +3386,7 @@ void CBGame::AfterLoadSound(void *Sound, void *Data) {  //////////////////////////////////////////////////////////////////////////
  void CBGame::AfterLoadFont(void *Font, void *Data) {
 -	((CBFont*)Font)->AfterLoad();
 +	((CBFont *)Font)->AfterLoad();
  }
  //////////////////////////////////////////////////////////////////////////
 @@ -3783,8 +3781,8 @@ HRESULT CBGame::Unfreeze() {  //////////////////////////////////////////////////////////////////////////
  bool CBGame::HandleKeypress(Common::Event *event, bool printable) {
 -	if(IsVideoPlaying()) {
 -		if(event->kbd.keycode == Common::KEYCODE_ESCAPE) 
 +	if (IsVideoPlaying()) {
 +		if (event->kbd.keycode == Common::KEYCODE_ESCAPE)
  			StopVideo();
  		return true;
  	}
 @@ -3812,14 +3810,14 @@ bool CBGame::HandleKeypress(Common::Event *event, bool printable) {  	if (_focusedWindow) {
  		if (!Game->_focusedWindow->HandleKeypress(event, _keyboardState->_currentPrintable)) {
  			/*if (event->type != SDL_TEXTINPUT) {*/
 -				if (Game->_focusedWindow->CanHandleEvent("Keypress"))
 -					Game->_focusedWindow->ApplyEvent("Keypress");
 -				else
 -					ApplyEvent("Keypress");
 +			if (Game->_focusedWindow->CanHandleEvent("Keypress"))
 +				Game->_focusedWindow->ApplyEvent("Keypress");
 +			else
 +				ApplyEvent("Keypress");
  			/*}*/
  		}
  		return true;
 -	} else /*if (event->type != SDL_TEXTINPUT)*/ {
 +	} else { /*if (event->type != SDL_TEXTINPUT)*/
  		ApplyEvent("Keypress");
  		return true;
  	} //else return true;
 @@ -4192,7 +4190,7 @@ void CBGame::DEBUG_DumpClassRegistry() {  	f->open("zz_class_reg_dump.log");
  	CSysClassRegistry::GetInstance()->DumpClasses(f);
 -	
 +
  	f->close();
  	delete f;
  	Game->QuickMessage("Classes dump completed.");
 @@ -4230,16 +4228,14 @@ HRESULT CBGame::SetWaitCursor(const char *Filename) {  }
  //////////////////////////////////////////////////////////////////////////
 -bool CBGame::IsVideoPlaying()
 -{
 +bool CBGame::IsVideoPlaying() {
  	if (_videoPlayer->isPlaying()) return true;
  	if (_theoraPlayer && _theoraPlayer->isPlaying()) return true;
  	return false;
  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CBGame::StopVideo()
 -{
 +HRESULT CBGame::StopVideo() {
  	if (_videoPlayer->isPlaying()) _videoPlayer->stop();
  	if (_theoraPlayer && _theoraPlayer->isPlaying()) {
  		_theoraPlayer->stop();
 diff --git a/engines/wintermute/Base/BGame.h b/engines/wintermute/Base/BGame.h index 4a660a91fb..e920fab2b9 100644 --- a/engines/wintermute/Base/BGame.h +++ b/engines/wintermute/Base/BGame.h @@ -263,8 +263,8 @@ public:  	HRESULT Unfreeze();
  	HRESULT Freeze(bool IncludingMusic = true);
  	HRESULT FocusWindow(CUIWindow *Window);
 -	CVidPlayer* _videoPlayer;
 -	CVidTheoraPlayer* _theoraPlayer;
 +	CVidPlayer *_videoPlayer;
 +	CVidTheoraPlayer *_theoraPlayer;
  	bool _loadInProgress;
  	CUIWindow *_focusedWindow;
  	bool _editorForceScripts;
 diff --git a/engines/wintermute/Base/BImage.cpp b/engines/wintermute/Base/BImage.cpp index 6076b09963..2504850887 100644 --- a/engines/wintermute/Base/BImage.cpp +++ b/engines/wintermute/Base/BImage.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.
 @@ -59,7 +59,7 @@ CBImage::CBImage(CBGame *inGame, FIBITMAP *bitmap): CBBase(inGame) {  //////////////////////////////////////////////////////////////////////
  CBImage::~CBImage() {
 -/*	delete _bitmap; */
 +	/*  delete _bitmap; */
  	delete _decoder;
  	delete _deletableSurface;
  #if 0
 @@ -83,21 +83,21 @@ HRESULT CBImage::loadFile(const Common::String &filename) {  	} else {
  		error("CBImage::loadFile : Unsupported fileformat %s", filename.c_str());
  	}
 -	
 +
  	Common::SeekableReadStream *file = Game->_fileManager->OpenFile(filename.c_str());
  	if (!file) return E_FAIL;
 -	
 +
  	_decoder->loadStream(*file);
  	_surface = _decoder->getSurface();
  	_palette = _decoder->getPalette();
  	Game->_fileManager->CloseFile(file);
 -	
 +
  	return S_OK;
  }
  byte CBImage::getAlphaAt(int x, int y) {
  	if (!_surface) return 0xFF;
 -	uint32 color = *(uint32*)_surface->getBasePtr(x, y);
 +	uint32 color = *(uint32 *)_surface->getBasePtr(x, y);
  	byte r, g, b, a;
  	_surface->format.colorToARGB(color, a, r, g, b);
  	return a;
 @@ -149,9 +149,12 @@ bool CBImage::writeBMPToStream(Common::WriteStream *stream) {  	stream->writeByte('M');
  	/* Since we don't care during reads, we don't care during writes: */
 -	/* uint32 fileSize = */ stream->writeUint32LE(0);
 -	/* uint16 res1 = */ stream->writeUint16LE(0);
 -	/* uint16 res2 = */ stream->writeUint16LE(0);
 +	/* uint32 fileSize = */
 +	stream->writeUint32LE(0);
 +	/* uint16 res1 = */
 +	stream->writeUint16LE(0);
 +	/* uint16 res2 = */
 +	stream->writeUint16LE(0);
  	const uint32 imageOffset = 54;
  	stream->writeUint32LE(imageOffset);
 @@ -165,12 +168,12 @@ bool CBImage::writeBMPToStream(Common::WriteStream *stream) {  	if (width == 0 || height == 0)
  		return false;
 -	
 +
  	if (height < 0) {
  		warning("Right-side up bitmaps not supported");
  		return false;
  	}
 -	
 +
  	/* uint16 planes = */ stream->writeUint16LE(0);
  	const uint16 bitsPerPixel = 24;
  	stream->writeUint16LE(bitsPerPixel);
 @@ -178,12 +181,16 @@ bool CBImage::writeBMPToStream(Common::WriteStream *stream) {  	const uint32 compression = 0;
  	stream->writeUint32LE(compression);
 -	/* uint32 imageSize = */ stream->writeUint32LE(0);
 -	/* uint32 pixelsPerMeterX = */ stream->writeUint32LE(0);
 -	/* uint32 pixelsPerMeterY = */ stream->writeUint32LE(0);
 +	/* uint32 imageSize = */
 +	stream->writeUint32LE(0);
 +	/* uint32 pixelsPerMeterX = */
 +	stream->writeUint32LE(0);
 +	/* uint32 pixelsPerMeterY = */
 +	stream->writeUint32LE(0);
  	const uint32 paletteColorCount = 0;
  	stream->writeUint32LE(paletteColorCount);
 -	/* uint32 colorsImportant = */ stream->writeUint32LE(0);
 +	/* uint32 colorsImportant = */
 +	stream->writeUint32LE(0);
  	// Start us at the beginning of the image (54 bytes in)
  	Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8();
 @@ -199,14 +206,14 @@ bool CBImage::writeBMPToStream(Common::WriteStream *stream) {  	for (int32 i = height - 1; i >= 0; i--) {
  		for (uint32 j = 0; j < width; j++) {
 -			byte b,g,r;
 -			uint32 color = *(uint32*)surface->getBasePtr(j, i);
 +			byte b, g, r;
 +			uint32 color = *(uint32 *)surface->getBasePtr(j, i);
  			surface->format.colorToRGB(color, r, g, b);
  			stream->writeByte(b);
  			stream->writeByte(g);
  			stream->writeByte(r);
  		}
 -		
 +
  		for (int k = 0; k < extraDataLength; k++) {
  			stream->writeByte(0);
  		}
 diff --git a/engines/wintermute/Base/BImage.h b/engines/wintermute/Base/BImage.h index 1161c97fa5..8b2cf70cc1 100644 --- a/engines/wintermute/Base/BImage.h +++ b/engines/wintermute/Base/BImage.h @@ -48,8 +48,12 @@ public:  	~CBImage();
  	HRESULT loadFile(const Common::String &filename);
 -	const Graphics::Surface *getSurface() const { return _surface; };
 -	const byte *getPalette() const { return _palette; }
 +	const Graphics::Surface *getSurface() const {
 +		return _surface;
 +	};
 +	const byte *getPalette() const {
 +		return _palette;
 +	}
  	byte getAlphaAt(int x, int y);
  	bool writeBMPToStream(Common::WriteStream *stream);
  	HRESULT Resize(int NewWidth, int NewHeight);
 diff --git a/engines/wintermute/Base/BKeyboardState.cpp b/engines/wintermute/Base/BKeyboardState.cpp index cc25dd39a9..3f5d9b1225 100644 --- a/engines/wintermute/Base/BKeyboardState.cpp +++ b/engines/wintermute/Base/BKeyboardState.cpp @@ -46,7 +46,7 @@ CBKeyboardState::CBKeyboardState(CBGame *inGame): CBScriptable(inGame) {  	_currentShift = false;
  	_currentAlt = false;
  	_currentControl = false;
 -	
 +
  	_keyStates = new uint8[323]; // Hardcoded size for the common/keyboard.h enum
  	for (int i = 0; i < 323; i++) {
  		_keyStates[i] = false;
 @@ -66,7 +66,7 @@ void CBKeyboardState::handleKeyPress(Common::Event *event) {  void CBKeyboardState::handleKeyRelease(Common::Event *event) {
  	if (event->type == Common::EVENT_KEYUP) {
 -		_keyStates[event->kbd.keycode] = false;	
 +		_keyStates[event->kbd.keycode] = false;
  	}
  }
 @@ -198,8 +198,8 @@ const char *CBKeyboardState::ScToString() {  HRESULT CBKeyboardState::ReadKey(Common::Event *event) {
  	//_currentPrintable = (event->type == SDL_TEXTINPUT); // TODO
  	_currentCharCode = KeyCodeToVKey(event);
 -	if ((_currentCharCode <= Common::KEYCODE_z && _currentCharCode >= Common::KEYCODE_a) || 
 -		(_currentCharCode <= Common::KEYCODE_9 && _currentCharCode >= Common::KEYCODE_0)) {
 +	if ((_currentCharCode <= Common::KEYCODE_z && _currentCharCode >= Common::KEYCODE_a) ||
 +	        (_currentCharCode <= Common::KEYCODE_9 && _currentCharCode >= Common::KEYCODE_0)) {
  		_currentPrintable = true;
  	} else {
  		_currentPrintable = false;
 @@ -225,7 +225,7 @@ HRESULT CBKeyboardState::Persist(CBPersistMgr *persistMgr) {  	persistMgr->transfer(TMEMBER(_currentKeyData));
  	persistMgr->transfer(TMEMBER(_currentPrintable));
  	persistMgr->transfer(TMEMBER(_currentShift));
 -	
 +
  	if (!persistMgr->_saving) {
  		_keyStates = new uint8[323]; // Hardcoded size for the common/keyboard.h enum
  		for (int i = 0; i < 323; i++) {
 diff --git a/engines/wintermute/Base/BParser.cpp b/engines/wintermute/Base/BParser.cpp index e3887f1acb..d7d58241cc 100644 --- a/engines/wintermute/Base/BParser.cpp +++ b/engines/wintermute/Base/BParser.cpp @@ -181,7 +181,7 @@ char *CBParser::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/BRenderSDL.cpp b/engines/wintermute/Base/BRenderSDL.cpp index 83adca59f3..54119d3a7a 100644 --- a/engines/wintermute/Base/BRenderSDL.cpp +++ b/engines/wintermute/Base/BRenderSDL.cpp @@ -145,7 +145,7 @@ HRESULT CBRenderSDL::InitRenderer(int width, int height, bool windowed) {  	g_system->beginGFXTransaction();
  	g_system->initSize(_width, _height, &format);
  	OSystem::TransactionError gfxError = g_system->endGFXTransaction();
 -	
 +
  	if (gfxError != OSystem::kTransactionSuccess) {
  		warning("Couldn't setup GFX-backend for %dx%dx%d", _width, _height, format.bytesPerPixel * 8);
  		return E_FAIL;
 @@ -275,7 +275,7 @@ HRESULT CBRenderSDL::FadeToColor(uint32 Color, Common::Rect *rect) {  		warning("Implement CBRenderSDL::FadeToColor"); // TODO.
  		hasWarned = true;
  	}
 -	
 +
  	Common::Rect fillRect;
  	if (rect) {
 @@ -317,7 +317,7 @@ void CBRenderSDL::drawFromSurface(Graphics::Surface *surf, Common::Rect *srcRect  		mirror |= TransparentSurface::FLIP_V;
  	if (mirrorY)
  		mirror |= TransparentSurface::FLIP_H;
 -	src.blit(*_renderSurface, dstRect->left, dstRect->top, mirror, srcRect, _colorMod, dstRect->width(), dstRect->height() );
 +	src.blit(*_renderSurface, dstRect->left, dstRect->top, mirror, srcRect, _colorMod, dstRect->width(), dstRect->height());
  }
  void CBRenderSDL::drawOpaqueFromSurface(Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, bool mirrorX, bool mirrorY) {
 @@ -332,31 +332,31 @@ void CBRenderSDL::drawOpaqueFromSurface(Graphics::Surface *surf, Common::Rect *s  		img = &src;
  	}
 -	int posX = dstRect->left;	
 +	int posX = dstRect->left;
  	int posY = dstRect->top;
 -	
 +
  	// Handle off-screen clipping
  	if (posY < 0) {
  		img->h = MAX(0, (int)img->h - -posY);
  		img->pixels = (byte *)img->pixels + img->pitch * -posY;
  		posY = 0;
  	}
 -	
 +
  	if (posX < 0) {
  		img->w = MAX(0, (int)img->w - -posX);
  		img->pixels = (byte *)img->pixels + (-posX * 4);
  		posX = 0;
  	}
 -	
 +
  	img->w = CLIP((int)img->w, 0, (int)MAX((int)_renderSurface->w - posX, 0));
  	img->h = CLIP((int)img->h, 0, (int)MAX((int)_renderSurface->h - posY, 0));
 -	
 +
  	for (int i = 0; i < img->h; i++) {
  		void *destPtr = _renderSurface->getBasePtr(posX, posY + i);
  		void *srcPtr = img->getBasePtr(0, i);
  		memcpy(destPtr, srcPtr, _renderSurface->format.bytesPerPixel * img->w);
  	}
 -	
 +
  	if (imgScaled) {
  		imgScaled->pixels = savedPixels;
  		imgScaled->free();
 diff --git a/engines/wintermute/Base/BResources.cpp b/engines/wintermute/Base/BResources.cpp index 3b6d0a264c..75b4a5d1ea 100644 --- a/engines/wintermute/Base/BResources.cpp +++ b/engines/wintermute/Base/BResources.cpp @@ -2806,7 +2806,7 @@ unsigned char systemfont[] = {  	0x01, 0x01, 0x01, 0x01, 0x01, 0x01
  } ;
 -Common::SeekableReadStream *CBResources::getFile(const Common::String& fileName) {
 +Common::SeekableReadStream *CBResources::getFile(const Common::String &fileName) {
  	if (scumm_stricmp(fileName.c_str(), "invalid.bmp") == 0) {
  		return new Common::MemoryReadStream(invalid, sizeof(invalid), DisposeAfterUse::NO);
  	} else if (scumm_stricmp(fileName.c_str(), "invalid_debug.bmp") == 0) {
 diff --git a/engines/wintermute/Base/BResources.h b/engines/wintermute/Base/BResources.h index f9a28865b4..6ec0541b5c 100644 --- a/engines/wintermute/Base/BResources.h +++ b/engines/wintermute/Base/BResources.h @@ -36,7 +36,7 @@ namespace WinterMute {  class CBResources {
  public:
 -	static Common::SeekableReadStream *getFile(const Common::String& fileName);
 +	static Common::SeekableReadStream *getFile(const Common::String &fileName);
  };
  } // end of namespace WinterMute
 diff --git a/engines/wintermute/Base/BScriptHolder.cpp b/engines/wintermute/Base/BScriptHolder.cpp index 50a704421c..efe8e5f195 100644 --- a/engines/wintermute/Base/BScriptHolder.cpp +++ b/engines/wintermute/Base/BScriptHolder.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/Base/BSoundBuffer.cpp b/engines/wintermute/Base/BSoundBuffer.cpp index c658cf5b31..a8c41cd022 100644 --- a/engines/wintermute/Base/BSoundBuffer.cpp +++ b/engines/wintermute/Base/BSoundBuffer.cpp @@ -260,7 +260,7 @@ void CBSoundBuffer::SetType(TSoundType Type) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CBSoundBuffer::SetVolume(int Volume) {
  	if (_stream && _handle) {
 -		byte vol = Volume/100.f * Audio::Mixer::kMaxChannelVolume;
 +		byte vol = Volume / 100.f * Audio::Mixer::kMaxChannelVolume;
  		g_system->getMixer()->setChannelVolume(*_handle, vol);
  	}
  	return S_OK;
 diff --git a/engines/wintermute/Base/BSurface.h b/engines/wintermute/Base/BSurface.h index e91f03ca02..2e745b8ed4 100644 --- a/engines/wintermute/Base/BSurface.h +++ b/engines/wintermute/Base/BSurface.h @@ -63,7 +63,9 @@ public:  	virtual HRESULT restore();
  	virtual HRESULT create(const char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime = -1, bool KeepLoaded = false) = 0;
  	virtual HRESULT create(int Width, int Height);
 -	virtual HRESULT putSurface(const Graphics::Surface &surface, bool hasAlpha = false) { return E_FAIL; }
 +	virtual HRESULT putSurface(const Graphics::Surface &surface, bool hasAlpha = false) {
 +		return E_FAIL;
 +	}
  	virtual HRESULT putPixel(int x, int y, byte r, byte g, byte b, int a = -1);
  	virtual HRESULT getPixel(int x, int y, byte *r, byte *g, byte *b, byte *a = NULL);
  	virtual bool comparePixel(int x, int y, byte r, byte g, byte b, int a = -1);
 diff --git a/engines/wintermute/Base/BSurfaceSDL.cpp b/engines/wintermute/Base/BSurfaceSDL.cpp index e118bac384..618c155b36 100644 --- a/engines/wintermute/Base/BSurfaceSDL.cpp +++ b/engines/wintermute/Base/BSurfaceSDL.cpp @@ -83,14 +83,14 @@ bool hasTransparency(Graphics::Surface *surf) {  		warning("hasTransparency:: non 32 bpp surface passed as argument");
  		return false;
  	}
 -	uint8 r,g,b,a;
 +	uint8 r, g, b, a;
  	for (int i = 0; i < surf->h; i++) {
  		for (int j = 0; j < surf->w; j++) {
 -			uint32 pix = *(uint32*)surf->getBasePtr(j, i);
 +			uint32 pix = *(uint32 *)surf->getBasePtr(j, i);
  			surf->format.colorToARGB(pix, a, r, g, b);
  			if (a != 255) {
  				return true;
 -			}	
 +			}
  		}
  	}
  	return false;
 @@ -98,7 +98,7 @@ bool hasTransparency(Graphics::Surface *surf) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CBSurfaceSDL::create(const char *filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int lifeTime, bool keepLoaded) {
 -/*	CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer); */
 +	/*  CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer); */
  	Common::String strFileName(filename);
  	CBImage *image = new CBImage(Game);
  	image->loadFile(strFileName);
 @@ -138,10 +138,10 @@ HRESULT CBSurfaceSDL::create(const char *filename, bool default_ck, byte ck_red,  	    FreeImage_FlipVertical(img);*/
  	//TODO: This is rather endian-specific, but should be replaced by non-SDL-code anyhow:
 -/*	uint32 rmask = surface->format.rMax() << surface->format.rShift;
 -	uint32 gmask = surface->format.gMax() << surface->format.gShift;
 -	uint32 bmask = surface->format.bMax() << surface->format.bShift;
 -	uint32 amask = surface->format.aMax();*/
 +	/*  uint32 rmask = surface->format.rMax() << surface->format.rShift;
 +	    uint32 gmask = surface->format.gMax() << surface->format.gShift;
 +	    uint32 bmask = surface->format.bMax() << surface->format.bShift;
 +	    uint32 amask = surface->format.aMax();*/
  //	SDL_Surface *surf = SDL_CreateRGBSurfaceFrom(surface->pixels, _width, _height, surface->format.bytesPerPixel * 8, surface->pitch, rmask, gmask, bmask, amask);
 @@ -165,7 +165,7 @@ HRESULT CBSurfaceSDL::create(const char *filename, bool default_ck, byte ck_red,  		_surface = new Graphics::Surface();
  		_surface->copyFrom(*image->getSurface());
  	}
 -	
 +
  	_hasAlpha = hasTransparency(_surface);
  	//SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "best"); //TODO
  	//_texture = SdlUtil::CreateTextureFromSurface(renderer->GetSdlRenderer(), surf);
 @@ -210,7 +210,7 @@ HRESULT CBSurfaceSDL::create(const char *filename, bool default_ck, byte ck_red,  	_valid = true;
  	Game->AddMem(_width * _height * 4);
 -	
 +
  	delete image;
  	return S_OK;
 @@ -280,11 +280,11 @@ uint32 CBSurfaceSDL::getPixel(Graphics::Surface *surface, int x, int y) {  	case 3:
  #ifdef SCUMM_BIG_ENDIAN
 -	//	if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
 -			return p[0] << 16 | p[1] << 8 | p[2];
 +		//  if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
 +		return p[0] << 16 | p[1] << 8 | p[2];
  #else
  		//else
 -			return p[0] | p[1] << 8 | p[2] << 16;
 +		return p[0] | p[1] << 8 | p[2] << 16;
  #endif
  		break;
 @@ -377,8 +377,8 @@ bool CBSurfaceSDL::isTransparentAtLite(int x, int y) {  		hasWarned = true;
  	}
  	if (_surface->format.bytesPerPixel == 4) {
 -		uint32 pixel = *(uint32*)_surface->getBasePtr(x, y);
 -		uint8 r,g,b,a;
 +		uint32 pixel = *(uint32 *)_surface->getBasePtr(x, y);
 +		uint8 r, g, b, a;
  		_surface->format.colorToARGB(pixel, a, r, g, b);
  		if (a <= 128) {
  			return true;
 @@ -482,7 +482,7 @@ HRESULT CBSurfaceSDL::drawSprite(int x, int y, RECT *Rect, float ZoomX, float Zo  	byte g = D3DCOLGetG(Alpha);
  	byte b = D3DCOLGetB(Alpha);
  	byte a = D3DCOLGetA(Alpha);
 -	
 +
  	renderer->setAlphaMod(a);
  	renderer->setColorMod(r, g, b);
  #if 0
 @@ -506,14 +506,14 @@ HRESULT CBSurfaceSDL::drawSprite(int x, int y, RECT *Rect, float ZoomX, float Zo  	position.left = x + offsetX;
  	position.top = y + offsetY;
  	// TODO: Scaling...
 -	
 +
  	position.setWidth((float)srcRect.width() * ZoomX / 100.f);
  	position.setHeight((float)srcRect.height() * ZoomX / 100.f);
  	renderer->ModTargetRect(&position);
 -/*	position.left += offsetX;
 -	position.top += offsetY;*/
 +	/*  position.left += offsetX;
 +	    position.top += offsetY;*/
  	// TODO: This actually requires us to have the SAME source-offsets every time,
  	// But no checking is in place for that yet.
 diff --git a/engines/wintermute/Base/BTransitionMgr.cpp b/engines/wintermute/Base/BTransitionMgr.cpp index 74553f3031..500f2a961d 100644 --- a/engines/wintermute/Base/BTransitionMgr.cpp +++ b/engines/wintermute/Base/BTransitionMgr.cpp @@ -115,7 +115,7 @@ HRESULT CBTransitionMgr::Update() {  	}
  	break;
  	default:
 -		error("CBTransitionMgr::Update - unhandled enum NUM_TRANSITION_TYPES");	
 +		error("CBTransitionMgr::Update - unhandled enum NUM_TRANSITION_TYPES");
  	}
  	if (IsReady()) {
 diff --git a/engines/wintermute/Base/PartEmitter.cpp b/engines/wintermute/Base/PartEmitter.cpp index c7a9259a51..39416377c8 100644 --- a/engines/wintermute/Base/PartEmitter.cpp +++ b/engines/wintermute/Base/PartEmitter.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/Base/PartEmitter.h b/engines/wintermute/Base/PartEmitter.h index 98eed9e678..76d4bcdbd2 100644 --- a/engines/wintermute/Base/PartEmitter.h +++ b/engines/wintermute/Base/PartEmitter.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/PartForce.cpp b/engines/wintermute/Base/PartForce.cpp index eb76a25469..441831dc8c 100644 --- a/engines/wintermute/Base/PartForce.cpp +++ b/engines/wintermute/Base/PartForce.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/Base/PartForce.h b/engines/wintermute/Base/PartForce.h index 0754eebfdf..8bfc7ebf68 100644 --- a/engines/wintermute/Base/PartForce.h +++ b/engines/wintermute/Base/PartForce.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/PartParticle.cpp b/engines/wintermute/Base/PartParticle.cpp index d6682e309b..da97a702f8 100644 --- a/engines/wintermute/Base/PartParticle.cpp +++ b/engines/wintermute/Base/PartParticle.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/Base/PartParticle.h b/engines/wintermute/Base/PartParticle.h index e86c1004ae..a7f7c37a65 100644 --- a/engines/wintermute/Base/PartParticle.h +++ b/engines/wintermute/Base/PartParticle.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/file/BDiskFile.cpp b/engines/wintermute/Base/file/BDiskFile.cpp index ce6a6a100c..c26b3f02c6 100644 --- a/engines/wintermute/Base/file/BDiskFile.cpp +++ b/engines/wintermute/Base/file/BDiskFile.cpp @@ -45,7 +45,7 @@ void correctSlashes(char *fileName) {  	}
  }
 -Common::SeekableReadStream *openDiskFile(const Common::String &Filename, CBFileManager *fileManager) {	
 +Common::SeekableReadStream *openDiskFile(const Common::String &Filename, CBFileManager *fileManager) {
  	char FullPath[MAX_PATH];
  	uint32 prefixSize = 0;
  	Common::SeekableReadStream *file = NULL;
 @@ -60,7 +60,7 @@ Common::SeekableReadStream *openDiskFile(const Common::String &Filename, CBFileM  			delete tempFile;
  		}
  	}
 -	
 +
  	// if we didn't find it in search paths, try to open directly
  	if (!file) {
  		strcpy(FullPath, Filename.c_str());
 @@ -73,28 +73,28 @@ Common::SeekableReadStream *openDiskFile(const Common::String &Filename, CBFileM  			delete tempFile;
  		}
  	}
 -	
 +
  	if (file) {
  		uint32 magic1, magic2;
  		magic1 = file->readUint32LE();
  		magic2 = file->readUint32LE();
 -		
 +
  		bool compressed = false;
  		if (magic1 == DCGF_MAGIC && magic2 == COMPRESSED_FILE_MAGIC) compressed = true;
 -		
 +
  		if (compressed) {
  			uint32 DataOffset, CompSize, UncompSize;
  			DataOffset = file->readUint32LE();
  			CompSize = file->readUint32LE();
  			UncompSize = file->readUint32LE();
 -			
 +
  			byte *CompBuffer = new byte[CompSize];
  			if (!CompBuffer) {
  				error("Error allocating memory for compressed file '%s'", Filename.c_str());
  				delete file;
  				return NULL;
  			}
 -			
 +
  			byte *data = new byte[UncompSize];
  			if (!data) {
  				error("Error allocating buffer for file '%s'", Filename.c_str());
 @@ -104,16 +104,16 @@ Common::SeekableReadStream *openDiskFile(const Common::String &Filename, CBFileM  			}
  			file->seek(DataOffset + prefixSize, SEEK_SET);
  			file->read(CompBuffer, CompSize);
 -			
 +
  			if (Common::uncompress(data, (unsigned long *)&UncompSize, CompBuffer, CompSize) != true) {
  				error("Error uncompressing file '%s'", Filename.c_str());
  				delete [] CompBuffer;
  				delete file;
  				return NULL;
  			}
 -			
 +
  			delete [] CompBuffer;
 -			
 +
  			return new Common::MemoryReadStream(data, UncompSize, DisposeAfterUse::YES);
  			delete file;
  			file = NULL;
 @@ -121,7 +121,7 @@ Common::SeekableReadStream *openDiskFile(const Common::String &Filename, CBFileM  			file->seek(0, SEEK_SET);
  			return file;
  		}
 -		
 +
  		return file;
  	}
 diff --git a/engines/wintermute/Base/file/BPkgFile.cpp b/engines/wintermute/Base/file/BPkgFile.cpp index ed3a24f313..02aec3419f 100644 --- a/engines/wintermute/Base/file/BPkgFile.cpp +++ b/engines/wintermute/Base/file/BPkgFile.cpp @@ -45,12 +45,24 @@ class CBPkgFile : public Common::SeekableReadStream {  	Common::SeekableReadStream *_stream;
  public:
  	CBPkgFile(Common::SeekableReadStream *stream, uint32 knownLength) : _size(knownLength), _stream(stream) {}
 -	virtual ~CBPkgFile() { delete _stream; }
 -	virtual uint32 read(void *dataPtr, uint32 dataSize) { return _stream->read(dataPtr, dataSize); }
 -	virtual bool eos() const { return _stream->eos(); }
 -	virtual int32 pos() const { return _stream->pos(); }
 -	virtual int32 size() const { return _size; }
 -	virtual bool seek(int32 offset, int whence = SEEK_SET) { return _stream->seek(offset, whence); }
 +	virtual ~CBPkgFile() {
 +		delete _stream;
 +	}
 +	virtual uint32 read(void *dataPtr, uint32 dataSize) {
 +		return _stream->read(dataPtr, dataSize);
 +	}
 +	virtual bool eos() const {
 +		return _stream->eos();
 +	}
 +	virtual int32 pos() const {
 +		return _stream->pos();
 +	}
 +	virtual int32 size() const {
 +		return _size;
 +	}
 +	virtual bool seek(int32 offset, int whence = SEEK_SET) {
 +		return _stream->seek(offset, whence);
 +	}
  };
  Common::SeekableReadStream *openPkgFile(const Common::String &Filename, CBFileManager *fileManager) {
 @@ -66,14 +78,14 @@ Common::SeekableReadStream *openPkgFile(const Common::String &Filename, CBFileMa  	fileEntry = fileManager->GetPackageEntry(fileName);
  	if (!fileEntry) return NULL;
 -	
 +
  	file = fileEntry->_package->GetFilePointer();
  	if (!file) return NULL;
 -	
 +
  	// TODO: Cleanup
  	bool compressed = (fileEntry->_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.
 @@ -86,7 +98,7 @@ Common::SeekableReadStream *openPkgFile(const Common::String &Filename, CBFileMa  	}
  	file->seek(0);
 -	
 +
  	return file;
  }
 diff --git a/engines/wintermute/Base/scriptables/SXDate.cpp b/engines/wintermute/Base/scriptables/SXDate.cpp index d046d88294..80905bba37 100644 --- a/engines/wintermute/Base/scriptables/SXDate.cpp +++ b/engines/wintermute/Base/scriptables/SXDate.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.
 @@ -35,7 +35,7 @@ namespace WinterMute {  IMPLEMENT_PERSISTENT(CSXDate, false)
  CBScriptable *makeSXDate(CBGame *inGame, CScStack *stack) {
 -	return new CSXDate(inGame, stack);	
 +	return new CSXDate(inGame, stack);
  }
  //////////////////////////////////////////////////////////////////////////
 diff --git a/engines/wintermute/Base/scriptables/SXFile.cpp b/engines/wintermute/Base/scriptables/SXFile.cpp index 7ebbf9fc50..cb883a9a7b 100644 --- a/engines/wintermute/Base/scriptables/SXFile.cpp +++ b/engines/wintermute/Base/scriptables/SXFile.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.
 @@ -89,8 +89,8 @@ void CSXFile::Close() {  		Game->_fileManager->CloseFile(_readFile);
  		_readFile = NULL;
  	}
 -	if ((FILE*)_writeFile) {
 -		fclose((FILE*)_writeFile);
 +	if ((FILE *)_writeFile) {
 +		fclose((FILE *)_writeFile);
  		_writeFile = NULL;
  	}
  	_mode = 0;
 @@ -312,9 +312,9 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This  			return S_OK;
  		}
  		if (strcmp(Name, "WriteLine") == 0)
 -			fprintf((FILE*)_writeFile, "%s\n", Line);
 +			fprintf((FILE *)_writeFile, "%s\n", Line);
  		else
 -			fprintf((FILE*)_writeFile, "%s", Line);
 +			fprintf((FILE *)_writeFile, "%s", Line);
  		Stack->PushBool(true);
 @@ -461,7 +461,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This  			Stack->PushBool(false);
  			return S_OK;
  		}
 -		fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
 +		fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
  		Stack->PushBool(true);
  		return S_OK;
 @@ -479,7 +479,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This  			Stack->PushBool(false);
  			return S_OK;
  		}
 -		fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
 +		fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
  		Stack->PushBool(true);
  		return S_OK;
 @@ -497,7 +497,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This  			Stack->PushBool(false);
  			return S_OK;
  		}
 -		fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
 +		fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
  		Stack->PushBool(true);
  		return S_OK;
 @@ -515,7 +515,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This  			Stack->PushBool(false);
  			return S_OK;
  		}
 -		fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
 +		fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
  		Stack->PushBool(true);
  		return S_OK;
 @@ -533,7 +533,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This  			Stack->PushBool(false);
  			return S_OK;
  		}
 -		fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
 +		fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
  		Stack->PushBool(true);
  		return S_OK;
 @@ -551,7 +551,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This  			Stack->PushBool(false);
  			return S_OK;
  		}
 -		fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
 +		fwrite(&Val, sizeof(Val), 1, (FILE *)_writeFile);
  		Stack->PushBool(true);
  		return S_OK;
 @@ -571,8 +571,8 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This  		}
  		uint32 Size = strlen(Val);
 -		fwrite(&Size, sizeof(Size), 1, (FILE*)_writeFile);
 -		fwrite(Val, Size, 1, (FILE*)_writeFile);
 +		fwrite(&Size, sizeof(Size), 1, (FILE *)_writeFile);
 +		fwrite(Val, Size, 1, (FILE *)_writeFile);
  		Stack->PushBool(true);
 @@ -665,14 +665,14 @@ HRESULT CSXFile::ScSetProperty(const char *Name, CScValue *Value) {  //////////////////////////////////////////////////////////////////////////
  uint32 CSXFile::GetPos() {
  	if (_mode == 1 && _readFile) return _readFile->pos();
 -	else if ((_mode == 2 || _mode == 3) && _writeFile) return ftell((FILE*)_writeFile);
 +	else if ((_mode == 2 || _mode == 3) && _writeFile) return ftell((FILE *)_writeFile);
  	else return 0;
  }
  //////////////////////////////////////////////////////////////////////////
  bool CSXFile::SetPos(uint32 pos, TSeek origin) {
  	if (_mode == 1 && _readFile) return _readFile->seek(pos, origin);
 -	else if ((_mode == 2 || _mode == 3) && _writeFile) return fseek((FILE*)_writeFile, pos, (int)origin) == 0;
 +	else if ((_mode == 2 || _mode == 3) && _writeFile) return fseek((FILE *)_writeFile, pos, (int)origin) == 0;
  	else return false;
  }
 @@ -680,10 +680,10 @@ bool CSXFile::SetPos(uint32 pos, TSeek origin) {  uint32 CSXFile::GetLength() {
  	if (_mode == 1 && _readFile) return _readFile->size();
  	else if ((_mode == 2 || _mode == 3) && _writeFile) {
 -		uint32 CurrentPos = ftell((FILE*)_writeFile);
 -		fseek((FILE*)_writeFile, 0, SEEK_END);
 -		int Ret = ftell((FILE*)_writeFile);
 -		fseek((FILE*)_writeFile, CurrentPos, SEEK_SET);
 +		uint32 CurrentPos = ftell((FILE *)_writeFile);
 +		fseek((FILE *)_writeFile, 0, SEEK_END);
 +		int Ret = ftell((FILE *)_writeFile);
 +		fseek((FILE *)_writeFile, CurrentPos, SEEK_SET);
  		return Ret;
  	} else return 0;
  }
 diff --git a/engines/wintermute/Base/scriptables/SXFile.h b/engines/wintermute/Base/scriptables/SXFile.h index 91cef4c1c5..8c37127f7b 100644 --- a/engines/wintermute/Base/scriptables/SXFile.h +++ b/engines/wintermute/Base/scriptables/SXFile.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/scriptables/SXMath.cpp b/engines/wintermute/Base/scriptables/SXMath.cpp index 68bad8c7d9..351fed9fe3 100644 --- a/engines/wintermute/Base/scriptables/SXMath.cpp +++ b/engines/wintermute/Base/scriptables/SXMath.cpp @@ -42,7 +42,7 @@ namespace WinterMute {  IMPLEMENT_PERSISTENT(CSXMath, true)
  CBScriptable *makeSXMath(CBGame *inGame) {
 -	return new CSXMath(inGame);	
 +	return new CSXMath(inGame);
  }
  //////////////////////////////////////////////////////////////////////////
 diff --git a/engines/wintermute/Base/scriptables/SXStore.cpp b/engines/wintermute/Base/scriptables/SXStore.cpp index 4192e2f8d4..0e13f5d738 100644 --- a/engines/wintermute/Base/scriptables/SXStore.cpp +++ b/engines/wintermute/Base/scriptables/SXStore.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/Base/scriptables/SXStore.h b/engines/wintermute/Base/scriptables/SXStore.h index f4ccaa3bb7..2eff4b065f 100644 --- a/engines/wintermute/Base/scriptables/SXStore.h +++ b/engines/wintermute/Base/scriptables/SXStore.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/scriptables/SXString.cpp b/engines/wintermute/Base/scriptables/SXString.cpp index 7c0f11813a..65bf933d0a 100644 --- a/engines/wintermute/Base/scriptables/SXString.cpp +++ b/engines/wintermute/Base/scriptables/SXString.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.
 @@ -271,7 +271,7 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th  		Common::Array<WideString> parts;
 -		
 +
  		Common::StringTokenizer tokenizer(str, delims);
  		while (!tokenizer.empty()) {
  			Common::String str2 = tokenizer.nextToken();
 @@ -279,19 +279,19 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th  		}
  		// TODO: Clean this up
  		/*do {
 -			pos = StringUtil::IndexOf(Common::String(str.c_str() + start), delims, start);
 -			//pos = str.find_first_of(delims, start);
 -			if (pos == start) {
 -				start = pos + 1;
 -			} else if (pos == str.size()) {
 -				parts.push_back(Common::String(str.c_str() + start));
 -				break;
 -			} else {
 -				parts.push_back(Common::String(str.c_str() + start, pos - start));
 -				start = pos + 1;
 -			}
 -			//start = str.find_first_not_of(delims, start);
 -			start = StringUtil::LastIndexOf(Common::String(str.c_str() + start), delims, start) + 1;
 +		    pos = StringUtil::IndexOf(Common::String(str.c_str() + start), delims, start);
 +		    //pos = str.find_first_of(delims, start);
 +		    if (pos == start) {
 +		        start = pos + 1;
 +		    } else if (pos == str.size()) {
 +		        parts.push_back(Common::String(str.c_str() + start));
 +		        break;
 +		    } else {
 +		        parts.push_back(Common::String(str.c_str() + start, pos - start));
 +		        start = pos + 1;
 +		    }
 +		    //start = str.find_first_not_of(delims, start);
 +		    start = StringUtil::LastIndexOf(Common::String(str.c_str() + start), delims, start) + 1;
  		} while (pos != str.size());*/
 diff --git a/engines/wintermute/Base/scriptables/ScEngine.cpp b/engines/wintermute/Base/scriptables/ScEngine.cpp index a4bb951dc2..0083c55ee9 100644 --- a/engines/wintermute/Base/scriptables/ScEngine.cpp +++ b/engines/wintermute/Base/scriptables/ScEngine.cpp @@ -48,51 +48,51 @@ IMPLEMENT_PERSISTENT(CScEngine, true)  CScEngine::CScEngine(CBGame *inGame): CBBase(inGame) {
  	Game->LOG(0, "Initializing scripting engine...");
 -/*
 -#ifdef __WIN32__
 -	char CompilerPath[MAX_PATH];
 -	strcpy(CompilerPath, COMPILER_DLL);
 -
 -	_compilerDLL = ::LoadLibrary(CompilerPath);
 -	if (_compilerDLL == NULL) {
 -		char ModuleName[MAX_PATH];
 -		::GetModuleFileName(NULL, ModuleName, MAX_PATH);
 -
 -		// switch to exe's dir
 -		char *ExeDir = CBUtils::GetPath(ModuleName);
 -		sprintf(CompilerPath, "%s%s", ExeDir, COMPILER_DLL);
 -		_compilerDLL = ::LoadLibrary(CompilerPath);
 -
 -		delete [] ExeDir;
 -	}
 -	if (_compilerDLL != NULL) {
 -		// bind compiler's functionality
 -		ExtCompileBuffer  = (DLL_COMPILE_BUFFER) ::GetProcAddress(_compilerDLL, "CompileBuffer");
 -		ExtCompileFile    = (DLL_COMPILE_FILE)   ::GetProcAddress(_compilerDLL, "CompileFile");
 -		ExtReleaseBuffer  = (DLL_RELEASE_BUFFER) ::GetProcAddress(_compilerDLL, "ReleaseBuffer");
 -		ExtSetCallbacks   = (DLL_SET_CALLBACKS)  ::GetProcAddress(_compilerDLL, "SetCallbacks");
 -		ExtDefineFunction = (DLL_DEFINE_FUNCTION)::GetProcAddress(_compilerDLL, "DefineFunction");
 -		ExtDefineVariable = (DLL_DEFINE_VARIABLE)::GetProcAddress(_compilerDLL, "DefineVariable");
 -
 -		if (!ExtCompileBuffer || !ExtCompileFile || !ExtReleaseBuffer || !ExtSetCallbacks || !ExtDefineFunction || !ExtDefineVariable) {
 -			_compilerAvailable = false;
 -			::FreeLibrary(_compilerDLL);
 -			_compilerDLL = NULL;
 -		} else {
 -		*/	/*
 -			// publish external methods to the compiler
 -			CALLBACKS c;
 -			c.Dll_AddError = AddError;
 -			c.Dll_CloseFile = CloseFile;
 -			c.Dll_LoadFile = LoadFile;
 -			ExtSetCallbacks(&c, Game);
 -			*/
 -/*
 -			_compilerAvailable = true;
 -		}
 -	} else _compilerAvailable = false;
 -#else
 -*/
 +	/*
 +	#ifdef __WIN32__
 +	    char CompilerPath[MAX_PATH];
 +	    strcpy(CompilerPath, COMPILER_DLL);
 +
 +	    _compilerDLL = ::LoadLibrary(CompilerPath);
 +	    if (_compilerDLL == NULL) {
 +	        char ModuleName[MAX_PATH];
 +	        ::GetModuleFileName(NULL, ModuleName, MAX_PATH);
 +
 +	        // switch to exe's dir
 +	        char *ExeDir = CBUtils::GetPath(ModuleName);
 +	        sprintf(CompilerPath, "%s%s", ExeDir, COMPILER_DLL);
 +	        _compilerDLL = ::LoadLibrary(CompilerPath);
 +
 +	        delete [] ExeDir;
 +	    }
 +	    if (_compilerDLL != NULL) {
 +	        // bind compiler's functionality
 +	        ExtCompileBuffer  = (DLL_COMPILE_BUFFER) ::GetProcAddress(_compilerDLL, "CompileBuffer");
 +	        ExtCompileFile    = (DLL_COMPILE_FILE)   ::GetProcAddress(_compilerDLL, "CompileFile");
 +	        ExtReleaseBuffer  = (DLL_RELEASE_BUFFER) ::GetProcAddress(_compilerDLL, "ReleaseBuffer");
 +	        ExtSetCallbacks   = (DLL_SET_CALLBACKS)  ::GetProcAddress(_compilerDLL, "SetCallbacks");
 +	        ExtDefineFunction = (DLL_DEFINE_FUNCTION)::GetProcAddress(_compilerDLL, "DefineFunction");
 +	        ExtDefineVariable = (DLL_DEFINE_VARIABLE)::GetProcAddress(_compilerDLL, "DefineVariable");
 +
 +	        if (!ExtCompileBuffer || !ExtCompileFile || !ExtReleaseBuffer || !ExtSetCallbacks || !ExtDefineFunction || !ExtDefineVariable) {
 +	            _compilerAvailable = false;
 +	            ::FreeLibrary(_compilerDLL);
 +	            _compilerDLL = NULL;
 +	        } else {
 +	        */  /*
 +            // publish external methods to the compiler
 +            CALLBACKS c;
 +            c.Dll_AddError = AddError;
 +            c.Dll_CloseFile = CloseFile;
 +            c.Dll_LoadFile = LoadFile;
 +            ExtSetCallbacks(&c, Game);
 +            */
 +	/*
 +	            _compilerAvailable = true;
 +	        }
 +	    } else _compilerAvailable = false;
 +	#else
 +	*/
  	_compilerAvailable = false;
  	_compilerDLL = NULL;
  //#endif
 @@ -776,7 +776,7 @@ HRESULT CScEngine::LoadBreakpoints() {  	int Count = Game->_registry->ReadInt("Debug", "NumBreakpoints", 0);
  	for (int i = 1; i <= Count; i++) {
 -	/*	uint32 BufSize = 512; */
 +		/*  uint32 BufSize = 512; */
  		sprintf(Key, "Breakpoint%d", i);
  		AnsiString breakpoint = Game->_registry->ReadString("Debug", Key, "");
 diff --git a/engines/wintermute/Base/scriptables/ScScript.cpp b/engines/wintermute/Base/scriptables/ScScript.cpp index 20dd8fb156..638f4ab816 100644 --- a/engines/wintermute/Base/scriptables/ScScript.cpp +++ b/engines/wintermute/Base/scriptables/ScScript.cpp @@ -471,7 +471,7 @@ HRESULT CScScript::ExecuteInstruction() {  	case II_DEF_GLOB_VAR:
  	case II_DEF_CONST_VAR: {
  		dw = GetDWORD();
 -/*		char *Temp = _symbols[dw]; // TODO delete */
 +		/*      char *Temp = _symbols[dw]; // TODO delete */
  		// only create global var if it doesn't exist
  		if (!_engine->_globals->PropExists(_symbols[dw])) {
  			_operand->SetNULL();
 @@ -1544,7 +1544,7 @@ HRESULT CScScript::DbgSendVariables(IWmeDebugClient *Client) {  	// send scope variables
  	if (_scopeStack->_sP >= 0) {
  		for (int i = 0; i <= _scopeStack->_sP; i++) {
 -		//	CScValue *Scope = _scopeStack->GetAt(i);
 +			//  CScValue *Scope = _scopeStack->GetAt(i);
  			//Scope->DbgSendVariables(Client, WME_DBGVAR_SCOPE, this, (unsigned int)Scope);
  		}
  	}
 diff --git a/engines/wintermute/Base/scriptables/SxObject.cpp b/engines/wintermute/Base/scriptables/SxObject.cpp index a1760eeaa5..9e33abdb2e 100644 --- a/engines/wintermute/Base/scriptables/SxObject.cpp +++ b/engines/wintermute/Base/scriptables/SxObject.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/Base/scriptables/SxObject.h b/engines/wintermute/Base/scriptables/SxObject.h index 2a6ad36a58..35dab041d1 100644 --- a/engines/wintermute/Base/scriptables/SxObject.h +++ b/engines/wintermute/Base/scriptables/SxObject.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/UI/UIEdit.cpp b/engines/wintermute/UI/UIEdit.cpp index 28f9671a6a..f6224c5e90 100644 --- a/engines/wintermute/UI/UIEdit.cpp +++ b/engines/wintermute/UI/UIEdit.cpp @@ -773,7 +773,8 @@ bool CUIEdit::HandleKeypress(Common::Event *event, bool printable) {  		if (_selStart != _selEnd) DeleteChars(_selStart, _selEnd);
  		//WideString wstr = StringUtil::Utf8ToWide(event->kbd.ascii);
 -		WideString wstr; wstr += (char)event->kbd.ascii;
 +		WideString wstr;
 +		wstr += (char)event->kbd.ascii;
  		_selEnd += InsertChars(_selEnd, (byte *)StringUtil::WideToAnsi(wstr).c_str(), 1);
  		if (Game->_textRTL) _selEnd = _selStart;
 diff --git a/engines/wintermute/graphics/tga.cpp b/engines/wintermute/graphics/tga.cpp index 45d67756a0..1c0d73c6cd 100644 --- a/engines/wintermute/graphics/tga.cpp +++ b/engines/wintermute/graphics/tga.cpp @@ -19,7 +19,7 @@   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.   */ -/* Based on code from eos https://github.com/DrMcCoy/xoreos/  +/* Based on code from eos https://github.com/DrMcCoy/xoreos/   * relicensed under GPLv2+ with permission from DrMcCoy and clone2727   */ @@ -33,7 +33,7 @@  namespace WinterMute {  TGA::TGA() { -	 +  }  TGA::~TGA() { @@ -45,10 +45,10 @@ void TGA::destroy() {  }  bool TGA::loadStream(Common::SeekableReadStream &tga) { -		byte imageType, pixelDepth; -		bool success; -		success = readHeader(tga, imageType, pixelDepth); -		success = readData  (tga, imageType, pixelDepth); +	byte imageType, pixelDepth; +	bool success; +	success = readHeader(tga, imageType, pixelDepth); +	success = readData(tga, imageType, pixelDepth);  	if (tga.err() || !success) {  		warning("Failed reading TGA-file"); @@ -93,10 +93,10 @@ bool TGA::readHeader(Common::SeekableReadStream &tga, byte &imageType, byte &pix  	if (imageType == 2) {  		if (pixelDepth == 24) {  			_hasAlpha  = false; -			_format = Graphics::PixelFormat(pixelDepth/8, 8, 8, 8, 0, 16, 8, 0, 0); +			_format = Graphics::PixelFormat(pixelDepth / 8, 8, 8, 8, 0, 16, 8, 0, 0);  		} else if (pixelDepth == 16 || pixelDepth == 32) {  			_hasAlpha  = true; -			_format = Graphics::PixelFormat(pixelDepth/8, 8, 8, 8, 8, 24, 16, 8, 0); +			_format = Graphics::PixelFormat(pixelDepth / 8, 8, 8, 8, 8, 24, 16, 8, 0);  		} else {  			warning("Unsupported pixel depth: %d, %d", imageType, pixelDepth);  			return false; @@ -127,7 +127,7 @@ bool TGA::readData(Common::SeekableReadStream &tga, byte imageType, byte pixelDe  			// Convert from 16bpp to 32bpp  			// 16bpp TGA is ARGB1555  			uint16 count = _surface.w * _surface.h; -			byte *dst = (byte*)_surface.pixels; +			byte *dst = (byte *)_surface.pixels;  			while (count--) {  				uint16 pixel = tga.readUint16LE(); @@ -145,7 +145,7 @@ bool TGA::readData(Common::SeekableReadStream &tga, byte imageType, byte pixelDe  	} else if (imageType == 3) {  		_surface.create(_surface.w, _surface.h, _surface.format); -		byte  *data  = (byte*)_surface.pixels; +		byte  *data  = (byte *)_surface.pixels;  		uint32 count = _surface.w * _surface.h;  		while (count-- > 0) { diff --git a/engines/wintermute/graphics/tga.h b/engines/wintermute/graphics/tga.h index 727d10c1a3..b3b46fb529 100644 --- a/engines/wintermute/graphics/tga.h +++ b/engines/wintermute/graphics/tga.h @@ -19,7 +19,7 @@   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.   */ -/* Based on code from eos https://github.com/DrMcCoy/xoreos/  +/* Based on code from eos https://github.com/DrMcCoy/xoreos/   * relicensed under GPLv2+ with permission from DrMcCoy and clone2727   */ @@ -30,7 +30,7 @@  #include "graphics/decoders/image_decoder.h"  namespace Common { -	class SeekableReadStream; +class SeekableReadStream;  }  namespace WinterMute { @@ -41,7 +41,9 @@ public:  	TGA();  	virtual ~TGA();  	virtual void destroy(); -	virtual const Graphics::Surface *getSurface() const { return &_surface; }; +	virtual const Graphics::Surface *getSurface() const { +		return &_surface; +	};  	virtual bool loadStream(Common::SeekableReadStream &stream);  private:  	Graphics::PixelFormat _format; diff --git a/engines/wintermute/video/VidPlayer.cpp b/engines/wintermute/video/VidPlayer.cpp index cd693f0b3f..73d6fffb6b 100644 --- a/engines/wintermute/video/VidPlayer.cpp +++ b/engines/wintermute/video/VidPlayer.cpp @@ -48,14 +48,14 @@ CVidPlayer::CVidPlayer(CBGame *inGame): CBBase(inGame) {  HRESULT CVidPlayer::SetDefaults() {  	_playing = false; -/*	_aviFile = NULL; +	/*  _aviFile = NULL; -	_audioStream = NULL; -	_audioFormat = NULL; +	    _audioStream = NULL; +	    _audioFormat = NULL; -	_videoStream = NULL; -	_videoFormat = NULL; -	_videoPGF = NULL;*/ +	    _videoStream = NULL; +	    _videoFormat = NULL; +	    _videoPGF = NULL;*/  	_videoEndTime = 0;  	//_sound = NULL; diff --git a/engines/wintermute/video/VidPlayer.h b/engines/wintermute/video/VidPlayer.h index eca9a96782..f3dfa97e33 100644 --- a/engines/wintermute/video/VidPlayer.h +++ b/engines/wintermute/video/VidPlayer.h @@ -83,9 +83,9 @@ public:  	int _playPosY;  	float _playZoom; -/*	LPBITMAPV4HEADER _targetFormat; +	/*  LPBITMAPV4HEADER _targetFormat; -	CBArray<CVidSubtitle *, CVidSubtitle *> _subtitles;*/ +	    CBArray<CVidSubtitle *, CVidSubtitle *> _subtitles;*/  };  } // end of namespace WinterMute diff --git a/engines/wintermute/video/VidTheoraPlayer.cpp b/engines/wintermute/video/VidTheoraPlayer.cpp index d52248ad4a..d44231d0d0 100644 --- a/engines/wintermute/video/VidTheoraPlayer.cpp +++ b/engines/wintermute/video/VidTheoraPlayer.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. @@ -77,11 +77,11 @@ void CVidTheoraPlayer::SetDefaults() {  	_seekingKeyframe = false;  	_timeOffset = 0.0f; -	 +  	_posX = _posY = 0;  	_playbackType = VID_PLAY_CENTER;  	_playZoom = 0.0f; -	 +  	_savedState = THEORA_STATE_NONE;  	_savedPos = 0;  	_volume = 100; @@ -99,10 +99,10 @@ void CVidTheoraPlayer::SetDefaults() {  CVidTheoraPlayer::~CVidTheoraPlayer(void) {  	cleanup(); -/*	SAFE_DELETE_ARRAY(_filename); -	SAFE_DELETE_ARRAY(_alphaFilename); -	SAFE_DELETE(_texture); -	SAFE_DELETE(_alphaImage);*/ +	/*  SAFE_DELETE_ARRAY(_filename); +	    SAFE_DELETE_ARRAY(_alphaFilename); +	    SAFE_DELETE(_texture); +	    SAFE_DELETE(_alphaImage);*/  //	SAFE_DELETE(_subtitler);  } @@ -134,7 +134,7 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo  	_filename = filename;  	_file = Game->_fileManager->OpenFile(filename, true, false);  	if (!_file) return E_FAIL; -	 +  	//if (Filename != _filename) CBUtils::SetString(&_filename, Filename);  #if defined (USE_THEORADEC)  	_theoraDecoder = new TheoraDecoder(); @@ -142,10 +142,10 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo  	return E_FAIL;  #endif  	_theoraDecoder->loadStream(_file); -	 +  	if (!_theoraDecoder->isVideoLoaded())  		return E_FAIL; -	 +  	_state = THEORA_STATE_PAUSED;  	// Additional setup. @@ -154,7 +154,7 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo  	_texture->create(_theoraDecoder->getWidth(), _theoraDecoder->getHeight());  	_state = THEORA_STATE_PLAYING;  	_playZoom = 100; -	 +  	return S_OK;  #if 0  	Cleanup(); @@ -343,17 +343,17 @@ HRESULT CVidTheoraPlayer::resetStream() {  //////////////////////////////////////////////////////////////////////////  HRESULT CVidTheoraPlayer::play(TVideoPlayback type, int x, int y, bool freezeGame, bool freezeMusic, bool looping, uint32 startTime, float forceZoom, int volume) { -	if (forceZoom < 0.0f)  +	if (forceZoom < 0.0f)  		forceZoom = 100.0f; -	if (volume < 0)  +	if (volume < 0)  		_volume = Game->_soundMgr->getVolumePercent(SOUND_SFX);  	else _volume = volume; -	 +  	_freezeGame = freezeGame; -	 -	if (!_playbackStarted && _freezeGame)  + +	if (!_playbackStarted && _freezeGame)  		Game->Freeze(freezeMusic); -	 +  	_playbackStarted = false;  	float width, height;  	if (_theoraDecoder) { @@ -367,7 +367,7 @@ HRESULT CVidTheoraPlayer::play(TVideoPlayback type, int x, int y, bool freezeGam  		_posX = x;  		_posY = y;  		_playZoom = forceZoom; -		 +  		width = (float)_theoraDecoder->getWidth();  		height = (float)_theoraDecoder->getHeight();  	} else { @@ -376,26 +376,26 @@ HRESULT CVidTheoraPlayer::play(TVideoPlayback type, int x, int y, bool freezeGam  	}  	switch (type) { -		case VID_PLAY_POS: -			_playZoom = forceZoom; -			_posX = x; -			_posY = y; -			break; -			 -		case VID_PLAY_STRETCH: { -			float ZoomX = (float)((float)Game->_renderer->_width / width * 100); -			float ZoomY = (float)((float)Game->_renderer->_height / height * 100); -			_playZoom = MIN(ZoomX, ZoomY); -			_posX = (Game->_renderer->_width - width * (_playZoom / 100)) / 2; -			_posY = (Game->_renderer->_height - height * (_playZoom / 100)) / 2; -		} -			break; -			 -		case VID_PLAY_CENTER: -			_playZoom = 100.0f; -			_posX = (Game->_renderer->_width - width) / 2; -			_posY = (Game->_renderer->_height - height) / 2; -			break; +	case VID_PLAY_POS: +		_playZoom = forceZoom; +		_posX = x; +		_posY = y; +		break; + +	case VID_PLAY_STRETCH: { +		float ZoomX = (float)((float)Game->_renderer->_width / width * 100); +		float ZoomY = (float)((float)Game->_renderer->_height / height * 100); +		_playZoom = MIN(ZoomX, ZoomY); +		_posX = (Game->_renderer->_width - width * (_playZoom / 100)) / 2; +		_posY = (Game->_renderer->_height - height * (_playZoom / 100)) / 2; +	} +	break; + +	case VID_PLAY_CENTER: +		_playZoom = 100.0f; +		_posX = (Game->_renderer->_width - width) / 2; +		_posY = (Game->_renderer->_height - height) / 2; +		break;  	}  	return S_OK;  #if 0 @@ -613,7 +613,7 @@ HRESULT CVidTheoraPlayer::WriteVideo() {  	if (!_texture) return E_FAIL;  	_texture->startPixelOp(); -	 +  	writeAlpha();  	if (_alphaImage) {  		_texture->putSurface(_surface, true); @@ -632,10 +632,10 @@ void CVidTheoraPlayer::writeAlpha() {  	if (_alphaImage && _surface.w == _alphaImage->getSurface()->w && _surface.h == _alphaImage->getSurface()->h) {  		assert(_alphaImage->getSurface()->format.bytesPerPixel == 4);  		assert(_surface.format.bytesPerPixel == 4); -		const byte *alphaData = (byte*)_alphaImage->getSurface()->getBasePtr(0, 0); +		const byte *alphaData = (byte *)_alphaImage->getSurface()->getBasePtr(0, 0);  		int alphaPlace = (_alphaImage->getSurface()->format.aShift / 8);  		alphaData += alphaPlace; -		byte *imgData = (byte*)_surface.getBasePtr(0,0); +		byte *imgData = (byte *)_surface.getBasePtr(0, 0);  		imgData += (_surface.format.aShift / 8);  		for (int i = 0; i < _surface.w * _surface.h; i++) {  			*imgData = *alphaData; @@ -664,7 +664,7 @@ HRESULT CVidTheoraPlayer::display(uint32 alpha) {  //////////////////////////////////////////////////////////////////////////  HRESULT CVidTheoraPlayer::setAlphaImage(const Common::String &filename) {  	warning("CVidTheoraPlayer::SetAlphaImage(%s) - Not implemented", filename.c_str()); -	 +  	delete _alphaImage;  	_alphaImage = new CBImage(Game);  	if (!_alphaImage || FAILED(_alphaImage->loadFile(filename))) { @@ -673,7 +673,7 @@ HRESULT CVidTheoraPlayer::setAlphaImage(const Common::String &filename) {  		_alphaFilename = "";  		return E_FAIL;  	} -	 +  	if (_alphaFilename != filename) {  		_alphaFilename = filename;  	} diff --git a/engines/wintermute/video/VidTheoraPlayer.h b/engines/wintermute/video/VidTheoraPlayer.h index 2c103095a1..43be1801a0 100644 --- a/engines/wintermute/video/VidTheoraPlayer.h +++ b/engines/wintermute/video/VidTheoraPlayer.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. @@ -42,10 +42,10 @@ namespace WinterMute {  class CVidTheoraPlayer : public CBBase {  private:  	enum { -		THEORA_STATE_NONE = 0, -		THEORA_STATE_PLAYING = 1, -		THEORA_STATE_PAUSED = 2, -		THEORA_STATE_FINISHED = 3 +	    THEORA_STATE_NONE = 0, +	    THEORA_STATE_PLAYING = 1, +	    THEORA_STATE_PAUSED = 2, +	    THEORA_STATE_FINISHED = 3  	};  	Video::RewindableVideoDecoder *_theoraDecoder;  	Graphics::Surface _surface; | 
