Use 45 degree lines for the diagonal test to avoid aliasing errors in line drawing.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404212
This commit is contained in:
Sam Lantinga 2009-11-21 06:28:25 +00:00
parent 3110c4d9fb
commit e3bfc7307d
3 changed files with 390 additions and 368 deletions

View file

@ -140,7 +140,19 @@ static void surface_testPrimitives( SDL_Surface *testsur )
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;