aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/gfx')
-rw-r--r--engines/sci/gfx/gfx_test.cpp18
-rw-r--r--engines/sci/gfx/operations.cpp2
-rw-r--r--engines/sci/gfx/picfill.cpp20
-rw-r--r--engines/sci/gfx/res_pic.cpp4
4 files changed, 16 insertions, 28 deletions
diff --git a/engines/sci/gfx/gfx_test.cpp b/engines/sci/gfx/gfx_test.cpp
index a5f57df315..7005a5e0b2 100644
--- a/engines/sci/gfx/gfx_test.cpp
+++ b/engines/sci/gfx/gfx_test.cpp
@@ -297,7 +297,7 @@ int gfxr_interpreter_calculate_pic(gfx_resstate_t *state, gfxr_pic_t *scaled_pic
break;
default:
- fprintf(stderr, "Attempt to reference invalid pic #%d\n", nr);
+ warning("Attempt to reference invalid pic #%d", nr);
}
printf(">> resource manager retrieved pic #%d\n", nr);
@@ -481,7 +481,7 @@ gfx_pixmap_t *gfxr_interpreter_get_cursor(gfx_resstate_t *state, int nr, void *i
break;
default:
- fprintf(stderr, "Attempt to load invalid pointer %d\n", nr);
+ warning("Attempt to load invalid pointer %d", nr);
gfx_free_pixmap(state->driver, cursor);
return NULL;
}
@@ -1081,7 +1081,7 @@ int main(int argc, char **argv) {
case 'x':
set_mode = xres = atoi(optarg);
if (xres < 1) {
- fprintf(stderr, "Invalid x scale factor!\n");
+ warning("Invalid x scale factor!");
return 1;
}
break;
@@ -1089,7 +1089,7 @@ int main(int argc, char **argv) {
case 'y':
set_mode = yres = atoi(optarg);
if (yres < 1) {
- fprintf(stderr, "Invalid y scale factor!\n");
+ warning("Invalid y scale factor!");
return 1;
}
break;
@@ -1097,13 +1097,13 @@ int main(int argc, char **argv) {
case 'c':
set_mode = color_mode = atoi(optarg);
if (color_mode < 1 || color_mode > 4) {
- fprintf(stderr, "Invalid number of bytes per pixel!\n");
+ warning("Invalid number of bytes per pixel!");
return 1;
}
break;
default:
- fprintf(stderr, "Run 'gfx_test -h' for help\n");
+ warning("Run 'gfx_test -h' for help");
return 1;
}
@@ -1128,17 +1128,17 @@ int main(int argc, char **argv) {
}
if (init_driver(drv)) {
- fprintf(stderr, "Initialization failed!\n");
+ warning("Initialization failed!");
return 1;
}
do_tests(tests);
if (gfxop_exit(state)) {
- fprintf(stderr, "Something weird happened while exitting...\n");
+ warning("Something weird happened while exitting...");
}
} else {
- fprintf(stderr, "No graphics driver found!\n");
+ warning("No graphics driver found!");
return 1;
}
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index 2fd115bf01..ad1265316a 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -1085,7 +1085,7 @@ int gfxop_set_visible_map(GfxState *state, gfx_map_mask_t visible_map) {
break;
default:
- fprintf(stderr, "Invalid display map %d selected!\n", visible_map);
+ warning("Invalid display map %d selected!", visible_map);
return GFX_ERROR;
}
diff --git a/engines/sci/gfx/picfill.cpp b/engines/sci/gfx/picfill.cpp
index 72aaf03f13..6b909c27af 100644
--- a/engines/sci/gfx/picfill.cpp
+++ b/engines/sci/gfx/picfill.cpp
@@ -74,10 +74,7 @@ static void AUXBUF_FILL_HELPER(gfxr_pic_t *pic, int old_xl, int old_xr, int y, i
if (xl > old_xr) // No fillable strip above the last one
return;
- if ((ytotal + xl) < 0) {
- fprintf(stderr, "AARGH-%d\n", __LINE__);
- BREAKPOINT();
- }
+ assert((ytotal + xl) >= 0);
xr = xl;
while (xr < 320 && !(pic->aux_map[ytotal + xr] & clipmask)) {
@@ -85,10 +82,7 @@ static void AUXBUF_FILL_HELPER(gfxr_pic_t *pic, int old_xl, int old_xr, int y, i
++xr;
}
- if ((ytotal + xr) > 64000) {
- fprintf(stderr, "AARGH-%d\n", __LINE__);
- BREAKPOINT();
- }
+ assert((ytotal + xr) <= 64000);
--xr;
@@ -137,14 +131,8 @@ static void AUXBUF_FILL_HELPER(gfxr_pic_t *pic, int old_xl, int old_xr, int y, i
}
}
- if ((ytotal + xl) < 0) {
- fprintf(stderr, "AARGH-%d\n", __LINE__);
- BREAKPOINT();
- }
- if ((ytotal + xr + 1) > 64000) {
- fprintf(stderr, "AARGH-%d\n", __LINE__);
- BREAKPOINT();
- }
+ assert((ytotal + xl) >= 0);
+ assert((ytotal + xr + 1) <= 64000);
if (control)
memset(pic->control_map->index_data + ytotal + xl, control, xr - xl + 1);
diff --git a/engines/sci/gfx/res_pic.cpp b/engines/sci/gfx/res_pic.cpp
index 274cd68754..8aecdd09b4 100644
--- a/engines/sci/gfx/res_pic.cpp
+++ b/engines/sci/gfx/res_pic.cpp
@@ -468,7 +468,7 @@ static void _gfxr_fill_ellipse(gfxr_pic_t *pic, byte *buffer, int linewidth, int
break;
default:
- fprintf(stderr, "%s L%d: Invalid ellipse fill mode!\n", __FILE__, __LINE__);
+ warning(" to %s,%d", __FILE__, __LINE__);
return;
}
@@ -770,7 +770,7 @@ static void _gfxr_draw_subline(gfxr_pic_t *pic, int x, int y, int ex, int ey, in
end.y = ey;
if (ex >= pic->visual_map->index_width || ey >= pic->visual_map->index_height || x < 0 || y < 0) {
- fprintf(stderr, "While drawing pic0: INVALID LINE %d,%d,%d,%d\n",
+ warning("While drawing pic0: INVALID LINE %d,%d,%d,%d",
start.x, start.y, end.x, end.y);
return;
}