diff test/automated/surface/surface.c @ 3471:da53c4046c65

Use 45 degree lines for the diagonal test to avoid aliasing errors in line drawing.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 21 Nov 2009 06:28:25 +0000
parents 0acec8c9f5c9
children 2c07bb579922
line wrap: on
line diff
--- a/test/automated/surface/surface.c	Sat Nov 21 06:19:34 2009 +0000
+++ b/test/automated/surface/surface.c	Sat Nov 21 06:28:25 2009 +0000
@@ -140,7 +140,19 @@
          SDL_MapRGB( testsur->format, 55, 55, 5 ) );
    if (SDL_ATassert( "SDL_DrawLine", ret == 0))
       return;
-   ret = SDL_DrawLine( testsur, 0, 60, 80, 0,
+   ret = SDL_DrawLine( testsur, 0, 0, 29, 29,
+         SDL_MapRGB( testsur->format, 5, 105, 105 ) );
+   if (SDL_ATassert( "SDL_DrawLine", ret == 0))
+      return;
+   ret = SDL_DrawLine( testsur, 29, 30, 0, 59,
+         SDL_MapRGB( testsur->format, 5, 105, 105 ) );
+   if (SDL_ATassert( "SDL_DrawLine", ret == 0))
+      return;
+   ret = SDL_DrawLine( testsur, 79, 0, 50, 29,
+         SDL_MapRGB( testsur->format, 5, 105, 105 ) );
+   if (SDL_ATassert( "SDL_DrawLine", ret == 0))
+      return;
+   ret = SDL_DrawLine( testsur, 79, 59, 50, 30,
          SDL_MapRGB( testsur->format, 5, 105, 105 ) );
    if (SDL_ATassert( "SDL_DrawLine", ret == 0))
       return;