[Scummvm-cvs-logs] SF.net SVN: scummvm:[47875] scummvm/trunk/engines/sci/graphics
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Thu Feb 4 13:07:27 CET 2010
Revision: 47875
http://scummvm.svn.sourceforge.net/scummvm/?rev=47875&view=rev
Author: m_kiewitz
Date: 2010-02-04 12:07:27 +0000 (Thu, 04 Feb 2010)
Log Message:
-----------
SCI: support for resX, resY inside frameout
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/frameout.cpp
scummvm/trunk/engines/sci/graphics/frameout.h
scummvm/trunk/engines/sci/graphics/gui32.cpp
Modified: scummvm/trunk/engines/sci/graphics/frameout.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/frameout.cpp 2010-02-04 12:01:19 UTC (rev 47874)
+++ scummvm/trunk/engines/sci/graphics/frameout.cpp 2010-02-04 12:07:27 UTC (rev 47875)
@@ -106,6 +106,7 @@
int16 planePictureCel;
int16 planePriority;
int16 planeTop, planeLeft;
+ int16 planeResY, planeResX;
reg_t itemObject;
reg_t itemPlane;
@@ -132,6 +133,8 @@
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,13 +151,19 @@
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->y += planeTop;
itemEntry->x += planeLeft;
- itemEntry->y += planeTop;
+ 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++;
itemCount++;
@@ -181,9 +190,9 @@
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()) {
Modified: scummvm/trunk/engines/sci/graphics/frameout.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/frameout.h 2010-02-04 12:01:19 UTC (rev 47874)
+++ scummvm/trunk/engines/sci/graphics/frameout.h 2010-02-04 12:07:27 UTC (rev 47875)
@@ -35,6 +35,7 @@
int16 celNo;
int16 x, y, z;
int16 priority;
+ uint16 signal;
uint16 scaleSignal;
int16 scaleX;
int16 scaleY;
Modified: scummvm/trunk/engines/sci/graphics/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.cpp 2010-02-04 12:01:19 UTC (rev 47874)
+++ scummvm/trunk/engines/sci/graphics/gui32.cpp 2010-02-04 12:07:27 UTC (rev 47875)
@@ -64,13 +64,21 @@
}
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) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list