From: <el...@us...> - 2010-02-26 17:19:17
|
Revision: 12981 http://alleg.svn.sourceforge.net/alleg/?rev=12981&view=rev Author: elias Date: 2010-02-26 17:19:09 +0000 (Fri, 26 Feb 2010) Log Message: ----------- Added subtractive blending. Not implemented for D3D yet (everything should work, but D3D will always assume additive blending right now). ex_blend2 is updated to include test cases for subtractive blending, including scaled/rotated blits and the primitives addon (selecting color and rotated draws a circle). Modified Paths: -------------- allegro/branches/4.9/addons/primitives/line_soft.c allegro/branches/4.9/addons/primitives/point_soft.c allegro/branches/4.9/addons/primitives/prim_directx.c allegro/branches/4.9/addons/primitives/prim_opengl.c allegro/branches/4.9/addons/primitives/tri_soft.c allegro/branches/4.9/demo/src/GUI.cpp allegro/branches/4.9/demo/src/render.cpp allegro/branches/4.9/docs/src/refman/graphics.txt allegro/branches/4.9/examples/ex_bitmap_flip.c allegro/branches/4.9/examples/ex_bitmap_target.c allegro/branches/4.9/examples/ex_blend.c allegro/branches/4.9/examples/ex_blend2.cpp allegro/branches/4.9/examples/ex_blend_bench.c allegro/branches/4.9/examples/ex_blend_test.c allegro/branches/4.9/examples/ex_blit.c allegro/branches/4.9/examples/ex_clip.c allegro/branches/4.9/examples/ex_color.cpp allegro/branches/4.9/examples/ex_display_options.c allegro/branches/4.9/examples/ex_draw.c allegro/branches/4.9/examples/ex_draw_bitmap.c allegro/branches/4.9/examples/ex_expose.c allegro/branches/4.9/examples/ex_font.c allegro/branches/4.9/examples/ex_gldepth.c allegro/branches/4.9/examples/ex_keyboard_events.c allegro/branches/4.9/examples/ex_lines.c allegro/branches/4.9/examples/ex_logo.c allegro/branches/4.9/examples/ex_membmp.c allegro/branches/4.9/examples/ex_mouse_cursor.c allegro/branches/4.9/examples/ex_mouse_events.c allegro/branches/4.9/examples/ex_native_filechooser.c allegro/branches/4.9/examples/ex_pixelformat.cpp allegro/branches/4.9/examples/ex_prim.c allegro/branches/4.9/examples/ex_rotate.c allegro/branches/4.9/examples/ex_scale.c allegro/branches/4.9/examples/ex_stream_seek.c allegro/branches/4.9/examples/ex_threads2.c allegro/branches/4.9/examples/ex_timer.c allegro/branches/4.9/examples/ex_ttf.c allegro/branches/4.9/examples/ex_windows.c allegro/branches/4.9/examples/nihgui.cpp allegro/branches/4.9/include/allegro5/bitmap_new.h allegro/branches/4.9/include/allegro5/opengl/GLext/gl_ext_alias.h allegro/branches/4.9/include/allegro5/opengl/GLext/gl_ext_api.h allegro/branches/4.9/src/bitmap_new.c allegro/branches/4.9/src/blenders.c allegro/branches/4.9/src/memblit.c allegro/branches/4.9/src/memdraw.c allegro/branches/4.9/src/opengl/ogl_bitmap.c allegro/branches/4.9/src/opengl/ogl_draw.c allegro/branches/4.9/src/system_new.c allegro/branches/4.9/src/tls.c allegro/branches/4.9/src/win/d3d_bmp.cpp allegro/branches/4.9/src/win/d3d_disp.cpp allegro/branches/4.9/src/win/wnewwin.c Modified: allegro/branches/4.9/addons/primitives/line_soft.c =================================================================== --- allegro/branches/4.9/addons/primitives/line_soft.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/addons/primitives/line_soft.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -487,10 +487,10 @@ { int shade = 1; int grad = 1; - int src_mode, dst_mode, src_alpha, dst_alpha; + int op, src_mode, dst_mode, op_alpha, src_alpha, dst_alpha; ALLEGRO_COLOR ic; - al_get_separate_blender(&src_mode, &dst_mode, &src_alpha, &dst_alpha, &ic); + al_get_separate_blender(&op, &src_mode, &dst_mode, &op_alpha, &src_alpha, &dst_alpha, &ic); if (src_mode == ALLEGRO_ONE && src_alpha == ALLEGRO_ONE && dst_mode == ALLEGRO_ZERO && dst_alpha == ALLEGRO_ZERO && ic.r == 1.0f && ic.g == 1.0f && ic.b == 1.0f && ic.a == 1.0f) { Modified: allegro/branches/4.9/addons/primitives/point_soft.c =================================================================== --- allegro/branches/4.9/addons/primitives/point_soft.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/addons/primitives/point_soft.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -36,10 +36,10 @@ void _al_point_2d(ALLEGRO_BITMAP* texture, ALLEGRO_VERTEX* v) { int shade = 1; - int src_mode, dst_mode; + int op, src_mode, dst_mode; ALLEGRO_COLOR ic; - al_get_blender(&src_mode, &dst_mode, &ic); + al_get_blender(&op, &src_mode, &dst_mode, &ic); if (src_mode == ALLEGRO_ONE && dst_mode == ALLEGRO_ZERO && ic.r == 1.0f && ic.g == 1.0f && ic.b == 1.0f && ic.a == 1.0f) { shade = 0; Modified: allegro/branches/4.9/addons/primitives/prim_directx.c =================================================================== --- allegro/branches/4.9/addons/primitives/prim_directx.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/addons/primitives/prim_directx.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -69,11 +69,11 @@ static void set_blender(ALLEGRO_DISPLAY *display) { - int src, dst, alpha_src, alpha_dst; + int op, src, dst, alpha_op, alpha_src, alpha_dst; ALLEGRO_COLOR color; LPDIRECT3DDEVICE9 device = al_d3d_get_device(display); - al_get_separate_blender(&src, &dst, &alpha_src, &alpha_dst, &color); + al_get_separate_blender(&op, &src, &dst, &alpha_op, &alpha_src, &alpha_dst, &color); src = al_blender_to_d3d(src); dst = al_blender_to_d3d(dst); Modified: allegro/branches/4.9/addons/primitives/prim_opengl.c =================================================================== --- allegro/branches/4.9/addons/primitives/prim_opengl.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/addons/primitives/prim_opengl.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -34,26 +34,46 @@ const int blend_modes[4] = { GL_ZERO, GL_ONE, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA }; - int src_color, dst_color, src_alpha, dst_alpha; + const int blend_equations[3] = { + GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT + }; + int op, src_color, dst_color, op_alpha, src_alpha, dst_alpha; ALLEGRO_DISPLAY *d = al_get_current_display(); (void)d; - al_get_separate_blender(&src_color, &dst_color, &src_alpha, - &dst_alpha, NULL); -#if !defined ALLEGRO_GP2XWIZ && !defined ALLEGRO_IPHONE + al_get_separate_blender(&op, &src_color, &dst_color, + &op_alpha, &src_alpha, &dst_alpha, NULL); + +#if defined ALLEGRO_IPHONE + glEnable(GL_BLEND); + glBlendFuncSeparate(blend_modes[src_color], + blend_modes[dst_color], blend_modes[src_alpha], + blend_modes[dst_alpha]); + glBlendEquationSeparate( + blend_equations[op], + blend_equations[alpha_op]); +#elif defined ALLEGRO_GP2XWIZ + glEnable(GL_BLEND); + glBlendFunc(blend_modes[src_color], blend_modes[dst_color]); + glBlendEquation(blend_equations[op]); +#else if (d->ogl_extras->ogl_info.version >= 1.4) { glEnable(GL_BLEND); glBlendFuncSeparate(blend_modes[src_color], blend_modes[dst_color], blend_modes[src_alpha], blend_modes[dst_alpha]); + if (d->ogl_extras->ogl_info.version >= 2.0) { + glBlendEquationSeparate( + blend_equations[op], + blend_equations[op_alpha]); + } + else + glBlendEquation(blend_equations[op]); } else { - if (src_color == src_alpha && dst_color == dst_alpha) { -#endif - glEnable(GL_BLEND); - glBlendFunc(blend_modes[src_color], blend_modes[dst_color]); -#if !defined ALLEGRO_GP2XWIZ && !defined ALLEGRO_IPHONE - } + glEnable(GL_BLEND); + glBlendFunc(blend_modes[src_color], blend_modes[dst_color]); + glBlendEquation(blend_equations[op]); } #endif } Modified: allegro/branches/4.9/addons/primitives/tri_soft.c =================================================================== --- allegro/branches/4.9/addons/primitives/tri_soft.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/addons/primitives/tri_soft.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -836,10 +836,10 @@ { int shade = 1; int grad = 1; - int src_mode, dst_mode; + int op, src_mode, dst_mode; ALLEGRO_COLOR ic; - al_get_blender(&src_mode, &dst_mode, &ic); + al_get_blender(&op, &src_mode, &dst_mode, &ic); if (src_mode == ALLEGRO_ONE && dst_mode == ALLEGRO_ZERO && ic.r == 1.0f && ic.g == 1.0f && ic.b == 1.0f && ic.a == 1.0f) { shade = 0; Modified: allegro/branches/4.9/demo/src/GUI.cpp =================================================================== --- allegro/branches/4.9/demo/src/GUI.cpp 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/demo/src/GUI.cpp 2010-02-26 17:19:09 UTC (rev 12981) @@ -36,10 +36,10 @@ 0); al_draw_rotated_bitmap(logo, lw/2, lh/2, BB_W/2, BB_H/4, 0.0f, 0); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(255, 255, 0)); al_draw_textf(myfont, BB_W/2, BB_H/2, ALLEGRO_ALIGN_CENTRE, "z/y to start"); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(255, 255, 255)); for (unsigned int i = 0; i < widgets.size(); i++) { Modified: allegro/branches/4.9/demo/src/render.cpp =================================================================== --- allegro/branches/4.9/demo/src/render.cpp 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/demo/src/render.cpp 2010-02-26 17:19:09 UTC (rev 12981) @@ -100,9 +100,9 @@ Entity *e = *it; e->render_four(); if (e->isHighlighted()) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_ONE, al_map_rgb(150, 150, 150)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_ONE, al_map_rgb(150, 150, 150)); e->render_four(); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(255, 255, 255)); } rendered++; Modified: allegro/branches/4.9/docs/src/refman/graphics.txt =================================================================== --- allegro/branches/4.9/docs/src/refman/graphics.txt 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/docs/src/refman/graphics.txt 2010-02-26 17:19:09 UTC (rev 12981) @@ -629,31 +629,45 @@ Blending means, the source and destination colors are combined in drawing operations. -Assume, the source color (e.g. color of a rectangle to draw, or pixel -of a bitmap to draw), is given as its red/green/blue/alpha -components (if the bitmap has no alpha, it always is assumed to be +Assume the source color (e.g. color of a rectangle to draw, or pixel +of a bitmap to draw) is given as its red/green/blue/alpha +components (if the bitmap has no alpha it always is assumed to be fully opaque, so 255 for 8-bit or 1.0 for floating point): *sr, sg, sb, sa*. And this color is drawn to a destination, which already has a color: *dr, dg, db, da*. -Blending formula: -The conceptional formula used by Allegro to draw any pixel then is +The Blending formula: +The conceptional formula used by Allegro to draw any pixel then depends +on the <op> parameter: + ALLEGRO_ADD r = dr * dst + sr * src g = dg * dst + sg * src b = db * dst + sb * src a = da * dst + sa * src + + ALLEGRO_DEST_MINUS_SRC + r = dr * dst - sr * src + g = dg * dst - sg * src + b = db * dst - sb * src + a = da * dst - sa * src + + ALLEGRO_SRC_MINUS_DEST + r = sr * src - dr * dst + g = sg * src - dg * dst + b = sb * src - db * dst + a = sa * src - da * dst -Blending functions: +Blending factors: Valid values for <src> and <dst> passed to this function are -* ALLEGRO_ZERO - src, dst = 0 -* ALLEGRO_ONE - src, dst = 1 -* ALLEGRO_ALPHA - src, dst = sa -* ALLEGRO_INVERSE_ALPHA - src, dst = 1 - sa +* ALLEGRO_ZERO - src = 0, dst = 0 +* ALLEGRO_ONE - src = 1, dst = 1 +* ALLEGRO_ALPHA - src = sa, dst = sa +* ALLEGRO_INVERSE_ALPHA - src = 1 - sa, dst = 1 - sa -The color parameter specified the blend color, it is multipled with +The color parameter specifies the blend color, it is multipled with the source color before the above blending operation. Blending examples: Modified: allegro/branches/4.9/examples/ex_bitmap_flip.c =================================================================== --- allegro/branches/4.9/examples/ex_bitmap_flip.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_bitmap_flip.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -121,17 +121,17 @@ /* opaque: software version matches hardware version */ /* - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); */ /* XXX dest zero: software version much darker */ /* - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_ZERO, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 0.5)); */ /* XXX: software version darker */ - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 0.5)); while (!done) { Modified: allegro/branches/4.9/examples/ex_bitmap_target.c =================================================================== --- allegro/branches/4.9/examples/ex_bitmap_target.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_bitmap_target.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -31,10 +31,10 @@ vsnprintf(message, sizeof message, format, list); va_end(list); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(0, 0, 0)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(0, 0, 0)); al_draw_text(myfont, x + 2, y + 2, 0, message); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(255, 255, 255)); al_draw_text(myfont, x, y, 0, message); } @@ -51,7 +51,7 @@ last_time = t; al_set_target_bitmap(target); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_filled_rectangle(x, y, x + RW, y + RH, al_map_rgba_f(1, 0, 0, 1)); @@ -77,7 +77,7 @@ } al_set_target_bitmap(al_get_backbuffer()); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_clear_to_color(al_map_rgba_f(0, 0, 1, 1)); xs = 1 + 0.2 * sin(t * ALLEGRO_PI * 2); ys = 1 + 0.2 * sin(t * ALLEGRO_PI * 2); Modified: allegro/branches/4.9/examples/ex_blend.c =================================================================== --- allegro/branches/4.9/examples/ex_blend.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_blend.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -48,7 +48,7 @@ else color = al_map_rgb(255, 255, 255); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, color); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, color); if (vertical) { int i; ALLEGRO_USTR_INFO ui; @@ -141,7 +141,7 @@ print(20, y + i * 110, true, blend_vnames[i]); } - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, white); if (ex.mode >= 1 && ex.mode <= 5) { al_set_target_bitmap(ex.offscreen); al_clear_to_color(test[ex.mode - 1]); @@ -153,7 +153,7 @@ for (j = 0; j < 4; j++) { for (i = 0; i < 4; i++) { - al_set_blender(blend_modes[j], blend_modes[i], blendcolor); + al_set_blender(ALLEGRO_ADD, blend_modes[j], blend_modes[i], blendcolor); if (ex.image == 0) al_draw_bitmap(ex.example, x + i * 110, y + j * 110, 0); else if (ex.image >= 1 && ex.image <= 6) { @@ -164,12 +164,12 @@ } if (ex.mode >= 1 && ex.mode <= 5) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, white); al_set_target_bitmap(target); al_draw_bitmap_region(ex.offscreen, x, y, 430, 430, x, y, 0); } if (ex.mode >= 6 && ex.mode <= 10) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, white); al_set_target_bitmap(target); al_draw_bitmap_region(ex.memory, x, y, 430, 430, x, y, 0); } Modified: allegro/branches/4.9/examples/ex_blend2.cpp =================================================================== --- allegro/branches/4.9/examples/ex_blend2.cpp 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_blend2.cpp 2010-02-26 17:19:09 UTC (rev 12981) @@ -31,8 +31,9 @@ Label blending_label; List source_image; List destination_image; - Label operation_label[4]; - List operations[4]; + List draw_mode; + Label operation_label[6]; + List operations[6]; VSlider r[3]; VSlider g[3]; VSlider b[3]; @@ -45,7 +46,7 @@ private: void blending_test(bool memory); void draw_samples(); - void draw_bitmap(const std::string &, bool, bool); + void draw_bitmap(const std::string &, const std::string &, bool, bool); }; Prog::Prog(const Theme & theme, ALLEGRO_DISPLAY *display) : @@ -55,7 +56,9 @@ source_label(Label("Source", false)), destination_label(Label("Destination", false)), blending_label(Label("Blending", false)), - destination_image(List(1)) + source_image(List(0)), + destination_image(List(1)), + draw_mode(List(0)) { d.add(memory_label, 10, 0, 10, 2); d.add(texture_label, 0, 0, 10, 2); @@ -63,23 +66,37 @@ d.add(destination_label, 7, 19, 6, 2); d.add(blending_label, 13, 19, 6, 2); - List *images[] = {&source_image, &destination_image}; - for (int i = 0; i < 2; i++) { + List *images[] = {&source_image, &destination_image, &draw_mode}; + for (int i = 0; i < 3; i++) { List & image = *images[i]; - image.append_item("Mysha"); - image.append_item("Allegro"); - image.append_item("Color"); + if (i < 2) { + image.append_item("Mysha"); + image.append_item("Allegro"); + image.append_item("Color"); + } + else { + image.append_item("original"); + image.append_item("scaled"); + image.append_item("rotated"); + } d.add(image, 1 + i * 6, 21, 4, 4); } - for (int i = 0; i < 4; i++) { + for (int i = 0; i < 6; i++) { operation_label[i] = Label(i % 2 == 0 ? "Color" : "Alpha", false); d.add(operation_label[i], 1 + i * 3, 25, 3, 2); List &l = operations[i]; - l.append_item("ONE"); - l.append_item("ZERO"); - l.append_item("ALPHA"); - l.append_item("INVERSE"); + if (i < 4) { + l.append_item("ONE"); + l.append_item("ZERO"); + l.append_item("ALPHA"); + l.append_item("INVERSE"); + } + else { + l.append_item("ADD"); + l.append_item("SRC_MINUS_DEST"); + l.append_item("DEST_MINUS_SRC"); + } d.add(l, 1 + i * 3, 27, 3, 6); } @@ -121,6 +138,12 @@ return ALLEGRO_ALPHA; if (str == "INVERSE") return ALLEGRO_INVERSE_ALPHA; + if (str == "ADD") + return ALLEGRO_ADD; + if (str == "SRC_MINUS_DEST") + return ALLEGRO_SRC_MINUS_DEST; + if (str == "DEST_MINUS_SRC") + return ALLEGRO_DEST_MINUS_SRC; ALLEGRO_ASSERT(false); return ALLEGRO_ONE; @@ -142,7 +165,9 @@ } } -void Prog::draw_bitmap(const std::string & str, bool memory, +void Prog::draw_bitmap(const std::string & str, + const std::string &how, + bool memory, bool destination) { int i = destination ? 1 : 0; @@ -152,17 +177,41 @@ int av = a[i].get_cur_value(); ALLEGRO_COLOR color = al_map_rgba(rv, gv, bv, av); - if (str == "Mysha") - al_draw_bitmap(memory ? mysha_bmp : mysha, 0, 0, 0); - else if (str == "Allegro") - al_draw_bitmap(memory ? allegro_bmp : allegro, 0, 0, 0); - else if (str == "Color") - al_draw_filled_rectangle(0, 0, 320, 200, color); + if (how == "original") { + if (str == "Mysha") + al_draw_bitmap(memory ? mysha_bmp : mysha, 0, 0, 0); + else if (str == "Allegro") + al_draw_bitmap(memory ? allegro_bmp : allegro, 0, 0, 0); + else if (str == "Color") + al_draw_filled_rectangle(0, 0, 320, 200, color); + } + else if (how == "scaled") { + if (str == "Mysha") + al_draw_scaled_bitmap(memory ? mysha_bmp : mysha, 0, 0, + 320, 200, 10, 10, 300, 180, 0); + else if (str == "Allegro") + al_draw_scaled_bitmap(memory ? allegro_bmp : allegro, 0, 0, + 320, 200, 10, 10, 300, 180, 0); + else if (str == "Color") + al_draw_filled_rectangle(10, 10, 300, 180, color); + } + else if (how == "rotated") { + if (str == "Mysha") + al_draw_rotated_bitmap(memory ? mysha_bmp : mysha, 160, 100, + 160, 100, ALLEGRO_PI / 8, 0); + else if (str == "Allegro") + al_draw_rotated_bitmap(memory ? allegro_bmp : allegro, 160, 100, + 160, 100, ALLEGRO_PI / 8, 0); + else if (str == "Color") + al_draw_filled_circle(160, 100, 100, color); + } } void Prog::blending_test(bool memory) { ALLEGRO_COLOR opaque_white = al_map_rgba_f(1, 1, 1, 1); + int op = str_to_blend_mode(operations[4].get_selected_item_text()); + int aop = str_to_blend_mode(operations[5].get_selected_item_text()); int src = str_to_blend_mode(operations[0].get_selected_item_text()); int asrc = str_to_blend_mode(operations[1].get_selected_item_text()); int dst = str_to_blend_mode(operations[2].get_selected_item_text()); @@ -174,13 +223,15 @@ /* Initialize with destination. */ al_clear_to_color(opaque_white); // Just in case. - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, opaque_white); - draw_bitmap(destination_image.get_selected_item_text(), memory, true); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, opaque_white); + draw_bitmap(destination_image.get_selected_item_text(), + "original", memory, true); /* Now draw the blended source over it. */ - al_set_separate_blender(src, dst, asrc, adst, + al_set_separate_blender(op, src, dst, aop, asrc, adst, al_map_rgba(rv, gv, bv, av)); - draw_bitmap(source_image.get_selected_item_text(), memory, false); + draw_bitmap(source_image.get_selected_item_text(), + draw_mode.get_selected_item_text(), memory, false); } void Prog::draw_samples() @@ -203,7 +254,7 @@ /* Display results. */ al_set_target_bitmap(al_get_backbuffer()); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba(255, 255, 255, 255)); al_draw_bitmap(target, 0, 20, 0); al_draw_bitmap(target_bmp, 320, 20, 0); Modified: allegro/branches/4.9/examples/ex_blend_bench.c =================================================================== --- allegro/branches/4.9/examples/ex_blend_bench.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_blend_bench.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -101,14 +101,14 @@ } al_set_target_bitmap(b1); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 0.5)); step(mode, b2); /* Display the blended bitmap to the screen so we can see something. */ al_store_state(&state, ALLEGRO_STATE_ALL); al_set_target_bitmap(al_get_backbuffer()); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_draw_bitmap(b1, 0, 0, 0); al_flip_display(); al_restore_state(&state); Modified: allegro/branches/4.9/examples/ex_blend_test.c =================================================================== --- allegro/branches/4.9/examples/ex_blend_test.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_blend_test.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -26,7 +26,7 @@ al_set_new_bitmap_format(dst_format); al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgb_f(1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgb_f(1, 1, 1)); dst_bmp = al_create_bitmap(1, 1); al_set_target_bitmap(dst_bmp); al_clear_to_color(dst_col); @@ -37,16 +37,16 @@ al_set_target_bitmap(src_bmp); al_clear_to_color(src_col); al_set_target_bitmap(dst_bmp); - al_set_separate_blender(src, dst, src_a, dst_a, blend); + al_set_separate_blender(ALLEGRO_ADD, src, dst, ALLEGRO_ADD, src_a, dst_a, blend); al_draw_bitmap(src_bmp, 0, 0, 0); al_destroy_bitmap(src_bmp); } else if (operation == 1) { - al_set_separate_blender(src, dst, src_a, dst_a, blend); + al_set_separate_blender(ALLEGRO_ADD, src, dst, ALLEGRO_ADD, src_a, dst_a, blend); al_draw_pixel(0, 0, src_col); } else if (operation == 2) { - al_set_separate_blender(src, dst, src_a, dst_a, blend); + al_set_separate_blender(ALLEGRO_ADD, src, dst, ALLEGRO_ADD, src_a, dst_a, blend); al_draw_line(0, 0, 1, 1, src_col, 0); } @@ -54,7 +54,7 @@ if (test_display) { al_set_target_bitmap(al_get_backbuffer()); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgb_f(1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgb_f(1, 1, 1)); al_draw_bitmap(dst_bmp, 0, 0, 0); } Modified: allegro/branches/4.9/examples/ex_blit.c =================================================================== --- allegro/branches/4.9/examples/ex_blit.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_blit.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -72,7 +72,7 @@ vsnprintf(message, sizeof message, format, list); va_end(list); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, ex.text); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, ex.text); al_draw_textf(ex.font, ex.text_x, ex.text_y, 0, "%s", message); al_restore_state(&state); @@ -107,7 +107,7 @@ void *data; int size, i, format; - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, ex.white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, ex.white); al_clear_to_color(ex.background); Modified: allegro/branches/4.9/examples/ex_clip.c =================================================================== --- allegro/branches/4.9/examples/ex_clip.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_clip.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -80,7 +80,7 @@ vsnprintf(message, sizeof message, format, list); va_end(list); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, ex.text); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, ex.text); al_draw_textf(ex.font, ex.text_x, ex.text_y, 0, "%s", message); al_restore_state(&state); @@ -115,7 +115,7 @@ al_get_clipping_rectangle(&cx, &cy, &cw, &ch); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, ex.white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, ex.white); al_clear_to_color(ex.background); Modified: allegro/branches/4.9/examples/ex_color.cpp =================================================================== --- allegro/branches/4.9/examples/ex_color.cpp 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_color.cpp 2010-02-26 17:19:09 UTC (rev 12981) @@ -139,7 +139,7 @@ al_color_rgb_to_html(v[0], v[1], v[2], html); ALLEGRO_STATE state; al_store_state(&state, ALLEGRO_STATE_ALL); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(0, 0, 0)); al_draw_text(d.get_theme().font, 0, 380, 0, name); al_draw_text(d.get_theme().font, 0, 360, 0, html); Modified: allegro/branches/4.9/examples/ex_display_options.c =================================================================== --- allegro/branches/4.9/examples/ex_display_options.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_display_options.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -62,7 +62,7 @@ ALLEGRO_COLOR c; c = al_map_rgb_f(0.8, 0.8, 1); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); al_draw_textf(font, x, y, 0, "Create new display"); y += font_h; for (i = 0; i < modes_count + 1; i++) { @@ -78,11 +78,11 @@ } if (selected_column == 0 && selected_mode == i) { c = al_map_rgb_f(1, 1, 0); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, white); al_draw_filled_rectangle(x, y, x + 300, y + font_h, c); } c = al_map_rgb_f(0, 0, 0); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); al_draw_textf(font, x, y, 0, "%s %d x %d (%d, %d)", i < modes_count ? "Fullscreen" : "Windowed", mode.width, @@ -93,14 +93,14 @@ x = dw / 2 + 10; y = 10; c = al_map_rgb_f(0.8, 0.8, 1); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); al_draw_textf(font, x, y, 0, "Options for new display"); al_draw_textf(font, dw - 10, y, ALLEGRO_ALIGN_RIGHT, "(current display)"); y += font_h; for (i = 0; i < n; i++) { if (selected_column == 1 && selected_option == i) { c = al_map_rgb_f(1, 1, 0); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, white); al_draw_filled_rectangle(x, y, x + 300, y + font_h, c); } @@ -109,7 +109,7 @@ case ALLEGRO_SUGGEST: c = al_map_rgb_f(0, 0, 0); break; case ALLEGRO_DONTCARE: c = al_map_rgb_f(0.5, 0.5, 0.5); break; } - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); al_draw_textf(font, x, y, 0, "%s: %d (%s)", options[i].name, options[i].value, options[i].required == ALLEGRO_REQUIRE ? "required" : @@ -117,14 +117,14 @@ "ignored"); c = al_map_rgb_f(0.9, 0.5, 0.3); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); al_draw_textf(font, dw - 10, y, ALLEGRO_ALIGN_RIGHT, "%d", al_get_display_option(options[i].option)); y += font_h; } c = al_map_rgb_f(0, 0, 0.8); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); x = 10; y = dh - font_h - 10; y -= font_h; @@ -135,7 +135,7 @@ al_draw_textf(font, x, y, 0, "Cursor keys: change selection"); c = al_map_rgb_f(1, 0, 0); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, c); al_draw_text(font, dw / 2, dh - font_h, ALLEGRO_ALIGN_CENTRE, status); } Modified: allegro/branches/4.9/examples/ex_draw.c =================================================================== --- allegro/branches/4.9/examples/ex_draw.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_draw.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -81,7 +81,7 @@ vsnprintf(message, sizeof message, format, list); va_end(list); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, ex.text); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, ex.text); al_draw_textf(ex.font, ex.text_x, ex.text_y, 0, "%s", message); al_restore_state(&state); @@ -137,7 +137,7 @@ set_xy(80, 16); print("Enlarged x 16"); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, ex.white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, ex.white); if (ex.software) { al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP); @@ -156,7 +156,7 @@ /* Draw the test scene. */ - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 0.5)); for (i = 0; i < rects_num; i++) { primitive( @@ -167,7 +167,7 @@ ex.foreground, false); } - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, ex.white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, ex.white); if (ex.software) { al_set_target_bitmap(screen); Modified: allegro/branches/4.9/examples/ex_draw_bitmap.c =================================================================== --- allegro/branches/4.9/examples/ex_draw_bitmap.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_draw_bitmap.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -121,7 +121,7 @@ example.bitmap = al_create_bitmap(size, size); example.bitmap_size = size; al_set_target_bitmap(example.bitmap); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, example.white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, example.white); al_clear_to_color(al_map_rgba_f(0, 0, 0, 0)); bw = al_get_bitmap_width(example.mysha); bh = al_get_bitmap_height(example.mysha); @@ -177,20 +177,20 @@ char const *binfo[] = {"alpha", "additive", "tinted", "solid"}; if (example.blending == 0) - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, example.half_white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, example.half_white); else if (example.blending == 1) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, example.dark); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, example.dark); else if (example.blending == 2) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, example.red); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, example.red); else if (example.blending == 3) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, example.white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, example.white); for (i = 0; i < example.sprite_count; i++) { Sprite *s = example.sprites + i; al_draw_bitmap(example.bitmap, s->x, s->y, 0); } - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, example.white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, example.white); if (example.show_help) { for (i = 0; i < 5; i++) al_draw_text(example.font, 0, h - 5 * fh + i * fh, 0, text[i]); Modified: allegro/branches/4.9/examples/ex_expose.c =================================================================== --- allegro/branches/4.9/examples/ex_expose.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_expose.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -67,14 +67,14 @@ w = event.display.width, h = event.display.height; /* Draw a red rectangle over the damaged area. */ - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_draw_filled_rectangle(x, y, x + w, y + h, al_map_rgba_f(1, 0, 0, 1)); al_flip_display(); } if (event.type == ALLEGRO_EVENT_TIMER) { /* Slowly restore the original bitmap. */ int x, y; - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 0.1)); for (y = 0; y < al_get_display_height(); y += 200) { for (x = 0; x < al_get_display_width(); x += 320) { Modified: allegro/branches/4.9/examples/ex_font.c =================================================================== --- allegro/branches/4.9/examples/ex_font.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_font.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -27,7 +27,7 @@ int y = event.display.y; int w = event.display.width; int h = event.display.height; - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb_f(1, 1, 1)); al_draw_bitmap_region(screen_clone, x, y, w, h, x, y, 0); @@ -87,17 +87,17 @@ al_draw_bitmap(bitmap, 0, 0, 0); /* Draw red text */ - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(255, 0, 0)); al_draw_textf(f, 10, 10, 0, "red"); /* Draw green text */ - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(0, 255, 0)); al_draw_textf(f, 10, 50, 0, "green"); /* Draw a unicode symbol */ - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(0, 0, 255)); al_draw_textf(a4f, 10, 90, 0, "Mysha's 0.02€"); Modified: allegro/branches/4.9/examples/ex_gldepth.c =================================================================== --- allegro/branches/4.9/examples/ex_gldepth.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_gldepth.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -159,7 +159,7 @@ al_draw_scaled_bitmap(tmp_bmp, 0, 0, al_get_bitmap_width(bmp), al_get_bitmap_height(bmp), 0, 0, w, h, 0); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(255, 0, 0)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(255, 0, 0)); depth = al_get_display_option(ALLEGRO_DEPTH_SIZE); if (!depth) al_draw_textf(font, 0, 5, 0, "No Z-buffer!"); Modified: allegro/branches/4.9/examples/ex_keyboard_events.c =================================================================== --- allegro/branches/4.9/examples/ex_keyboard_events.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_keyboard_events.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -62,7 +62,7 @@ int y; int i; - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, black); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, black); al_draw_text(myfont, 5, th * 0.5, 0, "EVENT KEY CHR UNICODE [MODIFIERS] KEY NAME"); @@ -84,7 +84,7 @@ } } - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, white); } Modified: allegro/branches/4.9/examples/ex_lines.c =================================================================== --- allegro/branches/4.9/examples/ex_lines.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_lines.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -35,7 +35,7 @@ static void fade(void) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, background); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, background); al_draw_filled_rectangle(0, 0, W, H, al_map_rgba_f(0.5, 0.5, 0.6, 0.2)); } @@ -68,7 +68,7 @@ #endif fade(); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, white); draw_clip_rect(); red_dot(x, y); @@ -79,7 +79,7 @@ else { my_set_clip_rect(); if (blend) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb_f(0.5, 1, 1)); } al_draw_line(last_x, last_y, x, y, white, 0); @@ -106,13 +106,13 @@ #endif fade(); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, white); draw_clip_rect(); red_dot(x, y); my_set_clip_rect(); if (blend) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb_f(0.5, 1, 1)); } for (theta = 0.0; theta < 2.0 * ALLEGRO_PI; theta += ALLEGRO_PI/16.0) { Modified: allegro/branches/4.9/examples/ex_logo.c =================================================================== --- allegro/branches/4.9/examples/ex_logo.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_logo.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -99,8 +99,8 @@ br = blur_radius; bw = br * 2 + 1; c = al_map_rgba_f(1, 1, 1, 1.0 / (bw * bw * blur_factor)); - al_set_separate_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, - ALLEGRO_ONE, ALLEGRO_ONE, c); + al_set_separate_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, c); for (i = -br; i <= br; i++) { for (j = -br; j <= br; j++) { al_draw_text(logofont, @@ -159,8 +159,8 @@ /* Draw a shadow. */ c = al_map_rgba_f(0, 0, 0, 0.5 / 9); - al_set_separate_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, - ALLEGRO_ONE, ALLEGRO_ONE, c); + al_set_separate_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, c); for (i = -1; i <= 1; i++) for (j = -1; j <= 1; j++) al_draw_text(logofont, @@ -169,8 +169,8 @@ 0, text); /* Then draw the lit text we made before on top. */ - al_set_separate_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, - ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA, white); + al_set_separate_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA, white); al_draw_bitmap(light, 0, 0, 0); al_destroy_bitmap(light); @@ -211,29 +211,29 @@ th = al_get_font_line_height(font) + 3; for (i = 0; param_names[i]; i++) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, label); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, label); al_draw_textf(font, 2, 2 + i * th, 0, "%s", param_names[i]); } for (i = 0; param_names[i]; i++) { int y = 2 + i * th; // FIXME: additive blending seems broken here when using // memory blenders (i.e. no FBO available) - // al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, white) - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, white); + // al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, white) + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, white); al_draw_filled_rectangle(75, y, 375, y + th - 2, al_map_rgba_f(1, 1, 1, 0.5)); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, i == selection ? light : normal); al_draw_textf(font, 75, y, 0, "%s", param_values[i]); if (i == selection && editing && (((int)(al_current_time() * 2)) & 1)) { int x = 75 + al_get_text_width(font, param_values[i]); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, normal); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, normal); al_draw_line(x, y, x, y + th, white, 0); } } - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, normal); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, normal); al_draw_textf(font, 400, 2, 0, "%s", "R - Randomize"); al_draw_textf(font, 400, 2 + th, 0, "%s", "S - Save as logo.png"); @@ -372,10 +372,10 @@ w = al_get_bitmap_width(logo); h = al_get_bitmap_height(logo); al_store_state(&state, ALLEGRO_STATE_BLENDER); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1 - f)); al_draw_bitmap(logo, logo_x, logo_y, 0); - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, c); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, c); for (j = -2; j <= 2; j += 2) { for (i = -2; i <= 2; i += 2) { al_draw_bitmap(logo_flash, logo_x + i, logo_y + j, 0); Modified: allegro/branches/4.9/examples/ex_membmp.c =================================================================== --- allegro/branches/4.9/examples/ex_membmp.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_membmp.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -8,10 +8,10 @@ static void print(ALLEGRO_FONT *myfont, char *message, int x, int y) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(0, 0, 0)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(0, 0, 0)); al_draw_text(myfont, x+2, y+2, 0, message); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(255, 255, 255)); al_draw_text(myfont, x, y, 0, message); } @@ -44,7 +44,7 @@ } } - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgb(255, 255, 255)); /* Clear the backbuffer with red so we can tell if the bitmap does not Modified: allegro/branches/4.9/examples/ex_mouse_cursor.c =================================================================== --- allegro/branches/4.9/examples/ex_mouse_cursor.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_mouse_cursor.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -55,7 +55,7 @@ al_set_target_bitmap(al_get_backbuffer()); al_clear_to_color(al_map_rgb(128, 128, 128)); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(0, 0, 0, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(0, 0, 0, 1)); th = al_get_font_line_height(font); for (i = 0; i < NUM_CURSORS; i++) { al_draw_text(font, MARGIN_LEFT, MARGIN_TOP + i * th, 0, cursor_list[i].label); Modified: allegro/branches/4.9/examples/ex_mouse_events.c =================================================================== --- allegro/branches/4.9/examples/ex_mouse_events.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_mouse_events.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -91,13 +91,13 @@ draw_mouse_button(i, buttons[i]); } al_draw_bitmap(cursor, mx, my, 0); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb_f(0, 0, 0)); al_draw_textf(font, 5, 5, 0, "dx %i, dy %i, dz %i, dw %i", mmx, mmy, mmz, mmw); al_draw_textf(font, 5, 15, 0, "x %i, y %i, z %i, w %i", mx, my, mz, mw); al_draw_textf(font, 5, 25, 0, "p = %g", p); al_draw_textf(font, 5, 35, 0, "%s", in ? "in" : "out"); - al_set_blender(ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA, al_map_rgb_f(1, 1, 1)); mmx = mmy = mmz = 0; al_flip_display(); Modified: allegro/branches/4.9/examples/ex_native_filechooser.c =================================================================== --- allegro/branches/4.9/examples/ex_native_filechooser.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_native_filechooser.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -157,7 +157,7 @@ path = al_get_native_file_dialog_path(dialog, i); name = al_path_cstr(path, '/'); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, info); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, info); al_draw_textf(font, x, y + i * th, ALLEGRO_ALIGN_CENTRE, name, 0, 0); } } @@ -277,7 +277,7 @@ float y = 0; redraw = false; al_clear_to_color(background); - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, cur_dialog ? inactive : active); al_draw_textf(font, x, y, ALLEGRO_ALIGN_CENTRE, "Open"); if (old_dialog) Modified: allegro/branches/4.9/examples/ex_pixelformat.cpp =================================================================== --- allegro/branches/4.9/examples/ex_pixelformat.cpp 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_pixelformat.cpp 2010-02-26 17:19:09 UTC (rev 12981) @@ -161,7 +161,7 @@ printf("Could not create bitmap, format = %d\n", formats[j].format); } - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgb(255, 255, 255)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgb(255, 255, 255)); if (bitmap1 && bitmap2) { al_set_target_bitmap(bitmap2); Modified: allegro/branches/4.9/examples/ex_prim.c =================================================================== --- allegro/branches/4.9/examples/ex_prim.c 2010-02-26 16:41:51 UTC (rev 12980) +++ allegro/branches/4.9/examples/ex_prim.c 2010-02-26 17:19:09 UTC (rev 12981) @@ -85,14 +85,14 @@ Theta += Speed; al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); } else if (mode == DRAW) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_textf(Font, ScreenW / 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, "Custom Vertex Format"); if (Blend) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); else - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_use_transform(&MainTrans); @@ -130,14 +130,14 @@ Theta += Speed; al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); } else if (mode == DRAW) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_textf(Font, ScreenW / 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, "Textured Primitives"); if (Blend) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); else - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_use_transform(&MainTrans); @@ -184,14 +184,14 @@ Theta += Speed; al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); } else if (mode == DRAW) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_textf(Font, ScreenW / 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, "Filled Textured Primitives"); if (Blend) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); else - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_use_transform(&MainTrans); @@ -232,14 +232,14 @@ Theta += Speed; al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); } else if (mode == DRAW) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_textf(Font, ScreenW / 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, "Low Level Filled Primitives"); if (Blend) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); else - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_use_transform(&MainTrans); @@ -291,14 +291,14 @@ al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); } else if (mode == DRAW) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_textf(Font, ScreenW / 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, "Indexed Filled Primitives"); if (Blend) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); else - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_use_transform(&MainTrans); @@ -325,14 +325,14 @@ 300, -200 }; - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_textf(Font, ScreenW / 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, "High Level Primitives"); if (Blend) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); else - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_use_transform(&MainTrans); @@ -357,14 +357,14 @@ Theta += Speed; al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); } else if (mode == DRAW) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_textf(Font, ScreenW / 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, "High Level Filled Primitives"); if (Blend) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); else - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_use_transform(&MainTrans); @@ -394,14 +394,14 @@ -700, 200, 300, -200 }; - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_textf(Font, ScreenW / 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, "Shaded Primitives"); if (Blend) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, shade_color); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, shade_color); else - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_use_transform(&MainTrans); @@ -433,14 +433,14 @@ -700, 200, 300, -200 }; - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_textf(Font, ScreenW / 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, "Transformations"); if (Blend) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); else - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_use_transform(&MainTrans); @@ -480,14 +480,14 @@ Theta += Speed; al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); } else if (mode == DRAW) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_textf(Font, ScreenW / 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, "Low Level Primitives"); if (Blend) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); else - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_use_transform(&MainTrans); @@ -533,14 +533,14 @@ al_build_transform(&MainTrans, ScreenW / 2, ScreenH / 2, 1, 1, Theta); } else if (mode == DRAW) { - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba_f(1, 1, 1, 1)); al_draw_textf(Font, ScreenW / 2, ScreenH - 20, ALLEGRO_ALIGN_CENTRE, "Indexed Primitives"); if (Blend) - al_set_blender(ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE, al_map_rgba_f(1, 1, 1, 1)); else - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgba_f(1, 1, 1, 1)); al_use_transform(&MainTrans); @@ -743,19 +743,19 @@ } if (Background && bkg) { - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, white); al_draw_scaled_bitmap(bkg, 0, 0, al_get_bitmap_width(bkg), al_get_bitmap_height(bkg), 0, 0, ScreenW, ScreenH, 0); } Screens[cur_screen](DRAW); if (Soft == 1) { - al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO, white); al_set_target_bitmap(al_get_backbuffer()); al_draw_bitmap(Buffer, 0, 0, 0); } - al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, white); + al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, white); al_draw_textf(Font, 0, 0, 0, "FPS: %f", (float)frames_done / (al_curren... [truncated message content] |