Skip to content

Commit

Permalink
SCI: Fix SCI32 hires detection making PQ4 unusably slow
Browse files Browse the repository at this point in the history
  • Loading branch information
csnover committed Jan 21, 2016
1 parent 5b6b20f commit 0017cfa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions engines/sci/graphics/frameout.cpp
Expand Up @@ -60,12 +60,19 @@ enum SciSpeciaPlanelPictureCodes {
};

GfxFrameout::GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCoordAdjuster *coordAdjuster, GfxCache *cache, GfxScreen *screen, GfxPalette32 *palette, GfxPaint32 *paint32)
: _segMan(segMan), _resMan(resMan), _cache(cache), _screen(screen), _palette(palette), _paint32(paint32) {
: _segMan(segMan), _resMan(resMan), _cache(cache), _screen(screen), _palette(palette), _paint32(paint32), _isHiRes(false) {

_coordAdjuster = (GfxCoordAdjuster32 *)coordAdjuster;
_curScrollText = -1;
_showScrollText = false;
_maxScrollTexts = 0;

// TODO: Make hires detection work uniformly across all SCI engine
// versions (this flag is normally passed by SCI::MakeGraphicsMgr
// to the GraphicsMgr constructor depending upon video configuration)
if (getSciVersion() >= SCI_VERSION_2_1_EARLY && _resMan->detectHires()) {
_isHiRes = true;
}
}

GfxFrameout::~GfxFrameout() {
Expand Down Expand Up @@ -877,7 +884,7 @@ void GfxFrameout::kernelFrameout() {
view->adjustBackUpscaledCoordinates(nsRect.top, nsRect.left);
view->adjustBackUpscaledCoordinates(nsRect.bottom, nsRect.right);
g_sci->_gfxCompare->setNSRect(itemEntry->object, nsRect);
} else if (getSciVersion() >= SCI_VERSION_2_1_EARLY && _resMan->detectHires()) {
} else if (getSciVersion() >= SCI_VERSION_2_1_EARLY && _isHiRes) {
_coordAdjuster->fromDisplayToScript(nsRect.top, nsRect.left);
_coordAdjuster->fromDisplayToScript(nsRect.bottom, nsRect.right);
g_sci->_gfxCompare->setNSRect(itemEntry->object, nsRect);
Expand Down
2 changes: 2 additions & 0 deletions engines/sci/graphics/frameout.h
Expand Up @@ -153,6 +153,8 @@ class GfxFrameout {
void printPlaneItemList(Console *con, reg_t planeObject);

private:
bool _isHiRes;

void showVideo();
void createPlaneItemList(reg_t planeObject, FrameoutList &itemList);
bool isPictureOutOfView(FrameoutEntry *itemEntry, Common::Rect planeRect, int16 planeOffsetX, int16 planeOffsetY);
Expand Down

0 comments on commit 0017cfa

Please sign in to comment.