[Scummvm-cvs-logs] SF.net SVN: scummvm:[53863] scummvm/branches/branch-1-2-0/engines/sci/ graphics
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Tue Oct 26 23:59:37 CEST 2010
Revision: 53863
http://scummvm.svn.sourceforge.net/scummvm/?rev=53863&view=rev
Author: thebluegr
Date: 2010-10-26 21:59:36 +0000 (Tue, 26 Oct 2010)
Log Message:
-----------
SCI: Backported revisions 53828, 53851, 53852, 53853, 53855, 53857: Hoyle 4 fixes and animate cleanup
Modified Paths:
--------------
scummvm/branches/branch-1-2-0/engines/sci/graphics/animate.cpp
scummvm/branches/branch-1-2-0/engines/sci/graphics/animate.h
scummvm/branches/branch-1-2-0/engines/sci/graphics/view.cpp
scummvm/branches/branch-1-2-0/engines/sci/graphics/view.h
Modified: scummvm/branches/branch-1-2-0/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/graphics/animate.cpp 2010-10-26 21:55:29 UTC (rev 53862)
+++ scummvm/branches/branch-1-2-0/engines/sci/graphics/animate.cpp 2010-10-26 21:59:36 UTC (rev 53863)
@@ -219,7 +219,7 @@
writeSelectorValue(_s->_segMan, curObject, SELECTOR(scaleY), entry->scaleY);
}
-void GfxAnimate::fill(byte &old_picNotValid, bool maySetNsRect) {
+void GfxAnimate::fill(byte &old_picNotValid) {
reg_t curObject;
uint16 signal;
GfxView *view = NULL;
@@ -274,7 +274,7 @@
//warning("%s view %d, loop %d, cel %d, signal %x", _s->_segMan->getObjectName(curObject), it->viewId, it->loopNo, it->celNo, it->signal);
- bool setNsRect = maySetNsRect;
+ bool setNsRect = true;
// Create rect according to coordinates and given cel
if (it->scaleSignal & kScaleSignalDoScaling) {
@@ -283,18 +283,20 @@
if ((signal & kSignalHidden) && !(signal & kSignalAlwaysUpdate))
setNsRect = false;
} else {
- view->getCelRect(it->loopNo, it->celNo, it->x, it->y, it->z, it->celRect);
+ // This special handling is not included in the other SCI1.1 interpreters and MUST NOT be
+ // checked in those cases, otherwise we will break games (e.g. EcoQuest 2, room 200)
+ if ((g_sci->getGameId() == GID_HOYLE4) && (it->scaleSignal & kScaleSignalHoyle4SpecialHandling)) {
+ it->celRect.left = readSelectorValue(_s->_segMan, curObject, SELECTOR(nsLeft));
+ it->celRect.top = readSelectorValue(_s->_segMan, curObject, SELECTOR(nsTop));
+ it->celRect.right = readSelectorValue(_s->_segMan, curObject, SELECTOR(nsRight));
+ it->celRect.bottom = readSelectorValue(_s->_segMan, curObject, SELECTOR(nsBottom));
+ view->getCelSpecialHoyle4Rect(it->loopNo, it->celNo, it->x, it->y, it->z, it->celRect);
+ setNsRect = false;
+ } else {
+ view->getCelRect(it->loopNo, it->celNo, it->x, it->y, it->z, it->celRect);
+ }
}
- // This statement must be here for Hoyle4, otherwise cards are unclickable.
- // This is probably one of the experimental features that were occasionally
- // added to SCI interpreters; the corresponding check is absent in many SSCI
- // versions. m_kiewitz knew about this flag before I (lskovlun) implemented it,
- // so it is possible that more test cases are known. Also, some presently open
- // SCI1.1 bugs may be fixed by this and should be re-tested with this patch generalized.
- if (g_sci->getGameId() == GID_HOYLE4 && it->scaleSignal & kScaleSignalDontSetNsrect)
- setNsRect = false;
-
if (setNsRect) {
writeSelectorValue(_s->_segMan, curObject, SELECTOR(nsLeft), it->celRect.left);
writeSelectorValue(_s->_segMan, curObject, SELECTOR(nsTop), it->celRect.top);
@@ -562,7 +564,7 @@
// Get the corresponding view
view = _cache->getView(it->viewId);
- // kAddToPic does not do loop/cel-number fixups, it also doesn't support global scaling
+ // kAddToPic does not do loop/cel-number fixups
if (it->priority == -1)
it->priority = _ports->kernelCoordinateToPriority(it->y);
@@ -657,7 +659,7 @@
disposeLastCast();
makeSortedList(list);
- fill(old_picNotValid, true);
+ fill(old_picNotValid);
if (old_picNotValid) {
// beginUpdate()/endUpdate() were introduced SCI1.
Modified: scummvm/branches/branch-1-2-0/engines/sci/graphics/animate.h
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/graphics/animate.h 2010-10-26 21:55:29 UTC (rev 53862)
+++ scummvm/branches/branch-1-2-0/engines/sci/graphics/animate.h 2010-10-26 21:59:36 UTC (rev 53863)
@@ -51,9 +51,9 @@
};
enum ViewScaleSignals {
- kScaleSignalDoScaling = 0x0001, // enables scaling when drawing that cel (involves scaleX and scaleY)
- kScaleSignalGlobalScaling = 0x0002, // means that global scaling shall get applied on that cel (sets scaleX/scaleY)
- kScaleSignalDontSetNsrect = 0x0004 // do not set nsRect inside kAnimate(); for a test case see bug #3038424
+ kScaleSignalDoScaling = 0x0001, // enables scaling when drawing that cel (involves scaleX and scaleY)
+ kScaleSignalGlobalScaling = 0x0002, // means that global scaling shall get applied on that cel (sets scaleX/scaleY)
+ kScaleSignalHoyle4SpecialHandling = 0x0004 // HOYLE4-exclusive: special handling inside kAnimate, is used when giving out cards
};
@@ -97,7 +97,7 @@
bool invoke(List *list, int argc, reg_t *argv);
void makeSortedList(List *list);
void applyGlobalScaling(AnimateList::iterator entry, GfxView *view);
- void fill(byte &oldPicNotValid, bool maySetNsRect);
+ void fill(byte &oldPicNotValid);
void update();
void drawCels();
void updateScreen(byte oldPicNotValid);
Modified: scummvm/branches/branch-1-2-0/engines/sci/graphics/view.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/graphics/view.cpp 2010-10-26 21:55:29 UTC (rev 53862)
+++ scummvm/branches/branch-1-2-0/engines/sci/graphics/view.cpp 2010-10-26 21:59:36 UTC (rev 53863)
@@ -354,6 +354,16 @@
outRect.top = outRect.bottom - celInfo->height;
}
+void GfxView::getCelSpecialHoyle4Rect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect &outRect) const {
+ const CelInfo *celInfo = getCelInfo(loopNo, celNo);
+ int16 adjustY = y - celInfo->height + celInfo->displaceY + 1;
+ int16 adjustX = x - ((celInfo->width - 1) >> 1) + celInfo->displaceX;
+ outRect.top += adjustY;
+ outRect.bottom += adjustY;
+ outRect.left += adjustX;
+ outRect.right += adjustX;
+}
+
void GfxView::getCelScaledRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, int16 scaleX, int16 scaleY, Common::Rect &outRect) const {
int16 scaledDisplaceX, scaledDisplaceY;
int16 scaledWidth, scaledHeight;
Modified: scummvm/branches/branch-1-2-0/engines/sci/graphics/view.h
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/graphics/view.h 2010-10-26 21:55:29 UTC (rev 53862)
+++ scummvm/branches/branch-1-2-0/engines/sci/graphics/view.h 2010-10-26 21:59:36 UTC (rev 53863)
@@ -66,6 +66,7 @@
int16 getHeight(int16 loopNo, int16 celNo) const;
const CelInfo *getCelInfo(int16 loopNo, int16 celNo) const;
void getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect &outRect) const;
+ void getCelSpecialHoyle4Rect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect &outRect) const;
void getCelScaledRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, int16 scaleX, int16 scaleY, Common::Rect &outRect) const;
const byte *getBitmap(int16 loopNo, int16 celNo);
void draw(const Common::Rect &rect, const Common::Rect &clipRect, const Common::Rect &clipRectTranslated, int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, bool upscaledHires);
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