Wrote an in-depth regression test for most image-path functions...

...in the test scenario.
This commit is contained in:
Ignacio R. Morelle 2009-01-31 13:47:46 +00:00
parent 9666e20fef
commit a17b244d90

View file

@ -1499,6 +1499,129 @@ Result:
[/unstone]
[/command]
[/set_menu_item]
#define SHOW_IMAGE_PATH_TEST FUNCTOR_AND_PARAMS
[set_variable]
name=functor
value={FUNCTOR_AND_PARAMS}
[/set_variable]
[scroll_to_unit]
check_fogged=yes
id=Urug-Telfar
[/scroll_to_unit]
[message]
speaker=narrator
image="units/orcs/warlord.png~RC(magenta>blue)~$functor"
message="I have been affected by the power of $functor|! To the Dark Gods with that wose-born creature!"
caption=Urug-Telfar
[/message]
[scroll_to_unit]
x,y=$x1,$y1
[/scroll_to_unit]
[clear_variable]
name=functor
[/clear_variable]
#enddef
[set_menu_item]
id=imagepath_tests
description="Image tricks"
[filter_location]
[filter]
type=Elvish Shyde,Elvish Druid,Elvish Sorceress,Elvish Enchantress,Elvish Sylph,Elvish Shaman
[/filter]
[/filter_location]
[command]
[message]
speaker=unit
message="What glamour should I cast upon our foe?"
[option]
message="Flip around!"
[command]
{SHOW_IMAGE_PATH_TEST "FL(horiz,vert)"}
[/command]
[/option]
[option]
message="Scale up"
[command]
{SHOW_IMAGE_PATH_TEST "SCALE(200,200)"}
[/command]
[/option]
[option]
message="Scale down"
[command]
{SHOW_IMAGE_PATH_TEST "SCALE(40,40)"}
[/command]
[/option]
[option]
message="Blur 3"
[command]
{SHOW_IMAGE_PATH_TEST "BL(3)"}
[/command]
[/option]
[option]
message="More red!"
[command]
{SHOW_IMAGE_PATH_TEST "R(255)"}
[/command]
[/option]
[option]
message="More green!"
[command]
{SHOW_IMAGE_PATH_TEST "G(255)"}
[/command]
[/option]
[option]
message="More blue!"
[command]
{SHOW_IMAGE_PATH_TEST "B(255)"}
[/command]
[/option]
[option]
message="Black and white!"
[command]
{SHOW_IMAGE_PATH_TEST "GS()"}
[/command]
[/option]
[option]
message="Other team"
[command]
{SHOW_IMAGE_PATH_TEST "TC(1,magenta)"}
[/command]
[/option]
[option]
message="And other team again"
[command]
{SHOW_IMAGE_PATH_TEST "RC(magenta>teal)"}
[/command]
[/option]
[option]
message="Psychedellic!"
[command]
{SHOW_IMAGE_PATH_TEST "CROP(10,10,50,50)~CS(255,-40,100)~O(50%)~BL(2)~SCALE(125,125)"}
[/command]
[/option]
[option]
message="Shrooms!"
[command]
# Shutz, this sounds like some obscure CPU architecture's data registers
{VARIABLE_OP rc rand 1..9}
{VARIABLE_OP cs.r rand 0..255}
{VARIABLE_OP cs.g rand 0..255}
{VARIABLE_OP cs.b rand 0..255}
{VARIABLE_OP op rand 25%,50%,75%,100%,125%,150%,175%,200%,225%,250%,275%,300%,500%}
{VARIABLE_OP bl rand 1..10}
{VARIABLE_OP sc.w rand 50..200}
{VARIABLE_OP sc.h rand 50..200}
{SHOW_IMAGE_PATH_TEST "RC(magenta>$rc|)~CS($cs.r|,$cs.g|,$cs.b|)~O($op)~BL($bl)~SCALE($sc.w|,$sc.h|)"}
{CLEAR_VARIABLE rc,cs,op,bl,sc}
[/command]
[/option]
[/message]
[/command]
[/set_menu_item]
#undef SHOW_IMAGE_PATH_TEST
[/event]
[/test]