We want to be strict on software renderer tests and opaque tests, but give a decent margin for blending inaccuracy for the blended tests.
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404218
This commit is contained in:
parent
e957ccc22a
commit
02d897e864
4 changed files with 32 additions and 30 deletions
|
@ -16,7 +16,7 @@
|
|||
/**
|
||||
* @brief Compares a surface and a surface image for equality.
|
||||
*/
|
||||
int surface_compare( SDL_Surface *sur, const SurfaceImage_t *img )
|
||||
int surface_compare( SDL_Surface *sur, const SurfaceImage_t *img, int allowable_error )
|
||||
{
|
||||
int ret;
|
||||
int i,j;
|
||||
|
@ -62,8 +62,8 @@ int surface_compare( SDL_Surface *sur, const SurfaceImage_t *img )
|
|||
dist += (B-pd[2])*(B-pd[2]);
|
||||
dist += (A-pd[3])*(A-pd[3]);
|
||||
}
|
||||
/* Allow up to sqrt(32) difference in blending accuracy */
|
||||
if (dist > 64) {
|
||||
/* Allow some difference in blending accuracy */
|
||||
if (dist > allowable_error) {
|
||||
/*printf("pixel %d,%d varies by %d\n", i, j, dist);*/
|
||||
++ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue