Moved the code which retrieves the current room number in a separate function and merged _sci1_alloc_system_colors inside _reset_graphics_input
svn-id: r40412
This commit is contained in:
parent
ceee278def
commit
acd5a87922
4 changed files with 11 additions and 17 deletions
|
@ -68,11 +68,6 @@ static int _init_vocabulary(EngineState *s) { // initialize vocabulary and relat
|
|||
|
||||
extern int _allocd_rules;
|
||||
|
||||
static void _sci1_alloc_system_colors(EngineState *s) {
|
||||
gfx_color_t black = { PaletteEntry(0, 0, 0), 0, 0, 0, GFX_MASK_VISUAL };
|
||||
gfxop_set_system_color(s->gfx_state, 0, &black);
|
||||
}
|
||||
|
||||
int _reset_graphics_input(EngineState *s) {
|
||||
Resource *resource;
|
||||
int font_nr;
|
||||
|
@ -90,7 +85,9 @@ int _reset_graphics_input(EngineState *s) {
|
|||
gfxop_set_system_color(s->gfx_state, i, &(s->ega_colors[i]));
|
||||
}
|
||||
} else {
|
||||
_sci1_alloc_system_colors(s);
|
||||
// Allocate SCI1 system colors
|
||||
gfx_color_t black = { PaletteEntry(0, 0, 0), 0, 0, 0, GFX_MASK_VISUAL };
|
||||
gfxop_set_system_color(s->gfx_state, 0, &black);
|
||||
|
||||
// Check for Amiga palette file.
|
||||
Common::File file;
|
||||
|
|
|
@ -1233,8 +1233,7 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) {
|
|||
// WORKAROUND: broken polygon in LSL1VGA, room 350, after opening elevator
|
||||
// Polygon has 17 points but size is set to 19
|
||||
if ((size == 19) && (s->_gameName == "LSL1")) {
|
||||
// FIXME: implement function to get current room number
|
||||
if ((KP_UINT(s->script_000->locals_block->locals[13]) == 350)
|
||||
if ((s->currentRoomNumber() == 350)
|
||||
&& (read_point(list, is_reg_t, 18) == Common::Point(108, 137))) {
|
||||
debug(1, "Applying fix for broken polygon in LSL1VGA, room 350");
|
||||
size = 17;
|
||||
|
@ -1243,21 +1242,21 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) {
|
|||
|
||||
// WORKAROUND: self-intersecting polygons in ECO, rooms 221, 280 and 300
|
||||
if ((size == 11) && (s->_gameName == "eco")) {
|
||||
if ((KP_UINT(s->script_000->locals_block->locals[13]) == 300)
|
||||
if ((s->currentRoomNumber() == 300)
|
||||
&& (read_point(list, is_reg_t, 10) == Common::Point(221, 0))) {
|
||||
debug(1, "Applying fix for self-intersecting polygon in ECO, room 300");
|
||||
size = 10;
|
||||
}
|
||||
}
|
||||
if ((size == 12) && (s->_gameName == "eco")) {
|
||||
if ((KP_UINT(s->script_000->locals_block->locals[13]) == 280)
|
||||
if ((s->currentRoomNumber() == 280)
|
||||
&& (read_point(list, is_reg_t, 11) == Common::Point(238, 189))) {
|
||||
debug(1, "Applying fix for self-intersecting polygon in ECO, room 280");
|
||||
size = 10;
|
||||
}
|
||||
}
|
||||
if ((size == 16) && (s->_gameName == "eco")) {
|
||||
if ((KP_UINT(s->script_000->locals_block->locals[13]) == 221)
|
||||
if ((s->currentRoomNumber() == 221)
|
||||
&& (read_point(list, is_reg_t, 1) == Common::Point(419, 175))) {
|
||||
debug(1, "Applying fix for self-intersecting polygon in ECO, room 221");
|
||||
// Swap the first two points
|
||||
|
@ -1437,11 +1436,8 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (s->_gameName == "Longbow") {
|
||||
// FIXME: implement function to get current room number
|
||||
if ((KP_UINT(s->script_000->locals_block->locals[13]) == 210))
|
||||
if (s->_gameName == "Longbow" && s->currentRoomNumber() == 210)
|
||||
fixLongbowRoom210(pf_s, *new_start, *new_end);
|
||||
}
|
||||
|
||||
// Merge start and end points into polygon set
|
||||
pf_s->vertex_start = merge_point(pf_s, *new_start);
|
||||
|
|
|
@ -424,8 +424,7 @@ reg_t kStrAt(EngineState *s, int funct_nr, int argc, reg_t *argv) {
|
|||
// LSL5 stores the password at the beginning in memory.drv, using XOR encryption,
|
||||
// which means that is_print_str() will fail. Therefore, do not use the heuristic to determine
|
||||
// if we're handling a string or an array for LSL5's password screen (room 155)
|
||||
// FIXME: implement function to get current room number
|
||||
if (s->_gameName.equalsIgnoreCase("lsl5") && (KP_UINT(s->script_000->locals_block->locals[13]) == 155))
|
||||
if (s->_gameName.equalsIgnoreCase("lsl5") && s->currentRoomNumber() == 155)
|
||||
lsl5PasswordWorkaround = true;
|
||||
|
||||
const char* dst = (const char *)dest; // used just for code beautification purposes
|
||||
|
|
|
@ -232,6 +232,8 @@ public:
|
|||
SegmentId script_000_segment;
|
||||
Script *script_000; /**< script 000, e.g. for globals */
|
||||
|
||||
uint16 currentRoomNumber() { return KP_UINT(script_000->locals_block->locals[13]); }
|
||||
|
||||
int parser_lastmatch_word; /**< Position of the input word the parser last matched on, or SAID_NO_MATCH */
|
||||
|
||||
/* Debugger data: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue