aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2009-04-02 16:38:33 +0000
committerFilippos Karapetis2009-04-02 16:38:33 +0000
commit6fe12a0888c065f906836b59c123530df03d7fc0 (patch)
tree86a593d9290bf4a740e29785faa58d8c6caf7e68 /engines/sci
parent9180f3a9a154af6dd350bda82f83f1437cdda64f (diff)
downloadscummvm-rg350-6fe12a0888c065f906836b59c123530df03d7fc0.tar.gz
scummvm-rg350-6fe12a0888c065f906836b59c123530df03d7fc0.tar.bz2
scummvm-rg350-6fe12a0888c065f906836b59c123530df03d7fc0.zip
pic_port_bounds was only set from command-line parameters it seems, so it's safe to put it together with the rest of the options
svn-id: r39800
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/game.cpp10
-rw-r--r--engines/sci/engine/kgraphics.cpp12
-rw-r--r--engines/sci/engine/kpathing.cpp2
-rw-r--r--engines/sci/gfx/gfx_options.h4
-rw-r--r--engines/sci/gfx/gfx_resmgr.cpp11
-rw-r--r--engines/sci/sci.cpp2
6 files changed, 31 insertions, 10 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index c3bd69983d..400626844e 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -168,7 +168,11 @@ int _reset_graphics_input(EngineState *s) {
s->visual = gfxw_new_visual(s->gfx_state, font_nr);
- s->wm_port = gfxw_new_port(s->visual, NULL, s->gfx_state->options->pic_port_bounds, s->ega_colors[0], transparent);
+#ifdef CUSTOM_GRAPHICS_OPTIONS
+ s->wm_port = gfxw_new_port(s->visual, NULL, s->gfx_state->options->pic_port_bounds, s->ega_colors[0], transparent);
+#else
+ s->wm_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 10, 320, 190), s->ega_colors[0], transparent);
+#endif
s->iconbar_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 0, 320, 200), s->ega_colors[0], transparent);
s->iconbar_port->flags |= GFXW_FLAG_NO_IMPLICIT_SWITCH;
@@ -196,7 +200,11 @@ int _reset_graphics_input(EngineState *s) {
s->titlebar_port->flags |= GFXW_FLAG_NO_IMPLICIT_SWITCH;
// but this is correct
+#ifdef CUSTOM_GRAPHICS_OPTIONS
s->picture_port = gfxw_new_port(s->visual, NULL, s->gfx_state->options->pic_port_bounds, s->ega_colors[0], transparent);
+#else
+ s->picture_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 10, 320, 190), s->ega_colors[0], transparent);
+#endif
s->pics_drawn_nr = 0;
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index ddf38e40a8..8d77e9306d 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1031,8 +1031,14 @@ reg_t kDrawPic(EngineState *s, int funct_nr, int argc, reg_t *argv) {
s->picture_port->widfree(GFXW(s->picture_port));
s->iconbar_port->widfree(GFXW(s->iconbar_port));
+#ifdef CUSTOM_GRAPHICS_OPTIONS
s->wm_port = gfxw_new_port(s->visual, NULL, s->gfx_state->options->pic_port_bounds, s->ega_colors[0], transparent);
s->picture_port = gfxw_new_port(s->visual, NULL, s->gfx_state->options->pic_port_bounds, s->ega_colors[0], transparent);
+#else
+ s->wm_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 10, 320, 190), s->ega_colors[0], transparent);
+ s->picture_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 10, 320, 190), s->ega_colors[0], transparent);
+#endif
+
s->iconbar_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 0, 320, 200), s->ega_colors[0], transparent);
s->iconbar_port->flags |= GFXW_FLAG_NO_IMPLICIT_SWITCH;
@@ -2375,9 +2381,13 @@ reg_t kSetPort(EngineState *s, int funct_nr, int argc, reg_t *argv) {
return s->r_acc;
}
- // FIXME: this actually changes the picture port bounds, which are supposed to be user-defined...
+ // This should never occur. This case happens when the port is supplied via command line parameters
+#ifdef CUSTOM_GRAPHICS_OPTIONS
s->gfx_state->options->pic_port_bounds = gfx_rect(UKPV(5), UKPV(4),
UKPV(3), UKPV(2));
+#else
+ warning("kSetPort() was called to change the picture port bounds, but custom graphics options are not enabled, so it has been ignored");
+#endif
// FIXME: Should really only invalidate all loaded pic resources here;
// this is overkill
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index 420946eee2..9d8fc565f9 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -77,7 +77,7 @@ enum {
PF_FATAL = -2
};
-#define scummvm_roundf(a) ((fmod(a,1)<0.5) ? floor(a) : ceil(a))
+#define scummvm_roundf(a) ((fmod(a, 1) < 0.5) ? floor(a) : ceil(a))
// Floating point struct
struct FloatPoint {
diff --git a/engines/sci/gfx/gfx_options.h b/engines/sci/gfx/gfx_options.h
index 76fbc23323..5850b21c66 100644
--- a/engines/sci/gfx/gfx_options.h
+++ b/engines/sci/gfx/gfx_options.h
@@ -76,10 +76,8 @@ struct gfx_options_t {
int dirty_frames;
int workarounds; // Workaround flags - see below
-#endif
-
- // FIXME: This option is abused: pic_port_bounds is actually set by the game itself in kSetPort()
rect_t pic_port_bounds;
+#endif
};
#ifdef CUSTOM_GRAPHICS_OPTIONS
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index a1b0fbe8ce..7258418ec1 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -86,16 +86,18 @@ int GfxResManager::calculatePic(gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic
basic_style.line_mode = GFX_LINE_MODE_CORRECT;
basic_style.brush_mode = GFX_BRUSH_MODE_SCALED;
- basic_style.pic_port_bounds = _options->pic_port_bounds;
#ifdef CUSTOM_GRAPHICS_OPTIONS
+ basic_style.pic_port_bounds = _options->pic_port_bounds;
style.line_mode = _options->pic0_line_mode;
style.brush_mode = _options->pic0_brush_mode;
+ style.pic_port_bounds = _options->pic_port_bounds;
#else
+ basic_style.pic_port_bounds = gfx_rect(0, 10, 320, 190);
style.line_mode = GFX_LINE_MODE_CORRECT;
style.brush_mode = GFX_BRUSH_MODE_RANDOM_ELLIPSES;
+ style.pic_port_bounds = gfx_rect(0, 10, 320, 190);
#endif
- style.pic_port_bounds = _options->pic_port_bounds;
if (!res || !res->data)
return GFX_ERROR;
@@ -148,14 +150,17 @@ int GfxResManager::getOptionsHash(gfx_resource_type_t type) {
error("getOptionsHash called on a VIEW resource");
case GFX_RESOURCE_TYPE_PIC:
+#ifdef CUSTOM_GRAPHICS_OPTIONS
if (_version >= SCI_VERSION_01_VGA)
return _options->pic_port_bounds.y;
else
-#ifdef CUSTOM_GRAPHICS_OPTIONS
return (_options->pic0_unscaled) ? 0x10000 : (_options->pic0_dither_mode << 12)
| (_options->pic0_dither_pattern << 8) | (_options->pic0_brush_mode << 4)
| (_options->pic0_line_mode);
#else
+ if (_version >= SCI_VERSION_01_VGA)
+ return 10;
+ else
return 0x10000 | (GFXR_DITHER_PATTERN_SCALED << 8) | (GFX_BRUSH_MODE_RANDOM_ELLIPSES << 4) | GFX_LINE_MODE_CORRECT;
#endif
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 1b9f5e4cf7..90a4595eb8 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -248,7 +248,6 @@ Common::Error SciEngine::run() {
// Default config:
gfx_options_t gfx_options;
- gfx_options.pic_port_bounds = gfx_rect(0, 10, 320, 190);
#ifdef CUSTOM_GRAPHICS_OPTIONS
gfx_options.buffer_pics_nr = 0;
@@ -267,6 +266,7 @@ Common::Error SciEngine::run() {
gfx_options.res_conf.mod[i] = NULL;
}
gfx_options.workarounds = 0;
+ gfx_options.pic_port_bounds = gfx_rect(0, 10, 320, 190);
// Default config ends
#endif