aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx/gfx_driver.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-09-07 16:18:05 +0000
committerFilippos Karapetis2009-09-07 16:18:05 +0000
commit8fa0b431ee64b7c9105051981c6a62f30983e6fc (patch)
treea6814e9fcf6e2bc803b1cdcf2a9c22430bc2d7b7 /engines/sci/gfx/gfx_driver.cpp
parentbebc76b4d8fd25ef84f22a7500df7e74b9714ddc (diff)
downloadscummvm-rg350-8fa0b431ee64b7c9105051981c6a62f30983e6fc.tar.gz
scummvm-rg350-8fa0b431ee64b7c9105051981c6a62f30983e6fc.tar.bz2
scummvm-rg350-8fa0b431ee64b7c9105051981c6a62f30983e6fc.zip
Merged xfact and yfact into scaleFactor - it doesn't really make sense to multiply one dimension with an integer multiplier which is different to the multiplier of the other dimension, otherwise we'll end up with funny looking and squashed resolutions like 640x200 or 320x400. Also, removed the now-unused pixelFormat member variable of the graphics driver struct
svn-id: r44003
Diffstat (limited to 'engines/sci/gfx/gfx_driver.cpp')
-rw-r--r--engines/sci/gfx/gfx_driver.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp
index e71081ce2c..91c5fadc23 100644
--- a/engines/sci/gfx/gfx_driver.cpp
+++ b/engines/sci/gfx/gfx_driver.cpp
@@ -83,22 +83,21 @@ static void drawProc(int x, int y, int c, void *data) {
GfxDriver *drv = (GfxDriver *)data;
byte *p = drv->getVisual0();
uint8 col = c;
- memcpy(p + (y * 320* drv->getMode()->xfact + x), &col, 1);
+ memcpy(p + (y * 320* drv->getMode()->scaleFactor + x), &col, 1);
}
void GfxDriver::drawLine(Common::Point start, Common::Point end, gfx_color_t color,
gfx_line_mode_t line_mode, gfx_line_style_t line_style) {
uint32 scolor = color.visual.parent_index;
- int xfact = (line_mode == GFX_LINE_MODE_FINE)? 1: _mode->xfact;
- int yfact = (line_mode == GFX_LINE_MODE_FINE)? 1: _mode->yfact;
+ int scaleFactor = (line_mode == GFX_LINE_MODE_FINE)? 1: _mode->scaleFactor;
int xsize = _mode->xsize;
int ysize = _mode->ysize;
if (color.mask & GFX_MASK_VISUAL) {
Common::Point nstart, nend;
- for (int xc = 0; xc < xfact; xc++) {
- for (int yc = 0; yc < yfact; yc++) {
+ for (int xc = 0; xc < scaleFactor; xc++) {
+ for (int yc = 0; yc < scaleFactor; yc++) {
nstart.x = CLIP<int16>(start.x + xc, 0, xsize);
nstart.y = CLIP<int16>(start.y + yc, 0, ysize);
@@ -229,14 +228,14 @@ byte *GfxDriver::createCursor(gfx_pixmap_t *pointer) {
// Note that some cursors don't have a palette in SQ5
if (pointer->palette && color < pointer->palette->size())
color = pointer->palette->getColor(color).parent_index;
- for (int scalectr = 0; scalectr < _mode->xfact; scalectr++) {
+ for (int scalectr = 0; scalectr < _mode->scaleFactor; scalectr++) {
*pos++ = color;
}
src++;
}
- for (int scalectr = 1; scalectr < _mode->yfact; scalectr++)
+ for (int scalectr = 1; scalectr < _mode->scaleFactor; scalectr++)
memcpy(linebase + linewidth * scalectr, linebase, linewidth);
- linebase += linewidth * _mode->yfact;
+ linebase += linewidth * _mode->scaleFactor;
}
return data;
}