aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorColin Snover2016-01-06 20:03:27 -0600
committerColin Snover2016-01-07 16:35:09 -0600
commit8a1d48fc0373730d9239786aea070b363b346729 (patch)
tree828ee001d5401ade09758d8e48ecf7199169ed39 /engines/sci/graphics
parent70d89b3e394e46bc96a7fde681cd84f36763ee52 (diff)
downloadscummvm-rg350-8a1d48fc0373730d9239786aea070b363b346729.tar.gz
scummvm-rg350-8a1d48fc0373730d9239786aea070b363b346729.tar.bz2
scummvm-rg350-8a1d48fc0373730d9239786aea070b363b346729.zip
SCI32: Add kFrameOut stub code
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/frameout.cpp91
1 files changed, 91 insertions, 0 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 7396115f4c..9512ec2ed1 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -651,6 +651,97 @@ void GfxFrameout::drawPicture(FrameoutEntry *itemEntry, int16 planeOffsetX, int1
// warning("picture cel %d %d", itemEntry->celNo, itemEntry->priority);
}
+/* TODO: This is the proper implementation of GraphicsMgr::FrameOut transcribed from SQ6 SCI engine disassembly.
+static DrawList* g_drawLists[100];
+static RectList* g_rectLists[100];
+void GfxFrameout::FrameOut(bool shouldShowBits, SOL_Rect *rect) {
+ if (robot) {
+ robot.doRobot();
+ }
+
+ auto planeCount = screen.planeList.planeCount;
+ if (planeCount > 0) {
+ for (int planeIndex = 0; planeIndex < planeCount; ++planeIndex) {
+ Plane plane = *screen.planeList[planeIndex];
+
+ DrawList* drawList = new DrawList();
+ g_drawLists[planeIndex] = drawList;
+ RectList* rectList = new RectList();
+ g_rectLists[planeIndex] = rectList;
+ }
+ }
+
+ if (g_Remap_numActiveRemaps > 0 && remapNeeded) {
+ screen.RemapMarkRedraw();
+ }
+
+ CalcLists(&g_drawLists, &g_rectLists, rect);
+
+ // SCI engine stores reference *after* CalcLists
+ planeCount = screen.planeList.planeCount;
+ if (planeCount > 0) {
+ for (int drawListIndex = 0; drawListIndex < planeCount; ++i) {
+ DrawList* drawList = g_drawLists[drawListIndex];
+ drawList->Sort();
+ }
+
+ for (int drawListIndex = 0; drawListIndex < planeCount; ++i) {
+ DrawList* drawList = g_drawLists[drawListIndex];
+ if (drawList == nullptr || drawList->count == 0) {
+ continue;
+ }
+
+ for (int screenItemIndex = 0, screenItemCount = drawList->count; screenItemIndex < screenItemCount; ++screenItemIndex) {
+ ScreenItem* screenItem = drawList->items[screenItemIndex];
+ screenItem->GetCelObj()->SubmitPalette();
+ }
+ }
+ }
+
+ // UpdateForFrame is where all palette mutations occur (cycles, varies, etc.)
+ bool remapNeeded = GPalette().UpdateForFrame();
+ if (planeCount > 0) {
+ frameNowVisible = false;
+
+ for (int planeIndex = 0; planeIndex < planeCount; ++planeIndex) {
+ Plane* plane = screen.planeList[planeIndex];
+
+ DrawEraseList(g_rectLists[planeIndex], plane);
+ DrawScreenItemsList(g_drawLists[planeIndex]);
+ }
+ }
+
+ if (robot) {
+ robot.FrameAlmostVisible();
+ }
+
+ GPalette().UpdateHardware();
+
+ if (shouldShowBits) {
+ ShowBits();
+ }
+
+ frameNowVisible = true;
+
+ if (robot) {
+ robot.FrameNowVisible();
+ }
+
+ if (planeCount > 0) {
+ for (int planeIndex = 0; planeIndex < planeCount; ++planeIndex) {
+ if (g_rectLists[planeIndex] != nullptr) {
+ delete g_rectLists[planeIndex];
+ }
+ if (g_drawLists[planeIndex] != nullptr) {
+ delete g_drawLists[planeIndex];
+ }
+ }
+ }
+}
+void GfxFrameout::CalcLists(DrawList **drawLists, RectList **rectLists, SOL_Rect *rect) {
+ screen.CalcLists(&visibleScreen, drawLists, rectLists, rect);
+}
+*/
void GfxFrameout::kernelFrameout() {
if (g_sci->_robotDecoder->isVideoLoaded()) {
showVideo();