[Scummvm-cvs-logs] SF.net SVN: scummvm:[39800] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Apr 2 18:38:33 CEST 2009
Revision: 39800
http://scummvm.svn.sourceforge.net/scummvm/?rev=39800&view=rev
Author: thebluegr
Date: 2009-04-02 16:38:33 +0000 (Thu, 02 Apr 2009)
Log Message:
-----------
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
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/game.cpp
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/engine/kpathing.cpp
scummvm/trunk/engines/sci/gfx/gfx_options.h
scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
scummvm/trunk/engines/sci/sci.cpp
Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp 2009-04-02 16:30:42 UTC (rev 39799)
+++ scummvm/trunk/engines/sci/engine/game.cpp 2009-04-02 16:38:33 UTC (rev 39800)
@@ -168,7 +168,11 @@
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 @@
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;
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-04-02 16:30:42 UTC (rev 39799)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-04-02 16:38:33 UTC (rev 39800)
@@ -1031,8 +1031,14 @@
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 @@
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
Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp 2009-04-02 16:30:42 UTC (rev 39799)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp 2009-04-02 16:38:33 UTC (rev 39800)
@@ -77,7 +77,7 @@
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 {
Modified: scummvm/trunk/engines/sci/gfx/gfx_options.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_options.h 2009-04-02 16:30:42 UTC (rev 39799)
+++ scummvm/trunk/engines/sci/gfx/gfx_options.h 2009-04-02 16:38:33 UTC (rev 39800)
@@ -76,10 +76,8 @@
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
Modified: scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp 2009-04-02 16:30:42 UTC (rev 39799)
+++ scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp 2009-04-02 16:38:33 UTC (rev 39800)
@@ -86,16 +86,18 @@
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 @@
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
Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp 2009-04-02 16:30:42 UTC (rev 39799)
+++ scummvm/trunk/engines/sci/sci.cpp 2009-04-02 16:38:33 UTC (rev 39800)
@@ -248,7 +248,6 @@
// 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 @@
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
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