mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-26 11:46:54 +00:00
SCI: support for resX, resY inside frameout
svn-id: r47875
This commit is contained in:
parent
e3cab50c15
commit
4e090f4ede
@ -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()) {
|
||||
|
@ -35,6 +35,7 @@ struct FrameoutEntry {
|
||||
int16 celNo;
|
||||
int16 x, y, z;
|
||||
int16 priority;
|
||||
uint16 signal;
|
||||
uint16 scaleSignal;
|
||||
int16 scaleX;
|
||||
int16 scaleY;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user