[Scummvm-cvs-logs] SF.net SVN: scummvm:[45658] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Wed Nov 4 12:52:11 CET 2009
Revision: 45658
http://scummvm.svn.sourceforge.net/scummvm/?rev=45658&view=rev
Author: thebluegr
Date: 2009-11-04 11:52:11 +0000 (Wed, 04 Nov 2009)
Log Message:
-----------
priority_first and priority_last are not used by the new drawing code, thus the new code didn't handle priority changes by kGraph()
Modified Paths:
--------------
scummvm/trunk/engines/sci/console.cpp
scummvm/trunk/engines/sci/engine/game.cpp
scummvm/trunk/engines/sci/engine/kernel.h
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/engine/savegame.cpp
scummvm/trunk/engines/sci/engine/state.cpp
scummvm/trunk/engines/sci/engine/state.h
scummvm/trunk/engines/sci/gui/gui.cpp
scummvm/trunk/engines/sci/gui/gui.h
scummvm/trunk/engines/sci/gui32/gui32.cpp
scummvm/trunk/engines/sci/gui32/gui32.h
scummvm/trunk/engines/sci/sci.cpp
Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/console.cpp 2009-11-04 11:52:11 UTC (rev 45658)
@@ -1319,6 +1319,7 @@
}
bool Console::cmdPriorityBands(int argc, const char **argv) {
+#ifdef INCLUDE_OLDGFX
if (argc != 2) {
DebugPrintf("Priority bands start at y=%d. They end at y=%d\n", _vm->_gamestate->priority_first, _vm->_gamestate->priority_last);
DebugPrintf("Use %s <priority band> to print the start of priority for the specified priority band (0 - 15)\n", argv[0]);
@@ -1326,7 +1327,7 @@
}
int zone = CLIP<int>(atoi(argv[1]), 0, 15);
-#ifdef INCLUDE_OLDGFX
+
DebugPrintf("Zone %x starts at y=%d\n", zone, _find_priority_band(_vm->_gamestate, zone));
#endif
Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/engine/game.cpp 2009-11-04 11:52:11 UTC (rev 45658)
@@ -162,8 +162,8 @@
return strdup(sierraId.c_str());
}
-int _reset_graphics_input(EngineState *s) {
#ifdef INCLUDE_OLDGFX
+int _reset_graphics_input(EngineState *s) {
Resource *resource;
int font_nr;
gfx_color_t transparent = { PaletteEntry(), 0, -1, -1, 0 };
@@ -263,8 +263,6 @@
s->titlebar_port->_bgcolor.priority = 11; // Standard priority for the titlebar port
#endif
-#endif
-
s->priority_first = 42; // Priority zone 0 ends here
if (s->usesOldGfxFunctions())
@@ -279,6 +277,8 @@
return _reset_graphics_input(s);
}
+#endif
+
static void _free_graphics_input(EngineState *s) {
debug(2, "Freeing graphics");
@@ -406,9 +406,6 @@
#ifdef INCLUDE_OLDGFX
if (s->gfx_state && _reset_graphics_input(s))
return 1;
-#else
- if (_reset_graphics_input(s))
- return 1;
#endif
s->successor = NULL; // No successor
Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/engine/kernel.h 2009-11-04 11:52:11 UTC (rev 45658)
@@ -221,20 +221,7 @@
*/
int _find_view_priority(EngineState *s, int y);
-#define SCI0_VIEW_PRIORITY_14_ZONES(y) (((y) < s->priority_first)? 0 : (((y) >= s->priority_last)? 14 : 1\
- + ((((y) - s->priority_first) * 14) / (s->priority_last - s->priority_first))))
-#define SCI0_PRIORITY_BAND_FIRST_14_ZONES(nr) ((((nr) == 0)? 0 : \
- ((s->priority_first) + (((nr)-1) * (s->priority_last - s->priority_first)) / 14)))
-
-#define SCI0_VIEW_PRIORITY(y) (((y) < s->priority_first)? 0 : (((y) >= s->priority_last)? 14 : 1\
- + ((((y) - s->priority_first) * 15) / (s->priority_last - s->priority_first))))
-
-#define SCI0_PRIORITY_BAND_FIRST(nr) ((((nr) == 0)? 0 : \
- ((s->priority_first) + (((nr)-1) * (s->priority_last - s->priority_first)) / 15)))
-
-
-
/******************** Dynamic view list functions ********************/
/**
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-11-04 11:52:11 UTC (rev 45658)
@@ -268,8 +268,7 @@
case K_GRAPH_ADJUST_PRIORITY:
debugC(2, kDebugLevelGraphics, "adjust_priority(%d, %d)\n", argv[1].toSint16(), argv[2].toSint16());
- s->priority_first = argv[1].toSint16() - 10;
- s->priority_last = argv[2].toSint16() - 10;
+ s->_gui->modifyPriorityBands(argv[1].toSint16() - 10, argv[2].toSint16() - 10);
break;
case K_GRAPH_SAVE_UPSCALEDHIRES_BOX:
Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp 2009-11-04 11:52:11 UTC (rev 45658)
@@ -658,8 +658,9 @@
}
}
}
-
+#ifdef INCLUDE_OLDGFX
int _reset_graphics_input(EngineState *s);
+#endif
static void reconstruct_sounds(EngineState *s) {
Song *seeker;
@@ -770,7 +771,9 @@
retval->gc_countdown = GC_INTERVAL - 1;
retval->sys_strings_segment = retval->_segMan->findSegmentByType(SEG_TYPE_SYS_STRINGS);
retval->sys_strings = (SystemStrings *)GET_SEGMENT(*retval->_segMan, retval->sys_strings_segment, SEG_TYPE_SYS_STRINGS);
+#ifdef INCLUDE_OLDGFX
_reset_graphics_input(retval);
+#endif
// Time state:
retval->last_wait_time = g_system->getMillis();
Modified: scummvm/trunk/engines/sci/engine/state.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/state.cpp 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/engine/state.cpp 2009-11-04 11:52:11 UTC (rev 45658)
@@ -61,13 +61,13 @@
dyn_views = 0;
drop_views = 0;
+
+ priority_first = 0;
+ priority_last = 0;
#endif
_menubar = 0;
- priority_first = 0;
- priority_last = 0;
-
last_wait_time = 0;
_fileHandles.resize(5);
Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/engine/state.h 2009-11-04 11:52:11 UTC (rev 45658)
@@ -169,13 +169,13 @@
GfxList *dyn_views; /**< Pointers to pic and dynamic view lists */
GfxList *drop_views; /**< A list Animate() can dump dropped dynviews into */
+
+ int priority_first; /**< The line where priority zone 0 ends */
+ int priority_last; /**< The line where the highest priority zone starts */
#endif
Menubar *_menubar; /**< The menu bar */
- int priority_first; /**< The line where priority zone 0 ends */
- int priority_last; /**< The line where the highest priority zone starts */
-
uint32 game_start_time; /**< The time at which the interpreter was started */
uint32 last_wait_time; /**< The last time the game invoked Wait() */
Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/gui/gui.cpp 2009-11-04 11:52:11 UTC (rev 45658)
@@ -101,6 +101,14 @@
}
}
+void SciGui::modifyPriorityBands(int top, int bottom) {
+ if (_usesOldGfxFunctions) {
+ _gfx->PriorityBandsInit(15, top, bottom);
+ } else {
+ _gfx->PriorityBandsInit(14, top, bottom);
+ }
+}
+
void SciGui::wait(int16 ticks) {
uint32 time;
Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/gui/gui.h 2009-11-04 11:52:11 UTC (rev 45658)
@@ -143,6 +143,8 @@
virtual void portraitShow(Common::String resourceName, Common::Point position, uint16 resourceNum, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
virtual void portraitUnload(uint16 portraitId);
+ virtual void modifyPriorityBands(int top, int bottom);
+
virtual bool debugUndither(bool flag);
virtual bool debugShowMap(int mapNo);
Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp 2009-11-04 11:52:11 UTC (rev 45658)
@@ -75,6 +75,18 @@
_s->visual->draw(gfxw_point_zero); \
gfxop_update(_s->gfx_state);
+#define SCI0_VIEW_PRIORITY_14_ZONES(y) (((y) < s->priority_first)? 0 : (((y) >= s->priority_last)? 14 : 1\
+ + ((((y) - s->priority_first) * 14) / (s->priority_last - s->priority_first))))
+
+#define SCI0_PRIORITY_BAND_FIRST_14_ZONES(nr) ((((nr) == 0)? 0 : \
+ ((s->priority_first) + (((nr)-1) * (s->priority_last - s->priority_first)) / 14)))
+
+#define SCI0_VIEW_PRIORITY(y) (((y) < s->priority_first)? 0 : (((y) >= s->priority_last)? 14 : 1\
+ + ((((y) - s->priority_first) * 15) / (s->priority_last - s->priority_first))))
+
+#define SCI0_PRIORITY_BAND_FIRST(nr) ((((nr) == 0)? 0 : \
+ ((s->priority_first) + (((nr)-1) * (s->priority_last - s->priority_first)) / 15)))
+
#if 0
// Used for debugging
#define FULL_INSPECTION()\
@@ -2996,6 +3008,11 @@
gfxop_get_event(_s->gfx_state, SCI_EVT_PEEK);
}
+void SciGui32::modifyPriorityBands(int top, int bottom) {
+ _s->priority_first = top;
+ _s->priority_last = bottom;
+}
+
bool SciGui32::debugUndither(bool flag) {
return true;
}
Modified: scummvm/trunk/engines/sci/gui32/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.h 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/gui32/gui32.h 2009-11-04 11:52:11 UTC (rev 45658)
@@ -109,6 +109,8 @@
void setCursorPos(Common::Point pos);
void moveCursor(Common::Point pos);
+ void modifyPriorityBands(int top, int bottom);
+
bool debugUndither(bool flag);
bool debugShowMap(int mapNo);
Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp 2009-11-04 11:48:17 UTC (rev 45657)
+++ scummvm/trunk/engines/sci/sci.cpp 2009-11-04 11:52:11 UTC (rev 45658)
@@ -168,12 +168,12 @@
#ifdef INCLUDE_OLDGFX
gfxop_init(&gfx_state, _resMan, screen, palette, 1);
-#endif
if (game_init_graphics(_gamestate)) { // Init interpreter graphics
warning("Game initialization failed: Error in GFX subsystem. Aborting...");
return Common::kUnknownError;
}
+#endif
if (game_init_sound(_gamestate, 0)) {
warning("Game initialization failed: Error in sound subsystem. Aborting...");
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