Changed to Assert

This commit is contained in:
jsalmon3 2004-05-08 02:51:11 +00:00
parent cc82601064
commit 78ec3c5965
5 changed files with 10 additions and 10 deletions

View file

@ -365,7 +365,7 @@ local int DoDrawText(int x, int y, unsigned font, const unsigned char* text,
}
}
DebugCheck(*text < 32);
Assert(*text >= 32);
if (*text - 32 >= 0 && height * (*text - 32) < fp->Graphic->Height) {
w = fp->CharWidth[*text - 32];

View file

@ -1402,8 +1402,8 @@ global void VideoDrawLineClip(Uint32 color, int x1, int y1, int x2, int y2)
// direction vector might be slightly off. Somehow, the sub-pixel
// position(s) on the clipped retangle should be denoted to the line
// drawing routine..
DebugCheck(x1 < ClipX1 || x2 < ClipX1 || x1 > ClipX2 || x2 > ClipX2 ||
y1 < ClipY1 || y2 < ClipY1 || y1 > ClipY2 || y2 > ClipY2);
Assert(x1 >= ClipX1 && x2 >= ClipX1 && x1 <= ClipX2 && x2 <= ClipX2 &&
y1 >= ClipY1 && y2 >= ClipY1 && y1 <= ClipY2 && y2 <= ClipY2);
VideoDrawLine(color, x1, y1, x2, y2);
}
@ -1604,13 +1604,13 @@ global void VideoDrawCircleClip(Uint32 color, int x, int y, int r)
VideoDrawPixelClip(color, x + cy, y);
VideoDrawPixelClip(color, x - cy, y);
} else if (cx == cy) {
DebugCheck(cx == 0 || cy == 0);
Assert(cx != 0 && cy != 0);
VideoDrawPixelClip(color, x + cx, y + cy);
VideoDrawPixelClip(color, x - cx, y + cy);
VideoDrawPixelClip(color, x + cx, y - cy);
VideoDrawPixelClip(color, x - cx, y - cy);
} else if (cx < cy) {
DebugCheck(cx == 0 || cy == 0);
Assert(cx != 0 && cy != 0);
VideoDrawPixelClip(color, x + cx, y + cy);
VideoDrawPixelClip(color, x + cx, y - cy);
VideoDrawPixelClip(color, x + cy, y + cx);

View file

@ -271,8 +271,8 @@ global void InitVideoSdl(void)
global void InvalidateArea(int x, int y, int w, int h)
{
#ifndef USE_OPENGL
DebugCheck(NumRects == sizeof(Rects) / sizeof(*Rects));
DebugCheck(x < 0 || y < 0 || x + w > VideoWidth || y + h > VideoHeight);
Assert(NumRects != sizeof(Rects) / sizeof(*Rects));
Assert(x >= 0 && y >= 0 && x + w <= VideoWidth && y + h <= VideoHeight);
Rects[NumRects].x = x;
Rects[NumRects].y = y;
Rects[NumRects].w = w;

View file

@ -425,7 +425,7 @@ global Graphic* LoadSprite(const char* name, int width, int height)
height = g->Height;
}
DebugCheck(width > g->Width || height > g->Height);
Assert(width <= g->Width && height <= g->Height);
if ((g->Width / width) * width != g->Width ||
(g->Height / height) * height != g->Height) {

View file

@ -256,7 +256,7 @@ global void SetClipping(int left, int top, int right, int bottom)
right >= VideoWidth || bottom < 0 || bottom >= VideoHeight) {
DebugLevel0Fn("Wrong clipping %d->%d %d->%d, write cleaner code.\n" _C_
left _C_ right _C_ top _C_ bottom);
// DebugCheck(1);
// Assert(0);
}
#endif
ClipRectToRect(&left, &top, &right, &bottom, 0, 0, VideoWidth, VideoHeight);
@ -362,7 +362,7 @@ global void VideoPaletteListRemove(SDL_Surface* surface)
}
curlink = &((*curlink)->Next);
}
DebugCheck(!*curlink);
Assert(*curlink);
if (*curlink == PaletteList) {
tmp = PaletteList->Next;
free(PaletteList);