diff options
66 files changed, 1090 insertions, 1093 deletions
diff --git a/engines/wintermute/Ad/AdActor.cpp b/engines/wintermute/Ad/AdActor.cpp index 1af137e96f..04152db456 100644 --- a/engines/wintermute/Ad/AdActor.cpp +++ b/engines/wintermute/Ad/AdActor.cpp @@ -124,8 +124,8 @@ CAdActor::~CAdActor() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdActor::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdActor::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -135,10 +135,10 @@ HRESULT CAdActor::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ACTOR file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing ACTOR file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -235,7 +235,7 @@ HRESULT CAdActor::loadBuffer(byte *buffer, bool complete) {  		buffer = params;
  	}
 -	CAdGame *AdGame = (CAdGame *)Game;
 +	CAdGame *adGame = (CAdGame *)Game;
  	CAdSpriteSet *spr = NULL;
  	int ar = 0, ag = 0, ab = 0, alpha = 0;
  	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
 @@ -291,19 +291,19 @@ HRESULT CAdActor::loadBuffer(byte *buffer, bool complete) {  			delete _walkSprite;
  			_walkSprite = NULL;
  			spr = new CAdSpriteSet(Game, this);
 -			if (!spr || FAILED(spr->loadBuffer(params, true, AdGame->_texWalkLifeTime, CACHE_HALF))) cmd = PARSERR_GENERIC;
 +			if (!spr || FAILED(spr->loadBuffer(params, true, adGame->_texWalkLifeTime, CACHE_HALF))) cmd = PARSERR_GENERIC;
  			else _walkSprite = spr;
  			break;
  		case TOKEN_TALK:
  			spr = new CAdSpriteSet(Game, this);
 -			if (!spr || FAILED(spr->loadBuffer(params, true, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
 +			if (!spr || FAILED(spr->loadBuffer(params, true, adGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
  			else _talkSprites.Add(spr);
  			break;
  		case TOKEN_TALK_SPECIAL:
  			spr = new CAdSpriteSet(Game, this);
 -			if (!spr || FAILED(spr->loadBuffer(params, true, AdGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
 +			if (!spr || FAILED(spr->loadBuffer(params, true, adGame->_texTalkLifeTime))) cmd = PARSERR_GENERIC;
  			else _talkSpritesEx.Add(spr);
  			break;
 @@ -311,7 +311,7 @@ HRESULT CAdActor::loadBuffer(byte *buffer, bool complete) {  			delete _standSprite;
  			_standSprite = NULL;
  			spr = new CAdSpriteSet(Game, this);
 -			if (!spr || FAILED(spr->loadBuffer(params, true, AdGame->_texStandLifeTime))) cmd = PARSERR_GENERIC;
 +			if (!spr || FAILED(spr->loadBuffer(params, true, adGame->_texStandLifeTime))) cmd = PARSERR_GENERIC;
  			else _standSprite = spr;
  			break;
 @@ -490,8 +490,8 @@ void CAdActor::goTo(int x, int y, TDirection afterWalkDir) {  	_afterWalkDir = afterWalkDir;
  	if (x == _targetPoint->x && y == _targetPoint->y && _state == STATE_FOLLOWING_PATH) return;
 -	_path->Reset();
 -	_path->SetReady(false);
 +	_path->reset();
 +	_path->setReady(false);
  	_targetPoint->x = x;
  	_targetPoint->y = y;
 @@ -512,7 +512,7 @@ HRESULT CAdActor::display() {  	else alpha = _shadowable ? ((CAdGame *)Game)->_scene->getAlphaAt(_posX, _posY, true) : 0xFFFFFFFF;
  	float scaleX, scaleY;
 -	GetScale(&scaleX, &scaleY);
 +	getScale(&scaleX, &scaleY);
  	float rotate;
 @@ -749,16 +749,16 @@ HRESULT CAdActor::update() {  //////////////////////////////////////////////////////////////////////////
  void CAdActor::followPath() {
  	// skip current position
 -	_path->GetFirst();
 -	while (_path->GetCurrent() != NULL) {
 -		if (_path->GetCurrent()->x != _posX || _path->GetCurrent()->y != _posY) break;
 -		_path->GetNext();
 +	_path->getFirst();
 +	while (_path->getCurrent() != NULL) {
 +		if (_path->getCurrent()->x != _posX || _path->getCurrent()->y != _posY) break;
 +		_path->getNext();
  	}
  	// are there points to follow?
 -	if (_path->GetCurrent() != NULL) {
 +	if (_path->getCurrent() != NULL) {
  		_state = STATE_FOLLOWING_PATH;;
 -		initLine(CBPoint(_posX, _posY), *_path->GetCurrent());
 +		initLine(CBPoint(_posX, _posY), *_path->getCurrent());
  	} else {
  		if (_afterWalkDir != DI_NONE) turnTo(_afterWalkDir);
  		else _state = STATE_READY;
 @@ -814,17 +814,17 @@ void CAdActor::getNextStep() {  	if (_pFCount == 0) {
 -		if (_path->GetNext() == NULL) {
 +		if (_path->getNext() == NULL) {
  			_posX = _targetPoint->x;
  			_posY = _targetPoint->y;
 -			_path->Reset();
 +			_path->reset();
  			if (_afterWalkDir != DI_NONE) turnTo(_afterWalkDir);
  			else {
  				_state = _nextState;
  				_nextState = STATE_READY;
  			}
 -		} else initLine(CBPoint(_posX, _posY), *_path->GetCurrent());
 +		} else initLine(CBPoint(_posX, _posY), *_path->getCurrent());
  	}
  }
 diff --git a/engines/wintermute/Ad/AdEntity.cpp b/engines/wintermute/Ad/AdEntity.cpp index 27509a529c..c4de591706 100644 --- a/engines/wintermute/Ad/AdEntity.cpp +++ b/engines/wintermute/Ad/AdEntity.cpp @@ -490,7 +490,7 @@ HRESULT CAdEntity::display() {  		else Alpha = _shadowable ? ((CAdGame *)Game)->_scene->getAlphaAt(_posX, _posY) : 0xFFFFFFFF;
  		float ScaleX, ScaleY;
 -		GetScale(&ScaleX, &ScaleY);
 +		getScale(&ScaleX, &ScaleY);
  		float Rotate;
  		if (_rotatable) {
 diff --git a/engines/wintermute/Ad/AdGame.cpp b/engines/wintermute/Ad/AdGame.cpp index fabeda7dea..c890033e18 100644 --- a/engines/wintermute/Ad/AdGame.cpp +++ b/engines/wintermute/Ad/AdGame.cpp @@ -474,12 +474,12 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this  			CAdResponse *res = new CAdResponse(Game);
  			if (res) {
  				res->_iD = id;
 -				res->SetText(text);
 +				res->setText(text);
  				_stringTable->Expand(&res->_text);
 -				if (!val1->isNULL()) res->SetIcon(val1->getString());
 -				if (!val2->isNULL()) res->SetIconHover(val2->getString());
 -				if (!val3->isNULL()) res->SetIconPressed(val3->getString());
 -				if (!val4->isNULL()) res->SetFont(val4->getString());
 +				if (!val1->isNULL()) res->setIcon(val1->getString());
 +				if (!val2->isNULL()) res->setIconHover(val2->getString());
 +				if (!val3->isNULL()) res->setIconPressed(val3->getString());
 +				if (!val4->isNULL()) res->setFont(val4->getString());
  				if (strcmp(name, "AddResponseOnce") == 0) res->_responseType = RESPONSE_ONCE;
  				else if (strcmp(name, "AddResponseOnceGame") == 0) res->_responseType = RESPONSE_ONCE_GAME;
 diff --git a/engines/wintermute/Ad/AdInventoryBox.cpp b/engines/wintermute/Ad/AdInventoryBox.cpp index 7af618e548..7ebcc4457f 100644 --- a/engines/wintermute/Ad/AdInventoryBox.cpp +++ b/engines/wintermute/Ad/AdInventoryBox.cpp @@ -98,7 +98,7 @@ HRESULT CAdInventoryBox::listen(CBScriptHolder *param1, uint32 param2) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdInventoryBox::display() {
 -	CAdGame *AdGame = (CAdGame *)Game;
 +	CAdGame *adGame = (CAdGame *)Game;
  	if (!_visible) return S_OK;
 @@ -108,7 +108,7 @@ HRESULT CAdInventoryBox::display() {  	if (_window) {
  		_window->enableWidget("prev", _scrollOffset > 0);
 -		_window->enableWidget("next", _scrollOffset + ItemsX * ItemsY < AdGame->_inventoryOwner->getInventory()->_takenItems.GetSize());
 +		_window->enableWidget("next", _scrollOffset + ItemsX * ItemsY < adGame->_inventoryOwner->getInventory()->_takenItems.GetSize());
  	}
 @@ -135,8 +135,8 @@ HRESULT CAdInventoryBox::display() {  		int xxx = rect.left;
  		for (int i = 0; i < ItemsX; i++) {
  			int ItemIndex = _scrollOffset + j * ItemsX + i;
 -			if (ItemIndex >= 0 && ItemIndex < AdGame->_inventoryOwner->getInventory()->_takenItems.GetSize()) {
 -				CAdItem *item = AdGame->_inventoryOwner->getInventory()->_takenItems[ItemIndex];
 +			if (ItemIndex >= 0 && ItemIndex < adGame->_inventoryOwner->getInventory()->_takenItems.GetSize()) {
 +				CAdItem *item = adGame->_inventoryOwner->getInventory()->_takenItems[ItemIndex];
  				if (item != ((CAdGame *)Game)->_selectedItem || !_hideSelected) {
  					item->update();
  					item->display(xxx, yyy);
 @@ -155,8 +155,8 @@ HRESULT CAdInventoryBox::display() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdInventoryBox::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdInventoryBox::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -166,10 +166,10 @@ HRESULT CAdInventoryBox::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing INVENTORY_BOX file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing INVENTORY_BOX file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -192,7 +192,7 @@ TOKEN_DEF(HIDE_SELECTED)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdInventoryBox::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CAdInventoryBox::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(INVENTORY_BOX)
  	TOKEN_TABLE(TEMPLATE)
 @@ -216,15 +216,15 @@ HRESULT CAdInventoryBox::loadBuffer(byte  *Buffer, bool Complete) {  	bool always_visible = false;
  	_exclusive = false;
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_INVENTORY_BOX) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_INVENTORY_BOX) {
  			Game->LOG(0, "'INVENTORY_BOX' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while (cmd > 0 && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -317,34 +317,34 @@ HRESULT CAdInventoryBox::loadBuffer(byte  *Buffer, bool Complete) {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdInventoryBox::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "INVENTORY_BOX\n");
 -	Buffer->putTextIndent(Indent, "{\n");
 +HRESULT CAdInventoryBox::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "INVENTORY_BOX\n");
 +	buffer->putTextIndent(indent, "{\n");
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
 -	Buffer->putTextIndent(Indent + 2, "AREA { %d, %d, %d, %d }\n", _itemsArea.left, _itemsArea.top, _itemsArea.right, _itemsArea.bottom);
 +	buffer->putTextIndent(indent + 2, "AREA { %d, %d, %d, %d }\n", _itemsArea.left, _itemsArea.top, _itemsArea.right, _itemsArea.bottom);
 -	Buffer->putTextIndent(Indent + 2, "EXCLUSIVE=%s\n", _exclusive ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "HIDE_SELECTED=%s\n", _hideSelected ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "ALWAYS_VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "SPACING=%d\n", _spacing);
 -	Buffer->putTextIndent(Indent + 2, "ITEM_WIDTH=%d\n", _itemWidth);
 -	Buffer->putTextIndent(Indent + 2, "ITEM_HEIGHT=%d\n", _itemHeight);
 -	Buffer->putTextIndent(Indent + 2, "SCROLL_BY=%d\n", _scrollBy);
 +	buffer->putTextIndent(indent + 2, "EXCLUSIVE=%s\n", _exclusive ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "HIDE_SELECTED=%s\n", _hideSelected ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "ALWAYS_VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "SPACING=%d\n", _spacing);
 +	buffer->putTextIndent(indent + 2, "ITEM_WIDTH=%d\n", _itemWidth);
 +	buffer->putTextIndent(indent + 2, "ITEM_HEIGHT=%d\n", _itemHeight);
 +	buffer->putTextIndent(indent + 2, "SCROLL_BY=%d\n", _scrollBy);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// window
 -	if (_window) _window->saveAsText(Buffer, Indent + 2);
 +	if (_window) _window->saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// editor properties
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n");
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/Ad/AdInventoryBox.h b/engines/wintermute/Ad/AdInventoryBox.h index 903a3ff8e9..e05c001da8 100644 --- a/engines/wintermute/Ad/AdInventoryBox.h +++ b/engines/wintermute/Ad/AdInventoryBox.h @@ -54,8 +54,8 @@ public:  	CAdInventoryBox(CBGame *inGame);
  	virtual ~CAdInventoryBox();
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  };
  } // end of namespace WinterMute
 diff --git a/engines/wintermute/Ad/AdItem.cpp b/engines/wintermute/Ad/AdItem.cpp index 77e6aa5a4a..2ef7f0c200 100644 --- a/engines/wintermute/Ad/AdItem.cpp +++ b/engines/wintermute/Ad/AdItem.cpp @@ -85,8 +85,8 @@ CAdItem::~CAdItem() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdItem::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdItem::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -96,10 +96,10 @@ HRESULT CAdItem::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ITEM file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing ITEM file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -134,7 +134,7 @@ TOKEN_DEF(AMOUNT_STRING)  TOKEN_DEF(AMOUNT)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdItem::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CAdItem::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(ITEM)
  	TOKEN_TABLE(TEMPLATE)
 @@ -168,16 +168,16 @@ HRESULT CAdItem::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd = 2;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_ITEM) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_ITEM) {
  			Game->LOG(0, "'ITEM' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
  	int ar = 0, ag = 0, ab = 0, alpha = 255;
 -	while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while (cmd > 0 && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -386,38 +386,38 @@ HRESULT CAdItem::update() {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdItem::display(int X, int Y) {
 -	int Width = 0;
 +HRESULT CAdItem::display(int x, int y) {
 +	int width = 0;
  	if (_currentSprite) {
  		RECT rc;
  		_currentSprite->GetBoundingRect(&rc, 0, 0);
 -		Width = rc.right - rc.left;
 +		width = rc.right - rc.left;
  	}
 -	_posX = X + Width / 2;
 -	_posY = Y;
 +	_posX = x + width / 2;
 +	_posY = y;
  	HRESULT ret;
 -	if (_currentSprite) ret = _currentSprite->Draw(X, Y, this, 100, 100, _alphaColor);
 +	if (_currentSprite) ret = _currentSprite->Draw(x, y, this, 100, 100, _alphaColor);
  	else ret = S_OK;
  	if (_displayAmount) {
 -		int AmountX = X;
 -		int AmountY = Y + _amountOffsetY;
 +		int amountX = x;
 +		int amountY = y + _amountOffsetY;
  		if (_amountAlign == TAL_RIGHT) {
 -			Width -= _amountOffsetX;
 -			AmountX -= _amountOffsetX;
 +			width -= _amountOffsetX;
 +			amountX -= _amountOffsetX;
  		}
 -		AmountX += _amountOffsetX;
 +		amountX += _amountOffsetX;
 -		CBFont *Font = _font ? _font : Game->_systemFont;
 -		if (Font) {
 -			if (_amountString) Font->drawText((byte *)_amountString, AmountX, AmountY, Width, _amountAlign);
 +		CBFont *font = _font ? _font : Game->_systemFont;
 +		if (font) {
 +			if (_amountString) font->drawText((byte *)_amountString, amountX, amountY, width, _amountAlign);
  			else {
  				char Str[256];
  				sprintf(Str, "%d", _amount);
 -				Font->drawText((byte *)Str, AmountX, AmountY, Width, _amountAlign);
 +				font->drawText((byte *)Str, amountX, amountY, width, _amountAlign);
  			}
  		}
  	}
 @@ -436,8 +436,8 @@ HRESULT CAdItem::scCallMethod(CScScript *script, CScStack *stack, CScStack *this  	if (strcmp(name, "SetHoverSprite") == 0) {
  		stack->correctParams(1);
 -		bool SetCurrent = false;
 -		if (_currentSprite && _currentSprite == _spriteHover) SetCurrent = true;
 +		bool setCurrent = false;
 +		if (_currentSprite && _currentSprite == _spriteHover) setCurrent = true;
  		const char *filename = stack->pop()->getString();
 @@ -449,7 +449,7 @@ HRESULT CAdItem::scCallMethod(CScScript *script, CScStack *stack, CScStack *this  			script->RuntimeError("Item.SetHoverSprite failed for file '%s'", filename);
  		} else {
  			_spriteHover = spr;
 -			if (SetCurrent) _currentSprite = _spriteHover;
 +			if (setCurrent) _currentSprite = _spriteHover;
  			stack->pushBool(true);
  		}
  		return S_OK;
 @@ -750,10 +750,10 @@ HRESULT CAdItem::persist(CBPersistMgr *persistMgr) {  //////////////////////////////////////////////////////////////////////////
 -bool CAdItem::getExtendedFlag(const char *FlagName) {
 -	if (!FlagName) return false;
 -	else if (strcmp(FlagName, "usable") == 0) return true;
 -	else return CAdObject::getExtendedFlag(FlagName);
 +bool CAdItem::getExtendedFlag(const char *flagName) {
 +	if (!flagName) return false;
 +	else if (strcmp(flagName, "usable") == 0) return true;
 +	else return CAdObject::getExtendedFlag(flagName);
  }
  } // end of namespace WinterMute
 diff --git a/engines/wintermute/Ad/AdItem.h b/engines/wintermute/Ad/AdItem.h index 31460319e7..fa2e99fa5a 100644 --- a/engines/wintermute/Ad/AdItem.h +++ b/engines/wintermute/Ad/AdItem.h @@ -46,8 +46,8 @@ public:  	HRESULT update();
  	DECLARE_PERSISTENT(CAdItem, CAdTalkHolder)
 -	HRESULT display(int X, int Y);
 -	bool getExtendedFlag(const char *FlagName);
 +	HRESULT display(int x, int y);
 +	bool getExtendedFlag(const char *flagName);
  	bool _inInventory;
  	bool _cursorCombined;
  	CBSprite *_spriteHover;
 @@ -56,7 +56,7 @@ public:  	CAdItem(CBGame *inGame);
  	virtual ~CAdItem();
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
  	// scripting interface
  	virtual CScValue *scGetProperty(const char *name);
 diff --git a/engines/wintermute/Ad/AdLayer.cpp b/engines/wintermute/Ad/AdLayer.cpp index 4329c7b36a..e71a31587c 100644 --- a/engines/wintermute/Ad/AdLayer.cpp +++ b/engines/wintermute/Ad/AdLayer.cpp @@ -62,8 +62,8 @@ CAdLayer::~CAdLayer() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdLayer::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdLayer::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -73,10 +73,9 @@ HRESULT CAdLayer::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing LAYER file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing LAYER file '%s'", filename);
 -
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -100,7 +99,7 @@ TOKEN_DEF(CLOSE_UP)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdLayer::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CAdLayer::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(LAYER)
  	TOKEN_TABLE(TEMPLATE)
 @@ -123,15 +122,15 @@ HRESULT CAdLayer::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_LAYER) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_LAYER) {
  			Game->LOG(0, "'LAYER' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -268,21 +267,21 @@ HRESULT CAdLayer::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(name, "AddRegion") == 0 || strcmp(name, "AddEntity") == 0) {
  		stack->correctParams(1);
 -		CScValue *Val = stack->pop();
 +		CScValue *val = stack->pop();
 -		CAdSceneNode *Node = new CAdSceneNode(Game);
 +		CAdSceneNode *node = new CAdSceneNode(Game);
  		if (strcmp(name, "AddRegion") == 0) {
 -			CAdRegion *Region = new CAdRegion(Game);
 -			if (!Val->isNULL()) Region->setName(Val->getString());
 -			Node->setRegion(Region);
 -			stack->pushNative(Region, true);
 +			CAdRegion *region = new CAdRegion(Game);
 +			if (!val->isNULL()) region->setName(val->getString());
 +			node->setRegion(region);
 +			stack->pushNative(region, true);
  		} else {
 -			CAdEntity *Entity = new CAdEntity(Game);
 -			if (!Val->isNULL()) Entity->setName(Val->getString());
 -			Node->setEntity(Entity);
 -			stack->pushNative(Entity, true);
 +			CAdEntity *entity = new CAdEntity(Game);
 +			if (!val->isNULL()) entity->setName(val->getString());
 +			node->setEntity(entity);
 +			stack->pushNative(entity, true);
  		}
 -		_nodes.Add(Node);
 +		_nodes.Add(node);
  		return S_OK;
  	}
 @@ -291,24 +290,24 @@ HRESULT CAdLayer::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(name, "InsertRegion") == 0 || strcmp(name, "InsertEntity") == 0) {
  		stack->correctParams(2);
 -		int Index = stack->pop()->getInt();
 -		CScValue *Val = stack->pop();
 +		int index = stack->pop()->getInt();
 +		CScValue *val = stack->pop();
 -		CAdSceneNode *Node = new CAdSceneNode(Game);
 +		CAdSceneNode *node = new CAdSceneNode(Game);
  		if (strcmp(name, "InsertRegion") == 0) {
 -			CAdRegion *Region = new CAdRegion(Game);
 -			if (!Val->isNULL()) Region->setName(Val->getString());
 -			Node->setRegion(Region);
 -			stack->pushNative(Region, true);
 +			CAdRegion *region = new CAdRegion(Game);
 +			if (!val->isNULL()) region->setName(val->getString());
 +			node->setRegion(region);
 +			stack->pushNative(region, true);
  		} else {
 -			CAdEntity *Entity = new CAdEntity(Game);
 -			if (!Val->isNULL()) Entity->setName(Val->getString());
 -			Node->setEntity(Entity);
 -			stack->pushNative(Entity, true);
 +			CAdEntity *entity = new CAdEntity(Game);
 +			if (!val->isNULL()) entity->setName(val->getString());
 +			node->setEntity(entity);
 +			stack->pushNative(entity, true);
  		}
 -		if (Index < 0) Index = 0;
 -		if (Index <= _nodes.GetSize() - 1) _nodes.InsertAt(Index, Node);
 -		else _nodes.Add(Node);
 +		if (index < 0) index = 0;
 +		if (index <= _nodes.GetSize() - 1) _nodes.InsertAt(index, node);
 +		else _nodes.Add(node);
  		return S_OK;
  	}
 @@ -318,30 +317,30 @@ HRESULT CAdLayer::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(name, "DeleteNode") == 0) {
  		stack->correctParams(1);
 -		CScValue *Val = stack->pop();
 +		CScValue *val = stack->pop();
 -		CAdSceneNode *ToDelete = NULL;
 -		if (Val->isNative()) {
 -			CBScriptable *Temp = Val->getNative();
 +		CAdSceneNode *toDelete = NULL;
 +		if (val->isNative()) {
 +			CBScriptable *temp = val->getNative();
  			for (int i = 0; i < _nodes.GetSize(); i++) {
 -				if (_nodes[i]->_region == Temp || _nodes[i]->_entity == Temp) {
 -					ToDelete = _nodes[i];
 +				if (_nodes[i]->_region == temp || _nodes[i]->_entity == temp) {
 +					toDelete = _nodes[i];
  					break;
  				}
  			}
  		} else {
 -			int Index = Val->getInt();
 -			if (Index >= 0 && Index < _nodes.GetSize()) {
 -				ToDelete = _nodes[Index];
 +			int index = val->getInt();
 +			if (index >= 0 && index < _nodes.GetSize()) {
 +				toDelete = _nodes[index];
  			}
  		}
 -		if (ToDelete == NULL) {
 +		if (toDelete == NULL) {
  			stack->pushBool(false);
  			return S_OK;
  		}
  		for (int i = 0; i < _nodes.GetSize(); i++) {
 -			if (_nodes[i] == ToDelete) {
 +			if (_nodes[i] == toDelete) {
  				delete _nodes[i];
  				_nodes[i] = NULL;
  				_nodes.RemoveAt(i);
 @@ -478,33 +477,33 @@ const char *CAdLayer::scToString() {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdLayer::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "LAYER {\n");
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
 -	Buffer->putTextIndent(Indent + 2, "MAIN=%s\n", _main ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "WIDTH=%d\n", _width);
 -	Buffer->putTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
 -	Buffer->putTextIndent(Indent + 2, "ACTIVE=%s\n", _active ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
 +HRESULT CAdLayer::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "LAYER {\n");
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
 +	buffer->putTextIndent(indent + 2, "MAIN=%s\n", _main ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "WIDTH=%d\n", _width);
 +	buffer->putTextIndent(indent + 2, "HEIGHT=%d\n", _height);
 +	buffer->putTextIndent(indent + 2, "ACTIVE=%s\n", _active ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
  	if (_closeUp)
 -		Buffer->putTextIndent(Indent + 2, "CLOSE_UP=%s\n", _closeUp ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "CLOSE_UP=%s\n", _closeUp ? "TRUE" : "FALSE");
  	int i;
  	for (i = 0; i < _scripts.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
 +		buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
  	}
 -	if (_scProp) _scProp->saveAsText(Buffer, Indent + 2);
 +	if (_scProp) _scProp->saveAsText(buffer, indent + 2);
  	for (i = 0; i < _nodes.GetSize(); i++) {
  		switch (_nodes[i]->_type) {
  		case OBJECT_ENTITY:
 -			_nodes[i]->_entity->saveAsText(Buffer, Indent + 2);
 +			_nodes[i]->_entity->saveAsText(buffer, indent + 2);
  			break;
  		case OBJECT_REGION:
 -			_nodes[i]->_region->saveAsText(Buffer, Indent + 2);
 +			_nodes[i]->_region->saveAsText(buffer, indent + 2);
  			break;
  		default:
  			error("CAdLayer::SaveAsText - Unhandled enum");
 @@ -512,9 +511,9 @@ HRESULT CAdLayer::saveAsText(CBDynBuffer *Buffer, int Indent) {  		}
  	}
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n\n");
 +	buffer->putTextIndent(indent, "}\n\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/Ad/AdLayer.h b/engines/wintermute/Ad/AdLayer.h index 0b8aa3958d..1090d253e1 100644 --- a/engines/wintermute/Ad/AdLayer.h +++ b/engines/wintermute/Ad/AdLayer.h @@ -43,8 +43,8 @@ public:  	virtual ~CAdLayer();
  	CBArray<CAdSceneNode *, CAdSceneNode *> _nodes;
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	// scripting interface
  	virtual CScValue *scGetProperty(const char *name);
 diff --git a/engines/wintermute/Ad/AdNodeState.cpp b/engines/wintermute/Ad/AdNodeState.cpp index 87f4e7d72f..266adc9378 100644 --- a/engines/wintermute/Ad/AdNodeState.cpp +++ b/engines/wintermute/Ad/AdNodeState.cpp @@ -84,7 +84,7 @@ void CAdNodeState::setFilename(const char *filename) {  //////////////////////////////////////////////////////////////////////////
 -void CAdNodeState::SetCursor(const char *filename) {
 +void CAdNodeState::setCursor(const char *filename) {
  	delete[] _cursor;
  	_cursor = NULL;
  	CBUtils::setString(&_cursor, filename);
 @@ -107,60 +107,60 @@ HRESULT CAdNodeState::persist(CBPersistMgr *persistMgr) {  //////////////////////////////////////////////////////////////////////////
 -void CAdNodeState::setCaption(const char *Caption, int Case) {
 -	if (Case == 0) Case = 1;
 -	if (Case < 1 || Case > 7) return;
 -
 -	delete[] _caption[Case - 1];
 -	_caption[Case - 1] = new char[strlen(Caption) + 1];
 -	if (_caption[Case - 1]) {
 -		strcpy(_caption[Case - 1], Caption);
 -		Game->_stringTable->Expand(&_caption[Case - 1]);
 +void CAdNodeState::setCaption(const char *caption, int caseVal) {
 +	if (caseVal== 0) caseVal= 1;
 +	if (caseVal< 1 || caseVal> 7) return;
 +
 +	delete[] _caption[caseVal- 1];
 +	_caption[caseVal- 1] = new char[strlen(caption) + 1];
 +	if (_caption[caseVal- 1]) {
 +		strcpy(_caption[caseVal- 1], caption);
 +		Game->_stringTable->Expand(&_caption[caseVal- 1]);
  	}
  }
  //////////////////////////////////////////////////////////////////////////
 -char *CAdNodeState::getCaption(int Case) {
 -	if (Case == 0) Case = 1;
 -	if (Case < 1 || Case > 7 || _caption[Case - 1] == NULL) return "";
 -	else return _caption[Case - 1];
 +char *CAdNodeState::getCaption(int caseVal) {
 +	if (caseVal== 0) caseVal= 1;
 +	if (caseVal< 1 || caseVal> 7 || _caption[caseVal- 1] == NULL) return "";
 +	else return _caption[caseVal- 1];
  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdNodeState::TransferEntity(CAdEntity *Entity, bool IncludingSprites, bool Saving) {
 -	if (!Entity) return E_FAIL;
 +HRESULT CAdNodeState::transferEntity(CAdEntity *entity, bool includingSprites, bool saving) {
 +	if (!entity) return E_FAIL;
  	// hack!
 -	if (this->Game != Entity->Game) this->Game = Entity->Game;
 +	if (this->Game != entity->Game) this->Game = entity->Game;
 -	if (Saving) {
 +	if (saving) {
  		for (int i = 0; i < 7; i++) {
 -			if (Entity->_caption[i]) setCaption(Entity->_caption[i], i);
 +			if (entity->_caption[i]) setCaption(entity->_caption[i], i);
  		}
 -		if (!Entity->_region && Entity->_sprite && Entity->_sprite->_filename) {
 -			if (IncludingSprites) setFilename(Entity->_sprite->_filename);
 +		if (!entity->_region && entity->_sprite && entity->_sprite->_filename) {
 +			if (includingSprites) setFilename(entity->_sprite->_filename);
  			else setFilename("");
  		}
 -		if (Entity->_cursor && Entity->_cursor->_filename) SetCursor(Entity->_cursor->_filename);
 -		_alphaColor = Entity->_alphaColor;
 -		_active = Entity->_active;
 +		if (entity->_cursor && entity->_cursor->_filename) setCursor(entity->_cursor->_filename);
 +		_alphaColor = entity->_alphaColor;
 +		_active = entity->_active;
  	} else {
  		for (int i = 0; i < 7; i++) {
 -			if (_caption[i]) Entity->setCaption(_caption[i], i);
 +			if (_caption[i]) entity->setCaption(_caption[i], i);
  		}
 -		if (_filename && !Entity->_region && IncludingSprites && strcmp(_filename, "") != 0) {
 -			if (!Entity->_sprite || !Entity->_sprite->_filename || scumm_stricmp(Entity->_sprite->_filename, _filename) != 0)
 -				Entity->setSprite(_filename);
 +		if (_filename && !entity->_region && includingSprites && strcmp(_filename, "") != 0) {
 +			if (!entity->_sprite || !entity->_sprite->_filename || scumm_stricmp(entity->_sprite->_filename, _filename) != 0)
 +				entity->setSprite(_filename);
  		}
  		if (_cursor) {
 -			if (!Entity->_cursor || !Entity->_cursor->_filename || scumm_stricmp(Entity->_cursor->_filename, _cursor) != 0)
 -				Entity->setCursor(_cursor);
 +			if (!entity->_cursor || !entity->_cursor->_filename || scumm_stricmp(entity->_cursor->_filename, _cursor) != 0)
 +				entity->setCursor(_cursor);
  		}
 -		Entity->_active = _active;
 -		Entity->_alphaColor = _alphaColor;
 +		entity->_active = _active;
 +		entity->_alphaColor = _alphaColor;
  	}
  	return S_OK;
 diff --git a/engines/wintermute/Ad/AdNodeState.h b/engines/wintermute/Ad/AdNodeState.h index 7d9b1c6d90..a5456b3407 100644 --- a/engines/wintermute/Ad/AdNodeState.h +++ b/engines/wintermute/Ad/AdNodeState.h @@ -35,18 +35,18 @@ class CAdEntity;  class CAdNodeState : public CBBase {
  public:
 -	HRESULT TransferEntity(CAdEntity *Entity, bool IncludingSprites, bool Saving);
 +	HRESULT transferEntity(CAdEntity *entity, bool includingSprites, bool saving);
  	void setName(const char *name);
  	void setFilename(const char *filename);
 -	void SetCursor(const char *filename);
 +	void setCursor(const char *filename);
  	DECLARE_PERSISTENT(CAdNodeState, CBBase)
  	CAdNodeState(CBGame *inGame);
  	virtual ~CAdNodeState();
  	char *_name;
  	bool _active;
  	char *_caption[7];
 -	void setCaption(const char *Caption, int Case);
 -	char *getCaption(int Case);
 +	void setCaption(const char *caption, int caseVal);
 +	char *getCaption(int caseVal);
  	uint32 _alphaColor;
  	char *_filename;
  	char *_cursor;
 diff --git a/engines/wintermute/Ad/AdObject.cpp b/engines/wintermute/Ad/AdObject.cpp index 5068bdf5dc..d7d829445b 100644 --- a/engines/wintermute/Ad/AdObject.cpp +++ b/engines/wintermute/Ad/AdObject.cpp @@ -240,10 +240,10 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(name, "ForceTalkAnim") == 0) {
  		stack->correctParams(1);
 -		const char *AnimName = stack->pop()->getString();
 +		const char *animName = stack->pop()->getString();
  		delete[] _forcedTalkAnimName;
 -		_forcedTalkAnimName = new char[strlen(AnimName) + 1];
 -		strcpy(_forcedTalkAnimName, AnimName);
 +		_forcedTalkAnimName = new char[strlen(animName) + 1];
 +		strcpy(_forcedTalkAnimName, animName);
  		_forcedTalkAnimUsed = false;
  		stack->pushBool(true);
  		return S_OK;
 @@ -256,23 +256,23 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th  	else if (strcmp(name, "Talk") == 0 || strcmp(name, "TalkAsync") == 0) {
  		stack->correctParams(5);
 -		const char *Text    = stack->pop()->getString();
 -		CScValue *SoundVal = stack->pop();
 -		int Duration  = stack->pop()->getInt();
 -		CScValue *ValStances = stack->pop();
 +		const char *text    = stack->pop()->getString();
 +		CScValue *soundVal = stack->pop();
 +		int duration  = stack->pop()->getInt();
 +		CScValue *valStances = stack->pop();
 -		const char *Stances = ValStances->isNULL() ? NULL : ValStances->getString();
 +		const char *stances = valStances->isNULL() ? NULL : valStances->getString();
 -		int Align;
 +		int align = 0;
  		CScValue *val = stack->pop();
 -		if (val->isNULL()) Align = TAL_CENTER;
 -		else Align = val->getInt();
 +		if (val->isNULL()) align = TAL_CENTER;
 +		else align = val->getInt();
 -		Align = MIN(MAX(0, Align), NUM_TEXT_ALIGN - 1);
 +		align = MIN(MAX(0, align), NUM_TEXT_ALIGN - 1);
 -		const char *Sound = SoundVal->isNULL() ? NULL : SoundVal->getString();
 +		const char *sound = soundVal->isNULL() ? NULL : soundVal->getString();
 -		talk(Text, Sound, Duration, Stances, (TTextAlign)Align);
 +		talk(text, sound, duration, stances, (TTextAlign)align);
  		if (strcmp(name, "TalkAsync") != 0) script->WaitForExclusive(this);
  		stack->pushNULL();
 @@ -285,38 +285,38 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th  	else if (strcmp(name, "StickToRegion") == 0) {
  		stack->correctParams(1);
 -		CAdLayer *Main = ((CAdGame *)Game)->_scene->_mainLayer;
 -		bool RegFound = false;
 +		CAdLayer *main = ((CAdGame *)Game)->_scene->_mainLayer;
 +		bool regFound = false;
  		int i;
 -		CScValue *Val = stack->pop();
 -		if (Val->isNULL() || !Main) {
 +		CScValue *val = stack->pop();
 +		if (val->isNULL() || !main) {
  			_stickRegion = NULL;
 -			RegFound = true;
 -		} else if (Val->isString()) {
 -			const char *RegionName = Val->getString();
 -			for (i = 0; i < Main->_nodes.GetSize(); i++) {
 -				if (Main->_nodes[i]->_type == OBJECT_REGION && Main->_nodes[i]->_region->_name && scumm_stricmp(Main->_nodes[i]->_region->_name, RegionName) == 0) {
 -					_stickRegion = Main->_nodes[i]->_region;
 -					RegFound = true;
 +			regFound = true;
 +		} else if (val->isString()) {
 +			const char *regionName = val->getString();
 +			for (i = 0; i < main->_nodes.GetSize(); i++) {
 +				if (main->_nodes[i]->_type == OBJECT_REGION && main->_nodes[i]->_region->_name && scumm_stricmp(main->_nodes[i]->_region->_name, regionName) == 0) {
 +					_stickRegion = main->_nodes[i]->_region;
 +					regFound = true;
  					break;
  				}
  			}
 -		} else if (Val->isNative()) {
 -			CBScriptable *Obj = Val->getNative();
 +		} else if (val->isNative()) {
 +			CBScriptable *obj = val->getNative();
 -			for (i = 0; i < Main->_nodes.GetSize(); i++) {
 -				if (Main->_nodes[i]->_type == OBJECT_REGION && Main->_nodes[i]->_region == Obj) {
 -					_stickRegion = Main->_nodes[i]->_region;
 -					RegFound = true;
 +			for (i = 0; i < main->_nodes.GetSize(); i++) {
 +				if (main->_nodes[i]->_type == OBJECT_REGION && main->_nodes[i]->_region == obj) {
 +					_stickRegion = main->_nodes[i]->_region;
 +					regFound = true;
  					break;
  				}
  			}
  		}
 -		if (!RegFound) _stickRegion = NULL;
 -		stack->pushBool(RegFound);
 +		if (!regFound) _stickRegion = NULL;
 +		stack->pushBool(regFound);
  		return S_OK;
  	}
 @@ -325,10 +325,10 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(name, "SetFont") == 0) {
  		stack->correctParams(1);
 -		CScValue *Val = stack->pop();
 +		CScValue *val = stack->pop();
 -		if (Val->isNULL()) SetFont(NULL);
 -		else SetFont(Val->getString());
 +		if (val->isNULL()) SetFont(NULL);
 +		else SetFont(val->getString());
  		stack->pushNULL();
  		return S_OK;
 @@ -357,13 +357,13 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th  		CScValue *val = stack->pop();
  		if (!val->isNULL()) {
 -			const char *ItemName = val->getString();
 +			const char *itemName = val->getString();
  			val = stack->pop();
 -			const char *InsertAfter = val->isNULL() ? NULL : val->getString();
 -			if (FAILED(_inventory->insertItem(ItemName, InsertAfter))) script->RuntimeError("Cannot add item '%s' to inventory", ItemName);
 +			const char *insertAfter = val->isNULL() ? NULL : val->getString();
 +			if (FAILED(_inventory->insertItem(itemName, insertAfter))) script->RuntimeError("Cannot add item '%s' to inventory", itemName);
  			else {
  				// hide associated entities
 -				((CAdGame *)Game)->_scene->handleItemAssociations(ItemName, false);
 +				((CAdGame *)Game)->_scene->handleItemAssociations(itemName, false);
  			}
  		} else script->RuntimeError("TakeItem: item name expected");
 @@ -453,12 +453,12 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(name, "CreateParticleEmitter") == 0) {
  		stack->correctParams(3);
 -		bool FollowParent = stack->pop()->getBool();
 -		int OffsetX = stack->pop()->getInt();
 -		int OffsetY = stack->pop()->getInt();
 +		bool followParent = stack->pop()->getBool();
 +		int offsetX = stack->pop()->getInt();
 +		int offsetY = stack->pop()->getInt();
 -		CPartEmitter *Emitter = createParticleEmitter(FollowParent, OffsetX, OffsetY);
 -		if (Emitter) stack->pushNative(_partEmitter, true);
 +		CPartEmitter *emitter = createParticleEmitter(followParent, offsetX, offsetY);
 +		if (emitter) stack->pushNative(_partEmitter, true);
  		else stack->pushNULL();
  		return S_OK;
 @@ -484,26 +484,26 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th  	else if (strcmp(name, "AddAttachment") == 0) {
  		stack->correctParams(4);
  		const char *filename = stack->pop()->getString();
 -		bool PreDisplay = stack->pop()->getBool(true);
 -		int OffsetX = stack->pop()->getInt();
 -		int OffsetY = stack->pop()->getInt();
 +		bool preDisplay = stack->pop()->getBool(true);
 +		int offsetX = stack->pop()->getInt();
 +		int offsetY = stack->pop()->getInt();
  		HRESULT res;
 -		CAdEntity *Ent = new CAdEntity(Game);
 -		if (FAILED(res = Ent->loadFile(filename))) {
 -			delete Ent;
 -			Ent = NULL;
 +		CAdEntity *ent = new CAdEntity(Game);
 +		if (FAILED(res = ent->loadFile(filename))) {
 +			delete ent;
 +			ent = NULL;
  			script->RuntimeError("AddAttachment() failed loading entity '%s'", filename);
  			stack->pushBool(false);
  		} else {
 -			Game->registerObject(Ent);
 +			Game->registerObject(ent);
 -			Ent->_posX = OffsetX;
 -			Ent->_posY = OffsetY;
 -			Ent->_active = true;
 +			ent->_posX = offsetX;
 +			ent->_posY = offsetY;
 +			ent->_active = true;
 -			if (PreDisplay) _attachmentsPre.Add(Ent);
 -			else _attachmentsPost.Add(Ent);
 +			if (preDisplay) _attachmentsPre.Add(ent);
 +			else _attachmentsPost.Add(ent);
  			stack->pushBool(true);
  		}
 @@ -516,31 +516,31 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(name, "RemoveAttachment") == 0) {
  		stack->correctParams(1);
 -		CScValue *Val = stack->pop();
 -		bool Found = false;
 -		if (Val->isNative()) {
 -			CBScriptable *Obj = Val->getNative();
 +		CScValue *val = stack->pop();
 +		bool found = false;
 +		if (val->isNative()) {
 +			CBScriptable *obj = val->getNative();
  			for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
 -				if (_attachmentsPre[i] == Obj) {
 -					Found = true;
 +				if (_attachmentsPre[i] == obj) {
 +					found = true;
  					Game->unregisterObject(_attachmentsPre[i]);
  					_attachmentsPre.RemoveAt(i);
  					i--;
  				}
  			}
  			for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
 -				if (_attachmentsPost[i] == Obj) {
 -					Found = true;
 +				if (_attachmentsPost[i] == obj) {
 +					found = true;
  					Game->unregisterObject(_attachmentsPost[i]);
  					_attachmentsPost.RemoveAt(i);
  					i--;
  				}
  			}
  		} else {
 -			const char *attachmentName = Val->getString();
 +			const char *attachmentName = val->getString();
  			for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
  				if (_attachmentsPre[i]->_name && scumm_stricmp(_attachmentsPre[i]->_name, attachmentName) == 0) {
 -					Found = true;
 +					found = true;
  					Game->unregisterObject(_attachmentsPre[i]);
  					_attachmentsPre.RemoveAt(i);
  					i--;
 @@ -548,14 +548,14 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th  			}
  			for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
  				if (_attachmentsPost[i]->_name && scumm_stricmp(_attachmentsPost[i]->_name, attachmentName) == 0) {
 -					Found = true;
 +					found = true;
  					Game->unregisterObject(_attachmentsPost[i]);
  					_attachmentsPost.RemoveAt(i);
  					i--;
  				}
  			}
  		}
 -		stack->pushBool(Found);
 +		stack->pushBool(found);
  		return S_OK;
  	}
 @@ -565,39 +565,39 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th  	//////////////////////////////////////////////////////////////////////////
  	else if (strcmp(name, "GetAttachment") == 0) {
  		stack->correctParams(1);
 -		CScValue *Val = stack->pop();
 +		CScValue *val = stack->pop();
 -		CAdObject *Ret = NULL;
 -		if (Val->isInt()) {
 -			int Index = Val->getInt();
 -			int CurrIndex = 0;
 +		CAdObject *ret = NULL;
 +		if (val->isInt()) {
 +			int index = val->getInt();
 +			int currIndex = 0;
  			for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
 -				if (CurrIndex == Index) Ret = _attachmentsPre[i];
 -				CurrIndex++;
 +				if (currIndex == index) ret = _attachmentsPre[i];
 +				currIndex++;
  			}
  			for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
 -				if (CurrIndex == Index) Ret = _attachmentsPost[i];
 -				CurrIndex++;
 +				if (currIndex == index) ret = _attachmentsPost[i];
 +				currIndex++;
  			}
  		} else {
 -			const char *attachmentName = Val->getString();
 +			const char *attachmentName = val->getString();
  			for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
  				if (_attachmentsPre[i]->_name && scumm_stricmp(_attachmentsPre[i]->_name, attachmentName) == 0) {
 -					Ret = _attachmentsPre[i];
 +					ret = _attachmentsPre[i];
  					break;
  				}
  			}
 -			if (!Ret) {
 +			if (!ret) {
  				for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
  					if (_attachmentsPost[i]->_name && scumm_stricmp(_attachmentsPost[i]->_name, attachmentName) == 0) {
 -						Ret = _attachmentsPre[i];
 +						ret = _attachmentsPre[i];
  						break;
  					}
  				}
  			}
  		}
 -		if (Ret != NULL) stack->pushNative(Ret, true);
 +		if (ret != NULL) stack->pushNative(ret, true);
  		else stack->pushNULL();
  		return S_OK;
 @@ -824,7 +824,7 @@ int CAdObject::getHeight() {  //////////////////////////////////////////////////////////////////////////
 -void CAdObject::talk(const char *Text, const char *Sound, uint32 Duration, const char *Stances, TTextAlign Align) {
 +void CAdObject::talk(const char *text, const char *sound, uint32 duration, const char *stances, TTextAlign Align) {
  	if (!_sentence) _sentence = new CAdSentence(Game);
  	if (!_sentence) return;
 @@ -837,10 +837,10 @@ void CAdObject::talk(const char *Text, const char *Sound, uint32 Duration, const  	delete(_sentence->_sound);
  	_sentence->_sound = NULL;
 -	_sentence->setText(Text);
 +	_sentence->setText(text);
  	Game->_stringTable->Expand(&_sentence->_text);
 -	_sentence->setStances(Stances);
 -	_sentence->_duration = Duration;
 +	_sentence->setStances(stances);
 +	_sentence->_duration = duration;
  	_sentence->_align = Align;
  	_sentence->_startTime = Game->_timer;
  	_sentence->_currentStance = -1;
 @@ -848,21 +848,21 @@ void CAdObject::talk(const char *Text, const char *Sound, uint32 Duration, const  	_sentence->_freezable = _freezable;
  	// try to locate speech file automatically
 -	bool DeleteSound = false;
 -	if (!Sound) {
 -		char *Key = Game->_stringTable->GetKey(Text);
 -		if (Key) {
 -			Sound = ((CAdGame *)Game)->findSpeechFile(Key);
 -			delete [] Key;
 -
 -			if (Sound) DeleteSound = true;
 +	bool deleteSound = false;
 +	if (!sound) {
 +		char *key = Game->_stringTable->GetKey(text);
 +		if (key) {
 +			sound = ((CAdGame *)Game)->findSpeechFile(key);
 +			delete [] key;
 +
 +			if (sound) deleteSound = true;
  		}
  	}
  	// load sound and set duration appropriately
 -	if (Sound) {
 +	if (sound) {
  		CBSound *snd = new CBSound(Game);
 -		if (snd && SUCCEEDED(snd->setSound(Sound, SOUND_SPEECH, true))) {
 +		if (snd && SUCCEEDED(snd->setSound(sound, SOUND_SPEECH, true))) {
  			_sentence->setSound(snd);
  			if (_sentence->_duration <= 0) {
  				uint32 Length = snd->getLength();
 @@ -927,11 +927,11 @@ void CAdObject::talk(const char *Text, const char *Sound, uint32 Duration, const  	_sentence->_fixedPos = !_subtitlesModRelative;
 -	_sentence->setupTalkFile(Sound);
 +	_sentence->setupTalkFile(sound);
  	_state = STATE_TALKING;
 -	if (DeleteSound) delete [] Sound;
 +	if (deleteSound) delete [] sound;
  }
 @@ -1016,20 +1016,20 @@ HRESULT CAdObject::resetSoundPan() {  //////////////////////////////////////////////////////////////////////////
 -bool CAdObject::getExtendedFlag(const char *FlagName) {
 -	if (!FlagName) return false;
 -	else if (strcmp(FlagName, "usable") == 0) return true;
 +bool CAdObject::getExtendedFlag(const char *flagName) {
 +	if (!flagName) return false;
 +	else if (strcmp(flagName, "usable") == 0) return true;
 -	else return CBObject::getExtendedFlag(FlagName);
 +	else return CBObject::getExtendedFlag(flagName);
  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdObject::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	if (_blockRegion) _blockRegion->saveAsText(Buffer, Indent + 2, "BLOCKED_REGION");
 -	if (_wptGroup) _wptGroup->saveAsText(Buffer, Indent + 2);
 +HRESULT CAdObject::saveAsText(CBDynBuffer *buffer, int indent) {
 +	if (_blockRegion) _blockRegion->saveAsText(buffer, indent + 2, "BLOCKED_REGION");
 +	if (_wptGroup) _wptGroup->saveAsText(buffer, indent + 2);
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
  	return S_OK;
  }
 @@ -1037,13 +1037,13 @@ HRESULT CAdObject::saveAsText(CBDynBuffer *Buffer, int Indent) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdObject::updateBlockRegion() {
 -	CAdGame *AdGame = (CAdGame *)Game;
 -	if (AdGame->_scene) {
 +	CAdGame *adGame = (CAdGame *)Game;
 +	if (adGame->_scene) {
  		if (_blockRegion && _currentBlockRegion)
 -			_currentBlockRegion->Mimic(_blockRegion, _zoomable ? AdGame->_scene->getScaleAt(_posY) : 100.0f, _posX, _posY);
 +			_currentBlockRegion->Mimic(_blockRegion, _zoomable ? adGame->_scene->getScaleAt(_posY) : 100.0f, _posX, _posY);
  		if (_wptGroup && _currentWptGroup)
 -			_currentWptGroup->Mimic(_wptGroup, _zoomable ? AdGame->_scene->getScaleAt(_posY) : 100.0f, _posX, _posY);
 +			_currentWptGroup->Mimic(_wptGroup, _zoomable ? adGame->_scene->getScaleAt(_posY) : 100.0f, _posX, _posY);
  	}
  	return S_OK;
  }
 @@ -1060,27 +1060,27 @@ CAdInventory *CAdObject::getInventory() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdObject::afterMove() {
 -	CAdRegion *NewRegions[MAX_NUM_REGIONS];
 +	CAdRegion *newRegions[MAX_NUM_REGIONS];
 -	((CAdGame *)Game)->_scene->getRegionsAt(_posX, _posY, NewRegions, MAX_NUM_REGIONS);
 +	((CAdGame *)Game)->_scene->getRegionsAt(_posX, _posY, newRegions, MAX_NUM_REGIONS);
  	for (int i = 0; i < MAX_NUM_REGIONS; i++) {
 -		if (!NewRegions[i]) break;
 -		bool RegFound = false;
 +		if (!newRegions[i]) break;
 +		bool regFound = false;
  		for (int j = 0; j < MAX_NUM_REGIONS; j++) {
 -			if (_currentRegions[j] == NewRegions[i]) {
 +			if (_currentRegions[j] == newRegions[i]) {
  				_currentRegions[j] = NULL;
 -				RegFound = true;
 +				regFound = true;
  				break;
  			}
  		}
 -		if (!RegFound) NewRegions[i]->applyEvent("ActorEntry");
 +		if (!regFound) newRegions[i]->applyEvent("ActorEntry");
  	}
  	for (int i = 0; i < MAX_NUM_REGIONS; i++) {
  		if (_currentRegions[i] && Game->validObject(_currentRegions[i])) {
  			_currentRegions[i]->applyEvent("ActorLeave");
  		}
 -		_currentRegions[i] = NewRegions[i];
 +		_currentRegions[i] = newRegions[i];
  	}
  	return S_OK;
 @@ -1094,15 +1094,15 @@ HRESULT CAdObject::invalidateCurrRegions() {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdObject::GetScale(float *ScaleX, float *ScaleY) {
 +HRESULT CAdObject::getScale(float *scaleX, float *scaleY) {
  	if (_zoomable) {
  		if (_scaleX >= 0 || _scaleY >= 0) {
 -			*ScaleX = _scaleX < 0 ? 100 : _scaleX;
 -			*ScaleY = _scaleY < 0 ? 100 : _scaleY;
 -		} else if (_scale >= 0) *ScaleX = *ScaleY = _scale;
 -		else *ScaleX = *ScaleY = ((CAdGame *)Game)->_scene->getZoomAt(_posX, _posY) + _relativeScale;
 +			*scaleX = _scaleX < 0 ? 100 : _scaleX;
 +			*scaleY = _scaleY < 0 ? 100 : _scaleY;
 +		} else if (_scale >= 0) *scaleX = *scaleY = _scale;
 +		else *scaleX = *scaleY = ((CAdGame *)Game)->_scene->getZoomAt(_posX, _posY) + _relativeScale;
  	} else {
 -		*ScaleX = *ScaleY = 100;
 +		*scaleX = *scaleY = 100;
  	}
  	return S_OK;
  }
 @@ -1119,8 +1119,8 @@ HRESULT CAdObject::updateSpriteAttachments() {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdObject::displaySpriteAttachments(bool PreDisplay) {
 -	if (PreDisplay) {
 +HRESULT CAdObject::displaySpriteAttachments(bool preDisplay) {
 +	if (preDisplay) {
  		for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
  			displaySpriteAttachment(_attachmentsPre[i]);
  		}
 @@ -1133,48 +1133,48 @@ HRESULT CAdObject::displaySpriteAttachments(bool PreDisplay) {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdObject::displaySpriteAttachment(CAdObject *Attachment) {
 -	if (!Attachment->_active) return S_OK;
 +HRESULT CAdObject::displaySpriteAttachment(CAdObject *attachment) {
 +	if (!attachment->_active) return S_OK;
 -	float ScaleX, ScaleY;
 -	GetScale(&ScaleX, &ScaleY);
 +	float scaleX, scaleY;
 +	getScale(&scaleX, &scaleY);
 -	int OrigX = Attachment->_posX;
 -	int OrigY = Attachment->_posY;
 +	int origX = attachment->_posX;
 +	int origY = attachment->_posY;
  	// inherit position from owner
 -	Attachment->_posX = (int)(this->_posX + Attachment->_posX * ScaleX / 100.0f);
 -	Attachment->_posY = (int)(this->_posY + Attachment->_posY * ScaleY / 100.0f);
 +	attachment->_posX = (int)(this->_posX + attachment->_posX * scaleX / 100.0f);
 +	attachment->_posY = (int)(this->_posY + attachment->_posY * scaleY / 100.0f);
  	// inherit other props
 -	Attachment->_alphaColor = this->_alphaColor;
 -	Attachment->_blendMode = this->_blendMode;
 +	attachment->_alphaColor = this->_alphaColor;
 +	attachment->_blendMode = this->_blendMode;
 -	Attachment->_scale = this->_scale;
 -	Attachment->_relativeScale = this->_relativeScale;
 -	Attachment->_scaleX = this->_scaleX;
 -	Attachment->_scaleY = this->_scaleY;
 +	attachment->_scale = this->_scale;
 +	attachment->_relativeScale = this->_relativeScale;
 +	attachment->_scaleX = this->_scaleX;
 +	attachment->_scaleY = this->_scaleY;
 -	Attachment->_rotate = this->_rotate;
 -	Attachment->_relativeRotate = this->_relativeRotate;
 -	Attachment->_rotateValid = this->_rotateValid;
 +	attachment->_rotate = this->_rotate;
 +	attachment->_relativeRotate = this->_relativeRotate;
 +	attachment->_rotateValid = this->_rotateValid;
 -	Attachment->_registerAlias = this;
 -	Attachment->_registrable = this->_registrable;
 +	attachment->_registerAlias = this;
 +	attachment->_registrable = this->_registrable;
 -	HRESULT ret = Attachment->display();
 +	HRESULT ret = attachment->display();
 -	Attachment->_posX = OrigX;
 -	Attachment->_posY = OrigY;
 +	attachment->_posX = origX;
 +	attachment->_posY = origY;
  	return ret;
  }
  //////////////////////////////////////////////////////////////////////////
 -CPartEmitter *CAdObject::createParticleEmitter(bool FollowParent, int OffsetX, int OffsetY) {
 -	_partFollowParent = FollowParent;
 -	_partOffsetX = OffsetX;
 -	_partOffsetY = OffsetY;
 +CPartEmitter *CAdObject::createParticleEmitter(bool followParent, int offsetX, int offsetY) {
 +	_partFollowParent = followParent;
 +	_partOffsetX = offsetX;
 +	_partOffsetY = offsetY;
  	if (!_partEmitter) {
  		_partEmitter = new CPartEmitter(Game, this);
 @@ -1191,11 +1191,11 @@ HRESULT CAdObject::updatePartEmitter() {  	if (!_partEmitter) return E_FAIL;
  	if (_partFollowParent) {
 -		float ScaleX, ScaleY;
 -		GetScale(&ScaleX, &ScaleY);
 +		float scaleX, scaleY;
 +		getScale(&scaleX, &scaleY);
 -		_partEmitter->_posX = (int)(_posX + (ScaleX / 100.0f) * _partOffsetX);
 -		_partEmitter->_posY = (int)(_posY + (ScaleY / 100.0f) * _partOffsetY);
 +		_partEmitter->_posX = (int)(_posX + (scaleX / 100.0f) * _partOffsetX);
 +		_partEmitter->_posY = (int)(_posY + (scaleY / 100.0f) * _partOffsetY);
  	}
  	return _partEmitter->update();
  }
 diff --git a/engines/wintermute/Ad/AdObject.h b/engines/wintermute/Ad/AdObject.h index 05548c6dbd..def28eff1d 100644 --- a/engines/wintermute/Ad/AdObject.h +++ b/engines/wintermute/Ad/AdObject.h @@ -111,11 +111,11 @@ public:  	HRESULT displaySpriteAttachments(bool preDisplay);
  	CAdObject *_registerAlias;
  private:
 -	HRESULT displaySpriteAttachment(CAdObject *Attachment);
 +	HRESULT displaySpriteAttachment(CAdObject *attachment);
  	CAdInventory *_inventory;
  protected:
 -	HRESULT GetScale(float *ScaleX, float *ScaleY);
 +	HRESULT getScale(float *scaleX, float *scaleY);
  };
  } // end of namespace WinterMute
 diff --git a/engines/wintermute/Ad/AdPath.cpp b/engines/wintermute/Ad/AdPath.cpp index 620ea5c38c..ca7adf0461 100644 --- a/engines/wintermute/Ad/AdPath.cpp +++ b/engines/wintermute/Ad/AdPath.cpp @@ -43,12 +43,12 @@ CAdPath::CAdPath(CBGame *inGame): CBBase(inGame) {  //////////////////////////////////////////////////////////////////////////
  CAdPath::~CAdPath() {
 -	Reset();
 +	reset();
  }
  //////////////////////////////////////////////////////////////////////////
 -void CAdPath::Reset() {
 +void CAdPath::reset() {
  	for (int i = 0; i < _points.GetSize(); i++)
  		delete _points[i];
 @@ -59,7 +59,7 @@ void CAdPath::Reset() {  //////////////////////////////////////////////////////////////////////////
 -CBPoint *CAdPath::GetFirst() {
 +CBPoint *CAdPath::getFirst() {
  	if (_points.GetSize() > 0) {
  		_currIndex = 0;
  		return _points[_currIndex];
 @@ -68,7 +68,7 @@ CBPoint *CAdPath::GetFirst() {  //////////////////////////////////////////////////////////////////////////
 -CBPoint *CAdPath::GetNext() {
 +CBPoint *CAdPath::getNext() {
  	_currIndex++;
  	if (_currIndex < _points.GetSize()) return _points[_currIndex];
  	else return NULL;
 @@ -76,20 +76,20 @@ CBPoint *CAdPath::GetNext() {  //////////////////////////////////////////////////////////////////////////
 -CBPoint *CAdPath::GetCurrent() {
 +CBPoint *CAdPath::getCurrent() {
  	if (_currIndex >= 0 && _currIndex < _points.GetSize()) return _points[_currIndex];
  	else return NULL;
  }
  //////////////////////////////////////////////////////////////////////////
 -void CAdPath::AddPoint(CBPoint *point) {
 +void CAdPath::addPoint(CBPoint *point) {
  	_points.Add(point);
  }
  //////////////////////////////////////////////////////////////////////////
 -bool CAdPath::SetReady(bool ready) {
 +bool CAdPath::setReady(bool ready) {
  	bool orig = _ready;
  	_ready = ready;
 diff --git a/engines/wintermute/Ad/AdPath.h b/engines/wintermute/Ad/AdPath.h index dbc769117a..2e150175f3 100644 --- a/engines/wintermute/Ad/AdPath.h +++ b/engines/wintermute/Ad/AdPath.h @@ -38,12 +38,12 @@ class CBPoint;  class CAdPath : public CBBase {
  public:
  	DECLARE_PERSISTENT(CAdPath, CBBase)
 -	CBPoint *GetCurrent();
 -	bool SetReady(bool ready = true);
 -	void AddPoint(CBPoint *point);
 -	CBPoint *GetNext();
 -	CBPoint *GetFirst();
 -	void Reset();
 +	CBPoint *getCurrent();
 +	bool setReady(bool ready = true);
 +	void addPoint(CBPoint *point);
 +	CBPoint *getNext();
 +	CBPoint *getFirst();
 +	void reset();
  	CAdPath(CBGame *inGame);
  	virtual ~CAdPath();
  	CBArray <CBPoint *, CBPoint *> _points;
 diff --git a/engines/wintermute/Ad/AdRegion.cpp b/engines/wintermute/Ad/AdRegion.cpp index 5f57a0d967..7e681ada72 100644 --- a/engines/wintermute/Ad/AdRegion.cpp +++ b/engines/wintermute/Ad/AdRegion.cpp @@ -55,8 +55,8 @@ CAdRegion::~CAdRegion() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdRegion::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdRegion::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -66,10 +66,10 @@ HRESULT CAdRegion::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -95,7 +95,7 @@ TOKEN_DEF(PROPERTY)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdRegion::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CAdRegion::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(REGION)
  	TOKEN_TABLE(TEMPLATE)
 @@ -120,12 +120,12 @@ HRESULT CAdRegion::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_REGION) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_REGION) {
  			Game->LOG(0, "'REGION' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
  	for (int i = 0; i < _points.GetSize(); i++) delete _points[i];
 @@ -133,7 +133,7 @@ HRESULT CAdRegion::loadBuffer(byte  *Buffer, bool Complete) {  	int ar = 255, ag = 255, ab = 255, alpha = 255;
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -346,32 +346,32 @@ const char *CAdRegion::scToString() {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdRegion::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "REGION {\n");
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
 -	Buffer->putTextIndent(Indent + 2, "BLOCKED=%s\n", _blocked ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "DECORATION=%s\n", _decoration ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "ACTIVE=%s\n", _active ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "SCALE=%d\n", (int)_zoom);
 -	Buffer->putTextIndent(Indent + 2, "ALPHA_COLOR { %d,%d,%d }\n", D3DCOLGetR(_alpha), D3DCOLGetG(_alpha), D3DCOLGetB(_alpha));
 -	Buffer->putTextIndent(Indent + 2, "ALPHA = %d\n", D3DCOLGetA(_alpha));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
 +HRESULT CAdRegion::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "REGION {\n");
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
 +	buffer->putTextIndent(indent + 2, "BLOCKED=%s\n", _blocked ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "DECORATION=%s\n", _decoration ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "ACTIVE=%s\n", _active ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "SCALE=%d\n", (int)_zoom);
 +	buffer->putTextIndent(indent + 2, "ALPHA_COLOR { %d,%d,%d }\n", D3DCOLGetR(_alpha), D3DCOLGetG(_alpha), D3DCOLGetB(_alpha));
 +	buffer->putTextIndent(indent + 2, "ALPHA = %d\n", D3DCOLGetA(_alpha));
 +	buffer->putTextIndent(indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
  	int i;
  	for (i = 0; i < _scripts.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
 +		buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
  	}
 -	if (_scProp) _scProp->saveAsText(Buffer, Indent + 2);
 +	if (_scProp) _scProp->saveAsText(buffer, indent + 2);
  	for (i = 0; i < _points.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "POINT {%d,%d}\n", _points[i]->x, _points[i]->y);
 +		buffer->putTextIndent(indent + 2, "POINT {%d,%d}\n", _points[i]->x, _points[i]->y);
  	}
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n\n");
 +	buffer->putTextIndent(indent, "}\n\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/Ad/AdRegion.h b/engines/wintermute/Ad/AdRegion.h index 9a9d0e1055..0e5700828a 100644 --- a/engines/wintermute/Ad/AdRegion.h +++ b/engines/wintermute/Ad/AdRegion.h @@ -43,8 +43,8 @@ public:  	CAdRegion(CBGame *inGame);
  	virtual ~CAdRegion();
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	// scripting interface
  	virtual CScValue *scGetProperty(const char *name);
 diff --git a/engines/wintermute/Ad/AdResponse.cpp b/engines/wintermute/Ad/AdResponse.cpp index e8923f2179..7c6a768c21 100644 --- a/engines/wintermute/Ad/AdResponse.cpp +++ b/engines/wintermute/Ad/AdResponse.cpp @@ -65,18 +65,18 @@ CAdResponse::~CAdResponse() {  //////////////////////////////////////////////////////////////////////////
 -void CAdResponse::SetText(const char *Text) {
 -	CBUtils::setString(&_text, Text);
 -	CBUtils::setString(&_textOrig, Text);
 +void CAdResponse::setText(const char *text) {
 +	CBUtils::setString(&_text, text);
 +	CBUtils::setString(&_textOrig, text);
  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdResponse::SetIcon(const char *filename) {
 +HRESULT CAdResponse::setIcon(const char *filename) {
  	delete _icon;
  	_icon = new CBSprite(Game);
  	if (!_icon || FAILED(_icon->loadFile(filename))) {
 -		Game->LOG(0, "CAdResponse::SetIcon failed for file '%s'", filename);
 +		Game->LOG(0, "CAdResponse::setIcon failed for file '%s'", filename);
  		delete _icon;
  		_icon = NULL;
  		return E_FAIL;
 @@ -85,22 +85,22 @@ HRESULT CAdResponse::SetIcon(const char *filename) {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdResponse::SetFont(const char *filename) {
 +HRESULT CAdResponse::setFont(const char *filename) {
  	if (_font) Game->_fontStorage->RemoveFont(_font);
  	_font = Game->_fontStorage->AddFont(filename);
  	if (!_font) {
 -		Game->LOG(0, "CAdResponse::SetFont failed for file '%s'", filename);
 +		Game->LOG(0, "CAdResponse::setFont failed for file '%s'", filename);
  		return E_FAIL;
  	}
  	return S_OK;
  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdResponse::SetIconHover(const char *filename) {
 +HRESULT CAdResponse::setIconHover(const char *filename) {
  	delete _iconHover;
  	_iconHover = new CBSprite(Game);
  	if (!_iconHover || FAILED(_iconHover->loadFile(filename))) {
 -		Game->LOG(0, "CAdResponse::SetIconHover failed for file '%s'", filename);
 +		Game->LOG(0, "CAdResponse::setIconHover failed for file '%s'", filename);
  		delete _iconHover;
  		_iconHover = NULL;
  		return E_FAIL;
 @@ -110,11 +110,11 @@ HRESULT CAdResponse::SetIconHover(const char *filename) {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdResponse::SetIconPressed(const char *filename) {
 +HRESULT CAdResponse::setIconPressed(const char *filename) {
  	delete _iconPressed;
  	_iconPressed = new CBSprite(Game);
  	if (!_iconPressed || FAILED(_iconPressed->loadFile(filename))) {
 -		Game->LOG(0, "CAdResponse::SetIconPressed failed for file '%s'", filename);
 +		Game->LOG(0, "CAdResponse::setIconPressed failed for file '%s'", filename);
  		delete _iconPressed;
  		_iconPressed = NULL;
  		return E_FAIL;
 diff --git a/engines/wintermute/Ad/AdResponse.h b/engines/wintermute/Ad/AdResponse.h index 84ec6a086a..8774267a97 100644 --- a/engines/wintermute/Ad/AdResponse.h +++ b/engines/wintermute/Ad/AdResponse.h @@ -38,11 +38,11 @@ class CBFont;  class CAdResponse : public CBObject {
  public:
  	DECLARE_PERSISTENT(CAdResponse, CBObject)
 -	HRESULT SetIcon(const char *filename);
 -	HRESULT SetFont(const char *filename);
 -	HRESULT SetIconHover(const char *filename);
 -	HRESULT SetIconPressed(const char *filename);
 -	void SetText(const char *Text);
 +	HRESULT setIcon(const char *filename);
 +	HRESULT setFont(const char *filename);
 +	HRESULT setIconHover(const char *filename);
 +	HRESULT setIconPressed(const char *filename);
 +	void setText(const char *text);
  	int _iD;
  	CBSprite *_icon;
  	CBSprite *_iconHover;
 diff --git a/engines/wintermute/Ad/AdResponseBox.cpp b/engines/wintermute/Ad/AdResponseBox.cpp index 80ab26392c..9f498b49a5 100644 --- a/engines/wintermute/Ad/AdResponseBox.cpp +++ b/engines/wintermute/Ad/AdResponseBox.cpp @@ -188,8 +188,8 @@ HRESULT CAdResponseBox::createButtons() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdResponseBox::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdResponseBox::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -199,10 +199,10 @@ HRESULT CAdResponseBox::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing RESPONSE_BOX file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing RESPONSE_BOX file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -223,7 +223,7 @@ TOKEN_DEF(VERTICAL_ALIGN)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdResponseBox::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CAdResponseBox::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(RESPONSE_BOX)
  	TOKEN_TABLE(TEMPLATE)
 @@ -244,15 +244,15 @@ HRESULT CAdResponseBox::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_RESPONSE_BOX) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_RESPONSE_BOX) {
  			Game->LOG(0, "'RESPONSE_BOX' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -335,31 +335,31 @@ HRESULT CAdResponseBox::loadBuffer(byte  *Buffer, bool Complete) {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdResponseBox::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "RESPONSE_BOX\n");
 -	Buffer->putTextIndent(Indent, "{\n");
 +HRESULT CAdResponseBox::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "RESPONSE_BOX\n");
 +	buffer->putTextIndent(indent, "{\n");
 -	Buffer->putTextIndent(Indent + 2, "AREA { %d, %d, %d, %d }\n", _responseArea.left, _responseArea.top, _responseArea.right, _responseArea.bottom);
 +	buffer->putTextIndent(indent + 2, "AREA { %d, %d, %d, %d }\n", _responseArea.left, _responseArea.top, _responseArea.right, _responseArea.bottom);
  	if (_font && _font->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT=\"%s\"\n", _font->_filename);
  	if (_fontHover && _fontHover->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT_HOVER=\"%s\"\n", _fontHover->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT_HOVER=\"%s\"\n", _fontHover->_filename);
  	if (_cursor && _cursor->_filename)
 -		Buffer->putTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
 +		buffer->putTextIndent(indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
 -	Buffer->putTextIndent(Indent + 2, "HORIZONTAL=%s\n", _horizontal ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "HORIZONTAL=%s\n", _horizontal ? "TRUE" : "FALSE");
  	switch (_align) {
  	case TAL_LEFT:
 -		Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
 +		buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
  		break;
  	case TAL_RIGHT:
 -		Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "right");
 +		buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "right");
  		break;
  	case TAL_CENTER:
 -		Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "center");
 +		buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "center");
  		break;
  	default:
  		error("CAdResponseBox::SaveAsText - Unhandled enum");
 @@ -368,29 +368,29 @@ HRESULT CAdResponseBox::saveAsText(CBDynBuffer *Buffer, int Indent) {  	switch (_verticalAlign) {
  	case VAL_TOP:
 -		Buffer->putTextIndent(Indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "top");
 +		buffer->putTextIndent(indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "top");
  		break;
  	case VAL_BOTTOM:
 -		Buffer->putTextIndent(Indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "bottom");
 +		buffer->putTextIndent(indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "bottom");
  		break;
  	case VAL_CENTER:
 -		Buffer->putTextIndent(Indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "center");
 +		buffer->putTextIndent(indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "center");
  		break;
  	}
 -	Buffer->putTextIndent(Indent + 2, "SPACING=%d\n", _spacing);
 +	buffer->putTextIndent(indent + 2, "SPACING=%d\n", _spacing);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// window
 -	if (_window) _window->saveAsText(Buffer, Indent + 2);
 +	if (_window) _window->saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// editor properties
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n");
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 @@ -432,12 +432,12 @@ HRESULT CAdResponseBox::display() {  	}
  	// prepare response buttons
 -	bool scroll_needed = false;
 +	bool scrollNeeded = false;
  	for (i = _scrollOffset; i < _respButtons.GetSize(); i++) {
  		if ((_horizontal && xxx + _respButtons[i]->_width > rect.right)
  		        || (!_horizontal && yyy + _respButtons[i]->_height > rect.bottom)) {
 -			scroll_needed = true;
 +			scrollNeeded = true;
  			_respButtons[i]->_visible = false;
  			break;
  		}
 @@ -456,7 +456,7 @@ HRESULT CAdResponseBox::display() {  	// show appropriate scroll buttons
  	if (_window) {
  		_window->showWidget("prev", _scrollOffset > 0);
 -		_window->showWidget("next", scroll_needed);
 +		_window->showWidget("next", scrollNeeded);
  	}
  	// go exclusive
 @@ -537,12 +537,12 @@ HRESULT CAdResponseBox::persist(CBPersistMgr *persistMgr) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdResponseBox::weedResponses() {
 -	CAdGame *AdGame = (CAdGame *)Game;
 +	CAdGame *adGame = (CAdGame *)Game;
  	for (int i = 0; i < _responses.GetSize(); i++) {
  		switch (_responses[i]->_responseType) {
  		case RESPONSE_ONCE:
 -			if (AdGame->branchResponseUsed(_responses[i]->_iD)) {
 +			if (adGame->branchResponseUsed(_responses[i]->_iD)) {
  				delete _responses[i];
  				_responses.RemoveAt(i);
  				i--;
 @@ -550,7 +550,7 @@ HRESULT CAdResponseBox::weedResponses() {  			break;
  		case RESPONSE_ONCE_GAME:
 -			if (AdGame->gameResponseUsed(_responses[i]->_iD)) {
 +			if (adGame->gameResponseUsed(_responses[i]->_iD)) {
  				delete _responses[i];
  				_responses.RemoveAt(i);
  				i--;
 @@ -566,25 +566,25 @@ HRESULT CAdResponseBox::weedResponses() {  //////////////////////////////////////////////////////////////////////////
 -void CAdResponseBox::setLastResponseText(const char *Text, const char *TextOrig) {
 -	CBUtils::setString(&_lastResponseText, Text);
 -	CBUtils::setString(&_lastResponseTextOrig, TextOrig);
 +void CAdResponseBox::setLastResponseText(const char *text, const char *textOrig) {
 +	CBUtils::setString(&_lastResponseText, text);
 +	CBUtils::setString(&_lastResponseTextOrig, textOrig);
  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdResponseBox::handleResponse(CAdResponse *Response) {
 -	setLastResponseText(Response->_text, Response->_textOrig);
 +HRESULT CAdResponseBox::handleResponse(CAdResponse *response) {
 +	setLastResponseText(response->_text, response->_textOrig);
 -	CAdGame *AdGame = (CAdGame *)Game;
 +	CAdGame *adGame = (CAdGame *)Game;
 -	switch (Response->_responseType) {
 +	switch (response->_responseType) {
  	case RESPONSE_ONCE:
 -		AdGame->addBranchResponse(Response->_iD);
 +		adGame->addBranchResponse(response->_iD);
  		break;
  	case RESPONSE_ONCE_GAME:
 -		AdGame->addGameResponse(Response->_iD);
 +		adGame->addGameResponse(response->_iD);
  		break;
  	default:
  		warning("CAdResponseBox::HandleResponse - Unhandled enum");
 @@ -595,51 +595,51 @@ HRESULT CAdResponseBox::handleResponse(CAdResponse *Response) {  //////////////////////////////////////////////////////////////////////////
 -CBObject *CAdResponseBox::getNextAccessObject(CBObject *CurrObject) {
 -	CBArray<CUIObject *, CUIObject *> Objects;
 -	getObjects(Objects, true);
 +CBObject *CAdResponseBox::getNextAccessObject(CBObject *currObject) {
 +	CBArray<CUIObject *, CUIObject *> objects;
 +	getObjects(objects, true);
 -	if (Objects.GetSize() == 0) return NULL;
 +	if (objects.GetSize() == 0) return NULL;
  	else {
 -		if (CurrObject != NULL) {
 -			for (int i = 0; i < Objects.GetSize(); i++) {
 -				if (Objects[i] == CurrObject) {
 -					if (i < Objects.GetSize() - 1) return Objects[i + 1];
 +		if (currObject != NULL) {
 +			for (int i = 0; i < objects.GetSize(); i++) {
 +				if (objects[i] == currObject) {
 +					if (i < objects.GetSize() - 1) return objects[i + 1];
  					else break;
  				}
  			}
  		}
 -		return Objects[0];
 +		return objects[0];
  	}
  	return NULL;
  }
  //////////////////////////////////////////////////////////////////////////
 -CBObject *CAdResponseBox::getPrevAccessObject(CBObject *CurrObject) {
 -	CBArray<CUIObject *, CUIObject *> Objects;
 -	getObjects(Objects, true);
 +CBObject *CAdResponseBox::getPrevAccessObject(CBObject *currObject) {
 +	CBArray<CUIObject *, CUIObject *> objects;
 +	getObjects(objects, true);
 -	if (Objects.GetSize() == 0) return NULL;
 +	if (objects.GetSize() == 0) return NULL;
  	else {
 -		if (CurrObject != NULL) {
 -			for (int i = Objects.GetSize() - 1; i >= 0; i--) {
 -				if (Objects[i] == CurrObject) {
 -					if (i > 0) return Objects[i - 1];
 +		if (currObject != NULL) {
 +			for (int i = objects.GetSize() - 1; i >= 0; i--) {
 +				if (objects[i] == currObject) {
 +					if (i > 0) return objects[i - 1];
  					else break;
  				}
  			}
  		}
 -		return Objects[Objects.GetSize() - 1];
 +		return objects[objects.GetSize() - 1];
  	}
  	return NULL;
  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdResponseBox::getObjects(CBArray<CUIObject *, CUIObject *> &Objects, bool InteractiveOnly) {
 +HRESULT CAdResponseBox::getObjects(CBArray<CUIObject *, CUIObject *> &objects, bool interactiveOnly) {
  	for (int i = 0; i < _respButtons.GetSize(); i++) {
 -		Objects.Add(_respButtons[i]);
 +		objects.Add(_respButtons[i]);
  	}
 -	if (_window) _window->getWindowObjects(Objects, InteractiveOnly);
 +	if (_window) _window->getWindowObjects(objects, interactiveOnly);
  	return S_OK;
  }
 diff --git a/engines/wintermute/Ad/AdResponseBox.h b/engines/wintermute/Ad/AdResponseBox.h index 2fcf7ab7a6..3d8a8bb7a6 100644 --- a/engines/wintermute/Ad/AdResponseBox.h +++ b/engines/wintermute/Ad/AdResponseBox.h @@ -42,17 +42,19 @@ class CAdResponseBox : public CBObject {  public:
  	CBObject *getNextAccessObject(CBObject *CurrObject);
  	CBObject *getPrevAccessObject(CBObject *CurrObject);
 -	HRESULT getObjects(CBArray<CUIObject *, CUIObject *> &Objects, bool InteractiveOnly);
 +	HRESULT getObjects(CBArray<CUIObject *, CUIObject *> &objects, bool interactiveOnly);
 -	HRESULT handleResponse(CAdResponse *Response);
 -	void setLastResponseText(const char *Text, const char *TextOrig);
 +	HRESULT handleResponse(CAdResponse *response);
 +	void setLastResponseText(const char *text, const char *textOrig);
  	char *_lastResponseText;
  	char *_lastResponseTextOrig;
  	DECLARE_PERSISTENT(CAdResponseBox, CBObject)
  	CScScript *_waitingScript;
  	virtual HRESULT listen(CBScriptHolder *param1, uint32 param2);
  	typedef enum {
 -	    EVENT_PREV, EVENT_NEXT, EVENT_RESPONSE
 +	    EVENT_PREV, 
 +		EVENT_NEXT, 
 +		EVENT_RESPONSE
  	} TResponseEvent;
  	HRESULT weedResponses();
 @@ -76,8 +78,8 @@ public:  	int _verticalAlign;
  	TTextAlign _align;
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  };
  } // end of namespace WinterMute
 diff --git a/engines/wintermute/Ad/AdResponseContext.cpp b/engines/wintermute/Ad/AdResponseContext.cpp index d757010023..60df7734e1 100644 --- a/engines/wintermute/Ad/AdResponseContext.cpp +++ b/engines/wintermute/Ad/AdResponseContext.cpp @@ -58,12 +58,12 @@ HRESULT CAdResponseContext::persist(CBPersistMgr *persistMgr) {  }
  //////////////////////////////////////////////////////////////////////////
 -void CAdResponseContext::setContext(const char *Context) {
 +void CAdResponseContext::setContext(const char *context) {
  	delete[] _context;
  	_context = NULL;
 -	if (Context) {
 -		_context = new char [strlen(Context) + 1];
 -		if (_context) strcpy(_context, Context);
 +	if (context) {
 +		_context = new char [strlen(context) + 1];
 +		if (_context) strcpy(_context, context);
  	}
  }
 diff --git a/engines/wintermute/Ad/AdResponseContext.h b/engines/wintermute/Ad/AdResponseContext.h index d6ad9a9d17..a39e2127d5 100644 --- a/engines/wintermute/Ad/AdResponseContext.h +++ b/engines/wintermute/Ad/AdResponseContext.h @@ -36,7 +36,7 @@ namespace WinterMute {  class CAdResponseContext : public CBBase {
  public:
 -	void setContext(const char *Context);
 +	void setContext(const char *context);
  	int _iD;
  	char *_context;
  	DECLARE_PERSISTENT(CAdResponseContext, CBBase)
 diff --git a/engines/wintermute/Ad/AdRotLevel.cpp b/engines/wintermute/Ad/AdRotLevel.cpp index 84a13260ae..356771d0fa 100644 --- a/engines/wintermute/Ad/AdRotLevel.cpp +++ b/engines/wintermute/Ad/AdRotLevel.cpp @@ -54,8 +54,8 @@ CAdRotLevel::~CAdRotLevel() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdRotLevel::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdRotLevel::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -65,10 +65,10 @@ HRESULT CAdRotLevel::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ROTATION_LEVEL file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing ROTATION_LEVEL file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -82,7 +82,7 @@ TOKEN_DEF(ROTATION)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdRotLevel::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CAdRotLevel::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(ROTATION_LEVEL)
  	TOKEN_TABLE(TEMPLATE)
 @@ -95,15 +95,15 @@ HRESULT CAdRotLevel::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_ROTATION_LEVEL) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_ROTATION_LEVEL) {
  			Game->LOG(0, "'ROTATION_LEVEL' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -135,12 +135,12 @@ HRESULT CAdRotLevel::loadBuffer(byte  *Buffer, bool Complete) {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdRotLevel::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "ROTATION_LEVEL {\n");
 -	Buffer->putTextIndent(Indent + 2, "X=%d\n", _posX);
 -	Buffer->putTextIndent(Indent + 2, "ROTATION=%d\n", (int)_rotation);
 -	CBBase::saveAsText(Buffer, Indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n");
 +HRESULT CAdRotLevel::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "ROTATION_LEVEL {\n");
 +	buffer->putTextIndent(indent + 2, "X=%d\n", _posX);
 +	buffer->putTextIndent(indent + 2, "ROTATION=%d\n", (int)_rotation);
 +	CBBase::saveAsText(buffer, indent + 2);
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/Ad/AdRotLevel.h b/engines/wintermute/Ad/AdRotLevel.h index dffca612c8..3c02cddc34 100644 --- a/engines/wintermute/Ad/AdRotLevel.h +++ b/engines/wintermute/Ad/AdRotLevel.h @@ -39,9 +39,9 @@ public:  	CAdRotLevel(CBGame *inGame);
  	virtual ~CAdRotLevel();
  	float _rotation;
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
  };
  } // end of namespace WinterMute
 diff --git a/engines/wintermute/Ad/AdScaleLevel.cpp b/engines/wintermute/Ad/AdScaleLevel.cpp index 1e686545ff..ba3a9806c6 100644 --- a/engines/wintermute/Ad/AdScaleLevel.cpp +++ b/engines/wintermute/Ad/AdScaleLevel.cpp @@ -52,8 +52,8 @@ CAdScaleLevel::~CAdScaleLevel() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdScaleLevel::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdScaleLevel::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -63,10 +63,10 @@ HRESULT CAdScaleLevel::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SCALE_LEVEL file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing SCALE_LEVEL file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -80,7 +80,7 @@ TOKEN_DEF(SCALE)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdScaleLevel::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CAdScaleLevel::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(SCALE_LEVEL)
  	TOKEN_TABLE(TEMPLATE)
 @@ -93,15 +93,15 @@ HRESULT CAdScaleLevel::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_SCALE_LEVEL) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_SCALE_LEVEL) {
  			Game->LOG(0, "'SCALE_LEVEL' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -133,12 +133,12 @@ HRESULT CAdScaleLevel::loadBuffer(byte  *Buffer, bool Complete) {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdScaleLevel::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "SCALE_LEVEL {\n");
 -	Buffer->putTextIndent(Indent + 2, "Y=%d\n", _posY);
 -	Buffer->putTextIndent(Indent + 2, "SCALE=%d\n", (int)_scale);
 -	CBBase::saveAsText(Buffer, Indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n");
 +HRESULT CAdScaleLevel::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "SCALE_LEVEL {\n");
 +	buffer->putTextIndent(indent + 2, "Y=%d\n", _posY);
 +	buffer->putTextIndent(indent + 2, "SCALE=%d\n", (int)_scale);
 +	CBBase::saveAsText(buffer, indent + 2);
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/Ad/AdScaleLevel.h b/engines/wintermute/Ad/AdScaleLevel.h index 6cb336aae5..31e67f05d8 100644 --- a/engines/wintermute/Ad/AdScaleLevel.h +++ b/engines/wintermute/Ad/AdScaleLevel.h @@ -40,9 +40,9 @@ public:  	float _scale;
  	CAdScaleLevel(CBGame *inGame);
  	virtual ~CAdScaleLevel();
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
  };
  } // end of namespace WinterMute
 diff --git a/engines/wintermute/Ad/AdScene.cpp b/engines/wintermute/Ad/AdScene.cpp index 02888c07e6..182d0bb1b1 100644 --- a/engines/wintermute/Ad/AdScene.cpp +++ b/engines/wintermute/Ad/AdScene.cpp @@ -192,8 +192,8 @@ bool CAdScene::getPath(CBPoint source, CBPoint target, CAdPath *path, CBObject *  		_pfTargetPath = path;
  		_pfRequester = requester;
 -		_pfTargetPath->Reset();
 -		_pfTargetPath->SetReady(false);
 +		_pfTargetPath->reset();
 +		_pfTargetPath->setReady(false);
  		// prepare working path
  		int i;
 @@ -453,7 +453,7 @@ void CAdScene::pathFinderStep() {  	if (lowest_pt == NULL) { // no path -> terminate PathFinder
  		_pfReady = true;
 -		_pfTargetPath->SetReady(true);
 +		_pfTargetPath->setReady(true);
  		return;
  	}
 @@ -467,7 +467,7 @@ void CAdScene::pathFinderStep() {  		}
  		_pfReady = true;
 -		_pfTargetPath->SetReady(true);
 +		_pfTargetPath->setReady(true);
  		return;
  	}
 @@ -504,8 +504,8 @@ HRESULT CAdScene::initLoop() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdScene::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdScene::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -516,13 +516,13 @@ HRESULT CAdScene::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SCENE file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing SCENE file '%s'", filename);
  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -568,7 +568,7 @@ TOKEN_DEF(PERSISTENT_STATE)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdScene::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CAdScene::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(SCENE)
  	TOKEN_TABLE(TEMPLATE)
 @@ -615,19 +615,19 @@ HRESULT CAdScene::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_SCENE) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_SCENE) {
  			Game->LOG(0, "'SCENE' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
  	int ar, ag, ab, aa;
  	char camera[MAX_PATH] = "";
  	/* float WaypointHeight = -1.0f; */
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -863,7 +863,7 @@ HRESULT CAdScene::traverseNodes(bool Update) {  	if (!_initialized) return S_OK;
  	int j, k;
 -	CAdGame *AdGame = (CAdGame *)Game;
 +	CAdGame *adGame = (CAdGame *)Game;
  	//////////////////////////////////////////////////////////////////////////
 @@ -872,8 +872,8 @@ HRESULT CAdScene::traverseNodes(bool Update) {  	if (_viewport && !Game->_editorMode) {
  		Game->pushViewport(_viewport);
  		PopViewport = true;
 -	} else if (AdGame->_sceneViewport && !Game->_editorMode) {
 -		Game->pushViewport(AdGame->_sceneViewport);
 +	} else if (adGame->_sceneViewport && !Game->_editorMode) {
 +		Game->pushViewport(adGame->_sceneViewport);
  		PopViewport = true;
  	}
 @@ -1039,18 +1039,18 @@ HRESULT CAdScene::display() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdScene::updateFreeObjects() {
 -	CAdGame *AdGame = (CAdGame *)Game;
 +	CAdGame *adGame = (CAdGame *)Game;
  	int i;
  	bool Is3DSet;
  	// *** update all active objects
  	Is3DSet = false;
 -	for (i = 0; i < AdGame->_objects.GetSize(); i++) {
 -		if (!AdGame->_objects[i]->_active) continue;
 +	for (i = 0; i < adGame->_objects.GetSize(); i++) {
 +		if (!adGame->_objects[i]->_active) continue;
 -		AdGame->_objects[i]->update();
 -		AdGame->_objects[i]->_drawn = false;
 +		adGame->_objects[i]->update();
 +		adGame->_objects[i]->_drawn = false;
  	}
 @@ -1073,15 +1073,15 @@ HRESULT CAdScene::updateFreeObjects() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdScene::displayRegionContent(CAdRegion *Region, bool Display3DOnly) {
 -	CAdGame *AdGame = (CAdGame *)Game;
 +	CAdGame *adGame = (CAdGame *)Game;
  	CBArray<CAdObject *, CAdObject *> Objects;
  	CAdObject *Obj;
  	int i;
  	// global objects
 -	for (i = 0; i < AdGame->_objects.GetSize(); i++) {
 -		Obj = AdGame->_objects[i];
 +	for (i = 0; i < adGame->_objects.GetSize(); i++) {
 +		Obj = adGame->_objects[i];
  		if (Obj->_active && !Obj->_drawn && (Obj->_stickRegion == Region || Region == NULL || (Obj->_stickRegion == NULL && Region->PointInRegion(Obj->_posX, Obj->_posY)))) {
  			Objects.Add(Obj);
  		}
 @@ -1138,7 +1138,7 @@ int CAdScene::compareObjs(const void *Obj1, const void *Obj2) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdScene::displayRegionContentOld(CAdRegion *Region) {
 -	CAdGame *AdGame = (CAdGame *)Game;
 +	CAdGame *adGame = (CAdGame *)Game;
  	CAdObject *obj;
  	int i;
 @@ -1148,10 +1148,10 @@ HRESULT CAdScene::displayRegionContentOld(CAdRegion *Region) {  		int minY = INT_MAX;
  		// global objects
 -		for (i = 0; i < AdGame->_objects.GetSize(); i++) {
 -			if (AdGame->_objects[i]->_active && !AdGame->_objects[i]->_drawn && AdGame->_objects[i]->_posY < minY && (AdGame->_objects[i]->_stickRegion == Region || Region == NULL || (AdGame->_objects[i]->_stickRegion == NULL && Region->PointInRegion(AdGame->_objects[i]->_posX, AdGame->_objects[i]->_posY)))) {
 -				obj = AdGame->_objects[i];
 -				minY = AdGame->_objects[i]->_posY;
 +		for (i = 0; i < adGame->_objects.GetSize(); i++) {
 +			if (adGame->_objects[i]->_active && !adGame->_objects[i]->_drawn && adGame->_objects[i]->_posY < minY && (adGame->_objects[i]->_stickRegion == Region || Region == NULL || (adGame->_objects[i]->_stickRegion == NULL && Region->PointInRegion(adGame->_objects[i]->_posX, adGame->_objects[i]->_posY)))) {
 +				obj = adGame->_objects[i];
 +				minY = adGame->_objects[i]->_posY;
  			}
  		}
 @@ -1969,99 +1969,99 @@ HRESULT CAdScene::removeObject(CAdObject *Object) {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdScene::saveAsText(CBDynBuffer *Buffer, int Indent) {
 +HRESULT CAdScene::saveAsText(CBDynBuffer *buffer, int indent) {
  	int i;
 -	Buffer->putTextIndent(Indent, "SCENE {\n");
 +	buffer->putTextIndent(indent, "SCENE {\n");
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
  	if (_persistentState)
 -		Buffer->putTextIndent(Indent + 2, "PERSISTENT_STATE=%s\n", _persistentState ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "PERSISTENT_STATE=%s\n", _persistentState ? "TRUE" : "FALSE");
  	if (!_persistentStateSprites)
 -		Buffer->putTextIndent(Indent + 2, "PERSISTENT_STATE_SPRITES=%s\n", _persistentStateSprites ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "PERSISTENT_STATE_SPRITES=%s\n", _persistentStateSprites ? "TRUE" : "FALSE");
  	// scripts
  	for (i = 0; i < _scripts.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
 +		buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
  	}
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// properties
 -	if (_scProp) _scProp->saveAsText(Buffer, Indent + 2);
 +	if (_scProp) _scProp->saveAsText(buffer, indent + 2);
  	// viewport
  	if (_viewport) {
  		RECT *rc = _viewport->getRect();
 -		Buffer->putTextIndent(Indent + 2, "VIEWPORT { %d, %d, %d, %d }\n", rc->left, rc->top, rc->right, rc->bottom);
 +		buffer->putTextIndent(indent + 2, "VIEWPORT { %d, %d, %d, %d }\n", rc->left, rc->top, rc->right, rc->bottom);
  	}
  	// editor settings
 -	Buffer->putTextIndent(Indent + 2, "; ----- editor settings\n");
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_MARGIN_H=%d\n", _editorMarginH);
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_MARGIN_V=%d\n", _editorMarginV);
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_FRAME { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColFrame), D3DCOLGetG(_editorColFrame), D3DCOLGetB(_editorColFrame), D3DCOLGetA(_editorColFrame));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_ENTITY_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColEntitySel), D3DCOLGetG(_editorColEntitySel), D3DCOLGetB(_editorColEntitySel), D3DCOLGetA(_editorColEntitySel));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_REGION_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColRegionSel), D3DCOLGetG(_editorColRegionSel), D3DCOLGetB(_editorColRegionSel), D3DCOLGetA(_editorColRegionSel));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_BLOCKED_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColBlockedSel), D3DCOLGetG(_editorColBlockedSel), D3DCOLGetB(_editorColBlockedSel), D3DCOLGetA(_editorColBlockedSel));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_DECORATION_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColDecorSel), D3DCOLGetG(_editorColDecorSel), D3DCOLGetB(_editorColDecorSel), D3DCOLGetA(_editorColDecorSel));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_WAYPOINTS_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColWaypointsSel), D3DCOLGetG(_editorColWaypointsSel), D3DCOLGetB(_editorColWaypointsSel), D3DCOLGetA(_editorColWaypointsSel));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_ENTITY { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColEntity), D3DCOLGetG(_editorColEntity), D3DCOLGetB(_editorColEntity), D3DCOLGetA(_editorColEntity));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_REGION { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColRegion), D3DCOLGetG(_editorColRegion), D3DCOLGetB(_editorColRegion), D3DCOLGetA(_editorColRegion));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_DECORATION { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColDecor), D3DCOLGetG(_editorColDecor), D3DCOLGetB(_editorColDecor), D3DCOLGetA(_editorColDecor));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_BLOCKED { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColBlocked), D3DCOLGetG(_editorColBlocked), D3DCOLGetB(_editorColBlocked), D3DCOLGetA(_editorColBlocked));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_WAYPOINTS { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColWaypoints), D3DCOLGetG(_editorColWaypoints), D3DCOLGetB(_editorColWaypoints), D3DCOLGetA(_editorColWaypoints));
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_COLOR_SCALE { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColScale), D3DCOLGetG(_editorColScale), D3DCOLGetB(_editorColScale), D3DCOLGetA(_editorColScale));
 -
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_SHOW_REGIONS=%s\n", _editorShowRegions ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_SHOW_BLOCKED=%s\n", _editorShowBlocked ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_SHOW_DECORATION=%s\n", _editorShowDecor ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_SHOW_ENTITIES=%s\n", _editorShowEntities ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_SHOW_SCALE=%s\n", _editorShowScale ? "TRUE" : "FALSE");
 -
 -	Buffer->putTextIndent(Indent + 2, "\n");
 -
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	buffer->putTextIndent(indent + 2, "; ----- editor settings\n");
 +	buffer->putTextIndent(indent + 2, "EDITOR_MARGIN_H=%d\n", _editorMarginH);
 +	buffer->putTextIndent(indent + 2, "EDITOR_MARGIN_V=%d\n", _editorMarginV);
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_FRAME { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColFrame), D3DCOLGetG(_editorColFrame), D3DCOLGetB(_editorColFrame), D3DCOLGetA(_editorColFrame));
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_ENTITY_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColEntitySel), D3DCOLGetG(_editorColEntitySel), D3DCOLGetB(_editorColEntitySel), D3DCOLGetA(_editorColEntitySel));
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_REGION_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColRegionSel), D3DCOLGetG(_editorColRegionSel), D3DCOLGetB(_editorColRegionSel), D3DCOLGetA(_editorColRegionSel));
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_BLOCKED_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColBlockedSel), D3DCOLGetG(_editorColBlockedSel), D3DCOLGetB(_editorColBlockedSel), D3DCOLGetA(_editorColBlockedSel));
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_DECORATION_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColDecorSel), D3DCOLGetG(_editorColDecorSel), D3DCOLGetB(_editorColDecorSel), D3DCOLGetA(_editorColDecorSel));
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_WAYPOINTS_SEL { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColWaypointsSel), D3DCOLGetG(_editorColWaypointsSel), D3DCOLGetB(_editorColWaypointsSel), D3DCOLGetA(_editorColWaypointsSel));
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_ENTITY { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColEntity), D3DCOLGetG(_editorColEntity), D3DCOLGetB(_editorColEntity), D3DCOLGetA(_editorColEntity));
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_REGION { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColRegion), D3DCOLGetG(_editorColRegion), D3DCOLGetB(_editorColRegion), D3DCOLGetA(_editorColRegion));
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_DECORATION { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColDecor), D3DCOLGetG(_editorColDecor), D3DCOLGetB(_editorColDecor), D3DCOLGetA(_editorColDecor));
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_BLOCKED { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColBlocked), D3DCOLGetG(_editorColBlocked), D3DCOLGetB(_editorColBlocked), D3DCOLGetA(_editorColBlocked));
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_WAYPOINTS { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColWaypoints), D3DCOLGetG(_editorColWaypoints), D3DCOLGetB(_editorColWaypoints), D3DCOLGetA(_editorColWaypoints));
 +	buffer->putTextIndent(indent + 2, "EDITOR_COLOR_SCALE { %d,%d,%d,%d }\n", D3DCOLGetR(_editorColScale), D3DCOLGetG(_editorColScale), D3DCOLGetB(_editorColScale), D3DCOLGetA(_editorColScale));
 +
 +	buffer->putTextIndent(indent + 2, "EDITOR_SHOW_REGIONS=%s\n", _editorShowRegions ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "EDITOR_SHOW_BLOCKED=%s\n", _editorShowBlocked ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "EDITOR_SHOW_DECORATION=%s\n", _editorShowDecor ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "EDITOR_SHOW_ENTITIES=%s\n", _editorShowEntities ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "EDITOR_SHOW_SCALE=%s\n", _editorShowScale ? "TRUE" : "FALSE");
 +
 +	buffer->putTextIndent(indent + 2, "\n");
 +
 +	CBBase::saveAsText(buffer, indent + 2);
  	// waypoints
 -	Buffer->putTextIndent(Indent + 2, "; ----- waypoints\n");
 -	for (i = 0; i < _waypointGroups.GetSize(); i++) _waypointGroups[i]->saveAsText(Buffer, Indent + 2);
 +	buffer->putTextIndent(indent + 2, "; ----- waypoints\n");
 +	for (i = 0; i < _waypointGroups.GetSize(); i++) _waypointGroups[i]->saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// layers
 -	Buffer->putTextIndent(Indent + 2, "; ----- layers\n");
 -	for (i = 0; i < _layers.GetSize(); i++) _layers[i]->saveAsText(Buffer, Indent + 2);
 +	buffer->putTextIndent(indent + 2, "; ----- layers\n");
 +	for (i = 0; i < _layers.GetSize(); i++) _layers[i]->saveAsText(buffer, indent + 2);
  	// scale levels
 -	Buffer->putTextIndent(Indent + 2, "; ----- scale levels\n");
 -	for (i = 0; i < _scaleLevels.GetSize(); i++) _scaleLevels[i]->saveAsText(Buffer, Indent + 2);
 +	buffer->putTextIndent(indent + 2, "; ----- scale levels\n");
 +	for (i = 0; i < _scaleLevels.GetSize(); i++) _scaleLevels[i]->saveAsText(buffer, indent + 2);
  	// rotation levels
 -	Buffer->putTextIndent(Indent + 2, "; ----- rotation levels\n");
 -	for (i = 0; i < _rotLevels.GetSize(); i++) _rotLevels[i]->saveAsText(Buffer, Indent + 2);
 +	buffer->putTextIndent(indent + 2, "; ----- rotation levels\n");
 +	for (i = 0; i < _rotLevels.GetSize(); i++) _rotLevels[i]->saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// free entities
 -	Buffer->putTextIndent(Indent + 2, "; ----- free entities\n");
 +	buffer->putTextIndent(indent + 2, "; ----- free entities\n");
  	for (i = 0; i < _objects.GetSize(); i++) {
  		if (_objects[i]->_type == OBJECT_ENTITY) {
 -			_objects[i]->saveAsText(Buffer, Indent + 2);
 +			_objects[i]->saveAsText(buffer, indent + 2);
  		}
  	}
 -	Buffer->putTextIndent(Indent, "}\n");
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 @@ -2359,13 +2359,13 @@ void CAdScene::pfPointsAdd(int X, int Y, int Distance) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdScene::getViewportOffset(int *OffsetX, int *OffsetY) {
 -	CAdGame *AdGame = (CAdGame *)Game;
 +	CAdGame *adGame = (CAdGame *)Game;
  	if (_viewport && !Game->_editorMode) {
  		if (OffsetX) *OffsetX = _viewport->_offsetX;
  		if (OffsetY) *OffsetY = _viewport->_offsetY;
 -	} else if (AdGame->_sceneViewport && !Game->_editorMode) {
 -		if (OffsetX) *OffsetX = AdGame->_sceneViewport->_offsetX;
 -		if (OffsetY) *OffsetY = AdGame->_sceneViewport->_offsetY;
 +	} else if (adGame->_sceneViewport && !Game->_editorMode) {
 +		if (OffsetX) *OffsetX = adGame->_sceneViewport->_offsetX;
 +		if (OffsetY) *OffsetY = adGame->_sceneViewport->_offsetY;
  	} else {
  		if (OffsetX) *OffsetX = 0;
  		if (OffsetY) *OffsetY = 0;
 @@ -2376,13 +2376,13 @@ HRESULT CAdScene::getViewportOffset(int *OffsetX, int *OffsetY) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdScene::getViewportSize(int *Width, int *Height) {
 -	CAdGame *AdGame = (CAdGame *)Game;
 +	CAdGame *adGame = (CAdGame *)Game;
  	if (_viewport && !Game->_editorMode) {
  		if (Width)  *Width  = _viewport->getWidth();
  		if (Height) *Height = _viewport->getHeight();
 -	} else if (AdGame->_sceneViewport && !Game->_editorMode) {
 -		if (Width)  *Width  = AdGame->_sceneViewport->getWidth();
 -		if (Height) *Height = AdGame->_sceneViewport->getHeight();
 +	} else if (adGame->_sceneViewport && !Game->_editorMode) {
 +		if (Width)  *Width  = adGame->_sceneViewport->getWidth();
 +		if (Height) *Height = adGame->_sceneViewport->getHeight();
  	} else {
  		if (Width)  *Width  = Game->_renderer->_width;
  		if (Height) *Height = Game->_renderer->_height;
 @@ -2485,38 +2485,36 @@ HRESULT CAdScene::loadState() {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdScene::persistState(bool Saving) {
 +HRESULT CAdScene::persistState(bool saving) {
  	if (!_persistentState) return S_OK;
 -	CAdGame *AdGame = (CAdGame *)Game;
 -	CAdSceneState *State = AdGame->getSceneState(_filename, Saving);
 -	if (!State) return S_OK;
 -
 +	CAdGame *adGame = (CAdGame *)Game;
 +	CAdSceneState *state = adGame->getSceneState(_filename, saving);
 +	if (!state) return S_OK;
 -	int i;
 -	CAdNodeState *NodeState;
 +	CAdNodeState *nodeState;
  	// dependent objects
 -	for (i = 0; i < _layers.GetSize(); i++) {
 +	for (int i = 0; i < _layers.GetSize(); i++) {
  		CAdLayer *layer = _layers[i];
  		for (int j = 0; j < layer->_nodes.GetSize(); j++) {
  			CAdSceneNode *node = layer->_nodes[j];
  			switch (node->_type) {
  			case OBJECT_ENTITY:
  				if (!node->_entity->_saveState) continue;
 -				NodeState = State->getNodeState(node->_entity->_name, Saving);
 -				if (NodeState) {
 -					NodeState->TransferEntity(node->_entity, _persistentStateSprites, Saving);
 +				nodeState = state->getNodeState(node->_entity->_name, saving);
 +				if (nodeState) {
 +					nodeState->transferEntity(node->_entity, _persistentStateSprites, saving);
  					//if(Saving) NodeState->_active = node->_entity->_active;
  					//else node->_entity->_active = NodeState->_active;
  				}
  				break;
  			case OBJECT_REGION:
  				if (!node->_region->_saveState) continue;
 -				NodeState = State->getNodeState(node->_region->_name, Saving);
 -				if (NodeState) {
 -					if (Saving) NodeState->_active = node->_region->_active;
 -					else node->_region->_active = NodeState->_active;
 +				nodeState = state->getNodeState(node->_region->_name, saving);
 +				if (nodeState) {
 +					if (saving) nodeState->_active = node->_region->_active;
 +					else node->_region->_active = nodeState->_active;
  				}
  				break;
  			default:
 @@ -2527,12 +2525,12 @@ HRESULT CAdScene::persistState(bool Saving) {  	}
  	// free entities
 -	for (i = 0; i < _objects.GetSize(); i++) {
 +	for (int i = 0; i < _objects.GetSize(); i++) {
  		if (!_objects[i]->_saveState) continue;
  		if (_objects[i]->_type == OBJECT_ENTITY) {
 -			NodeState = State->getNodeState(_objects[i]->_name, Saving);
 -			if (NodeState) {
 -				NodeState->TransferEntity((CAdEntity *)_objects[i], _persistentStateSprites, Saving);
 +			nodeState = state->getNodeState(_objects[i]->_name, saving);
 +			if (nodeState) {
 +				nodeState->transferEntity((CAdEntity *)_objects[i], _persistentStateSprites, saving);
  				//if(Saving) NodeState->_active = _objects[i]->_active;
  				//else _objects[i]->_active = NodeState->_active;
  			}
 @@ -2540,11 +2538,11 @@ HRESULT CAdScene::persistState(bool Saving) {  	}
  	// waypoint groups
 -	for (i = 0; i < _waypointGroups.GetSize(); i++) {
 -		NodeState = State->getNodeState(_waypointGroups[i]->_name, Saving);
 -		if (NodeState) {
 -			if (Saving) NodeState->_active = _waypointGroups[i]->_active;
 -			else _waypointGroups[i]->_active = NodeState->_active;
 +	for (int i = 0; i < _waypointGroups.GetSize(); i++) {
 +		nodeState = state->getNodeState(_waypointGroups[i]->_name, saving);
 +		if (nodeState) {
 +			if (saving) nodeState->_active = _waypointGroups[i]->_active;
 +			else _waypointGroups[i]->_active = nodeState->_active;
  		}
  	}
 @@ -2553,14 +2551,14 @@ HRESULT CAdScene::persistState(bool Saving) {  //////////////////////////////////////////////////////////////////////////
 -float CAdScene::getRotationAt(int X, int Y) {
 +float CAdScene::getRotationAt(int x, int y) {
  	CAdRotLevel *prev = NULL;
  	CAdRotLevel *next = NULL;
  	for (int i = 0; i < _rotLevels.GetSize(); i++) {
  		/*  CAdRotLevel *xxx = _rotLevels[i];
  		    int j = _rotLevels.GetSize();*/
 -		if (_rotLevels[i]->_posX < X) prev = _rotLevels[i];
 +		if (_rotLevels[i]->_posX < x) prev = _rotLevels[i];
  		else {
  			next = _rotLevels[i];
  			break;
 @@ -2571,32 +2569,30 @@ float CAdScene::getRotationAt(int X, int Y) {  	int delta_x = next->_posX - prev->_posX;
  	float delta_rot = next->_rotation - prev->_rotation;
 -	X -= prev->_posX;
 +	x -= prev->_posX;
 -	float percent = (float)X / ((float)delta_x / 100.0f);
 +	float percent = (float)x / ((float)delta_x / 100.0f);
  	return prev->_rotation + delta_rot / 100 * percent;
  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdScene::handleItemAssociations(const char *ItemName, bool Show) {
 -	int i;
 -
 -	for (i = 0; i < _layers.GetSize(); i++) {
 +HRESULT CAdScene::handleItemAssociations(const char *itemName, bool show) {
 +	for (int i = 0; i < _layers.GetSize(); i++) {
  		CAdLayer *Layer = _layers[i];
  		for (int j = 0; j < Layer->_nodes.GetSize(); j++) {
  			if (Layer->_nodes[j]->_type == OBJECT_ENTITY) {
  				CAdEntity *Ent = Layer->_nodes[j]->_entity;
 -				if (Ent->_item && strcmp(Ent->_item, ItemName) == 0) Ent->_active = Show;
 +				if (Ent->_item && strcmp(Ent->_item, itemName) == 0) Ent->_active = show;
  			}
  		}
  	}
 -	for (i = 0; i < _objects.GetSize(); i++) {
 +	for (int i = 0; i < _objects.GetSize(); i++) {
  		if (_objects[i]->_type == OBJECT_ENTITY) {
 -			CAdEntity *Ent = (CAdEntity *)_objects[i];
 -			if (Ent->_item && strcmp(Ent->_item, ItemName) == 0) Ent->_active = Show;
 +			CAdEntity *ent = (CAdEntity *)_objects[i];
 +			if (ent->_item && strcmp(ent->_item, itemName) == 0) ent->_active = show;
  		}
  	}
 @@ -2634,20 +2630,20 @@ HRESULT CAdScene::restoreDeviceObjects() {  //////////////////////////////////////////////////////////////////////////
  CBObject *CAdScene::getNextAccessObject(CBObject *CurrObject) {
 -	CBArray<CAdObject *, CAdObject *> Objects;
 -	getSceneObjects(Objects, true);
 +	CBArray<CAdObject *, CAdObject *> objects;
 +	getSceneObjects(objects, true);
 -	if (Objects.GetSize() == 0) return NULL;
 +	if (objects.GetSize() == 0) return NULL;
  	else {
  		if (CurrObject != NULL) {
 -			for (int i = 0; i < Objects.GetSize(); i++) {
 -				if (Objects[i] == CurrObject) {
 -					if (i < Objects.GetSize() - 1) return Objects[i + 1];
 +			for (int i = 0; i < objects.GetSize(); i++) {
 +				if (objects[i] == CurrObject) {
 +					if (i < objects.GetSize() - 1) return objects[i + 1];
  					else break;
  				}
  			}
  		}
 -		return Objects[0];
 +		return objects[0];
  	}
  	return NULL;
  }
 @@ -2734,14 +2730,14 @@ HRESULT CAdScene::getSceneObjects(CBArray<CAdObject *, CAdObject *> &Objects, bo  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdScene::getRegionObjects(CAdRegion *Region, CBArray<CAdObject *, CAdObject *> &Objects, bool InteractiveOnly) {
 -	CAdGame *AdGame = (CAdGame *)Game;
 +	CAdGame *adGame = (CAdGame *)Game;
  	CAdObject *Obj;
  	int i;
  	// global objects
 -	for (i = 0; i < AdGame->_objects.GetSize(); i++) {
 -		Obj = AdGame->_objects[i];
 +	for (i = 0; i < adGame->_objects.GetSize(); i++) {
 +		Obj = adGame->_objects[i];
  		if (Obj->_active && (Obj->_stickRegion == Region || Region == NULL || (Obj->_stickRegion == NULL && Region->PointInRegion(Obj->_posX, Obj->_posY)))) {
  			if (InteractiveOnly && !Obj->_registrable) continue;
 diff --git a/engines/wintermute/Ad/AdScene.h b/engines/wintermute/Ad/AdScene.h index ae4750b612..e89d4540f1 100644 --- a/engines/wintermute/Ad/AdScene.h +++ b/engines/wintermute/Ad/AdScene.h @@ -87,7 +87,7 @@ public:  	float getScaleAt(int Y);
  	HRESULT sortScaleLevels();
  	HRESULT sortRotLevels();
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	uint32 getAlphaAt(int X, int Y, bool ColorCheck = false);
  	bool _paralaxScrolling;
  	void skipTo(int OffsetX, int OffsetY);
 @@ -124,7 +124,7 @@ public:  	CBArray<CAdObject *, CAdObject *> _objects;
  	CBArray<CAdWaypointGroup *, CAdWaypointGroup *> _waypointGroups;
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
  	int _width;
  	int _height;
  	HRESULT addObject(CAdObject *Object);
 diff --git a/engines/wintermute/Ad/AdSpriteSet.cpp b/engines/wintermute/Ad/AdSpriteSet.cpp index d51bdc3d02..111f7ff535 100644 --- a/engines/wintermute/Ad/AdSpriteSet.cpp +++ b/engines/wintermute/Ad/AdSpriteSet.cpp @@ -59,17 +59,17 @@ CAdSpriteSet::~CAdSpriteSet() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdSpriteSet::loadFile(const char *filename, int lifeTime, TSpriteCacheType cacheType) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdSpriteSet::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
  	HRESULT ret;
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SPRITESET file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing SPRITESET file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 diff --git a/engines/wintermute/Ad/AdTalkDef.cpp b/engines/wintermute/Ad/AdTalkDef.cpp index 11e2b1e2af..5b7f4b5e7a 100644 --- a/engines/wintermute/Ad/AdTalkDef.cpp +++ b/engines/wintermute/Ad/AdTalkDef.cpp @@ -70,8 +70,8 @@ CAdTalkDef::~CAdTalkDef() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdTalkDef::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdTalkDef::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -80,9 +80,9 @@ HRESULT CAdTalkDef::loadFile(const char *filename) {  	CBUtils::setString(&_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TALK file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing TALK file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -98,7 +98,7 @@ TOKEN_DEF(DEFAULT_SPRITE)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdTalkDef::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CAdTalkDef::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(TALK)
  	TOKEN_TABLE(TEMPLATE)
 @@ -113,15 +113,15 @@ HRESULT CAdTalkDef::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_TALK) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_TALK) {
  			Game->LOG(0, "'TALK' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 diff --git a/engines/wintermute/Ad/AdTalkNode.cpp b/engines/wintermute/Ad/AdTalkNode.cpp index 8b093922e9..0880e1f7ac 100644 --- a/engines/wintermute/Ad/AdTalkNode.cpp +++ b/engines/wintermute/Ad/AdTalkNode.cpp @@ -80,7 +80,7 @@ TOKEN_DEF(PRECACHE)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdTalkNode::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CAdTalkNode::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(ACTION)
  	TOKEN_TABLE(SPRITESET_FILE)
 @@ -97,19 +97,19 @@ HRESULT CAdTalkNode::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_ACTION) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_ACTION) {
  			Game->LOG(0, "'ACTION' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
  	_endTime = 0;
  	_playToEnd = false;
  	_preCache = false;
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_SPRITE:
  			CBUtils::setString(&_spriteFilename, (char *)params);
 @@ -198,19 +198,19 @@ HRESULT CAdTalkNode::persist(CBPersistMgr *persistMgr) {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdTalkNode::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "ACTION {\n");
 -	if (_comment) Buffer->putTextIndent(Indent + 2, "COMMENT=\"%s\"\n", _comment);
 -	Buffer->putTextIndent(Indent + 2, "START_TIME=%d\n", _startTime);
 -	if (!_playToEnd) Buffer->putTextIndent(Indent + 2, "END_TIME=%d\n", _endTime);
 -	if (_spriteFilename) Buffer->putTextIndent(Indent + 2, "SPRITE=\"%s\"\n", _spriteFilename);
 -	if (_spriteSetFilename) Buffer->putTextIndent(Indent + 2, "SPRITESET_FILE=\"%s\"\n", _spriteSetFilename);
 -	else if (_spriteSet) _spriteSet->saveAsText(Buffer, Indent + 2);
 -	if (_preCache) Buffer->putTextIndent(Indent + 2, "PRECACHE=\"%s\"\n", _preCache ? "TRUE" : "FALSE");
 -
 -	CBBase::saveAsText(Buffer, Indent + 2);
 -
 -	Buffer->putTextIndent(Indent, "}\n");
 +HRESULT CAdTalkNode::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "ACTION {\n");
 +	if (_comment) buffer->putTextIndent(indent + 2, "COMMENT=\"%s\"\n", _comment);
 +	buffer->putTextIndent(indent + 2, "START_TIME=%d\n", _startTime);
 +	if (!_playToEnd) buffer->putTextIndent(indent + 2, "END_TIME=%d\n", _endTime);
 +	if (_spriteFilename) buffer->putTextIndent(indent + 2, "SPRITE=\"%s\"\n", _spriteFilename);
 +	if (_spriteSetFilename) buffer->putTextIndent(indent + 2, "SPRITESET_FILE=\"%s\"\n", _spriteSetFilename);
 +	else if (_spriteSet) _spriteSet->saveAsText(buffer, indent + 2);
 +	if (_preCache) buffer->putTextIndent(indent + 2, "PRECACHE=\"%s\"\n", _preCache ? "TRUE" : "FALSE");
 +
 +	CBBase::saveAsText(buffer, indent + 2);
 +
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/Ad/AdWaypointGroup.cpp b/engines/wintermute/Ad/AdWaypointGroup.cpp index a0004e978b..22727834c5 100644 --- a/engines/wintermute/Ad/AdWaypointGroup.cpp +++ b/engines/wintermute/Ad/AdWaypointGroup.cpp @@ -65,8 +65,8 @@ void CAdWaypointGroup::cleanup() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CAdWaypointGroup::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CAdWaypointGroup::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -76,10 +76,10 @@ HRESULT CAdWaypointGroup::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing WAYPOINTS file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing WAYPOINTS file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -96,7 +96,7 @@ TOKEN_DEF(PROPERTY)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdWaypointGroup::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CAdWaypointGroup::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(WAYPOINTS)
  	TOKEN_TABLE(TEMPLATE)
 @@ -112,15 +112,15 @@ HRESULT CAdWaypointGroup::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_WAYPOINTS) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_WAYPOINTS) {
  			Game->LOG(0, "'WAYPOINTS' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -164,20 +164,20 @@ HRESULT CAdWaypointGroup::loadBuffer(byte  *Buffer, bool Complete) {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CAdWaypointGroup::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "WAYPOINTS {\n");
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_SELECTED_POINT=%d\n", _editorSelectedPoint);
 +HRESULT CAdWaypointGroup::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "WAYPOINTS {\n");
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "EDITOR_SELECTED_POINT=%d\n", _editorSelectedPoint);
 -	if (_scProp) _scProp->saveAsText(Buffer, Indent + 2);
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	if (_scProp) _scProp->saveAsText(buffer, indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
  	for (int i = 0; i < _points.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "POINT {%d,%d}\n", _points[i]->x, _points[i]->y);
 +		buffer->putTextIndent(indent + 2, "POINT {%d,%d}\n", _points[i]->x, _points[i]->y);
  	}
 -	Buffer->putTextIndent(Indent, "}\n");
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/Ad/AdWaypointGroup.h b/engines/wintermute/Ad/AdWaypointGroup.h index dc4a5650e9..690bdf972d 100644 --- a/engines/wintermute/Ad/AdWaypointGroup.h +++ b/engines/wintermute/Ad/AdWaypointGroup.h @@ -41,11 +41,11 @@ public:  	void cleanup();
  	HRESULT Mimic(CAdWaypointGroup *Wpt, float Scale = 100.0f, int X = 0, int Y = 0);
  	DECLARE_PERSISTENT(CAdWaypointGroup, CBObject)
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	bool _active;
  	CAdWaypointGroup(CBGame *inGame);
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
  	virtual ~CAdWaypointGroup();
  	CBArray<CBPoint *, CBPoint *> _points;
  	int _editorSelectedPoint;
 diff --git a/engines/wintermute/Base/BBase.cpp b/engines/wintermute/Base/BBase.cpp index bcd6a43e23..08baa337ed 100644 --- a/engines/wintermute/Base/BBase.cpp +++ b/engines/wintermute/Base/BBase.cpp @@ -84,7 +84,7 @@ TOKEN_DEF(NAME)  TOKEN_DEF(VALUE)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CBBase::parseEditorProperty(byte  *Buffer, bool Complete) {
 +HRESULT CBBase::parseEditorProperty(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(EDITOR_PROPERTY)
  	TOKEN_TABLE(NAME)
 @@ -99,18 +99,18 @@ HRESULT CBBase::parseEditorProperty(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_EDITOR_PROPERTY) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_EDITOR_PROPERTY) {
  			Game->LOG(0, "'EDITOR_PROPERTY' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
  	char *PropName = NULL;
  	char *PropValue = NULL;
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_NAME:
  			delete[] PropName;
 @@ -158,16 +158,16 @@ HRESULT CBBase::parseEditorProperty(byte  *Buffer, bool Complete) {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CBBase::saveAsText(CBDynBuffer *Buffer, int Indent) {
 +HRESULT CBBase::saveAsText(CBDynBuffer *buffer, int indent) {
  	_editorPropsIter = _editorProps.begin();
  	while (_editorPropsIter != _editorProps.end()) {
 -		Buffer->putTextIndent(Indent, "EDITOR_PROPERTY\n");
 -		Buffer->putTextIndent(Indent, "{\n");
 -		Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _editorPropsIter->_key.c_str());
 -		Buffer->putTextIndent(Indent + 2, "VALUE=\"%s\"\n", _editorPropsIter->_value.c_str());
 -		//Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", (char *)_editorPropsIter->first.c_str()); // <- TODO, remove
 -		//Buffer->putTextIndent(Indent + 2, "VALUE=\"%s\"\n", _editorPropsIter->second.c_str()); // <- TODO, remove
 -		Buffer->putTextIndent(Indent, "}\n\n");
 +		buffer->putTextIndent(indent, "EDITOR_PROPERTY\n");
 +		buffer->putTextIndent(indent, "{\n");
 +		buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _editorPropsIter->_key.c_str());
 +		buffer->putTextIndent(indent + 2, "VALUE=\"%s\"\n", _editorPropsIter->_value.c_str());
 +		//buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", (char *)_editorPropsIter->first.c_str()); // <- TODO, remove
 +		//buffer->putTextIndent(indent + 2, "VALUE=\"%s\"\n", _editorPropsIter->second.c_str()); // <- TODO, remove
 +		buffer->putTextIndent(indent, "}\n\n");
  		_editorPropsIter++;
  	}
 diff --git a/engines/wintermute/Base/BFont.cpp b/engines/wintermute/Base/BFont.cpp index 7286c9179d..6158ac6430 100644 --- a/engines/wintermute/Base/BFont.cpp +++ b/engines/wintermute/Base/BFont.cpp @@ -187,10 +187,10 @@ bool CBFont::isTrueType(CBGame *Game, const char *filename) {  	TOKEN_TABLE_END
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) return false;
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) return false;
 -	byte *WorkBuffer = Buffer;
 +	byte *WorkBuffer = buffer;
  	char *params;
  	CBParser parser(Game);
 @@ -199,7 +199,7 @@ bool CBFont::isTrueType(CBGame *Game, const char *filename) {  	if (parser.GetCommand((char **)&WorkBuffer, commands, (char **)¶ms) == TOKEN_TTFONT)
  		Ret = true;
 -	delete [] Buffer;
 +	delete [] buffer;
  	return Ret;
  }
 diff --git a/engines/wintermute/Base/BFontBitmap.cpp b/engines/wintermute/Base/BFontBitmap.cpp index 16a1274e18..714b66f990 100644 --- a/engines/wintermute/Base/BFontBitmap.cpp +++ b/engines/wintermute/Base/BFontBitmap.cpp @@ -246,8 +246,8 @@ void CBFontBitmap::drawChar(byte  c, int x, int y) {  //////////////////////////////////////////////////////////////////////
  HRESULT CBFontBitmap::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CBFontBitmap::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -257,9 +257,9 @@ HRESULT CBFontBitmap::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer))) Game->LOG(0, "Error parsing FONT file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer))) Game->LOG(0, "Error parsing FONT file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -284,7 +284,7 @@ TOKEN_DEF(WIDTHS_FRAME)  TOKEN_DEF(PAINT_WHOLE_CELL)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////
 -HRESULT CBFontBitmap::loadBuffer(byte  *Buffer) {
 +HRESULT CBFontBitmap::loadBuffer(byte *buffer) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(FONTEXT_FIX)
  	TOKEN_TABLE(FONT)
 @@ -308,11 +308,11 @@ HRESULT CBFontBitmap::loadBuffer(byte  *Buffer) {  	int cmd;
  	CBParser parser(Game);
 -	if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_FONT) {
 +	if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_FONT) {
  		Game->LOG(0, "'FONT' keyword expected.");
  		return E_FAIL;
  	}
 -	Buffer = (byte *)params;
 +	buffer = (byte *)params;
  	int widths[300];
  	int num = 0, default_width = 8;
 @@ -327,7 +327,7 @@ HRESULT CBFontBitmap::loadBuffer(byte  *Buffer) {  	int SpaceWidth = 0;
  	int ExpandWidth = 0;
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_IMAGE:
 diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp index a5081f91f9..ed8a1c7771 100644 --- a/engines/wintermute/Base/BFontTT.cpp +++ b/engines/wintermute/Base/BFontTT.cpp @@ -405,8 +405,8 @@ int CBFontTT::getLetterHeight() {  //////////////////////////////////////////////////////////////////////
  HRESULT CBFontTT::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CBFontTT::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -416,9 +416,9 @@ HRESULT CBFontTT::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer))) Game->LOG(0, "Error parsing TTFONT file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer))) Game->LOG(0, "Error parsing TTFONT file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -441,7 +441,7 @@ TOKEN_DEF(OFFSET_X)  TOKEN_DEF(OFFSET_Y)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////
 -HRESULT CBFontTT::loadBuffer(byte  *Buffer) {
 +HRESULT CBFontTT::loadBuffer(byte *buffer) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(TTFONT)
  	TOKEN_TABLE(SIZE)
 @@ -461,15 +461,15 @@ HRESULT CBFontTT::loadBuffer(byte  *Buffer) {  	int cmd;
  	CBParser parser(Game);
 -	if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_TTFONT) {
 +	if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_TTFONT) {
  		Game->LOG(0, "'TTFONT' keyword expected.");
  		return E_FAIL;
  	}
 -	Buffer = (byte *)params;
 +	buffer = (byte *)params;
  	uint32 BaseColor = 0x00000000;
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_SIZE:
  			parser.ScanStr(params, "%d", &_fontHeight);
 @@ -549,7 +549,7 @@ HRESULT CBFontTT::loadBuffer(byte  *Buffer) {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CBFontTT::parseLayer(CBTTFontLayer *Layer, byte *Buffer) {
 +HRESULT CBFontTT::parseLayer(CBTTFontLayer *Layer, byte *buffer) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(OFFSET_X)
  	TOKEN_TABLE(OFFSET_Y)
 @@ -561,7 +561,7 @@ HRESULT CBFontTT::parseLayer(CBTTFontLayer *Layer, byte *Buffer) {  	int cmd;
  	CBParser parser(Game);
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_OFFSET_X:
  			parser.ScanStr(params, "%d", &Layer->_offsetX);
 diff --git a/engines/wintermute/Base/BFrame.cpp b/engines/wintermute/Base/BFrame.cpp index 8a20b87299..7818d40396 100644 --- a/engines/wintermute/Base/BFrame.cpp +++ b/engines/wintermute/Base/BFrame.cpp @@ -342,39 +342,39 @@ bool CBFrame::getBoundingRect(LPRECT Rect, int X, int Y, float ScaleX, float Sca  //////////////////////////////////////////////////////////////////////////
 -HRESULT CBFrame::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "FRAME {\n");
 -	Buffer->putTextIndent(Indent + 2, "DELAY = %d\n", _delay);
 +HRESULT CBFrame::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "FRAME {\n");
 +	buffer->putTextIndent(indent + 2, "DELAY = %d\n", _delay);
  	if (_moveX != 0 || _moveY != 0)
 -		Buffer->putTextIndent(Indent + 2, "MOVE {%d, %d}\n", _moveX, _moveY);
 +		buffer->putTextIndent(indent + 2, "MOVE {%d, %d}\n", _moveX, _moveY);
  	if (_sound && _sound->_soundFilename)
 -		Buffer->putTextIndent(Indent + 2, "SOUND=\"%s\"\n", _sound->_soundFilename);
 +		buffer->putTextIndent(indent + 2, "SOUND=\"%s\"\n", _sound->_soundFilename);
 -	Buffer->putTextIndent(Indent + 2, "KEYFRAME=%s\n", _keyframe ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "KEYFRAME=%s\n", _keyframe ? "TRUE" : "FALSE");
  	if (_killSound)
 -		Buffer->putTextIndent(Indent + 2, "KILL_SOUND=%s\n", _killSound ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "KILL_SOUND=%s\n", _killSound ? "TRUE" : "FALSE");
  	if (_editorExpanded)
 -		Buffer->putTextIndent(Indent + 2, "EDITOR_EXPANDED=%s\n", _editorExpanded ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "EDITOR_EXPANDED=%s\n", _editorExpanded ? "TRUE" : "FALSE");
 -	if (_subframes.GetSize() > 0) _subframes[0]->saveAsText(Buffer, Indent, false);
 +	if (_subframes.GetSize() > 0) _subframes[0]->saveAsText(buffer, indent, false);
  	int i;
  	for (i = 1; i < _subframes.GetSize(); i++) {
 -		_subframes[i]->saveAsText(Buffer, Indent + 2);
 +		_subframes[i]->saveAsText(buffer, indent + 2);
  	}
  	for (i = 0; i < _applyEvent.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "APPLY_EVENT=\"%s\"\n", _applyEvent[i]);
 +		buffer->putTextIndent(indent + 2, "APPLY_EVENT=\"%s\"\n", _applyEvent[i]);
  	}
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n\n");
 +	buffer->putTextIndent(indent, "}\n\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/Base/BFrame.h b/engines/wintermute/Base/BFrame.h index 18b6061cd6..8c75fc50c6 100644 --- a/engines/wintermute/Base/BFrame.h +++ b/engines/wintermute/Base/BFrame.h @@ -47,7 +47,7 @@ public:  	CBSound *_sound;
  	bool _editorExpanded;
  	bool getBoundingRect(LPRECT Rect, int X, int Y, float ScaleX = 100, float ScaleY = 100);
 -	HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	int _moveY;
  	int _moveX;
  	uint32 _delay;
 diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp index 7037e19c31..6e36df929f 100644 --- a/engines/wintermute/Base/BGame.cpp +++ b/engines/wintermute/Base/BGame.cpp @@ -3522,17 +3522,17 @@ HRESULT CBGame::loadSettings(const char *filename) {  	HRESULT ret = S_OK;
 -	byte *Buffer = OrigBuffer;
 +	byte *buffer = OrigBuffer;
  	byte *params;
  	int cmd;
  	CBParser parser(Game);
 -	if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_SETTINGS) {
 +	if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_SETTINGS) {
  		Game->LOG(0, "'SETTINGS' keyword expected in game settings file.");
  		return E_FAIL;
  	}
 -	Buffer = params;
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	buffer = params;
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_GAME:
  			delete[] _settingsGameFile;
 diff --git a/engines/wintermute/Base/BGame.h b/engines/wintermute/Base/BGame.h index 055e2d1410..86b72d5730 100644 --- a/engines/wintermute/Base/BGame.h +++ b/engines/wintermute/Base/BGame.h @@ -194,7 +194,7 @@ public:  	void *_dEBUG_LogFile;
  	int _sequence;
  	virtual HRESULT loadFile(const char *filename);
 -	virtual HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 +	virtual HRESULT loadBuffer(byte *buffer, bool complete = true);
  	CBArray<CBQuickMsg *, CBQuickMsg *> _quickMessages;
  	CBArray<CUIWindow *, CUIWindow *> _windows;
  	CBArray<CBViewport *, CBViewport *> _viewportStack;
 diff --git a/engines/wintermute/Base/BObject.h b/engines/wintermute/Base/BObject.h index ef4d8f3909..a77bde0896 100644 --- a/engines/wintermute/Base/BObject.h +++ b/engines/wintermute/Base/BObject.h @@ -97,7 +97,7 @@ public:  	CBSprite *_cursor;
  	bool _sharedCursors;
  	CBSprite *_activeCursor;
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	virtual HRESULT listen(CBScriptHolder *param1, uint32 param2);
  	bool _ready;
  	bool _registrable;
 diff --git a/engines/wintermute/Base/BRegion.cpp b/engines/wintermute/Base/BRegion.cpp index 3efd913da8..6194346093 100644 --- a/engines/wintermute/Base/BRegion.cpp +++ b/engines/wintermute/Base/BRegion.cpp @@ -96,8 +96,8 @@ bool CBRegion::PointInRegion(int X, int Y) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CBRegion::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CBRegion::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -107,10 +107,10 @@ HRESULT CBRegion::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -128,7 +128,7 @@ TOKEN_DEF(EDITOR_SELECTED_POINT)  TOKEN_DEF(PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CBRegion::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CBRegion::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(REGION)
  	TOKEN_TABLE(TEMPLATE)
 @@ -145,12 +145,12 @@ HRESULT CBRegion::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_REGION) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_REGION) {
  			Game->LOG(0, "'REGION' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
  	int i;
 @@ -158,7 +158,7 @@ HRESULT CBRegion::loadBuffer(byte  *Buffer, bool Complete) {  	for (i = 0; i < _points.GetSize(); i++) delete _points[i];
  	_points.RemoveAll();
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -378,28 +378,28 @@ const char *CBRegion::scToString() {  //////////////////////////////////////////////////////////////////////////
 -HRESULT CBRegion::saveAsText(CBDynBuffer *Buffer, int Indent, const char *NameOverride) {
 -	if (!NameOverride) Buffer->putTextIndent(Indent, "REGION {\n");
 -	else Buffer->putTextIndent(Indent, "%s {\n", NameOverride);
 +HRESULT CBRegion::saveAsText(CBDynBuffer *buffer, int indent, const char *NameOverride) {
 +	if (!NameOverride) buffer->putTextIndent(indent, "REGION {\n");
 +	else buffer->putTextIndent(indent, "%s {\n", NameOverride);
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
 -	Buffer->putTextIndent(Indent + 2, "ACTIVE=%s\n", _active ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "EDITOR_SELECTED_POINT=%d\n", _editorSelectedPoint);
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
 +	buffer->putTextIndent(indent + 2, "ACTIVE=%s\n", _active ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "EDITOR_SELECTED_POINT=%d\n", _editorSelectedPoint);
  	int i;
  	for (i = 0; i < _scripts.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
 +		buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
  	}
  	for (i = 0; i < _points.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "POINT {%d,%d}\n", _points[i]->x, _points[i]->y);
 +		buffer->putTextIndent(indent + 2, "POINT {%d,%d}\n", _points[i]->x, _points[i]->y);
  	}
 -	if (_scProp) _scProp->saveAsText(Buffer, Indent + 2);
 +	if (_scProp) _scProp->saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n\n");
 +	buffer->putTextIndent(indent, "}\n\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/Base/BRegion.h b/engines/wintermute/Base/BRegion.h index fb725e814b..2ac783ca7b 100644 --- a/engines/wintermute/Base/BRegion.h +++ b/engines/wintermute/Base/BRegion.h @@ -51,7 +51,7 @@ public:  	bool PointInRegion(int X, int Y);
  	bool CreateRegion();
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
  	RECT _rect;
  	CBArray<CBPoint *, CBPoint *> _points;
  	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent, const char *NameOverride = NULL);
 diff --git a/engines/wintermute/Base/BScriptHolder.cpp b/engines/wintermute/Base/BScriptHolder.cpp index 6353352b8d..a740fde2fc 100644 --- a/engines/wintermute/Base/BScriptHolder.cpp +++ b/engines/wintermute/Base/BScriptHolder.cpp @@ -257,8 +257,8 @@ const char *CBScriptHolder::scToString() {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CBScriptHolder::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	return CBBase::saveAsText(Buffer, Indent);
 +HRESULT CBScriptHolder::saveAsText(CBDynBuffer *buffer, int indent) {
 +	return CBBase::saveAsText(buffer, indent);
  }
 @@ -345,7 +345,7 @@ TOKEN_DEF(NAME)  TOKEN_DEF(VALUE)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CBScriptHolder::parseProperty(byte  *Buffer, bool Complete) {
 +HRESULT CBScriptHolder::parseProperty(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(PROPERTY)
  	TOKEN_TABLE(NAME)
 @@ -356,18 +356,18 @@ HRESULT CBScriptHolder::parseProperty(byte  *Buffer, bool Complete) {  	int cmd;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_PROPERTY) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_PROPERTY) {
  			Game->LOG(0, "'PROPERTY' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
  	char *PropName = NULL;
  	char *PropValue = NULL;
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_NAME:
  			delete[] PropName;
 diff --git a/engines/wintermute/Base/BSprite.cpp b/engines/wintermute/Base/BSprite.cpp index 5c44fcf546..859dfb74aa 100644 --- a/engines/wintermute/Base/BSprite.cpp +++ b/engines/wintermute/Base/BSprite.cpp @@ -153,10 +153,10 @@ HRESULT CBSprite::loadFile(const char *filename, int LifeTime, TSpriteCacheType  			ret = S_OK;
  		}
  	} else {
 -		byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -		if (Buffer) {
 -			if (FAILED(ret = loadBuffer(Buffer, true, LifeTime, CacheType))) Game->LOG(0, "Error parsing SPRITE file '%s'", filename);
 -			delete [] Buffer;
 +		byte *buffer = Game->_fileManager->readWholeFile(filename);
 +		if (buffer) {
 +			if (FAILED(ret = loadBuffer(buffer, true, LifeTime, CacheType))) Game->LOG(0, "Error parsing SPRITE file '%s'", filename);
 +			delete [] buffer;
  		}
  	}
 @@ -187,7 +187,7 @@ TOKEN_DEF(EDITOR_BG_ALPHA)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////
 -HRESULT CBSprite::loadBuffer(byte  *Buffer, bool Complete, int LifeTime, TSpriteCacheType CacheType) {
 +HRESULT CBSprite::loadBuffer(byte *buffer, bool complete, int lifeTime, TSpriteCacheType cacheType) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(CONTINUOUS)
  	TOKEN_TABLE(SPRITE)
 @@ -213,17 +213,17 @@ HRESULT CBSprite::loadBuffer(byte  *Buffer, bool Complete, int LifeTime, TSprite  	cleanup();
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_SPRITE) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_SPRITE) {
  			Game->LOG(0, "'SPRITE' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
  	int frame_count = 1;
  	CBFrame *frame;
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_CONTINUOUS:
  			parser.ScanStr((char *)params, "%b", &_continuous);
 @@ -247,9 +247,9 @@ HRESULT CBSprite::loadBuffer(byte  *Buffer, bool Complete, int LifeTime, TSprite  		case TOKEN_STREAMED:
  			parser.ScanStr((char *)params, "%b", &_streamed);
 -			if (_streamed && LifeTime == -1) {
 -				LifeTime = 500;
 -				CacheType = CACHE_ALL;
 +			if (_streamed && lifeTime == -1) {
 +				lifeTime = 500;
 +				cacheType = CACHE_ALL;
  			}
  			break;
 @@ -284,8 +284,8 @@ HRESULT CBSprite::loadBuffer(byte  *Buffer, bool Complete, int LifeTime, TSprite  			break;
  		case TOKEN_FRAME: {
 -			int FrameLifeTime = LifeTime;
 -			if (CacheType == CACHE_HALF && frame_count % 2 != 1) FrameLifeTime = -1;
 +			int FrameLifeTime = lifeTime;
 +			if (cacheType == CACHE_HALF && frame_count % 2 != 1) FrameLifeTime = -1;
  			frame = new CBFrame(Game);
 @@ -428,44 +428,44 @@ bool CBSprite::GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX, float Sc  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CBSprite::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "SPRITE {\n");
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "LOOPING=%s\n", _looping ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "CONTINUOUS=%s\n", _continuous ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "PRECISE=%s\n", _precise ? "TRUE" : "FALSE");
 +HRESULT CBSprite::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "SPRITE {\n");
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "LOOPING=%s\n", _looping ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "CONTINUOUS=%s\n", _continuous ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "PRECISE=%s\n", _precise ? "TRUE" : "FALSE");
  	if (_streamed) {
 -		Buffer->putTextIndent(Indent + 2, "STREAMED=%s\n", _streamed ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "STREAMED=%s\n", _streamed ? "TRUE" : "FALSE");
  		if (_streamedKeepLoaded)
 -			Buffer->putTextIndent(Indent + 2, "STREAMED_KEEP_LOADED=%s\n", _streamedKeepLoaded ? "TRUE" : "FALSE");
 +			buffer->putTextIndent(indent + 2, "STREAMED_KEEP_LOADED=%s\n", _streamedKeepLoaded ? "TRUE" : "FALSE");
  	}
  	if (_editorMuted)
 -		Buffer->putTextIndent(Indent + 2, "EDITOR_MUTED=%s\n", _editorMuted ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "EDITOR_MUTED=%s\n", _editorMuted ? "TRUE" : "FALSE");
  	if (_editorBgFile) {
 -		Buffer->putTextIndent(Indent + 2, "EDITOR_BG_FILE=\"%s\"\n", _editorBgFile);
 -		Buffer->putTextIndent(Indent + 2, "EDITOR_BG_OFFSET_X=%d\n", _editorBgOffsetX);
 -		Buffer->putTextIndent(Indent + 2, "EDITOR_BG_OFFSET_Y=%d\n", _editorBgOffsetY);
 -		Buffer->putTextIndent(Indent + 2, "EDITOR_BG_ALPHA=%d\n", _editorBgAlpha);
 +		buffer->putTextIndent(indent + 2, "EDITOR_BG_FILE=\"%s\"\n", _editorBgFile);
 +		buffer->putTextIndent(indent + 2, "EDITOR_BG_OFFSET_X=%d\n", _editorBgOffsetX);
 +		buffer->putTextIndent(indent + 2, "EDITOR_BG_OFFSET_Y=%d\n", _editorBgOffsetY);
 +		buffer->putTextIndent(indent + 2, "EDITOR_BG_ALPHA=%d\n", _editorBgAlpha);
  	}
 -	CBScriptHolder::saveAsText(Buffer, Indent + 2);
 +	CBScriptHolder::saveAsText(buffer, indent + 2);
  	int i;
  	// scripts
  	for (i = 0; i < _scripts.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
 +		buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
  	}
  	for (i = 0; i < _frames.GetSize(); i++) {
 -		_frames[i]->saveAsText(Buffer, Indent + 2);
 +		_frames[i]->saveAsText(buffer, indent + 2);
  	}
 -	Buffer->putTextIndent(Indent, "}\n\n");
 +	buffer->putTextIndent(indent, "}\n\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/Base/BSprite.h b/engines/wintermute/Base/BSprite.h index 3857be14de..da69fb6566 100644 --- a/engines/wintermute/Base/BSprite.h +++ b/engines/wintermute/Base/BSprite.h @@ -76,7 +76,7 @@ public:  	CBSprite(CBGame *inGame, CBObject *Owner = NULL);
  	virtual ~CBSprite();
  	CBArray<CBFrame *, CBFrame *> _frames;
 -	HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	// scripting interface
  	virtual CScValue *scGetProperty(const char *name);
 diff --git a/engines/wintermute/Base/BStringTable.cpp b/engines/wintermute/Base/BStringTable.cpp index 3c51866948..72b5535714 100644 --- a/engines/wintermute/Base/BStringTable.cpp +++ b/engines/wintermute/Base/BStringTable.cpp @@ -175,15 +175,15 @@ HRESULT CBStringTable::loadFile(const char *filename, bool ClearOld) {  	if (ClearOld) _strings.clear();
  	uint32 Size;
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename, &Size);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename, &Size);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CBStringTable::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
  	int Pos = 0;
 -	if (Size > 3 && Buffer[0] == 0xEF && Buffer[1] == 0xBB && Buffer[2] == 0xBF) {
 +	if (Size > 3 && buffer[0] == 0xEF && buffer[1] == 0xBB && buffer[2] == 0xBF) {
  		Pos += 3;
  		if (Game->_textEncoding != TEXT_UTF8) {
  			Game->_textEncoding = TEXT_UTF8;
 @@ -195,11 +195,11 @@ HRESULT CBStringTable::loadFile(const char *filename, bool ClearOld) {  	int LineLength = 0;
  	while (Pos < Size) {
  		LineLength = 0;
 -		while (Pos + LineLength < Size && Buffer[Pos + LineLength] != '\n' && Buffer[Pos + LineLength] != '\0') LineLength++;
 +		while (Pos + LineLength < Size && buffer[Pos + LineLength] != '\n' && buffer[Pos + LineLength] != '\0') LineLength++;
  		int RealLength = LineLength - (Pos + LineLength >= Size ? 0 : 1);
  		char *line = new char[RealLength + 1];
 -		strncpy(line, (char *)&Buffer[Pos], RealLength);
 +		strncpy(line, (char *)&buffer[Pos], RealLength);
  		line[RealLength] = '\0';
  		char *value = strchr(line, '\t');
  		if (value == NULL) value = strchr(line, ' ');
 @@ -219,7 +219,7 @@ HRESULT CBStringTable::loadFile(const char *filename, bool ClearOld) {  		Pos += LineLength + 1;
  	}
 -	delete [] Buffer;
 +	delete [] buffer;
  	Game->LOG(0, "  %d strings loaded", _strings.size());
 diff --git a/engines/wintermute/Base/BSubFrame.cpp b/engines/wintermute/Base/BSubFrame.cpp index ac7ecc8b20..a561d55345 100644 --- a/engines/wintermute/Base/BSubFrame.cpp +++ b/engines/wintermute/Base/BSubFrame.cpp @@ -249,53 +249,53 @@ bool CBSubFrame::getBoundingRect(LPRECT Rect, int X, int Y, float ScaleX, float  //////////////////////////////////////////////////////////////////////////
 -HRESULT CBSubFrame::saveAsText(CBDynBuffer *Buffer, int Indent, bool Complete) {
 -	if (Complete)
 -		Buffer->putTextIndent(Indent, "SUBFRAME {\n");
 +HRESULT CBSubFrame::saveAsText(CBDynBuffer *buffer, int indent, bool complete) {
 +	if (complete)
 +		buffer->putTextIndent(indent, "SUBFRAME {\n");
  	if (_surface && _surface->_filename != NULL)
 -		Buffer->putTextIndent(Indent + 2, "IMAGE = \"%s\"\n", _surface->_filename);
 +		buffer->putTextIndent(indent + 2, "IMAGE = \"%s\"\n", _surface->_filename);
  	if (_transparent != 0xFFFF00FF)
 -		Buffer->putTextIndent(Indent + 2, "TRANSPARENT { %d,%d,%d }\n", D3DCOLGetR(_transparent), D3DCOLGetG(_transparent), D3DCOLGetB(_transparent));
 +		buffer->putTextIndent(indent + 2, "TRANSPARENT { %d,%d,%d }\n", D3DCOLGetR(_transparent), D3DCOLGetG(_transparent), D3DCOLGetB(_transparent));
  	RECT rect;
  	CBPlatform::SetRectEmpty(&rect);
  	if (_surface) CBPlatform::SetRect(&rect, 0, 0, _surface->getWidth(), _surface->getHeight());
  	if (!CBPlatform::EqualRect(&rect, &_rect))
 -		Buffer->putTextIndent(Indent + 2, "RECT { %d,%d,%d,%d }\n", _rect.left, _rect.top, _rect.right, _rect.bottom);
 +		buffer->putTextIndent(indent + 2, "RECT { %d,%d,%d,%d }\n", _rect.left, _rect.top, _rect.right, _rect.bottom);
  	if (_hotspotX != 0 || _hotspotY != 0)
 -		Buffer->putTextIndent(Indent + 2, "HOTSPOT {%d, %d}\n", _hotspotX, _hotspotY);
 +		buffer->putTextIndent(indent + 2, "HOTSPOT {%d, %d}\n", _hotspotX, _hotspotY);
  	if (_alpha != 0xFFFFFFFF) {
 -		Buffer->putTextIndent(Indent + 2, "ALPHA_COLOR { %d,%d,%d }\n", D3DCOLGetR(_alpha), D3DCOLGetG(_alpha), D3DCOLGetB(_alpha));
 -		Buffer->putTextIndent(Indent + 2, "ALPHA = %d\n", D3DCOLGetA(_alpha));
 +		buffer->putTextIndent(indent + 2, "ALPHA_COLOR { %d,%d,%d }\n", D3DCOLGetR(_alpha), D3DCOLGetG(_alpha), D3DCOLGetB(_alpha));
 +		buffer->putTextIndent(indent + 2, "ALPHA = %d\n", D3DCOLGetA(_alpha));
  	}
  	if (_mirrorX)
 -		Buffer->putTextIndent(Indent + 2, "MIRROR_X=%s\n", _mirrorX ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "MIRROR_X=%s\n", _mirrorX ? "TRUE" : "FALSE");
  	if (_mirrorY)
 -		Buffer->putTextIndent(Indent + 2, "MIRROR_Y=%s\n", _mirrorY ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "MIRROR_Y=%s\n", _mirrorY ? "TRUE" : "FALSE");
  	if (_2DOnly)
 -		Buffer->putTextIndent(Indent + 2, "2D_ONLY=%s\n", _2DOnly ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "2D_ONLY=%s\n", _2DOnly ? "TRUE" : "FALSE");
  	if (_3DOnly)
 -		Buffer->putTextIndent(Indent + 2, "3D_ONLY=%s\n", _3DOnly ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "3D_ONLY=%s\n", _3DOnly ? "TRUE" : "FALSE");
  	if (_decoration)
 -		Buffer->putTextIndent(Indent + 2, "DECORATION=%s\n", _decoration ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "DECORATION=%s\n", _decoration ? "TRUE" : "FALSE");
  	if (_editorSelected)
 -		Buffer->putTextIndent(Indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
 +		buffer->putTextIndent(indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
 -	if (Complete)
 -		Buffer->putTextIndent(Indent, "}\n\n");
 +	if (complete)
 +		buffer->putTextIndent(indent, "}\n\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/Base/scriptables/ScScript.cpp b/engines/wintermute/Base/scriptables/ScScript.cpp index ddb862460b..4e59893d1d 100644 --- a/engines/wintermute/Base/scriptables/ScScript.cpp +++ b/engines/wintermute/Base/scriptables/ScScript.cpp @@ -1352,33 +1352,33 @@ HRESULT CScScript::ExternalCall(CScStack *stack, CScStack *thisStack, CScScript:  				CScValue *Val = stack->pop();
  				switch (Function->params[i]) {
  				case TYPE_BOOL:
 -					Buffer->PutDWORD((uint32)Val->getBool());
 +					buffer->PutDWORD((uint32)Val->getBool());
  					break;
  				case TYPE_LONG:
 -					Buffer->PutDWORD(Val->getInt());
 +					buffer->PutDWORD(Val->getInt());
  					break;
  				case TYPE_BYTE:
 -					Buffer->PutDWORD((byte)Val->getInt());
 +					buffer->PutDWORD((byte)Val->getInt());
  					break;
  				case TYPE_STRING:
 -					if (Val->isNULL()) Buffer->PutDWORD(0);
 -					else Buffer->PutDWORD((uint32)Val->getString());
 +					if (Val->isNULL()) buffer->PutDWORD(0);
 +					else buffer->PutDWORD((uint32)Val->getString());
  					break;
  				case TYPE_MEMBUFFER:
 -					if (Val->isNULL()) Buffer->PutDWORD(0);
 -					else Buffer->PutDWORD((uint32)Val->getMemBuffer());
 +					if (Val->isNULL()) buffer->PutDWORD(0);
 +					else buffer->PutDWORD((uint32)Val->getMemBuffer());
  					break;
  				case TYPE_FLOAT: {
  					float f = Val->getFloat();
 -					Buffer->PutDWORD(*((uint32 *)&f));
 +					buffer->PutDWORD(*((uint32 *)&f));
  					break;
  				}
  				case TYPE_DOUBLE: {
  					double d = Val->getFloat();
  					uint32 *pd = (uint32 *)&d;
 -					Buffer->PutDWORD(pd[0]);
 -					Buffer->PutDWORD(pd[1]);
 +					buffer->PutDWORD(pd[0]);
 +					buffer->PutDWORD(pd[1]);
  					break;
  				}
  				}
 @@ -1389,10 +1389,10 @@ HRESULT CScScript::ExternalCall(CScStack *stack, CScStack *thisStack, CScScript:  			bool StackCorrupted = false;
  			switch (Function->call_type) {
  			case CALL_CDECL:
 -				ret = Call_cdecl(Buffer->_buffer, Buffer->GetSize(), (uint32)pFunc, &StackCorrupted);
 +				ret = Call_cdecl(buffer->_buffer, buffer->GetSize(), (uint32)pFunc, &StackCorrupted);
  				break;
  			default:
 -				ret = Call_stdcall(Buffer->_buffer, Buffer->GetSize(), (uint32)pFunc, &StackCorrupted);
 +				ret = Call_stdcall(buffer->_buffer, buffer->GetSize(), (uint32)pFunc, &StackCorrupted);
  			}
  			delete Buffer;
 diff --git a/engines/wintermute/Base/scriptables/ScValue.h b/engines/wintermute/Base/scriptables/ScValue.h index 3c25a4d1e7..887a39e50f 100644 --- a/engines/wintermute/Base/scriptables/ScValue.h +++ b/engines/wintermute/Base/scriptables/ScValue.h @@ -52,7 +52,7 @@ public:  	DECLARE_PERSISTENT(CScValue, CBBase)
  	bool _isConstVar;
 -	HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	void setValue(CScValue *Val);
  	bool _persistent;
  	bool propExists(const char *name);
 diff --git a/engines/wintermute/UI/UIButton.cpp b/engines/wintermute/UI/UIButton.cpp index dffb9532da..0131f0bd02 100644 --- a/engines/wintermute/UI/UIButton.cpp +++ b/engines/wintermute/UI/UIButton.cpp @@ -96,8 +96,8 @@ CUIButton::~CUIButton() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CUIButton::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CUIButton::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -107,10 +107,10 @@ HRESULT CUIButton::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing BUTTON file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing BUTTON file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -155,7 +155,7 @@ TOKEN_DEF(PIXEL_PERFECT)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUIButton::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CUIButton::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(BUTTON)
  	TOKEN_TABLE(TEMPLATE)
 @@ -199,15 +199,15 @@ HRESULT CUIButton::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd = 2;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_BUTTON) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_BUTTON) {
  			Game->LOG(0, "'BUTTON' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while (cmd > 0 && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -440,101 +440,101 @@ HRESULT CUIButton::loadBuffer(byte  *Buffer, bool Complete) {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUIButton::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "BUTTON\n");
 -	Buffer->putTextIndent(Indent, "{\n");
 +HRESULT CUIButton::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "BUTTON\n");
 +	buffer->putTextIndent(indent, "{\n");
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	if (_back && _back->_filename)
 -		Buffer->putTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
 +		buffer->putTextIndent(indent + 2, "BACK=\"%s\"\n", _back->_filename);
  	if (_backHover && _backHover->_filename)
 -		Buffer->putTextIndent(Indent + 2, "BACK_HOVER=\"%s\"\n", _backHover->_filename);
 +		buffer->putTextIndent(indent + 2, "BACK_HOVER=\"%s\"\n", _backHover->_filename);
  	if (_backPress && _backPress->_filename)
 -		Buffer->putTextIndent(Indent + 2, "BACK_PRESS=\"%s\"\n", _backPress->_filename);
 +		buffer->putTextIndent(indent + 2, "BACK_PRESS=\"%s\"\n", _backPress->_filename);
  	if (_backDisable && _backDisable->_filename)
 -		Buffer->putTextIndent(Indent + 2, "BACK_DISABLE=\"%s\"\n", _backDisable->_filename);
 +		buffer->putTextIndent(indent + 2, "BACK_DISABLE=\"%s\"\n", _backDisable->_filename);
  	if (_backFocus && _backFocus->_filename)
 -		Buffer->putTextIndent(Indent + 2, "BACK_FOCUS=\"%s\"\n", _backFocus->_filename);
 +		buffer->putTextIndent(indent + 2, "BACK_FOCUS=\"%s\"\n", _backFocus->_filename);
  	if (_image && _image->_filename)
 -		Buffer->putTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
 +		buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
  	if (_imageHover && _imageHover->_filename)
 -		Buffer->putTextIndent(Indent + 2, "IMAGE_HOVER=\"%s\"\n", _imageHover->_filename);
 +		buffer->putTextIndent(indent + 2, "IMAGE_HOVER=\"%s\"\n", _imageHover->_filename);
  	if (_imagePress && _imagePress->_filename)
 -		Buffer->putTextIndent(Indent + 2, "IMAGE_PRESS=\"%s\"\n", _imagePress->_filename);
 +		buffer->putTextIndent(indent + 2, "IMAGE_PRESS=\"%s\"\n", _imagePress->_filename);
  	if (_imageDisable && _imageDisable->_filename)
 -		Buffer->putTextIndent(Indent + 2, "IMAGE_DISABLE=\"%s\"\n", _imageDisable->_filename);
 +		buffer->putTextIndent(indent + 2, "IMAGE_DISABLE=\"%s\"\n", _imageDisable->_filename);
  	if (_imageFocus && _imageFocus->_filename)
 -		Buffer->putTextIndent(Indent + 2, "IMAGE_FOCUS=\"%s\"\n", _imageFocus->_filename);
 +		buffer->putTextIndent(indent + 2, "IMAGE_FOCUS=\"%s\"\n", _imageFocus->_filename);
  	if (_font && _font->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT=\"%s\"\n", _font->_filename);
  	if (_fontHover && _fontHover->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT_HOVER=\"%s\"\n", _fontHover->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT_HOVER=\"%s\"\n", _fontHover->_filename);
  	if (_fontPress && _fontPress->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT_PRESS=\"%s\"\n", _fontPress->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT_PRESS=\"%s\"\n", _fontPress->_filename);
  	if (_fontDisable && _fontDisable->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT_DISABLE=\"%s\"\n", _fontDisable->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT_DISABLE=\"%s\"\n", _fontDisable->_filename);
  	if (_fontFocus && _fontFocus->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT_FOCUS=\"%s\"\n", _fontFocus->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT_FOCUS=\"%s\"\n", _fontFocus->_filename);
  	if (_cursor && _cursor->_filename)
 -		Buffer->putTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
 +		buffer->putTextIndent(indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	if (_text)
 -		Buffer->putTextIndent(Indent + 2, "TEXT=\"%s\"\n", _text);
 +		buffer->putTextIndent(indent + 2, "TEXT=\"%s\"\n", _text);
  	switch (_align) {
  	case TAL_LEFT:
 -		Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
 +		buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
  		break;
  	case TAL_RIGHT:
 -		Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "right");
 +		buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "right");
  		break;
  	case TAL_CENTER:
 -		Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "center");
 +		buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "center");
  		break;
  	default:
  		warning("CUIButton::SaveAsText - unhandled enum");
  		break;
  	}
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
 -	Buffer->putTextIndent(Indent + 2, "X=%d\n", _posX);
 -	Buffer->putTextIndent(Indent + 2, "Y=%d\n", _posY);
 -	Buffer->putTextIndent(Indent + 2, "WIDTH=%d\n", _width);
 -	Buffer->putTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
 +	buffer->putTextIndent(indent + 2, "X=%d\n", _posX);
 +	buffer->putTextIndent(indent + 2, "Y=%d\n", _posY);
 +	buffer->putTextIndent(indent + 2, "WIDTH=%d\n", _width);
 +	buffer->putTextIndent(indent + 2, "HEIGHT=%d\n", _height);
 -	Buffer->putTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "FOCUSABLE=%s\n", _canFocus ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "CENTER_IMAGE=%s\n", _centerImage ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "PRESSED=%s\n", _stayPressed ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "PIXEL_PERFECT=%s\n", _pixelPerfect ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "FOCUSABLE=%s\n", _canFocus ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "CENTER_IMAGE=%s\n", _centerImage ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "PRESSED=%s\n", _stayPressed ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "PIXEL_PERFECT=%s\n", _pixelPerfect ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// scripts
  	for (int i = 0; i < _scripts.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
 +		buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
  	}
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// editor properties
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n");
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/UI/UIButton.h b/engines/wintermute/UI/UIButton.h index 856afc5be0..cb14a68d5c 100644 --- a/engines/wintermute/UI/UIButton.h +++ b/engines/wintermute/UI/UIButton.h @@ -64,8 +64,8 @@ public:  	CUIButton(CBGame *inGame = NULL);
  	virtual ~CUIButton();
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	// scripting interface
  	virtual CScValue *scGetProperty(const char *name);
 diff --git a/engines/wintermute/UI/UIEdit.cpp b/engines/wintermute/UI/UIEdit.cpp index 87d70c8f88..5ad3c3fcdf 100644 --- a/engines/wintermute/UI/UIEdit.cpp +++ b/engines/wintermute/UI/UIEdit.cpp @@ -95,8 +95,8 @@ CUIEdit::~CUIEdit() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CUIEdit::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CUIEdit::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -106,9 +106,9 @@ HRESULT CUIEdit::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing EDIT file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing EDIT file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -139,7 +139,7 @@ TOKEN_DEF(EDIT)  TOKEN_DEF(CAPTION)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUIEdit::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CUIEdit::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(TEMPLATE)
  	TOKEN_TABLE(DISABLED)
 @@ -169,15 +169,15 @@ HRESULT CUIEdit::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd = 2;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_EDIT) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_EDIT) {
  			Game->LOG(0, "'EDIT' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while (cmd > 0 && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -302,59 +302,59 @@ HRESULT CUIEdit::loadBuffer(byte  *Buffer, bool Complete) {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUIEdit::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "EDIT\n");
 -	Buffer->putTextIndent(Indent, "{\n");
 +HRESULT CUIEdit::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "EDIT\n");
 +	buffer->putTextIndent(indent, "{\n");
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	if (_back && _back->_filename)
 -		Buffer->putTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
 +		buffer->putTextIndent(indent + 2, "BACK=\"%s\"\n", _back->_filename);
  	if (_image && _image->_filename)
 -		Buffer->putTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
 +		buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
  	if (_font && _font->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT=\"%s\"\n", _font->_filename);
  	if (_fontSelected && _fontSelected->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT_SELECTED=\"%s\"\n", _fontSelected->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT_SELECTED=\"%s\"\n", _fontSelected->_filename);
  	if (_cursor && _cursor->_filename)
 -		Buffer->putTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
 +		buffer->putTextIndent(indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	if (_text)
 -		Buffer->putTextIndent(Indent + 2, "TEXT=\"%s\"\n", _text);
 +		buffer->putTextIndent(indent + 2, "TEXT=\"%s\"\n", _text);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
 -	Buffer->putTextIndent(Indent + 2, "X=%d\n", _posX);
 -	Buffer->putTextIndent(Indent + 2, "Y=%d\n", _posY);
 -	Buffer->putTextIndent(Indent + 2, "WIDTH=%d\n", _width);
 -	Buffer->putTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
 -	Buffer->putTextIndent(Indent + 2, "MAX_LENGTH=%d\n", _maxLength);
 -	Buffer->putTextIndent(Indent + 2, "CURSOR_BLINK_RATE=%d\n", _cursorBlinkRate);
 -	Buffer->putTextIndent(Indent + 2, "FRAME_WIDTH=%d\n", _frameWidth);
 +	buffer->putTextIndent(indent + 2, "X=%d\n", _posX);
 +	buffer->putTextIndent(indent + 2, "Y=%d\n", _posY);
 +	buffer->putTextIndent(indent + 2, "WIDTH=%d\n", _width);
 +	buffer->putTextIndent(indent + 2, "HEIGHT=%d\n", _height);
 +	buffer->putTextIndent(indent + 2, "MAX_LENGTH=%d\n", _maxLength);
 +	buffer->putTextIndent(indent + 2, "CURSOR_BLINK_RATE=%d\n", _cursorBlinkRate);
 +	buffer->putTextIndent(indent + 2, "FRAME_WIDTH=%d\n", _frameWidth);
 -	Buffer->putTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
  	// scripts
  	for (int i = 0; i < _scripts.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
 +		buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
  	}
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// editor properties
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n");
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/UI/UIEdit.h b/engines/wintermute/UI/UIEdit.h index 0db087e4df..936cf0b72d 100644 --- a/engines/wintermute/UI/UIEdit.h +++ b/engines/wintermute/UI/UIEdit.h @@ -57,8 +57,8 @@ public:  	virtual ~CUIEdit();
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	// scripting interface
  	virtual CScValue *scGetProperty(const char *name);
 diff --git a/engines/wintermute/UI/UIEntity.cpp b/engines/wintermute/UI/UIEntity.cpp index a396ae0560..e9d3662471 100644 --- a/engines/wintermute/UI/UIEntity.cpp +++ b/engines/wintermute/UI/UIEntity.cpp @@ -56,8 +56,8 @@ CUIEntity::~CUIEntity() {  //////////////////////////////////////////////////////////////////////////
  HRESULT CUIEntity::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CUIEntity::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -67,10 +67,10 @@ HRESULT CUIEntity::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ENTITY container file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing ENTITY container file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -89,7 +89,7 @@ TOKEN_DEF(SCRIPT)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUIEntity::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CUIEntity::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(ENTITY_CONTAINER)
  	TOKEN_TABLE(TEMPLATE)
 @@ -107,15 +107,15 @@ HRESULT CUIEntity::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd = 2;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_ENTITY_CONTAINER) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_ENTITY_CONTAINER) {
  			Game->LOG(0, "'ENTITY_CONTAINER' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while (cmd > 0 && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -174,36 +174,36 @@ HRESULT CUIEntity::loadBuffer(byte  *Buffer, bool Complete) {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUIEntity::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "ENTITY_CONTAINER\n");
 -	Buffer->putTextIndent(Indent, "{\n");
 +HRESULT CUIEntity::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "ENTITY_CONTAINER\n");
 +	buffer->putTextIndent(indent, "{\n");
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
 -	Buffer->putTextIndent(Indent + 2, "X=%d\n", _posX);
 -	Buffer->putTextIndent(Indent + 2, "Y=%d\n", _posY);
 +	buffer->putTextIndent(indent + 2, "X=%d\n", _posX);
 +	buffer->putTextIndent(indent + 2, "Y=%d\n", _posY);
 -	Buffer->putTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
  	if (_entity && _entity->_filename)
 -		Buffer->putTextIndent(Indent + 2, "ENTITY=\"%s\"\n", _entity->_filename);
 +		buffer->putTextIndent(indent + 2, "ENTITY=\"%s\"\n", _entity->_filename);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// scripts
  	for (int i = 0; i < _scripts.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
 +		buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
  	}
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// editor properties
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n");
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/UI/UIEntity.h b/engines/wintermute/UI/UIEntity.h index 8722ac304b..f096af390c 100644 --- a/engines/wintermute/UI/UIEntity.h +++ b/engines/wintermute/UI/UIEntity.h @@ -40,7 +40,7 @@ public:  	virtual ~CUIEntity();
  	HRESULT loadFile(const char *filename);
  	HRESULT loadBuffer(byte  *Buffer, bool Complete);
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	virtual HRESULT display(int OffsetX = 0, int OffsetY = 0);
  	CAdEntity *_entity;
 diff --git a/engines/wintermute/UI/UIObject.cpp b/engines/wintermute/UI/UIObject.cpp index 26d903990d..aad8e23900 100644 --- a/engines/wintermute/UI/UIObject.cpp +++ b/engines/wintermute/UI/UIObject.cpp @@ -582,7 +582,7 @@ HRESULT CUIObject::persist(CBPersistMgr *persistMgr) {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUIObject::saveAsText(CBDynBuffer *Buffer, int Indent) {
 +HRESULT CUIObject::saveAsText(CBDynBuffer *buffer, int indent) {
  	return E_FAIL;
  }
 diff --git a/engines/wintermute/UI/UIObject.h b/engines/wintermute/UI/UIObject.h index f1ebd81f8c..ad7384860e 100644 --- a/engines/wintermute/UI/UIObject.h +++ b/engines/wintermute/UI/UIObject.h @@ -69,7 +69,7 @@ public:  	uint32 _listenerParamDWORD;
  	CBScriptHolder *_listenerObject;
  	CUIObject *_focusedWidget;
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	// scripting interface
  	virtual CScValue *scGetProperty(const char *name);
 diff --git a/engines/wintermute/UI/UIText.cpp b/engines/wintermute/UI/UIText.cpp index afb6a6976c..dce7f48731 100644 --- a/engines/wintermute/UI/UIText.cpp +++ b/engines/wintermute/UI/UIText.cpp @@ -96,8 +96,8 @@ HRESULT CUIText::display(int OffsetX, int OffsetY) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CUIText::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CUIText::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -107,9 +107,9 @@ HRESULT CUIText::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing STATIC file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing STATIC file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -138,7 +138,7 @@ TOKEN_DEF(PARENT_NOTIFY)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUIText::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CUIText::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(STATIC)
  	TOKEN_TABLE(TEMPLATE)
 @@ -166,15 +166,15 @@ HRESULT CUIText::loadBuffer(byte  *Buffer, bool Complete) {  	int cmd = 2;
  	CBParser parser(Game);
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_STATIC) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_STATIC) {
  			Game->LOG(0, "'STATIC' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while (cmd > 0 && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -293,39 +293,39 @@ HRESULT CUIText::loadBuffer(byte  *Buffer, bool Complete) {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUIText::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "STATIC\n");
 -	Buffer->putTextIndent(Indent, "{\n");
 +HRESULT CUIText::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "STATIC\n");
 +	buffer->putTextIndent(indent, "{\n");
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	if (_back && _back->_filename)
 -		Buffer->putTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
 +		buffer->putTextIndent(indent + 2, "BACK=\"%s\"\n", _back->_filename);
  	if (_image && _image->_filename)
 -		Buffer->putTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
 +		buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
  	if (_font && _font->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT=\"%s\"\n", _font->_filename);
  	if (_cursor && _cursor->_filename)
 -		Buffer->putTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
 +		buffer->putTextIndent(indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
  	if (_text)
 -		Buffer->putTextIndent(Indent + 2, "TEXT=\"%s\"\n", _text);
 +		buffer->putTextIndent(indent + 2, "TEXT=\"%s\"\n", _text);
  	switch (_textAlign) {
  	case TAL_LEFT:
 -		Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
 +		buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "left");
  		break;
  	case TAL_RIGHT:
 -		Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "right");
 +		buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "right");
  		break;
  	case TAL_CENTER:
 -		Buffer->putTextIndent(Indent + 2, "TEXT_ALIGN=\"%s\"\n", "center");
 +		buffer->putTextIndent(indent + 2, "TEXT_ALIGN=\"%s\"\n", "center");
  		break;
  	default:
  		error("CUIText::SaveAsText - Unhandled enum");
 @@ -334,42 +334,42 @@ HRESULT CUIText::saveAsText(CBDynBuffer *Buffer, int Indent) {  	switch (_verticalAlign) {
  	case VAL_TOP:
 -		Buffer->putTextIndent(Indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "top");
 +		buffer->putTextIndent(indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "top");
  		break;
  	case VAL_BOTTOM:
 -		Buffer->putTextIndent(Indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "bottom");
 +		buffer->putTextIndent(indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "bottom");
  		break;
  	case VAL_CENTER:
 -		Buffer->putTextIndent(Indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "center");
 +		buffer->putTextIndent(indent + 2, "VERTICAL_ALIGN=\"%s\"\n", "center");
  		break;
  	default:
  		error("UIText::SaveAsText - Unhandled enum value: NUM_VERTICAL_ALIGN");
  	}
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
 -	Buffer->putTextIndent(Indent + 2, "X=%d\n", _posX);
 -	Buffer->putTextIndent(Indent + 2, "Y=%d\n", _posY);
 -	Buffer->putTextIndent(Indent + 2, "WIDTH=%d\n", _width);
 -	Buffer->putTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
 +	buffer->putTextIndent(indent + 2, "X=%d\n", _posX);
 +	buffer->putTextIndent(indent + 2, "Y=%d\n", _posY);
 +	buffer->putTextIndent(indent + 2, "WIDTH=%d\n", _width);
 +	buffer->putTextIndent(indent + 2, "HEIGHT=%d\n", _height);
 -	Buffer->putTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// scripts
  	for (int i = 0; i < _scripts.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
 +		buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
  	}
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// editor properties
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n");
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/UI/UIText.h b/engines/wintermute/UI/UIText.h index 5ef3c85df9..876b6762f7 100644 --- a/engines/wintermute/UI/UIText.h +++ b/engines/wintermute/UI/UIText.h @@ -44,8 +44,8 @@ public:  	TTextAlign _textAlign;
  	TVerticalAlign _verticalAlign;
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	// scripting interface
  	virtual CScValue *scGetProperty(const char *name);
 diff --git a/engines/wintermute/UI/UITiledImage.cpp b/engines/wintermute/UI/UITiledImage.cpp index d0f9cdb0f2..a56d3af9c1 100644 --- a/engines/wintermute/UI/UITiledImage.cpp +++ b/engines/wintermute/UI/UITiledImage.cpp @@ -120,8 +120,8 @@ HRESULT CUITiledImage::display(int X, int Y, int Width, int Height) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CUITiledImage::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CUITiledImage::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -131,10 +131,10 @@ HRESULT CUITiledImage::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TILED_IMAGE file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing TILED_IMAGE file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -158,7 +158,7 @@ TOKEN_DEF(HORIZONTAL_TILES)  TOKEN_DEF(EDITOR_PROPERTY)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUITiledImage::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CUITiledImage::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(TILED_IMAGE)
  	TOKEN_TABLE(TEMPLATE)
 @@ -184,15 +184,15 @@ HRESULT CUITiledImage::loadBuffer(byte  *Buffer, bool Complete) {  	int H1 = 0, H2 = 0, H3 = 0;
  	int V1 = 0, V2 = 0, V3 = 0;
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_TILED_IMAGE) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_TILED_IMAGE) {
  			Game->LOG(0, "'TILED_IMAGE' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
 +	while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -307,12 +307,12 @@ HRESULT CUITiledImage::loadBuffer(byte  *Buffer, bool Complete) {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUITiledImage::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "TILED_IMAGE\n");
 -	Buffer->putTextIndent(Indent, "{\n");
 +HRESULT CUITiledImage::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "TILED_IMAGE\n");
 +	buffer->putTextIndent(indent, "{\n");
  	if (_image && _image->_surfaceFilename)
 -		Buffer->putTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_surfaceFilename);
 +		buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_surfaceFilename);
  	int H1, H2, H3;
  	int V1, V2, V3;
 @@ -326,13 +326,13 @@ HRESULT CUITiledImage::saveAsText(CBDynBuffer *Buffer, int Indent) {  	V3 = _downLeft.bottom - _downLeft.top;
 -	Buffer->putTextIndent(Indent + 2, "VERTICAL_TILES { %d, %d, %d }\n", V1, V2, V3);
 -	Buffer->putTextIndent(Indent + 2, "HORIZONTAL_TILES { %d, %d, %d }\n", H1, H2, H3);
 +	buffer->putTextIndent(indent + 2, "VERTICAL_TILES { %d, %d, %d }\n", V1, V2, V3);
 +	buffer->putTextIndent(indent + 2, "HORIZONTAL_TILES { %d, %d, %d }\n", H1, H2, H3);
  	// editor properties
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n");
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/UI/UITiledImage.h b/engines/wintermute/UI/UITiledImage.h index 16712746c5..60b95c12d9 100644 --- a/engines/wintermute/UI/UITiledImage.h +++ b/engines/wintermute/UI/UITiledImage.h @@ -39,8 +39,8 @@ public:  	DECLARE_PERSISTENT(CUITiledImage, CBObject)
  	void correctSize(int *Width, int *Height);
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	HRESULT display(int X, int Y, int Width, int Height);
  	CUITiledImage(CBGame *inGame = NULL);
 diff --git a/engines/wintermute/UI/UIWindow.cpp b/engines/wintermute/UI/UIWindow.cpp index fd36971847..c2eef79210 100644 --- a/engines/wintermute/UI/UIWindow.cpp +++ b/engines/wintermute/UI/UIWindow.cpp @@ -201,8 +201,8 @@ HRESULT CUIWindow::display(int OffsetX, int OffsetY) {  //////////////////////////////////////////////////////////////////////////
  HRESULT CUIWindow::loadFile(const char *filename) {
 -	byte *Buffer = Game->_fileManager->readWholeFile(filename);
 -	if (Buffer == NULL) {
 +	byte *buffer = Game->_fileManager->readWholeFile(filename);
 +	if (buffer == NULL) {
  		Game->LOG(0, "CUIWindow::LoadFile failed for file '%s'", filename);
  		return E_FAIL;
  	}
 @@ -212,9 +212,9 @@ HRESULT CUIWindow::loadFile(const char *filename) {  	_filename = new char [strlen(filename) + 1];
  	strcpy(_filename, filename);
 -	if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing WINDOW file '%s'", filename);
 +	if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing WINDOW file '%s'", filename);
 -	delete [] Buffer;
 +	delete [] buffer;
  	return ret;
  }
 @@ -259,7 +259,7 @@ TOKEN_DEF(EDITOR_PROPERTY)  TOKEN_DEF(EDIT)
  TOKEN_DEF_END
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUIWindow::loadBuffer(byte  *Buffer, bool Complete) {
 +HRESULT CUIWindow::loadBuffer(byte *buffer, bool complete) {
  	TOKEN_TABLE_START(commands)
  	TOKEN_TABLE(WINDOW)
  	TOKEN_TABLE(ALPHA_COLOR)
 @@ -306,15 +306,15 @@ HRESULT CUIWindow::loadBuffer(byte  *Buffer, bool Complete) {  	int FadeR = 0, FadeG = 0, FadeB = 0, FadeA = 0;
  	int ar = 0, ag = 0, ab = 0, alpha = 0;
 -	if (Complete) {
 -		if (parser.GetCommand((char **)&Buffer, commands, (char **)¶ms) != TOKEN_WINDOW) {
 +	if (complete) {
 +		if (parser.GetCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_WINDOW) {
  			Game->LOG(0, "'WINDOW' keyword expected.");
  			return E_FAIL;
  		}
 -		Buffer = params;
 +		buffer = params;
  	}
 -	while (cmd >= PARSERR_TOKENNOTFOUND && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) >= PARSERR_TOKENNOTFOUND) {
 +	while (cmd >= PARSERR_TOKENNOTFOUND && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) >= PARSERR_TOKENNOTFOUND) {
  		switch (cmd) {
  		case TOKEN_TEMPLATE:
  			if (FAILED(loadFile((char *)params))) cmd = PARSERR_GENERIC;
 @@ -538,7 +538,7 @@ HRESULT CUIWindow::loadBuffer(byte  *Buffer, bool Complete) {  		default:
 -			if (FAILED(Game->windowLoadHook(this, (char **)&Buffer, (char **)params))) {
 +			if (FAILED(Game->windowLoadHook(this, (char **)&buffer, (char **)params))) {
  				cmd = PARSERR_GENERIC;
  			}
  		}
 @@ -567,105 +567,105 @@ HRESULT CUIWindow::loadBuffer(byte  *Buffer, bool Complete) {  }
  //////////////////////////////////////////////////////////////////////////
 -HRESULT CUIWindow::saveAsText(CBDynBuffer *Buffer, int Indent) {
 -	Buffer->putTextIndent(Indent, "WINDOW\n");
 -	Buffer->putTextIndent(Indent, "{\n");
 +HRESULT CUIWindow::saveAsText(CBDynBuffer *buffer, int indent) {
 +	buffer->putTextIndent(indent, "WINDOW\n");
 +	buffer->putTextIndent(indent, "{\n");
 -	Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _name);
 -	Buffer->putTextIndent(Indent + 2, "CAPTION=\"%s\"\n", getCaption());
 +	buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
 +	buffer->putTextIndent(indent + 2, "CAPTION=\"%s\"\n", getCaption());
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	if (_back && _back->_filename)
 -		Buffer->putTextIndent(Indent + 2, "BACK=\"%s\"\n", _back->_filename);
 +		buffer->putTextIndent(indent + 2, "BACK=\"%s\"\n", _back->_filename);
  	if (_backInactive && _backInactive->_filename)
 -		Buffer->putTextIndent(Indent + 2, "BACK_INACTIVE=\"%s\"\n", _backInactive->_filename);
 +		buffer->putTextIndent(indent + 2, "BACK_INACTIVE=\"%s\"\n", _backInactive->_filename);
  	if (_image && _image->_filename)
 -		Buffer->putTextIndent(Indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
 +		buffer->putTextIndent(indent + 2, "IMAGE=\"%s\"\n", _image->_filename);
  	if (_imageInactive && _imageInactive->_filename)
 -		Buffer->putTextIndent(Indent + 2, "IMAGE_INACTIVE=\"%s\"\n", _imageInactive->_filename);
 +		buffer->putTextIndent(indent + 2, "IMAGE_INACTIVE=\"%s\"\n", _imageInactive->_filename);
  	if (_font && _font->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT=\"%s\"\n", _font->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT=\"%s\"\n", _font->_filename);
  	if (_fontInactive && _fontInactive->_filename)
 -		Buffer->putTextIndent(Indent + 2, "FONT_INACTIVE=\"%s\"\n", _fontInactive->_filename);
 +		buffer->putTextIndent(indent + 2, "FONT_INACTIVE=\"%s\"\n", _fontInactive->_filename);
  	if (_cursor && _cursor->_filename)
 -		Buffer->putTextIndent(Indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
 +		buffer->putTextIndent(indent + 2, "CURSOR=\"%s\"\n", _cursor->_filename);
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	if (_text)
 -		Buffer->putTextIndent(Indent + 2, "TITLE=\"%s\"\n", _text);
 +		buffer->putTextIndent(indent + 2, "TITLE=\"%s\"\n", _text);
  	switch (_titleAlign) {
  	case TAL_LEFT:
 -		Buffer->putTextIndent(Indent + 2, "TITLE_ALIGN=\"%s\"\n", "left");
 +		buffer->putTextIndent(indent + 2, "TITLE_ALIGN=\"%s\"\n", "left");
  		break;
  	case TAL_RIGHT:
 -		Buffer->putTextIndent(Indent + 2, "TITLE_ALIGN=\"%s\"\n", "right");
 +		buffer->putTextIndent(indent + 2, "TITLE_ALIGN=\"%s\"\n", "right");
  		break;
  	case TAL_CENTER:
 -		Buffer->putTextIndent(Indent + 2, "TITLE_ALIGN=\"%s\"\n", "center");
 +		buffer->putTextIndent(indent + 2, "TITLE_ALIGN=\"%s\"\n", "center");
  		break;
  	default:
  		error("UIWindow::SaveAsText - Unhandled enum-value NUM_TEXT_ALIGN");
  	}
  	if (!CBPlatform::IsRectEmpty(&_titleRect)) {
 -		Buffer->putTextIndent(Indent + 2, "TITLE_RECT { %d, %d, %d, %d }\n", _titleRect.left, _titleRect.top, _titleRect.right, _titleRect.bottom);
 +		buffer->putTextIndent(indent + 2, "TITLE_RECT { %d, %d, %d, %d }\n", _titleRect.left, _titleRect.top, _titleRect.right, _titleRect.bottom);
  	}
  	if (!CBPlatform::IsRectEmpty(&_dragRect)) {
 -		Buffer->putTextIndent(Indent + 2, "DRAG_RECT { %d, %d, %d, %d }\n", _dragRect.left, _dragRect.top, _dragRect.right, _dragRect.bottom);
 +		buffer->putTextIndent(indent + 2, "DRAG_RECT { %d, %d, %d, %d }\n", _dragRect.left, _dragRect.top, _dragRect.right, _dragRect.bottom);
  	}
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
 -	Buffer->putTextIndent(Indent + 2, "X=%d\n", _posX);
 -	Buffer->putTextIndent(Indent + 2, "Y=%d\n", _posY);
 -	Buffer->putTextIndent(Indent + 2, "WIDTH=%d\n", _width);
 -	Buffer->putTextIndent(Indent + 2, "HEIGHT=%d\n", _height);
 +	buffer->putTextIndent(indent + 2, "X=%d\n", _posX);
 +	buffer->putTextIndent(indent + 2, "Y=%d\n", _posY);
 +	buffer->putTextIndent(indent + 2, "WIDTH=%d\n", _width);
 +	buffer->putTextIndent(indent + 2, "HEIGHT=%d\n", _height);
 -	Buffer->putTextIndent(Indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "DISABLED=%s\n", _disable ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "VISIBLE=%s\n", _visible ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "PARENT_NOTIFY=%s\n", _parentNotify ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "TRANSPARENT=%s\n", _transparent ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "PAUSE_MUSIC=%s\n", _pauseMusic ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "MENU=%s\n", _isMenu ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "IN_GAME=%s\n", _inGame ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "CLIP_CONTENTS=%s\n", _clipContents ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "TRANSPARENT=%s\n", _transparent ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "PAUSE_MUSIC=%s\n", _pauseMusic ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "MENU=%s\n", _isMenu ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "IN_GAME=%s\n", _inGame ? "TRUE" : "FALSE");
 +	buffer->putTextIndent(indent + 2, "CLIP_CONTENTS=%s\n", _clipContents ? "TRUE" : "FALSE");
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	if (_fadeBackground) {
 -		Buffer->putTextIndent(Indent + 2, "FADE_COLOR { %d, %d, %d }\n", D3DCOLGetR(_fadeColor), D3DCOLGetG(_fadeColor), D3DCOLGetB(_fadeColor));
 -		Buffer->putTextIndent(Indent + 2, "FADE_ALPHA=%d\n", D3DCOLGetA(_fadeColor));
 +		buffer->putTextIndent(indent + 2, "FADE_COLOR { %d, %d, %d }\n", D3DCOLGetR(_fadeColor), D3DCOLGetG(_fadeColor), D3DCOLGetB(_fadeColor));
 +		buffer->putTextIndent(indent + 2, "FADE_ALPHA=%d\n", D3DCOLGetA(_fadeColor));
  	}
 -	Buffer->putTextIndent(Indent + 2, "ALPHA_COLOR { %d, %d, %d }\n", D3DCOLGetR(_alphaColor), D3DCOLGetG(_alphaColor), D3DCOLGetB(_alphaColor));
 -	Buffer->putTextIndent(Indent + 2, "ALPHA=%d\n", D3DCOLGetA(_alphaColor));
 +	buffer->putTextIndent(indent + 2, "ALPHA_COLOR { %d, %d, %d }\n", D3DCOLGetR(_alphaColor), D3DCOLGetG(_alphaColor), D3DCOLGetB(_alphaColor));
 +	buffer->putTextIndent(indent + 2, "ALPHA=%d\n", D3DCOLGetA(_alphaColor));
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// scripts
  	for (int i = 0; i < _scripts.GetSize(); i++) {
 -		Buffer->putTextIndent(Indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
 +		buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
  	}
 -	Buffer->putTextIndent(Indent + 2, "\n");
 +	buffer->putTextIndent(indent + 2, "\n");
  	// editor properties
 -	CBBase::saveAsText(Buffer, Indent + 2);
 +	CBBase::saveAsText(buffer, indent + 2);
  	// controls
  	for (int i = 0; i < _widgets.GetSize(); i++)
 -		_widgets[i]->saveAsText(Buffer, Indent + 2);
 +		_widgets[i]->saveAsText(buffer, indent + 2);
 -	Buffer->putTextIndent(Indent, "}\n");
 +	buffer->putTextIndent(indent, "}\n");
  	return S_OK;
  }
 diff --git a/engines/wintermute/UI/UIWindow.h b/engines/wintermute/UI/UIWindow.h index c29038860d..6f639cc603 100644 --- a/engines/wintermute/UI/UIWindow.h +++ b/engines/wintermute/UI/UIWindow.h @@ -74,12 +74,12 @@ public:  	CBArray<CUIObject *, CUIObject *> _widgets;
  	TTextAlign _titleAlign;
  	HRESULT loadFile(const char *filename);
 -	HRESULT loadBuffer(byte  *Buffer, bool Complete = true);
 +	HRESULT loadBuffer(byte *buffer, bool complete = true);
  	CUITiledImage *_backInactive;
  	CBFont *_fontInactive;
  	CBSprite *_imageInactive;
  	virtual HRESULT listen(CBScriptHolder *param1, uint32 param2);
 -	virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
 +	virtual HRESULT saveAsText(CBDynBuffer *buffer, int indent);
  	// scripting interface
  	virtual CScValue *scGetProperty(const char *name);
  | 
