[Scummvm-cvs-logs] CVS: scummvm/scumm costume.cpp,1.3,1.4 gfx.cpp,1.6,1.7 saveload.cpp,1.7,1.8 scummvm.cpp,1.8,1.9 string.cpp,1.5,1.6
Pawe? Ko?odziejski
aquadran at users.sourceforge.net
Sat Aug 31 09:30:02 CEST 2002
Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv30461
Modified Files:
costume.cpp gfx.cpp saveload.cpp scummvm.cpp string.cpp
Log Message:
changed resolution values from static to dynamic, I hope I don't break something
Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- costume.cpp 29 Aug 2002 23:45:15 -0000 1.3
+++ costume.cpp 31 Aug 2002 16:29:17 -0000 1.4
@@ -160,7 +160,7 @@
_right = _left = _xpos;
_scaleIndexX = unk19;
for (i = 0; i < _width; i++) {
- if (_left > 319) {
+ if (_left > (_realWidth - 1)) {
s++;
unk19 = _scaleIndexX;
}
@@ -217,10 +217,10 @@
if (_top >= (int)_outheight || _bottom <= 0)
return 0;
- _ypitch = _height * 320;
+ _ypitch = _height * _realWidth;
_docontinue = 0;
b = 1;
- if (_left > 319 || _right <= 0)
+ if (_left > (_realWidth - 1) || _right <= 0)
return 1;
if (_mirror) {
_ypitch--;
@@ -235,7 +235,7 @@
_docontinue = 1;
}
} else {
- s = _right - 320;
+ s = _right - _realWidth;
if (s <= 0) {
b = 2;
} else {
@@ -245,12 +245,12 @@
} else {
_ypitch++;
if (scaling == 0)
- s = _right - 320;
+ s = _right - _realWidth;
if (s > 0) {
if (!newAmiCost) {
_width2 -= s;
ignorePakCols(s);
- _xpos = 319;
+ _xpos = _realWidth - 1;
_docontinue = 1;
}
} else {
@@ -646,7 +646,7 @@
_scaleIndexX = t + _scaleIndexXStep;
if (cost_scaleTable[t] < _scaleX) {
_xpos += _scaleIndexXStep;
- if (_xpos >= 320)
+ if (_xpos >= _realWidth)
return;
maskbit = revBitMask[_xpos & 7];
_backbuff_ptr += _scaleIndexXStep;
@@ -694,7 +694,7 @@
pcolor = _shadow_table[*dst];
*dst = pcolor;
}
- dst += 320;
+ dst += _realWidth;
y++;
}
if (!--height) {
@@ -707,7 +707,7 @@
_scaleIndexX = t + _scaleIndexXStep;
if (cost_scaleTable[t] < _scaleX) {
_xpos += _scaleIndexXStep;
- if (_xpos >= 320)
+ if (_xpos >= _realWidth)
return;
_backbuff_ptr += _scaleIndexXStep;
}
@@ -745,7 +745,7 @@
len = *src++;
do {
- if (color && x >= 0 && x < 320) {
+ if (color && x >= 0 && x < _realWidth) {
pcolor = _palette[color];
/* if (pcolor == 13) {
pcolor = _shadow_table[*dst];
@@ -759,7 +759,7 @@
if (!--height)
return;
width = _width;
- dst += 320-step*_width;
+ dst += _realWidth - step * _width;
x = _xpos;
y++;
if (y >= scrheight)
@@ -795,7 +795,7 @@
len = *src++;
do {
- if (color && x >=0 && x < 320 && !(*mask & maskbit)) {
+ if (color && x >=0 && x < _realWidth && !(*mask & maskbit)) {
pcolor = _palette[color];
/* if (pcolor == 13)
pcolor = _shadow_table[*dst];*/
@@ -824,7 +824,7 @@
width = _width;
x = _xpos;
y++;
- dst += 320-step*_width;
+ dst += _realWidth - step * _width;
_mask_ptr+=40;
mask = _mask_ptr;
maskbit = revBitMask[_xpos & 7];
@@ -861,7 +861,7 @@
len = *src++;
do {
- if (color && x >= 0 && x < 320 && !((*mask | mask[_imgbufoffs]) & maskbit)) {
+ if (color && x >= 0 && x < _realWidth && !((*mask | mask[_imgbufoffs]) & maskbit)) {
pcolor = _palette[color];
/* if (pcolor == 13)
pcolor = _shadow_table[*dst];*/
@@ -888,7 +888,7 @@
width = _width;
y++;
x = _xpos;
- dst += 320-step*_width;
+ dst += _realWidth - step * _width;
_mask_ptr+= 40;
mask = _mask_ptr;
maskbit = revBitMask[_xpos & 7];
@@ -949,7 +949,7 @@
return;
if (_xpos != oldXpos) {
- dst += 320-(_xpos-oldXpos);
+ dst += _realWidth - (_xpos - oldXpos);
_mask_ptr += 40;
mask = _mask_ptr;
y++;
@@ -990,7 +990,7 @@
len = *src++;
do {
if (cost_scaleTable[_scaleIndexY] < _scaleY) {
- if (color && _xpos >= 0 && _xpos < 320 && !(*mask & maskbit)) {
+ if (color && _xpos >= 0 && _xpos < _realWidth && !(*mask & maskbit)) {
pcolor = _palette[color];
/* if (pcolor == 13)
pcolor = _shadow_table[*dst];*/
@@ -1014,7 +1014,7 @@
return;
if (_xpos != oldXpos) {
- dst += 320-(_xpos-oldXpos);
+ dst += _realWidth - (_xpos - oldXpos);
_mask_ptr += 40;
mask = _mask_ptr;
y++;
@@ -1059,7 +1059,7 @@
do {
if (cost_scaleTable[_scaleIndexY] < _scaleY) {
- if (color && _xpos >= 0 && _xpos < 320) {
+ if (color && _xpos >= 0 && _xpos < _realWidth) {
pcolor = _palette[color];
/* if (pcolor == 13)
pcolor = _shadow_table[*dst];*/
@@ -1081,7 +1081,7 @@
return;
if (_xpos != oldXpos) {
- dst += 320-(_xpos-oldXpos);
+ dst += _realWidth - (_xpos - oldXpos);
y++;
}
width = _width;
@@ -1166,7 +1166,7 @@
*dst = pcolor;
}
}
- dst += 320;
+ dst += _realWidth;
mask += 40;
y++;
}
@@ -1180,7 +1180,7 @@
_scaleIndexX = t + _scaleIndexXStep;
if (cost_scaleTable[t] < _scaleX) {
_xpos += _scaleIndexXStep;
- if (_xpos >= 320)
+ if (_xpos >= _realWidth)
return;
maskbit = revBitMask[_xpos & 7];
_backbuff_ptr += _scaleIndexXStep;
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gfx.cpp 31 Aug 2002 14:27:33 -0000 1.6
+++ gfx.cpp 31 Aug 2002 16:29:17 -0000 1.7
@@ -85,7 +85,7 @@
vs->number = slot;
vs->unk1 = 0;
- vs->width = 320;
+ vs->width = _realWidth;
vs->topline = top;
vs->height = height;
vs->alloctwobuffers = twobufs;
@@ -96,7 +96,7 @@
vs->backBuf = NULL;
if (vs->scrollable)
- size += 320 * 4;
+ size += _realWidth * 4;
createResource(rtBuffer, slot + 1, size);
vs->screenPtr = getResourceAddress(rtBuffer, slot + 1);
@@ -148,7 +148,7 @@
vs = &virtscr[0];
src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - 100;
- _system->copy_rect(src, 320, 0, vs->topline, 320, vs->height);
+ _system->copy_rect(src, _realWidth, 0, vs->topline, _realWidth, vs->height);
for (i = 0; i < NUM_STRIPS; i++) {
vs->tdirty[i] = (byte)vs->height;
@@ -225,15 +225,15 @@
b = vs->height;
height = b - t;
- if (height > 200)
- height = 200;
+ if (height > _realHeight)
+ height = _realHeight;
- scrollY = _vm->camera._cur.y - 100;
- if (scrollY == -100)
+ scrollY = _vm->camera._cur.y - (_realHeight / 2);
+ if (scrollY == -(_realHeight / 2))
scrollY = 0;
- ptr = vs->screenPtr + (t * NUM_STRIPS + x) * 8 + _readOffs + scrollY * 320;
- _vm->_system->copy_rect(ptr, 320, x * 8, vs->topline + t, w, height);
+ ptr = vs->screenPtr + (t * NUM_STRIPS + x) * 8 + _readOffs + scrollY * _realWidth;
+ _vm->_system->copy_rect(ptr, _realWidth, x * 8, vs->topline + t, w, height);
}
void blit(byte *dst, byte *src, int w, int h)
@@ -269,7 +269,7 @@
camera._dest = camera._cur;
- assert(camera._cur.x >= 160 && camera._cur.y >= 100);
+ assert(camera._cur.x >= (_realWidth / 2) && camera._cur.y >= (_realHeight / 2));
if ((camera._cur.x != old.x || camera._cur.y != old.y)
&& _vars[VAR_SCROLL_SCRIPT]) {
@@ -280,7 +280,7 @@
} else {
int t;
- if (camera._mode != CM_FOLLOW_ACTOR || abs(pos_x - camera._cur.x) > 160) {
+ if (camera._mode != CM_FOLLOW_ACTOR || abs(pos_x - camera._cur.x) > (_realWidth / 2)) {
camera._cur.x = pos_x;
}
camera._dest.x = pos_x;
@@ -318,7 +318,7 @@
ax = abs(a->x - camera._cur.x);
ay = abs(a->y - camera._cur.y);
- if (ax > _vars[VAR_CAMERA_THRESHOLD_X] || ay > _vars[VAR_CAMERA_THRESHOLD_Y] || ax > 160 || ay > 100) {
+ if (ax > _vars[VAR_CAMERA_THRESHOLD_X] || ay > _vars[VAR_CAMERA_THRESHOLD_Y] || ax > (_realWidth / 2) || ay > (_realHeight / 2)) {
setCameraAt(a->x, a->y);
}
@@ -357,7 +357,7 @@
byte *room;
if (_features & GF_AFTER_V7) {
- initVirtScreen(0, 0, virtscr[0].topline, 200, height, 1, 1);
+ initVirtScreen(0, 0, virtscr[0].topline, _realHeight, height, 1, 1);
}
room = getResourceAddress(rtRoom, _roomResource);
@@ -598,7 +598,7 @@
if (flashBuffer) {
- offset = 320 - flashW*8;
+ offset = _realWidth - flashW*8;
i = flashH;
do {
j = flashW*2;
@@ -641,7 +641,7 @@
}
byte *bgbak;
- offset = (flashY - topline) * 320 + virtscr[0].xstart + flashX*8;
+ offset = (flashY - topline) * _realWidth + virtscr[0].xstart + flashX * 8;
flashBuffer = virtscr[0].screenPtr + offset;
bgbak = getResourceAddress(rtBuffer, 5) + offset;
@@ -652,9 +652,9 @@
int corner_data[] = { 8, 6, 4, 3, 2, 2, 1, 1 };
int minrow = 0;
int maxcol = flashW * 8 - 1;
- int maxrow = (flashH - 1) * 320;
+ int maxrow = (flashH - 1) * _realWidth;
- for (i = 0; i < 8; i++, minrow += 320, maxrow -= 320) {
+ for (i = 0; i < 8; i++, minrow += _realWidth, maxrow -= _realWidth) {
int d = corner_data[i];
for (j = 0; j < d; j++) {
@@ -872,7 +872,7 @@
twobufs = vs->alloctwobuffers;
- _vertStripNextInc = h * 320 - 1;
+ _vertStripNextInc = h * _realWidth - 1;
_numLinesToProcess = h;
@@ -1138,8 +1138,8 @@
((uint32 *)dst)[0] = ((uint32 *)src)[0];
((uint32 *)dst)[1] = ((uint32 *)src)[1];
}
- src += 320;
- dst += 320;
+ src += _realWidth;
+ dst += _realWidth;
mask += NUM_STRIPS;
} while (--height);
}
@@ -1187,7 +1187,7 @@
do {
((uint32 *)dst)[0] = 0;
((uint32 *)dst)[1] = 0;
- dst += 320;
+ dst += _realWidth;
} while (--height);
}
@@ -1508,7 +1508,7 @@
_tempNumLines = _numLinesToProcess;
do {
FILL_BITS *dst = color + _palette_mod;
- dst += 320;
+ dst += _realWidth;
if (!READ_BIT) {
} else if (!READ_BIT) {
FILL_BITS color = bits & _decomp_mask;
@@ -1532,7 +1532,7 @@
bits = ((buffer & mask) != 0);
#define NEXT_ROW \
- dst += 320; \
+ dst += _realWidth; \
if (--h == 0) { \
if (!--_currentX) \
return; \
@@ -1565,7 +1565,7 @@
((uint32 *)dst)[0] = ((uint32 *)src)[0];
((uint32 *)dst)[1] = ((uint32 *)src)[1];
#endif
- dst += 320;
+ dst += _realWidth;
src += 8;
} while (--height);
}
@@ -1756,16 +1756,16 @@
left = 0;
if (right < 0)
right = 0;
- if (left > 320)
+ if (left > _realWidth)
return;
- if (right > 320)
- right = 320;
+ if (right > _realWidth)
+ right = _realWidth;
if (bottom >= height)
bottom = height;
updateDirtyRect(vs->number, left, right, top - topline, bottom - topline, 0x40000000);
- height = (top - topline) * 320 + vs->xstart + left;
+ height = (top - topline) * _realWidth + vs->xstart + left;
backbuff = vs->screenPtr + height;
bgbak = getResourceAddress(rtBuffer, vs->number + 5) + height;
@@ -1820,8 +1820,8 @@
lp = (left >> 3) + _screenStartStrip;
if (lp < 0)
lp = 0;
- if (rp >= 200)
- rp = 200;
+ if (rp >= _realHeight)
+ rp = _realHeight;
if (lp <= rp) {
num = rp - lp + 1;
sp = &gfxUsageBits[lp];
@@ -2161,7 +2161,7 @@
camera._dest.y = a->y;
}
- assert(camera._cur.x >= 160 && camera._cur.y >= 100);
+ assert(camera._cur.x >= (_realWidth / 2) && camera._cur.y >= (_realHeight / 2));
clampCameraPos(&camera._dest);
@@ -2311,14 +2311,14 @@
_screenEndStrip = _screenStartStrip + NUM_STRIPS - 1;
virtscr[0].xstart = _screenStartStrip << 3;
- _screenLeft = camera._cur.x - 160;
- _screenTop = camera._cur.y - 100;
+ _screenLeft = camera._cur.x - (_realWidth / 2);
+ _screenTop = camera._cur.y - (_realHeight / 2);
} else {
- if (camera._cur.x < 160) {
- camera._cur.x = 160;
- } else if (camera._cur.x + 160 >= _scrWidth) {
- camera._cur.x = _scrWidth - 160;
+ if (camera._cur.x < (_realWidth / 2)) {
+ camera._cur.x = (_realWidth / 2);
+ } else if (camera._cur.x + (_realWidth / 2) >= _scrWidth) {
+ camera._cur.x = _scrWidth - (_realWidth / 2);
}
_screenStartStrip = (camera._cur.x >> 3) - 20;
@@ -2832,7 +2832,7 @@
for (; height; height--) {
memcpy(dst, ptr, width);
dst += width;
- ptr += 320;
+ ptr += _realWidth;
}
updateCursor();
Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- saveload.cpp 29 Aug 2002 23:45:15 -0000 1.7
+++ saveload.cpp 31 Aug 2002 16:29:17 -0000 1.8
@@ -136,7 +136,7 @@
gdi._mask_left = -1;
- initScreens(0, 0, 320, 200);
+ initScreens(0, 0, _realWidth, _realHeight);
// Force a fade to black
int old_screenEffectFlag = _screenEffectFlag;
@@ -144,7 +144,7 @@
fadeOut(129);
_screenEffectFlag = old_screenEffectFlag;
- initScreens(0, sb, 320, sh);
+ initScreens(0, sb, _realWidth, sh);
_completeScreenRedraw = true;
setDirtyColors(0, 255);
Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- scummvm.cpp 31 Aug 2002 13:29:09 -0000 1.8
+++ scummvm.cpp 31 Aug 2002 16:29:17 -0000 1.9
@@ -92,6 +92,10 @@
_realWidth = 320;
_realHeight = 240;
} else {
+ if (_gameId == GID_CMI) {
+ _realWidth = 640;
+ _realHeight = 480;
+ } else {
_realWidth = 320;
_realHeight = 200;
}
@@ -176,7 +180,7 @@
if (!(_features & GF_SMALL_NAMES))
loadCharset(1);
- initScreens(0, 16, 320, 144);
+ initScreens(0, 16, _realWidth, 144);
setShake(0);
setupCursor();
@@ -201,7 +205,7 @@
for (i = 0; i < _maxVerbs; i++) {
_verbs[i].verbid = 0;
- _verbs[i].right = 319;
+ _verbs[i].right = _realWidth - 1;
_verbs[i].oldleft = -1;
_verbs[i].type = 0;
_verbs[i].color = 2;
@@ -272,7 +276,7 @@
string[i].t_xpos = 2;
string[i].t_ypos = 5;
}
- string[i].t_right = 319;
+ string[i].t_right = _realWidth - 1;
string[i].t_color = 0xF;
string[i].t_center = 0;
string[i].t_charset = 0;
@@ -566,8 +570,8 @@
if (!(_features & GF_AFTER_V7)) {
camera._mode = CM_NORMAL;
- camera._cur.x = camera._dest.x = 160;
- camera._cur.y = camera._dest.y = 100;
+ camera._cur.x = camera._dest.x = _realWidth / 2;
+ camera._cur.y = camera._dest.y = _realHeight / 2;
}
if (_features & GF_AFTER_V6) {
@@ -576,14 +580,14 @@
}
if (_features & GF_AFTER_V7) {
- _vars[VAR_CAMERA_MIN_X] = 160;
- _vars[VAR_CAMERA_MAX_X] = _scrWidth - 160;
- _vars[VAR_CAMERA_MIN_Y] = 100;
- _vars[VAR_CAMERA_MAX_Y] = _scrHeight - 100;
- setCameraAt(160, 100);
+ _vars[VAR_CAMERA_MIN_X] = _realWidth / 2;
+ _vars[VAR_CAMERA_MAX_X] = _scrWidth - (_realWidth / 2);
+ _vars[VAR_CAMERA_MIN_Y] = _realHeight / 2;
+ _vars[VAR_CAMERA_MAX_Y] = _scrHeight - (_realHeight / 2);
+ setCameraAt(_realWidth / 2, _realHeight / 2);
} else {
- _vars[VAR_CAMERA_MAX_X] = _scrWidth - 160;
- _vars[VAR_CAMERA_MIN_X] = 160;
+ _vars[VAR_CAMERA_MAX_X] = _scrWidth - (_realWidth / 2);
+ _vars[VAR_CAMERA_MIN_X] = _realWidth / 2;
}
if (_roomResource == 0)
@@ -1465,10 +1469,10 @@
_minHeapThreshold = 400000;
// Create a primary virtual screen
- _videoBuffer = (byte *)calloc(328*200, 1);
+ _videoBuffer = (byte *)calloc((_realWidth + 8) * _realHeight, 1);
allocResTypeData(rtBuffer, MKID('NONE'), 10, "buffer", 0);
- initVirtScreen(0, 0, 0, 320, 200, false, false);
+ initVirtScreen(0, 0, 0, _realWidth, _realHeight, false, false);
if (_features & GF_AFTER_V7)
setupScummVarsNew();
Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- string.cpp 31 Aug 2002 15:00:44 -0000 1.5
+++ string.cpp 31 Aug 2002 16:29:17 -0000 1.6
@@ -240,12 +240,12 @@
if (string[0].ypos < 1)
string[0].ypos = 1;
- if (string[0].ypos < camera._cur.y - 100)
+ if (string[0].ypos < camera._cur.y - (_realHeight / 2))
- string[0].ypos = camera._cur.y - 100;
+ string[0].ypos = camera._cur.y - (_realHeight / 2);
s = a->scalex * a->new_2 / 0xFF;
- string[0].xpos = ((a->new_2 - s) >> 1) + s + a->x - camera._cur.x + 160;
+ string[0].xpos = ((a->new_2 - s) >> 1) + s + a->x - camera._cur.x + (_realWidth / 2);
if (string[0].xpos < 80)
string[0].xpos = 80;
if (string[0].xpos > 240)
@@ -301,7 +301,7 @@
gdi._mask_left = string[0].xpos;
gdi._mask_top = string[0].ypos;
gdi._mask_bottom = string[0].ypos + 8;
- gdi._mask_right = 320;
+ gdi._mask_right = _realWidth;
if (string[0].ypos <= 16) // If we are cleaning the text line, clean 2 lines.
gdi._mask_bottom = 16;
}
@@ -458,7 +458,7 @@
charset._top = string[0].ypos;
charset._left = string[0].xpos;
charset._left2 = string[0].xpos;
- charset._right = 319;
+ charset._right = _realWidth - 1;
charset._xpos2 = string[0].xpos;
charset._ypos2 = string[0].ypos;
charset._disableOffsX = charset._unk12 = 1;
@@ -813,7 +813,7 @@
_unk12 = 0;
}
char_ptr = _vm->getResourceAddress(rtCharset, _curId) + 224 + (chr + 1) * 8;
- dest_ptr = vs->screenPtr + vs->xstart + (_top - vs->topline) * 320 + _left;
+ dest_ptr = vs->screenPtr + vs->xstart + (_top - vs->topline) * _realWidth + _left;
_vm->updateDirtyRect(vs->number, _left, _left + 8, _top - vs->topline, _top - vs->topline + 8, 0);
for (y = 0; y < 8; y++) {
@@ -824,7 +824,7 @@
}
color = ((buffer & mask) != 0);
if (color)
- *(dest_ptr + y * 320 + x) = _color;
+ *(dest_ptr + y * _realWidth + x) = _color;
}
}
@@ -937,7 +937,7 @@
_hasMask = true;
#endif
- _dest_ptr = _backbuff_ptr = vs->screenPtr + vs->xstart + _drawTop * 320 + _left;
+ _dest_ptr = _backbuff_ptr = vs->screenPtr + vs->xstart + _drawTop * _realWidth + _left;
#if !defined(OLD)
if (_blitAlso) {
@@ -945,7 +945,7 @@
if (1) {
#endif
_dest_ptr = _bgbak_ptr = _vm->getResourceAddress(rtBuffer, vs->number + 5)
- + vs->xstart + _drawTop * 320 + _left;
+ + vs->xstart + _drawTop * _realWidth + _left;
}
_mask_ptr = _vm->getResourceAddress(rtBuffer, 9)
@@ -1012,7 +1012,7 @@
maskpos++;
}
}
- dst = (_dest_ptr += 320);
+ dst = (_dest_ptr += _realWidth);
mask += 40;
y++;
}
More information about the Scummvm-git-logs
mailing list