diff options
| author | Strangerke | 2013-10-17 01:43:51 +0200 | 
|---|---|---|
| committer | Willem Jan Palenstijn | 2013-10-17 22:17:10 +0200 | 
| commit | 5f0361c03a5cfd328872684d8bba51ae12f3d1c0 (patch) | |
| tree | 0389dd7ec86b8af474d83b1049f9b716176bf4c7 /engines/avalanche/dialogs.cpp | |
| parent | 5f180a06baa3e9e63015b2efb698770e897875df (diff) | |
| download | scummvm-rg350-5f0361c03a5cfd328872684d8bba51ae12f3d1c0.tar.gz scummvm-rg350-5f0361c03a5cfd328872684d8bba51ae12f3d1c0.tar.bz2 scummvm-rg350-5f0361c03a5cfd328872684d8bba51ae12f3d1c0.zip | |
AVALANCHE: Move Bubble pos to Dialogs, make them private
Diffstat (limited to 'engines/avalanche/dialogs.cpp')
| -rw-r--r-- | engines/avalanche/dialogs.cpp | 35 | 
1 files changed, 22 insertions, 13 deletions
| diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index 750dd80cc6..444b157d1c 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -519,18 +519,18 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {  	int16 my = yw * 2 - 2;  	int16 xc = 0; -	if ((_vm->_talkX - xw) < 0) -		xc = -(_vm->_talkX - xw); -	if ((_vm->_talkX + xw) > 639) -		xc = 639 - (_vm->_talkX + xw); +	if (_talkX - xw < 0) +		xc = -(_talkX - xw); +	if (_talkX + xw > 639) +		xc = 639 - (_talkX + xw);  	// Compute triangle coords for the tail of the bubble -	points[0].x = _vm->_talkX - 10; +	points[0].x = _talkX - 10;  	points[0].y = yw; -	points[1].x = _vm->_talkX + 10; +	points[1].x = _talkX + 10;  	points[1].y = yw; -	points[2].x = _vm->_talkX; -	points[2].y = _vm->_talkY; +	points[2].x = _talkX; +	points[2].y = _talkY;  	_vm->_graphics->prepareBubble(xc, xw, my, points); @@ -538,7 +538,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {  	// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used characters instead.  	// It's almost the same, only notable differences are '?', '!', etc.  	for (int i = 0; i <= _maxLineNum; i++) { -		int16 x = xc + _vm->_talkX - _scroll[i].size() / 2 * 8; +		int16 x = xc + _talkX - _scroll[i].size() / 2 * 8;  		bool offset = _scroll[i].size() % 2;  		_vm->_graphics->drawScrollText(_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_graphics->_talkFontColor);  	} @@ -568,8 +568,8 @@ void Dialogs::reset() {   * @remarks	Originally called 'natural'   */  void Dialogs::setBubbleStateNatural() { -	_vm->_talkX = 320; -	_vm->_talkY = 200; +	_talkX = 320; +	_talkY = 200;  	_vm->_graphics->setDialogColor(kColorDarkgray, kColorWhite);  } @@ -699,8 +699,8 @@ void Dialogs::callDialogDriver() {  					// thing with QPs as triptype.chatter does with the  					// sprites.)  					PedType *quasiPed = &_vm->_peds[kQuasipeds[_param - 10]._whichPed]; -					_vm->_talkX = quasiPed->_x; -					_vm->_talkY = quasiPed->_y; // Position. +					_talkX = quasiPed->_x; +					_talkY = quasiPed->_y; // Position.  					_vm->_graphics->setDialogColor(kQuasipeds[_param - 10]._backgroundColor, kQuasipeds[_param - 10]._textColor);  				} else { @@ -803,6 +803,15 @@ void Dialogs::callDialogDriver() {  	}  } +void Dialogs::setTalkPos(int16 x, int16 y) { +	_talkX = x; +	_talkY = y; +} + +int16 Dialogs::getTalkPosX() { +	return _talkX; +} +  /**   * Display text by calling the dialog driver   * @remarks	Originally called 'display' | 
