comparison 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
comparison
equal deleted inserted replaced
3470:419f459f2f38 3471:da53c4046c65
138 return; 138 return;
139 ret = SDL_DrawLine( testsur, 40, 30, 40, 60, 139 ret = SDL_DrawLine( testsur, 40, 30, 40, 60,
140 SDL_MapRGB( testsur->format, 55, 55, 5 ) ); 140 SDL_MapRGB( testsur->format, 55, 55, 5 ) );
141 if (SDL_ATassert( "SDL_DrawLine", ret == 0)) 141 if (SDL_ATassert( "SDL_DrawLine", ret == 0))
142 return; 142 return;
143 ret = SDL_DrawLine( testsur, 0, 60, 80, 0, 143 ret = SDL_DrawLine( testsur, 0, 0, 29, 29,
144 SDL_MapRGB( testsur->format, 5, 105, 105 ) );
145 if (SDL_ATassert( "SDL_DrawLine", ret == 0))
146 return;
147 ret = SDL_DrawLine( testsur, 29, 30, 0, 59,
148 SDL_MapRGB( testsur->format, 5, 105, 105 ) );
149 if (SDL_ATassert( "SDL_DrawLine", ret == 0))
150 return;
151 ret = SDL_DrawLine( testsur, 79, 0, 50, 29,
152 SDL_MapRGB( testsur->format, 5, 105, 105 ) );
153 if (SDL_ATassert( "SDL_DrawLine", ret == 0))
154 return;
155 ret = SDL_DrawLine( testsur, 79, 59, 50, 30,
144 SDL_MapRGB( testsur->format, 5, 105, 105 ) ); 156 SDL_MapRGB( testsur->format, 5, 105, 105 ) );
145 if (SDL_ATassert( "SDL_DrawLine", ret == 0)) 157 if (SDL_ATassert( "SDL_DrawLine", ret == 0))
146 return; 158 return;
147 159
148 /* See if it's the same. */ 160 /* See if it's the same. */