aboutsummaryrefslogtreecommitdiff
path: root/gfx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx.cpp')
-rw-r--r--gfx.cpp175
1 files changed, 89 insertions, 86 deletions
diff --git a/gfx.cpp b/gfx.cpp
index 38761c2d78..f481a1fe8e 100644
--- a/gfx.cpp
+++ b/gfx.cpp
@@ -37,8 +37,11 @@ void Scumm::getGraphicsPerformance() {
}
_vars[VAR_PERFORMANCE_2] = 0;//_scummTimer;
-
- initScreens(0, 16, 320, 144);
+
+ if(_gameId == GID_DIG)
+ initScreens(0, 0, 320, 200);
+ else
+ initScreens(0, 16, 320, 144);
}
void Scumm::initScreens(int a, int b, int w, int h) {
@@ -2318,92 +2321,92 @@ int Scumm::remapPaletteColor(int r, int g, int b, uint threshold) {
}
void Scumm::drawBomp(BompDrawData *bd) {
- byte *dest = bd->out + bd->y * bd->outwidth, *src;
- int h = bd->srcheight;
- bool inside;
-
- if (h==0 || bd->srcwidth==0)
- return;
-
- inside = (bd->x>=0) && (bd->y>=0) &&
- (bd->x <= bd->outwidth - bd->srcwidth) &&
- (bd->y <= bd->outheight - bd->srcheight);
-
-
- if (1 || bd->scale_x==255 && bd->scale_y==255) {
- /* Routine used when no scaling is needed */
- if (inside) {
- dest += bd->x;
- src = bd->dataptr;
- do {
- byte code,color;
- uint len = bd->srcwidth, num, i;
- byte *d = dest;
- src += 2;
- do {
- code = *src++;
- num = (code>>1)+1;
- if (num>len) num=len;
- len -= num;
- if (code&1) {
- color = *src++;
- if (color!=255) {
- do *d++ = color; while (--num);
- } else {
- d += num;
- }
- } else {
- for(i=0;i<num; i++)
- if ( (color=src[i]) != 255)
- d[i] = color;
- d += num;
- src += num;
- }
- } while (len);
- dest += bd->outwidth;
- } while (--h);
+ byte *dest = bd->out + bd->y * bd->outwidth, *src;
+ int h = bd->srcheight;
+ bool inside;
+
+ if (h==0 || bd->srcwidth==0)
+ return;
+
+ inside = (bd->x>=0) && (bd->y>=0) &&
+ (bd->x <= bd->outwidth - bd->srcwidth) &&
+ (bd->y <= bd->outheight - bd->srcheight);
+
+ if (1 || bd->scale_x==255 && bd->scale_y==255) {
+ /* Routine used when no scaling is needed */
+ if (inside) {
+ dest += bd->x;
+ src = bd->dataptr;
+ do {
+ byte code,color;
+ uint len = bd->srcwidth, num, i;
+ byte *d = dest;
+ src += 2;
+ do {
+ code = *src++;
+ num = (code>>1)+1;
+ if (num>len) num=len;
+ len -= num;
+ if (code&1) {
+ color = *src++;
+ if (color!=255) {
+ do *d++ = color; while (--num);
+ } else {
+ d += num;
+ }
+ } else {
+ for(i=0;i<num; i++)
+ if ( (color=src[i]) != 255)
+ d[i] = color;
+ d += num;
+ src += num;
+ }
+ } while (len);
+ dest += bd->outwidth;
+ } while (--h);
} else {
- uint y = bd->y;
- src = bd->dataptr;
+ uint y = bd->y;
+ src = bd->dataptr;
+
+ do {
+ byte color,code;
+ uint len, num;
+ uint x;
+ if ((uint)y >= (uint)bd->outheight) {
+ src += READ_LE_UINT16(src) + 2;
+ continue;
+ }
+ len = bd->srcwidth;
+ x = bd->x;
+
+ src += 2;
+ do {
+ byte code = *src++;
+ num = (code>>1)+1;
+ if (num>len) num=len;
+ len -= num;
+ if (code&1) {
+ if ((color = *src++)!=255) {
+ do {
+ if ((uint)x < (uint)bd->outwidth)
+ dest[x] = color;
+ } while (++x,--num);
+ } else {
+ x += num;
+ }
+ } else {
+ do {
+ if ((color=*src++) != 255 && (uint)x < (uint)bd->outwidth)
+ dest[x] = color;
+ } while (++x,--num);
+ }
+ } while (len);
+ } while (dest += bd->outwidth,y++,--h);
+ }
+ } else {
+ /* scaling of bomp images not supported yet */
+ }
- do {
- byte color;
- uint len, num;
- uint x;
- if ((uint)y >= (uint)bd->outheight) {
- src += READ_LE_UINT16(src) + 2;
- continue;
- }
- len = bd->srcwidth;
- x = bd->x;
-
- src += 2;
- do {
- byte code = *src++;
- num = (code>>1)+1;
- if (num>len) num=len;
- len -= num;
- if (code&1) {
- if ((color = *src++)!=255) {
- do {
- if ((uint)x < (uint)bd->outwidth)
- dest[x] = color;
- } while (++x,--num);
- } else {
- x += num;
- }
- } else {
- do {
- if ((color=*src++) != 255 && (uint)x < (uint)bd->outwidth)
- dest[x] = color;
- } while (++x,--num);
- }
- } while (len);
- } while (dest += bd->outwidth,y++,--h);
- }
- } else {
- /* scaling of bomp images not supported yet */
- }
CHECK_HEAP
}