SCI: Fix scrolling in SCI1 list controls.
svn-id: r44429
This commit is contained in:
parent
76132409d6
commit
725377f090
3 changed files with 12 additions and 1 deletions
|
@ -1625,12 +1625,21 @@ static void _k_draw_control(EngineState *s, reg_t obj, int inverse) {
|
||||||
case K_CONTROL_CONTROL:
|
case K_CONTROL_CONTROL:
|
||||||
case K_CONTROL_CONTROL_ALIAS: {
|
case K_CONTROL_CONTROL_ALIAS: {
|
||||||
int entries_nr;
|
int entries_nr;
|
||||||
int lsTop = GET_SEL32V(obj, lsTop) - text_pos.offset;
|
int lsTop;
|
||||||
int list_top = 0;
|
int list_top = 0;
|
||||||
int selection = 0;
|
int selection = 0;
|
||||||
int entry_size = GET_SEL32V(obj, x);
|
int entry_size = GET_SEL32V(obj, x);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (s->_kernel->_selectorCache.topString != -1) {
|
||||||
|
// Games from early SCI1 onwards use topString
|
||||||
|
lsTop = GET_SEL32V(obj, topString);
|
||||||
|
} else {
|
||||||
|
// Earlier games use lsTop
|
||||||
|
lsTop = GET_SEL32V(obj, lsTop);
|
||||||
|
}
|
||||||
|
lsTop -= text_pos.offset;
|
||||||
|
|
||||||
debugC(2, kDebugLevelGraphics, "drawing list control %04x:%04x to %d,%d, diff %d\n", PRINT_REG(obj), x, y, SCI_MAX_SAVENAME_LENGTH);
|
debugC(2, kDebugLevelGraphics, "drawing list control %04x:%04x to %d,%d, diff %d\n", PRINT_REG(obj), x, y, SCI_MAX_SAVENAME_LENGTH);
|
||||||
cursor = GET_SEL32V(obj, cursor) - text_pos.offset;
|
cursor = GET_SEL32V(obj, cursor) - text_pos.offset;
|
||||||
|
|
||||||
|
|
|
@ -241,6 +241,7 @@ void Kernel::mapSelectors() {
|
||||||
FIND_SELECTOR(parseLang);
|
FIND_SELECTOR(parseLang);
|
||||||
FIND_SELECTOR(motionCue);
|
FIND_SELECTOR(motionCue);
|
||||||
FIND_SELECTOR(setCursor);
|
FIND_SELECTOR(setCursor);
|
||||||
|
FIND_SELECTOR(topString);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kernel::dumpScriptObject(char *data, int seeker, int objsize) {
|
void Kernel::dumpScriptObject(char *data, int seeker, int objsize) {
|
||||||
|
|
|
@ -157,6 +157,7 @@ struct SelectorCache {
|
||||||
Selector elements; /**< Used by SetSynonyms() */
|
Selector elements; /**< Used by SetSynonyms() */
|
||||||
|
|
||||||
Selector lsTop, lsBottom, lsRight, lsLeft; /**< Used by Animate() subfunctions and scroll list controls */
|
Selector lsTop, lsBottom, lsRight, lsLeft; /**< Used by Animate() subfunctions and scroll list controls */
|
||||||
|
Selector topString; /**< SCI1 scroll lists use this instead of lsTop */
|
||||||
|
|
||||||
Selector looper, mover, isBlocked, heading; /**< Used in DoAvoider */
|
Selector looper, mover, isBlocked, heading; /**< Used in DoAvoider */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue