[Scummvm-cvs-logs] SF.net SVN: scummvm:[51332] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Mon Jul 26 21:25:56 CEST 2010
Revision: 51332
http://scummvm.svn.sourceforge.net/scummvm/?rev=51332&view=rev
Author: m_kiewitz
Date: 2010-07-26 19:25:56 +0000 (Mon, 26 Jul 2010)
Log Message:
-----------
SCI: implement scaling for kDrawCel
fixes qfg4 demo properly (bug #3034506, previous commit r51304)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kernel_tables.h
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/graphics/paint16.cpp
scummvm/trunk/engines/sci/graphics/paint16.h
Modified: scummvm/trunk/engines/sci/engine/kernel_tables.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel_tables.h 2010-07-26 18:45:32 UTC (rev 51331)
+++ scummvm/trunk/engines/sci/engine/kernel_tables.h 2010-07-26 19:25:56 UTC (rev 51332)
@@ -332,7 +332,7 @@
{ MAP_CALL(DoBresen), SIG_EVERYWHERE, "o", NULL, NULL },
{ MAP_CALL(DoSound), SIG_EVERYWHERE, "i(.*)", kDoSound_subops, NULL },
{ MAP_CALL(DoSync), SIG_EVERYWHERE, "i(.*)", NULL, NULL }, // subop
- { MAP_CALL(DrawCel), SIG_SCI11, SIGFOR_PC, "iiiii(i)(i)(r0)", NULL, NULL }, // for kq6 hires
+ { MAP_CALL(DrawCel), SIG_SCI11, SIGFOR_PC, "iiiii(i)(i)([ri])", NULL, NULL }, // reference for kq6 hires
{ MAP_CALL(DrawCel), SIG_EVERYWHERE, "iiiii(i)(i)", NULL, NULL },
{ MAP_CALL(DrawControl), SIG_EVERYWHERE, "o", NULL, NULL },
{ MAP_CALL(DrawMenuBar), SIG_EVERYWHERE, "i", NULL, NULL },
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-07-26 18:45:32 UTC (rev 51331)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-07-26 19:25:56 UTC (rev 51332)
@@ -1000,11 +1000,27 @@
uint16 y = argv[4].toUint16();
int16 priority = (argc > 5) ? argv[5].toSint16() : -1;
uint16 paletteNo = (argc > 6) ? argv[6].toUint16() : 0;
- bool hiresMode = (argc > 7) ? true : false;
- reg_t upscaledHiresHandle = (argc > 7) ? argv[7] : NULL_REG;
+ bool hiresMode = false;
+ reg_t upscaledHiresHandle = NULL_REG;
+ uint16 scaleX = 128;
+ uint16 scaleY = 128;
- g_sci->_gfxPaint16->kernelDrawCel(viewId, loopNo, celNo, x, y, priority, paletteNo, hiresMode, upscaledHiresHandle);
+ if (argc > 7) {
+ // this is either kq6 hires or scaling
+ if (paletteNo > 0) {
+ // it's scaling
+ scaleX = argv[6].toUint16();
+ scaleY = argv[7].toUint16();
+ paletteNo = 0;
+ } else {
+ // KQ6 hires
+ hiresMode = true;
+ upscaledHiresHandle = argv[7];
+ }
+ }
+ g_sci->_gfxPaint16->kernelDrawCel(viewId, loopNo, celNo, x, y, priority, paletteNo, scaleX, scaleY, hiresMode, upscaledHiresHandle);
+
return s->r_acc;
}
Modified: scummvm/trunk/engines/sci/graphics/paint16.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.cpp 2010-07-26 18:45:32 UTC (rev 51331)
+++ scummvm/trunk/engines/sci/graphics/paint16.cpp 2010-07-26 19:25:56 UTC (rev 51332)
@@ -383,11 +383,11 @@
_ports->setPort(oldPort);
}
-void GfxPaint16::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle) {
+void GfxPaint16::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY, bool hiresMode, reg_t upscaledHiresHandle) {
// some calls are hiresMode even under kq6 DOS, that's why we check for
// upscaled hires here
if ((!hiresMode) || (!_screen->getUpscaledHires())) {
- drawCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
+ drawCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo, scaleX, scaleY);
} else {
drawHiresCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo, upscaledHiresHandle);
}
Modified: scummvm/trunk/engines/sci/graphics/paint16.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.h 2010-07-26 18:45:32 UTC (rev 51331)
+++ scummvm/trunk/engines/sci/graphics/paint16.h 2010-07-26 19:25:56 UTC (rev 51332)
@@ -73,7 +73,7 @@
void bitsFree(reg_t memoryHandle);
void kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
- void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle);
+ void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY, bool hiresMode, reg_t upscaledHiresHandle);
void kernelGraphFillBoxForeground(const Common::Rect &rect);
void kernelGraphFillBoxBackground(const Common::Rect &rect);
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