From: <el...@us...> - 2010-09-09 15:50:42
|
Revision: 13709 http://alleg.svn.sourceforge.net/alleg/?rev=13709&view=rev Author: elias Date: 2010-09-09 15:50:36 +0000 (Thu, 09 Sep 2010) Log Message: ----------- Changed specification of al_draw_*bitmap to not allow transformation and ignore blending/tinting when the screen itself is being drawn (except when drawn into a memory bitmap). Modified Paths: -------------- allegro/branches/4.9/docs/src/refman/graphics.txt allegro/branches/4.9/src/opengl/ogl_bitmap.c allegro/branches/4.9/tests/test_backbuffer.ini allegro/branches/4.9/tests/test_driver.c allegro/branches/4.9/tests/test_driver.txt Modified: allegro/branches/4.9/docs/src/refman/graphics.txt =================================================================== --- allegro/branches/4.9/docs/src/refman/graphics.txt 2010-09-08 14:06:31 UTC (rev 13708) +++ allegro/branches/4.9/docs/src/refman/graphics.txt 2010-09-09 15:50:36 UTC (rev 13709) @@ -513,9 +513,11 @@ To copy part of a bitmap into the same bitmap simply use a temporary bitmap instead. -> *Note:* The backbuffer (or a sub-bitmap thereof) can not be transformed. -If you need to draw a transformed part of the backbuffer draw it to -a temporary bitmap first. +> *Note:* The backbuffer (or a sub-bitmap thereof) can not be +transformed, blended or tinted. If you need to draw the backbuffer draw +it to a temporary bitmap first with no active transformation (except +translation). Blending and tinting settings/parameters will be +ignored. This does not apply when drawing into a memory bitmap. See also: [al_draw_bitmap_region], [al_draw_scaled_bitmap], [al_draw_rotated_bitmap], [al_draw_scaled_rotated_bitmap] Modified: allegro/branches/4.9/src/opengl/ogl_bitmap.c =================================================================== --- allegro/branches/4.9/src/opengl/ogl_bitmap.c 2010-09-08 14:06:31 UTC (rev 13708) +++ allegro/branches/4.9/src/opengl/ogl_bitmap.c 2010-09-09 15:50:36 UTC (rev 13709) @@ -361,6 +361,11 @@ sh = target->cb_excl - ytrans; } + /* Note: Allegro 5.0.0 does not support blending or + * tinting if the source bitmap is the screen. So it is + * correct to ignore them here. + */ + glBindTexture(GL_TEXTURE_2D, ogl_target->texture); glCopyTexSubImage2D(GL_TEXTURE_2D, 0, xtrans, target->h - ytrans - sh, Modified: allegro/branches/4.9/tests/test_backbuffer.ini =================================================================== --- allegro/branches/4.9/tests/test_backbuffer.ini 2010-09-08 14:06:31 UTC (rev 13708) +++ allegro/branches/4.9/tests/test_backbuffer.ini 2010-09-09 15:50:36 UTC (rev 13709) @@ -47,10 +47,14 @@ # now. tolerance=21 +# In Allegro 5.0.0, tinting as well as blending is ignored when the +# source bitmap is the screen (and locking is not used). + [test bbsrc tint] extend=test bbsrc op4=al_draw_tinted_bitmap(target, #008000, 0, 0, flags) hash=bd1ac2c5 +hw_hash=eaf8f7fd sig=aTKKQNfhhknnnjggggYXgUtZflpUQg543223MSX788878KMM548987RKH577849MOO477885LNM345478 # Support for transforming the back-buffer is not on the feature list Modified: allegro/branches/4.9/tests/test_driver.c =================================================================== --- allegro/branches/4.9/tests/test_driver.c 2010-09-08 14:06:31 UTC (rev 13708) +++ allegro/branches/4.9/tests/test_driver.c 2010-09-09 15:50:36 UTC (rev 13709) @@ -500,6 +500,7 @@ char const *sigexp; exp = al_get_config_value(cfg, testname, "hash"); + sigexp = al_get_config_value(cfg, testname, "sig"); if (exp && streq(exp, "off")) { @@ -582,6 +583,17 @@ double rms = bitmap_dissimilarity(bmp1, bmp2); double tolerance; char const *value; + + if (bmp_type == HW) { + char const *exp = al_get_config_value(cfg, testname, "hw_hash"); + char hash[16]; + sprintf(hash, "%08x", hash_bitmap(bmp1)); + if (exp && streq(hash, exp)) { + printf("OK %s [%s]\n", testname, bt); + passed_tests++; + return; + } + } /* The default cutoff is "empirically determined" only. */ if ((value = al_get_config_value(cfg, testname, "tolerance"))) Modified: allegro/branches/4.9/tests/test_driver.txt =================================================================== --- allegro/branches/4.9/tests/test_driver.txt 2010-09-08 14:06:31 UTC (rev 13708) +++ allegro/branches/4.9/tests/test_driver.txt 2010-09-09 15:50:36 UTC (rev 13709) @@ -87,4 +87,6 @@ The hardware implementation is compared against the software implementation, with some tolerance. The tolerance is arbitrary but you can set it if -necessary with the 'tolerance' key. +necessary with the 'tolerance' key. In case the HW results is supposed +to look different, a separate hash can be specifeid with 'hw_hash' +instead of the similarity comparison. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |