aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2002-09-01 15:01:40 +0000
committerPaweł Kołodziejski2002-09-01 15:01:40 +0000
commitdaa997fab248b92c81f9299ae0fcc857f69ca754 (patch)
tree98bc55cd8aaa109cc7c438017f4692d1fa0b52d9
parenta2ab750f88fbbd34decdcbae50a9454075ccdcb0 (diff)
downloadscummvm-rg350-daa997fab248b92c81f9299ae0fcc857f69ca754.tar.gz
scummvm-rg350-daa997fab248b92c81f9299ae0fcc857f69ca754.tar.bz2
scummvm-rg350-daa997fab248b92c81f9299ae0fcc857f69ca754.zip
fixes to resolutions
svn-id: r4893
-rw-r--r--scumm/actor.cpp4
-rw-r--r--scumm/akos.cpp4
-rw-r--r--scumm/costume.cpp18
-rw-r--r--scumm/debug.cpp6
-rw-r--r--scumm/gfx.cpp16
-rw-r--r--scumm/object.cpp2
-rw-r--r--scumm/script.cpp10
-rw-r--r--scumm/script_v1.cpp18
-rw-r--r--scumm/script_v2.cpp20
-rw-r--r--scumm/scummvm.cpp2
10 files changed, 50 insertions, 50 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 5a807b2313..5353890c37 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -366,8 +366,8 @@ void Actor::setupActorScale()
if (resptr == NULL)
error("Scale table %d not defined", scale);
int theY = y;
- if (theY >= 200)
- theY = 199;
+ if (theY >= (_vm->_realWidth / 2))
+ theY = (_vm->_realWidth / 2) - 1;
else if (theY < 0)
theY = 0;
scale = resptr[theY];
diff --git a/scumm/akos.cpp b/scumm/akos.cpp
index 78eabfeb14..a7c18871d5 100644
--- a/scumm/akos.cpp
+++ b/scumm/akos.cpp
@@ -355,7 +355,7 @@ void akos_generic_decode(AkosRenderer * ar)
if (ar->v1.scaletable[ar->v1.tmp_x] < ar->scale_x) {
ar->v1.x += ar->v1.scaleXstep;
- if ((uint) ar->v1.x >= 320)
+ if ((uint) ar->v1.x >= g_scumm->_realWidth)
return;
maskbit = revBitMask[ar->v1.x & 7];
ar->v1.destptr += ar->v1.scaleXstep;
@@ -423,7 +423,7 @@ void akos_c1_spec1(AkosRenderer * ar)
if (ar->v1.scaletable[ar->v1.tmp_x] < ar->scale_x) {
ar->v1.x += ar->v1.scaleXstep;
- if ((uint) ar->v1.x >= 320)
+ if ((uint) ar->v1.x >= g_scumm->_realWidth)
return;
maskbit = revBitMask[ar->v1.x & 7];
ar->v1.destptr += ar->v1.scaleXstep;
diff --git a/scumm/costume.cpp b/scumm/costume.cpp
index 6fdb678988..612fc4683d 100644
--- a/scumm/costume.cpp
+++ b/scumm/costume.cpp
@@ -284,8 +284,8 @@ byte CostumeRenderer::mainRoutine(Actor *a, int slot, int frame)
CHECK_HEAP return 2;
}
- _bgbak_ptr = _vm->getResourceAddress(rtBuffer, 5) + _vm->virtscr[0].xstart + _ypos * 320 + _xpos;
- _backbuff_ptr = _vm->virtscr[0].screenPtr + _vm->virtscr[0].xstart + _ypos * 320 + _xpos;
+ _bgbak_ptr = _vm->getResourceAddress(rtBuffer, 5) + _vm->virtscr[0].xstart + _ypos * _vm->_realWidth + _xpos;
+ _backbuff_ptr = _vm->virtscr[0].screenPtr + _vm->virtscr[0].xstart + _ypos * _vm->_realWidth + _xpos;
charsetmask =
_vm->hasCharsetMask(_left, _top + _vm->virtscr[0].topline, _right,
_vm->virtscr[0].topline + _bottom);
@@ -395,7 +395,7 @@ void CostumeRenderer::proc6()
*dst = pcolor;
}
- dst += 320;
+ dst += _vm->_realWidth;
y++;
if (!--height) {
if (!--width)
@@ -443,7 +443,7 @@ void CostumeRenderer::proc5()
pcolor = _shadow_table[*dst];
*dst = pcolor;
}
- dst += 320;
+ dst += _vm->_realWidth;
y++;
mask += 40;
if (!--height) {
@@ -506,7 +506,7 @@ void CostumeRenderer::proc4()
pcolor = _shadow_table[*dst];
*dst = pcolor;
}
- dst += 320;
+ dst += _vm->_realWidth;
y++;
mask += 40;
if (!--height) {
@@ -570,7 +570,7 @@ void CostumeRenderer::proc3()
pcolor = _shadow_table[*dst];
*dst = pcolor;
}
- dst += 320;
+ dst += _vm->_realWidth;
mask += 40;
y++;
}
@@ -584,7 +584,7 @@ void CostumeRenderer::proc3()
_scaleIndexX = t + _scaleIndexXStep;
if (cost_scaleTable[t] < _scaleX) {
_xpos += _scaleIndexXStep;
- if (_xpos >= 320)
+ if (_xpos >= _vm->_realWidth)
return;
maskbit = revBitMask[_xpos & 7];
_backbuff_ptr += _scaleIndexXStep;
@@ -632,7 +632,7 @@ void CostumeRenderer::proc2()
pcolor = _shadow_table[*dst];
*dst = pcolor;
}
- dst += 320;
+ dst += _vm->_realWidth;
mask += 40;
y++;
}
@@ -925,7 +925,7 @@ void CostumeRenderer::proc3_ami()
len = *src++;
do {
if (cost_scaleTable[_scaleIndexY] < _scaleY) {
- if (color && _xpos >= 0 && _xpos < 320 && !((*mask | mask[_imgbufoffs]) & maskbit)) {
+ if (color && _xpos >= 0 && _xpos < _vm->_realWidth && !((*mask | mask[_imgbufoffs]) & maskbit)) {
pcolor = _palette[color];
/* if (pcolor == 13)
pcolor = _shadow_table[*dst];*/
diff --git a/scumm/debug.cpp b/scumm/debug.cpp
index 1f37e01df6..2ee1878678 100644
--- a/scumm/debug.cpp
+++ b/scumm/debug.cpp
@@ -355,8 +355,8 @@ static byte *getBasePtr(Scumm *_s, int x, int y)
if (vs == NULL)
return NULL;
- return vs->screenPtr + x + (y - vs->topline) * 320 +
- _s->_screenStartStrip * 8 + (_s->camera._cur.y - 100) * 320;
+ return vs->screenPtr + x + (y - vs->topline) * _s->_realWidth +
+ _s->_screenStartStrip * 8 + (_s->camera._cur.y - (_s->_realHeight / 2)) * _s->_realWidth;
}
static void hline(Scumm *scumm, int x1, int x2, int y, byte color)
@@ -479,7 +479,7 @@ void ScummDebugger::boxTest(int num)
VirtScreen *vs = _s->findVirtScreen(box.ul.y);
if (vs != NULL)
- _s->setVirtscreenDirty(vs, 0, 0, 320, 200);
+ _s->setVirtscreenDirty(vs, 0, 0, _s->_realWidth, _s->_realHeight);
_s->drawDirtyScreenParts();
_s->_system->update_screen();
}
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index e684e2d937..07f92f9e33 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -147,7 +147,7 @@ void Scumm::drawDirtyScreenParts()
} else {
vs = &virtscr[0];
- src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - 100;
+ src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - (_realHeight / 2);
_system->copy_rect(src, _realWidth, 0, vs->topline, _realWidth, vs->height);
for (i = 0; i < NUM_STRIPS; i++) {
@@ -1174,7 +1174,7 @@ void Gdi::clear8ColWithMasking()
((uint32 *)dst)[0] = 0;
((uint32 *)dst)[1] = 0;
}
- dst += 320;
+ dst += _vm->_realWidth;
mask += NUM_STRIPS;
} while (--height);
}
@@ -1442,7 +1442,7 @@ void Gdi::unkDecode4()
do {
FILL_BITS if (color != _transparency)
*dst = color + _palette_mod;
- dst += 320;
+ dst += _vm->_realWidth;
if (!READ_BIT) {
} else if (!READ_BIT) {
FILL_BITS color = bits & _decomp_mask;
@@ -1680,7 +1680,7 @@ void Gdi::unkDecode11()
_tempNumLines = _numLinesToProcess;
do {
*dst = color;
- dst += 320;
+ dst += _vm->_realWidth;
for (i = 0; i < 3; i++) {
READ_256BIT if (!bits)
break;
@@ -1790,7 +1790,7 @@ void Scumm::restoreBG(int left, int top, int right, int bottom)
if (height) {
do {
memset(backbuff, _bkColor, width);
- backbuff += 320;
+ backbuff += _realWidth;
} while (--height);
}
}
@@ -2312,9 +2312,9 @@ void Scumm::cameraMoved()
{
if (_features & GF_AFTER_V7) {
- assert(camera._cur.x >= 160 && camera._cur.y >= 100);
+ assert(camera._cur.x >= (_realWidth / 2) && camera._cur.y >= (_realHeight / 2));
- _screenStartStrip = (camera._cur.x - 160) >> 3;
+ _screenStartStrip = (camera._cur.x - (_realWidth / 2)) >> 3;
_screenEndStrip = _screenStartStrip + NUM_STRIPS - 1;
virtscr[0].xstart = _screenStartStrip << 3;
@@ -2788,7 +2788,7 @@ void Scumm::grabCursor(int x, int y, int w, int h)
return;
}
- grabCursor(vs->screenPtr + (y - vs->topline) * 320 + x, w, h);
+ grabCursor(vs->screenPtr + (y - vs->topline) * _realWidth + x, w, h);
}
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 319328c0ee..52a0afca6f 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -1166,7 +1166,7 @@ void Scumm::enqueueObject(int objectNumber, int objectX, int objectY, int object
eo->areaWidth = _enqueue_d;
eo->areaHeight = _enqueue_e;
eo->posX = objectX + (camera._cur.x & 7);
- eo->posY = objectY + (camera._cur.y - 100);
+ eo->posY = objectY + (camera._cur.y - (_realHeight / 2));
if (objectWidth == 0) {
od = &_objs[getObjectIndex(objectNumber)];
eo->width = od->width;
diff --git a/scumm/script.cpp b/scumm/script.cpp
index d5fd2458d3..7440e783a0 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -479,25 +479,25 @@ void Scumm::drawBox(int x, int y, int x2, int y2, int color)
y = 0;
if (x2 < 0)
return;
- if (x2 > 320)
- x2 = 320;
+ if (x2 > _realWidth)
+ x2 = _realWidth;
if (y2 > bottom)
y2 = bottom;
updateDirtyRect(vs->number, x, x2, y - top, y2 - top, 0);
- backbuff = vs->screenPtr + vs->xstart + (y - top) * 320 + x;
+ backbuff = vs->screenPtr + vs->xstart + (y - top) * _realWidth + x;
if (color == -1) {
if (vs->number != 0)
error("can only copy bg to main window");
- bgbuff = getResourceAddress(rtBuffer, vs->number + 5) + vs->xstart + (y - top) * 320 + x;
+ bgbuff = getResourceAddress(rtBuffer, vs->number + 5) + vs->xstart + (y - top) * _realWidth + x;
blit(backbuff, bgbuff, x2 - x, y2 - y);
} else {
count = y2 - y;
while (count) {
memset(backbuff, color, x2 - x);
- backbuff += 320;
+ backbuff += _realWidth;
count--;
}
}
diff --git a/scumm/script_v1.cpp b/scumm/script_v1.cpp
index fe85bc94b6..96eb92394a 100644
--- a/scumm/script_v1.cpp
+++ b/scumm/script_v1.cpp
@@ -1881,14 +1881,14 @@ void Scumm::o5_roomOps()
a = getVarOrDirectWord(0x80);
b = getVarOrDirectWord(0x40);
}
- if (a < 160)
- a = 160;
- if (b < 160)
- b = 160;
- if (a > _scrWidth - 160)
- a = _scrWidth - 160;
- if (b > _scrWidth - 160)
- b = _scrWidth - 160;
+ if (a < (_realWidth / 2))
+ a = (_realWidth / 2);
+ if (b < (_realWidth / 2))
+ b = (_realWidth / 2);
+ if (a > _scrWidth - (_realWidth / 2))
+ a = _scrWidth - (_realWidth / 2);
+ if (b > _scrWidth - (_realWidth / 2))
+ b = _scrWidth - (_realWidth / 2);
_vars[VAR_CAMERA_MIN_X] = a;
_vars[VAR_CAMERA_MAX_X] = b;
break;
@@ -1911,7 +1911,7 @@ void Scumm::o5_roomOps()
a = getVarOrDirectWord(0x80);
b = getVarOrDirectWord(0x40);
}
- initScreens(0, a, 320, b);
+ initScreens(0, a, _realWidth, b);
break;
case 4: /* set palette color */
if (_features & GF_SMALL_HEADER) {
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index b8242be326..a717980013 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -1410,7 +1410,7 @@ void Scumm::o6_putActorAtObject()
if (whereIsObject(obj) != WIO_NOT_FOUND) {
getObjectXYPos(obj, x, y);
} else {
- x = 160;
+ x = (_realWidth / 2);
y = 120;
}
if (room == 0xFF)
@@ -1790,14 +1790,14 @@ void Scumm::o6_roomOps()
case 172: /* room scroll */
b = pop();
a = pop();
- if (a < 160)
- a = 160;
- if (b < 160)
- b = 160;
- if (a > _scrWidth - 160)
- a = _scrWidth - 160;
- if (b > _scrWidth - 160)
- b = _scrWidth - 160;
+ if (a < (_realWidth / 2))
+ a = (_realWidth / 2);
+ if (b < (_realWidth / 2))
+ b = (_realWidth / 2);
+ if (a > _scrWidth - (_realWidth / 2))
+ a = _scrWidth - (_realWidth / 2);
+ if (b > _scrWidth - (_realWidth / 2))
+ b = _scrWidth - (_realWidth / 2);
_vars[VAR_CAMERA_MIN_X] = a;
_vars[VAR_CAMERA_MAX_X] = b;
break;
@@ -1805,7 +1805,7 @@ void Scumm::o6_roomOps()
case 174: /* set screen */
b = pop();
a = pop();
- initScreens(0, a, 320, b);
+ initScreens(0, a, _realWidth, b);
break;
case 175: /* set palette color */
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 0c681b4148..95ce563f5c 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -931,7 +931,7 @@ void Scumm::processKbd()
if(_features & GF_AFTER_V7)
- _virtual_mouse_y = mouse.y + camera._cur.y-100;
+ _virtual_mouse_y = mouse.y + camera._cur.y - (_realHeight / 2);
else
_virtual_mouse_y = mouse.y;