# Test primitives which are only in the 5.1 branch.

[test projection]
# Projection doesn't work on memory bitmaps
hw_only = true
op0=al_orthographic_transform(trans, -1, -1, -1, 1, 1, 1)
op1=al_use_projection_transform(trans)
op2=al_draw_filled_circle(0, 0, 1, #aa6600)
hash=cb2630a9
sig=0DMMMMMC0CMMMMMMM9MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM9MMMMMMM60AMMMMM80

[test projection flipped]
# Projection doesn't work on memory bitmaps
hw_only = true
op0=al_orthographic_transform(trans, -1, 1, -1, 1, -1, 1)
op1=al_use_projection_transform(trans)
op2=al_draw_filled_circle(0, 0, 1, #aa6600)
hash=cb2630a9
sig=0DMMMMMC0CMMMMMMM9MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM9MMMMMMM60AMMMMM80

[triangle base]
op0=al_clear_to_color(white)
op1=al_draw_polyline(verts, join, cap, color, thickness, miter_limit)
verts=vtx_triangle
join=ALLEGRO_LINE_JOIN_NONE
cap=ALLEGRO_LINE_CAP_NONE
color=#8080aa
thickness=1.0
miter_limit=1.0

[squiggle base]
extend=triangle base
verts=vtx_squiggle
thickness=25

[test polyline collinear 50]
extend=triangle base
verts=vtx_collinear
thickness=50
hash=553ab2e5

[test polyline triangle 50]
extend=triangle base
thickness=50
hash=019534c0

[test polyline squiggle 0]
extend=squiggle base
thickness=0
hash=1b5e258d

[test polyline squiggle 1]
extend=squiggle base
thickness=1
hash=08066329

[test polyline join bevel]
extend=squiggle base
join=ALLEGRO_LINE_JOIN_BEVEL
hash=1452f13d

[test polyline join round]
extend=squiggle base
join=ALLEGRO_LINE_JOIN_ROUND
hash=e3be6520

[test polyline join miter1]
extend=squiggle base
join=ALLEGRO_LINE_JOIN_MITER
miter_limit=1.0
hash=0cc7a65d

[test polyline join miter2]
extend=squiggle base
join=ALLEGRO_LINE_JOIN_MITER
miter_limit=2.0
hash=973b5a4d

[test polyline cap square]
extend=squiggle base
cap=ALLEGRO_LINE_CAP_SQUARE
hash=8df5cafc

[test polyline cap round]
extend=squiggle base
cap=ALLEGRO_LINE_CAP_ROUND
hash=a308506c

[test polyline cap triangle]
extend=squiggle base
cap=ALLEGRO_LINE_CAP_TRIANGLE
hash=680ab634

[test polyline cap closed]
extend=squiggle base
cap=ALLEGRO_LINE_CAP_CLOSED
hash=6f62fb5c

# The backbuffer may not have an alpha channel so we draw to an
# intermediate bitmap.
[test polygon]
op0=b = al_create_bitmap(640, 480)
op1=al_set_target_bitmap(b)
op2=al_clear_to_color(white)
op3=al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA)
op4=al_draw_polygon(vtx_concave, join, #4444aa80, 25, 1)
op5=al_set_target_bitmap(target)
op6=al_set_separate_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA, ALLEGRO_ADD, ALLEGRO_ZERO, ALLEGRO_ONE)
op7=al_clear_to_color(brown)
op8=al_draw_bitmap(b, 0, 0, 0)
join=ALLEGRO_LINE_JOIN_ROUND
hash=2c6d9cdc

[test filled polygon]
extend=test polygon
op4=al_draw_filled_polygon(vtx_concave, #4444aa80)
hash=de3f4621

[test filled polygon with holes]
extend=test polygon
op4=al_draw_filled_polygon_with_holes(decep.vtx, decep.counts, #4444aa80)
hash=23b1a895


[vtx_collinear]
v0  = 100, 100
v1  = 300, 100
v2  = 200, 100

[vtx_triangle]
v0  = 96.00, 195.00
v1  = 251.00, 297.00
v2  = 150.00, 206.00

[vtx_squiggle]
v0  = 41.00, 219.00
v1  = 193.00, 316.00
v2  = 137.00, 178.00
v3  = 287.00, 172.00
v4  = 242.00, 270.00
v5  = 387.00, 273.00
v6  = 382.00, 174.00
v7  = 313.00, 77.00
v8  = 468.00, 63.00
v9  = 496.00, 130.00
v10 = 416.00, 151.00
v11 = 501.00, 249.00

[vtx_concave]
v0  = 80.00, 296.00
v1  = 330.00, 297.00
v2  = 268.00, 251.00
v3  = 331.00, 242.00
v4  = 292.00, 192.00
v5  = 290.00, 231.00
v6  = 235.00, 223.00
v7  = 250.00, 172.00
v8  = 272.00, 215.00
v9  = 278.00, 165.00
v10 = 367.00, 180.00
v11 = 361.00, 115.00
v12 = 300.00, 71.00
v13 = 333.00, 130.00
v14 = 292.00, 122.00
v15 = 262.00, 76.00
v16 = 245.00, 118.00
v17 = 247.00, 140.00
v18 = 202.00, 146.00
v19 = 185.00, 102.00
v20 = 128.00, 93.00
v21 = 122.00, 138.00
v22 = 179.00, 161.00
v23 = 100.00, 170.00
v24 = 88.00, 236.00
v25 = 127.00, 186.00
v26 = 195.00, 242.00
v27 = 163.00, 271.00
v28 = 165.00, 191.00

[decep.vtx]
v0 = 314.00, 438.00
v1 = 459.00, 207.00
v2 = 485.00, 44.00
v3 = 431.00, 111.00
v4 = 373.00, 130.00
v5 = 368.00, 167.00
v6 = 427.00, 153.00
v7 = 426.00, 159.00
v8 = 366.00, 177.00
v9 = 360.00, 204.00
v10= 420.00, 188.00
v11= 419.00, 196.00
v12= 350.00, 217.00
v13= 314.00, 257.00
v14= 280.00, 218.00
v15= 206.00, 197.00
v16= 205.00, 188.00
v17= 270.00, 208.00
v18= 263.00, 177.00
v19= 205.00, 161.00
v20= 201.00, 151.00
v21= 263.00, 171.00
v22= 251.00, 131.00
v23= 196.00, 110.00
v24= 140.00, 41.00
v25= 168.00, 211.00
v26= 225.00, 234.00
v27= 266.00, 245.00
v28= 280.00, 275.00
v29= 242.00, 255.00
v30= 364.00, 245.00
v31= 402.00, 234.00
v32= 388.00, 255.00
v33= 349.00, 275.00

[decep.counts]
p0=26
p1=4
p2=4
