diff options
| author | Martin Kiewitz | 2010-02-04 12:07:27 +0000 | 
|---|---|---|
| committer | Martin Kiewitz | 2010-02-04 12:07:27 +0000 | 
| commit | 4e090f4edeffc750679eb851da0394a3c3bf5bc5 (patch) | |
| tree | 3e4c4b671cc93db70592e96b782e5e3cc1a49e27 | |
| parent | e3cab50c15ae5a935e3aced57a638c22f5055d14 (diff) | |
| download | scummvm-rg350-4e090f4edeffc750679eb851da0394a3c3bf5bc5.tar.gz scummvm-rg350-4e090f4edeffc750679eb851da0394a3c3bf5bc5.tar.bz2 scummvm-rg350-4e090f4edeffc750679eb851da0394a3c3bf5bc5.zip | |
SCI: support for resX, resY inside frameout
svn-id: r47875
| -rw-r--r-- | engines/sci/graphics/frameout.cpp | 15 | ||||
| -rw-r--r-- | engines/sci/graphics/frameout.h | 1 | ||||
| -rw-r--r-- | engines/sci/graphics/gui32.cpp | 16 | 
3 files changed, 25 insertions, 7 deletions
| diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 741501744c..9d2d94c4a9 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -106,6 +106,7 @@ void GfxFrameout::kernelFrameout() {  	int16 planePictureCel;  	int16 planePriority;  	int16 planeTop, planeLeft; +	int16 planeResY, planeResX;  	reg_t itemObject;  	reg_t itemPlane; @@ -132,6 +133,8 @@ void GfxFrameout::kernelFrameout() {  		planeTop = GET_SEL32V(_segMan, planeObject, top);  		planeLeft = GET_SEL32V(_segMan, planeObject, left); +		planeResY = GET_SEL32V(_segMan, planeObject, resY); +		planeResX = GET_SEL32V(_segMan, planeObject, resX);  		// Fill our itemlist for this plane  		itemCount = 0; @@ -148,12 +151,18 @@ void GfxFrameout::kernelFrameout() {  				itemEntry->y = GET_SEL32V(_segMan, itemObject, y);  				itemEntry->z = GET_SEL32V(_segMan, itemObject, z);  				itemEntry->priority = GET_SEL32V(_segMan, itemObject, priority); +				itemEntry->signal = GET_SEL32V(_segMan, itemObject, signal);  				itemEntry->scaleX = GET_SEL32V(_segMan, itemObject, scaleX);  				itemEntry->scaleY = GET_SEL32V(_segMan, itemObject, scaleY);  				itemEntry->object = itemObject; -				itemEntry->x += planeLeft;  				itemEntry->y += planeTop; +				itemEntry->x += planeLeft; +				itemEntry->y = ((itemEntry->y * _screen->getHeight()) / planeResY); +				itemEntry->x = ((itemEntry->x * _screen->getWidth()) / planeResX); + +				if (itemEntry->priority == 0) +					itemEntry->priority = itemEntry->y;  				itemList.push_back(itemEntry);  				itemEntry++; @@ -181,9 +190,9 @@ void GfxFrameout::kernelFrameout() {  			if (itemEntry->viewId != 0xFFFF) {  				View *view = _cache->getView(itemEntry->viewId); -				if ((itemEntry->scaleX == 128) && (itemEntry->scaleY == 128)) +				if ((itemEntry->scaleX == 128) && (itemEntry->scaleY == 128)) {  					view->getCelRect(itemEntry->loopNo, itemEntry->celNo, itemEntry->x, itemEntry->y, itemEntry->z, &itemEntry->celRect); -				else +				} else  					view->getCelScaledRect(itemEntry->loopNo, itemEntry->celNo, itemEntry->x, itemEntry->y, itemEntry->z, itemEntry->scaleX, itemEntry->scaleY, &itemEntry->celRect);  				if (itemEntry->celRect.top < 0 || itemEntry->celRect.top >= _screen->getHeight()) { diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h index bd5c13b2da..ce2e9bcf19 100644 --- a/engines/sci/graphics/frameout.h +++ b/engines/sci/graphics/frameout.h @@ -35,6 +35,7 @@ struct FrameoutEntry {  	int16 celNo;  	int16 x, y, z;  	int16 priority; +	uint16 signal;  	uint16 scaleSignal;  	int16 scaleX;  	int16 scaleY; diff --git a/engines/sci/graphics/gui32.cpp b/engines/sci/graphics/gui32.cpp index 61add8a8cd..f06f783853 100644 --- a/engines/sci/graphics/gui32.cpp +++ b/engines/sci/graphics/gui32.cpp @@ -64,13 +64,21 @@ void SciGui32::init() {  }  void SciGui32::globalToLocal(int16 *x, int16 *y, reg_t planeObj) { -	*x = *x - GET_SEL32V(_s->_segMan, planeObj, left); -	*y = *y - GET_SEL32V(_s->_segMan, planeObj, top); +	//int16 resY = GET_SEL32V(_s->_segMan, planeObj, resY); +	//int16 resX = GET_SEL32V(_s->_segMan, planeObj, resX); +	//*x = ( *x * _screen->getWidth()) / resX; +	//*y = ( *y * _screen->getHeight()) / resY; +	*x -= GET_SEL32V(_s->_segMan, planeObj, left); +	*y -= GET_SEL32V(_s->_segMan, planeObj, top);  }  void SciGui32::localToGlobal(int16 *x, int16 *y, reg_t planeObj) { -	*x = *x + GET_SEL32V(_s->_segMan, planeObj, left); -	*y = *y + GET_SEL32V(_s->_segMan, planeObj, top); +	//int16 resY = GET_SEL32V(_s->_segMan, planeObj, resY); +	//int16 resX = GET_SEL32V(_s->_segMan, planeObj, resX); +	*x += GET_SEL32V(_s->_segMan, planeObj, left); +	*y += GET_SEL32V(_s->_segMan, planeObj, top); +	//*x = ( *x * resX) / _screen->getWidth(); +	//*y = ( *y * resY) / _screen->getHeight();  }  void SciGui32::textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight) { | 
