From 6fa8772baef4e76a1cb4b92c14f2479def8210b5 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 1 Nov 2010 16:00:35 +0000 Subject: SWORD25: Replace art_warn/art_die by warning/error svn-id: r54002 --- engines/sword25/gfx/image/art.cpp | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/engines/sword25/gfx/image/art.cpp b/engines/sword25/gfx/image/art.cpp index 064ca333e7..d30460901d 100644 --- a/engines/sword25/gfx/image/art.cpp +++ b/engines/sword25/gfx/image/art.cpp @@ -34,39 +34,12 @@ /* Various utility functions RLL finds useful. */ +#include "common/textconsole.h" + #include "sword25/gfx/image/art.h" namespace Sword25 { -/** - * art_die: Print the error message to stderr and exit with a return code of 1. - * @fmt: The printf-style format for the error message. - * - * Used for dealing with severe errors. - **/ -void art_die(const char *fmt, ...) { - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - exit(1); -} - -/** - * art_warn: Print the warning message to stderr. - * @fmt: The printf-style format for the warning message. - * - * Used for generating warnings. - **/ -void art_warn(const char *fmt, ...) { - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); -} - /** * art_svp_free: Free an #ArtSVP structure. * @svp: #ArtSVP to free. @@ -1172,7 +1145,7 @@ static int art_svp_writer_rewind_add_segment(ArtSvpWriter *self, int wind_left, right_filled = (wind_right > 0); break; default: - art_die("Unknown wind rule %d\n", swr->rule); + error("Unknown wind rule %d", swr->rule); } if (left_filled == right_filled) { /* discard segment now */ @@ -1386,7 +1359,7 @@ static void art_svp_intersect_add_horiz(ArtIntersectCtx *ctx, ArtActiveSeg *seg) ArtActiveSeg *place_right = NULL; if (seg->flags & ART_ACTIVE_FLAGS_IN_HORIZ) { - art_warn("*** attempt to put segment in horiz list twice\n"); + warning("attempt to put segment in horiz list twice"); return; } seg->flags |= ART_ACTIVE_FLAGS_IN_HORIZ; @@ -1563,7 +1536,7 @@ static ArtActiveSeg *art_svp_intersect_add_point(ArtIntersectCtx *ctx, double x, break; new_x = x_test; if (new_x < x_test) { - art_warn("art_svp_intersect_add_point: non-ascending x\n"); + warning("art_svp_intersect_add_point: non-ascending x"); } x_test = new_x; } -- cgit v1.2.3