Implement the IMAGE argument type for macros.

This involved changing a bunch of formal args in the terrain graphics
macros from IMAGE to IMAGESTEM or IMAGELINE to avoid false positives.
This commit is contained in:
Eric S. Raymond 2008-02-06 19:28:56 +00:00
parent 28079dcd08
commit 8a2db11ceb
12 changed files with 180 additions and 171 deletions

View file

@ -183,13 +183,13 @@
# transitions to other terrains. The larger transitions have greater priority
# and go first.
#define TERRAIN_ADJACENT_PREC_FL LAYER TERRAIN ADJACENT IMAGE FLAG
{TERRAIN_ADJACENT_PREC_4_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} {FLAG}}
{TERRAIN_ADJACENT_PREC_3_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} {FLAG}}
{TERRAIN_ADJACENT_PREC_2_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} {FLAG}}
{TERRAIN_ADJACENT_PREC_1_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} {FLAG}}
#define TERRAIN_ADJACENT_PREC_FL LAYER TERRAIN ADJACENT IMAGESTEM FLAG
{TERRAIN_ADJACENT_PREC_4_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} {FLAG}}
{TERRAIN_ADJACENT_PREC_3_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} {FLAG}}
{TERRAIN_ADJACENT_PREC_2_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} {FLAG}}
{TERRAIN_ADJACENT_PREC_1_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} {FLAG}}
#enddef
#define TERRAIN_ADJACENT_PREC LAYER TERRAIN ADJACENT IMAGE
{TERRAIN_ADJACENT_PREC_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} transition}
#define TERRAIN_ADJACENT_PREC LAYER TERRAIN ADJACENT IMAGESTEM
{TERRAIN_ADJACENT_PREC_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} transition}
#enddef

View file

@ -209,7 +209,7 @@
[/terrain_graphics]
#enddef
#define TERRAIN_OVERLAY_PROB LETTER FLAG PROB IMAGE
#define TERRAIN_OVERLAY_PROB LETTER FLAG PROB IMAGESTEM
[terrain_graphics]
[tile]
x=0
@ -217,7 +217,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}
name={IMAGESTEM}
[/image]
[/tile]
probability={PROB}
@ -624,9 +624,9 @@
#{TERRAIN_BASE O orccastle}
#define TERRAIN_ADJACENT_CORNER_BOTH INNER OUTER IMAGE
{TERRAIN_ADJACENT_CORNER {INNER} {OUTER} {OUTER} 52,76 {IMAGE}-convex}
{TERRAIN_ADJACENT_CORNER {OUTER} {INNER} {INNER} 56,68 {IMAGE}-concave}
#define TERRAIN_ADJACENT_CORNER_BOTH INNER OUTER IMAGESTEM
{TERRAIN_ADJACENT_CORNER {INNER} {OUTER} {OUTER} 52,76 {IMAGESTEM}-convex}
{TERRAIN_ADJACENT_CORNER {OUTER} {INNER} {INNER} 56,68 {IMAGESTEM}-concave}
#enddef
# Loyalist castle

View file

@ -5,7 +5,7 @@
# This will add 4-tile transitions from terrains of type g or t to terrains of
# any other type, using the filename grassland-x-x-x-x.png
#define TERRAIN_ADJACENT_4_FL LAYER TERRAIN ADJACENT IMAGE FLAG
#define TERRAIN_ADJACENT_4_FL LAYER TERRAIN ADJACENT IMAGESTEM FLAG
[terrain_graphics]
map="
, 2
@ -22,7 +22,7 @@
[image]
layer={LAYER}
name={IMAGE}-@R0-@R1-@R2-@R3
name={IMAGESTEM}-@R0-@R1-@R2-@R3
[/image]
[/tile]
[tile]
@ -56,7 +56,7 @@
# Same as above, but for 3-tile transitions.
#define TERRAIN_ADJACENT_3_FL LAYER TERRAIN ADJACENT IMAGE FLAG
#define TERRAIN_ADJACENT_3_FL LAYER TERRAIN ADJACENT IMAGESTEM FLAG
[terrain_graphics]
map="
, 2
@ -73,7 +73,7 @@
[image]
layer={LAYER}
name={IMAGE}-@R0-@R1-@R2
name={IMAGESTEM}-@R0-@R1-@R2
[/image]
[/tile]
[tile]
@ -101,7 +101,7 @@
# Same as above, but for 2-tile transitions.
#define TERRAIN_ADJACENT_2_FL LAYER TERRAIN ADJACENT IMAGE FLAG
#define TERRAIN_ADJACENT_2_FL LAYER TERRAIN ADJACENT IMAGESTEM FLAG
[terrain_graphics]
map="
, 2
@ -118,7 +118,7 @@
[image]
layer={LAYER}
name={IMAGE}-@R0-@R1
name={IMAGESTEM}-@R0-@R1
[/image]
[/tile]
[tile]
@ -140,7 +140,7 @@
# Same as above, but for 1-tile (simple) transitions.
#define TERRAIN_ADJACENT_1_FL LAYER TERRAIN ADJACENT IMAGE FLAG
#define TERRAIN_ADJACENT_1_FL LAYER TERRAIN ADJACENT IMAGESTEM FLAG
[terrain_graphics]
map="
, 2
@ -157,7 +157,7 @@
[image]
layer={LAYER}
name={IMAGE}-@R0
name={IMAGESTEM}-@R0
[/image]
[/tile]
[tile]
@ -175,32 +175,32 @@
# transitions to other terrains. The larger transitions have greater priority
# and go first.
#define TERRAIN_ADJACENT_FL LAYER TERRAIN ADJACENT IMAGE FLAG
{TERRAIN_ADJACENT_4_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} {FLAG}}
{TERRAIN_ADJACENT_3_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} {FLAG}}
{TERRAIN_ADJACENT_2_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} {FLAG}}
{TERRAIN_ADJACENT_1_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} {FLAG}}
#define TERRAIN_ADJACENT_FL LAYER TERRAIN ADJACENT IMAGESTEM FLAG
{TERRAIN_ADJACENT_4_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} {FLAG}}
{TERRAIN_ADJACENT_3_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} {FLAG}}
{TERRAIN_ADJACENT_2_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} {FLAG}}
{TERRAIN_ADJACENT_1_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} {FLAG}}
#enddef
#define TERRAIN_ADJACENT LAYER TERRAIN ADJACENT IMAGE
{TERRAIN_ADJACENT_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} transition}
#define TERRAIN_ADJACENT LAYER TERRAIN ADJACENT IMAGESTEM
{TERRAIN_ADJACENT_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} transition}
#enddef
#define TERRAIN_ADJACENT_OV LAYER TERRAIN ADJACENT IMAGE
{TERRAIN_ADJACENT_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} overlay}
#define TERRAIN_ADJACENT_OV LAYER TERRAIN ADJACENT IMAGESTEM
{TERRAIN_ADJACENT_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} overlay}
#enddef
# If you need a custom flag use this one, this allows stacking of
# several transitions.
#define TERRAIN_ADJACENT_CUSTOM LAYER TERRAIN ADJACENT IMAGE FLAG
{TERRAIN_ADJACENT_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGE} {FLAG}}
#define TERRAIN_ADJACENT_CUSTOM LAYER TERRAIN ADJACENT IMAGESTEM FLAG
{TERRAIN_ADJACENT_FL ({LAYER}) ({TERRAIN}) ({ADJACENT}) {IMAGESTEM} {FLAG}}
#enddef
# define a specific rule for layering when the transition borders
# on a specific OTHER_TERRAIN - to use in situations where the layering
# needs to be adjusted for three-way-junctions of a particular set of
# terrains
#define TERRAIN_ADJACENT_3_DIFFERENT LAYER TERRAIN ADJACENT OTHER_TERRAIN IMAGE FLAG
#define TERRAIN_ADJACENT_3_DIFFERENT LAYER TERRAIN ADJACENT OTHER_TERRAIN IMAGESTEM FLAG
[terrain_graphics]
map="
, 2
@ -217,7 +217,7 @@
[image]
layer={LAYER}
name={IMAGE}-@R0
name={IMAGESTEM}-@R0
[/image]
[/tile]
[tile]
@ -251,7 +251,7 @@
[image]
layer={LAYER}
name={IMAGE}-@R0
name={IMAGESTEM}-@R0
[/image]
[/tile]
[tile]

View file

@ -1,6 +1,6 @@
#textdomain wesnoth
#define TERRAIN_BASE_FLAG LETTER FLAG IMAGE
#define TERRAIN_BASE_FLAG LETTER FLAG IMAGESTEM
[terrain_graphics]
[tile]
x=0
@ -9,7 +9,7 @@
has_flag={FLAG}
[image]
layer=-1000
name={IMAGE}
name={IMAGESTEM}
[/image]
[/tile]
no_flag="base"
@ -20,7 +20,7 @@
# Attachs an image to a single terrain tile, with a given probability.
# example: {TERRAIN_BASE_PROBABILITY g grassland-rocks 20}
#define TERRAIN_BASE_PROB_FL LETTER IMAGE PROB FLAG LAYER
#define TERRAIN_BASE_PROB_FL LETTER IMAGESTEM PROB FLAG LAYER
[terrain_graphics]
[tile]
x=0
@ -28,7 +28,7 @@
type="{LETTER}"
[image]
layer={LAYER}
name={IMAGE}
name={IMAGESTEM}
[/image]
[/tile]
@ -42,24 +42,24 @@
# example: {TERRAIN_BASE g grassland}
# Should be last on the list: when a terrain has been placed, no other one can.
#define TERRAIN_BASE_FL LETTER IMAGE FLAG LAYER
{TERRAIN_BASE_PROB_FL ({LETTER}) {IMAGE} 100 {FLAG} {LAYER}}
#define TERRAIN_BASE_FL LETTER IMAGESTEM FLAG LAYER
{TERRAIN_BASE_PROB_FL ({LETTER}) {IMAGESTEM} 100 {FLAG} {LAYER}}
#enddef
#define TERRAIN_BASE_PROB LETTER IMAGE PROB
{TERRAIN_BASE_PROB_FL ({LETTER}) {IMAGE} {PROB} base -1000}
#define TERRAIN_BASE_PROB LETTER IMAGESTEM PROB
{TERRAIN_BASE_PROB_FL ({LETTER}) {IMAGESTEM} {PROB} base -1000}
#enddef
#define TERRAIN_BASE LETTER IMAGE
{TERRAIN_BASE_FL ({LETTER}) {IMAGE} base -1000}
#define TERRAIN_BASE LETTER IMAGESTEM
{TERRAIN_BASE_FL ({LETTER}) {IMAGESTEM} base -1000}
#enddef
#define TERRAIN_BASE_PROB_OV LETTER IMAGE PROB
{TERRAIN_BASE_PROB_FL ({LETTER}) {IMAGE} {PROB} overlay -80}
#define TERRAIN_BASE_PROB_OV LETTER IMAGESTEM PROB
{TERRAIN_BASE_PROB_FL ({LETTER}) {IMAGESTEM} {PROB} overlay -80}
#enddef
#define TERRAIN_BASE_OV LETTER IMAGE
{TERRAIN_BASE_FL ({LETTER}) {IMAGE} overlay -80}
#define TERRAIN_BASE_OV LETTER IMAGESTEM
{TERRAIN_BASE_FL ({LETTER}) {IMAGESTEM} overlay -80}
#enddef
#define TERRAIN_BASE_DEFAULT IMAGE
#define TERRAIN_BASE_DEFAULT IMAGESTEM
[terrain_graphics]
[tile]
x=0
@ -67,7 +67,7 @@
type=*
[image]
layer=-1000
name={IMAGE}
name={IMAGESTEM}
[/image]
[/tile]
no_flag="base"

View file

@ -10,7 +10,7 @@
#enddef
# this macro adds dock-style ends to bridges ending in water
#define DOCK_END IMAGE WATER BRIDGETYPE BEACHSIDE X Y
#define DOCK_END IMAGESTEM WATER BRIDGETYPE BEACHSIDE X Y
[terrain_graphics]
[tile]
x=1
@ -22,13 +22,13 @@
y={Y}
type={WATER}
no_flag=angleaway_{BEACHSIDE}
{IMAGE_L_N -80 {IMAGE}-{BEACHSIDE}-end}
{IMAGE_L_N -80 {IMAGESTEM}-{BEACHSIDE}-end}
[/tile]
[/terrain_graphics]
#enddef
# this macro adds ramp-style ends to bridges ending on other bridges
#define RAMP_BRIDGE IMAGE BRIDGETYPE BRIDGES R0 R1 R2 R3 R4 R5 S0 S1 S2 S3 S4 S5
#define RAMP_BRIDGE IMAGESTEM BRIDGETYPE BRIDGES R0 R1 R2 R3 R4 R5 S0 S1 S2 S3 S4 S5
[terrain_graphics]
map="
, {S0}
@ -45,13 +45,13 @@
pos=2
type={BRIDGES}
no_flag=angle_{R3}
{IMAGE_L_N -80 {IMAGE}-{R3}}
{IMAGE_L_N -80 {IMAGESTEM}-{R3}}
[/tile]
[/terrain_graphics]
#enddef
# this macro adds ramp-style ends to bridges ending on land
#define RAMP_END IMAGE WATER NOTERM BRIDGETYPE R0 R1 R2 R3 R4 R5 X Y
#define RAMP_END IMAGESTEM WATER NOTERM BRIDGETYPE R0 R1 R2 R3 R4 R5 X Y
[terrain_graphics]
[tile]
x=1
@ -64,13 +64,13 @@
y={Y}
type=!,{BRIDGETYPE},{WATER},{NOTERM}
no_flag=angle_{R3}
{IMAGE_L_N -80 {IMAGE}-{R3}}
{IMAGE_L_N -80 {IMAGESTEM}-{R3}}
[/tile]
[/terrain_graphics]
#enddef
# this macro produces Y intersections
#define BRIDGE_Y BRIDGETYPE1 BRIDGETYPE2 BRIDGETYPE3 YIMAGE R0 R1 R2 R3 R4 R5 S0 S1 S2 S3 S4 S5
#define BRIDGE_Y BRIDGETYPE1 BRIDGETYPE2 BRIDGETYPE3 YIMAGESTEM R0 R1 R2 R3 R4 R5 S0 S1 S2 S3 S4 S5
[terrain_graphics]
map="
, {S1}
@ -83,7 +83,7 @@
type={BRIDGETYPE1}
no_flag=overlay,angle_{R0},angle_{R2},angle_{R4}
set_flag=overlay,angle_{R1},angle_{R5},angle_{R3}
{IMAGE_L_N -80 {YIMAGE}}
{IMAGE_L_N -80 {YIMAGESTEM}}
[/tile]
[tile]
pos=2
@ -126,7 +126,7 @@
#enddef
# this macro handles the normal corners
#define CORNER ANGLEIMAGE BRIDGETYPE1 BRIDGETYPE2 A1 A2 A3 A4 A5 A6 S0 S1 S2 S3 S4 S5
#define CORNER ANGLEIMAGESTEM BRIDGETYPE1 BRIDGETYPE2 A1 A2 A3 A4 A5 A6 S0 S1 S2 S3 S4 S5
[terrain_graphics]
map="
, {S1}
@ -139,7 +139,7 @@
type={BRIDGETYPE1}
no_flag=overlay,angle_{A3},angle_{A4},angle_{A5},angle_{A6}
set_flag=overlay,angle_{A1},angle_{A2}
{IMAGE_L_N -80 {ANGLEIMAGE}}
{IMAGE_L_N -80 {ANGLEIMAGESTEM}}
[/tile]
[tile]
pos=2
@ -155,15 +155,15 @@
#enddef
# the main macro, called from terrain-graphics.cfg
#define BRIDGE SE_NW N_S NE_SW WATER NOTERM IMAGE
#define BRIDGE SE_NW N_S NE_SW WATER NOTERM IMAGESTEM
# find Y intersections
{BRIDGE_Y {N_S} {SE_NW} {NE_SW} {IMAGE}-joint-ne-s-nw n ne se s sw nw 2 4 3 . . .}
{BRIDGE_Y {NE_SW} {N_S} {SE_NW} {IMAGE}-joint-n-se-sw ne se s sw nw n . 2 4 3 . .}
{BRIDGE_Y {SE_NW} {NE_SW} {N_S} {IMAGE}-joint-ne-s-nw se s sw nw n ne . . 2 4 3 .}
{BRIDGE_Y {N_S} {SE_NW} {NE_SW} {IMAGE}-joint-n-se-sw s sw nw n ne se . . . 2 4 3}
{BRIDGE_Y {NE_SW} {N_S} {SE_NW} {IMAGE}-joint-ne-s-nw sw nw n ne se s 3 . . . 2 4}
{BRIDGE_Y {SE_NW} {NE_SW} {N_S} {IMAGE}-joint-n-se-sw nw n ne se s sw 4 3 . . . 2}
{BRIDGE_Y {N_S} {SE_NW} {NE_SW} {IMAGESTEM}-joint-ne-s-nw n ne se s sw nw 2 4 3 . . .}
{BRIDGE_Y {NE_SW} {N_S} {SE_NW} {IMAGESTEM}-joint-n-se-sw ne se s sw nw n . 2 4 3 . .}
{BRIDGE_Y {SE_NW} {NE_SW} {N_S} {IMAGESTEM}-joint-ne-s-nw se s sw nw n ne . . 2 4 3 .}
{BRIDGE_Y {N_S} {SE_NW} {NE_SW} {IMAGESTEM}-joint-n-se-sw s sw nw n ne se . . . 2 4 3}
{BRIDGE_Y {NE_SW} {N_S} {SE_NW} {IMAGESTEM}-joint-ne-s-nw sw nw n ne se s 3 . . . 2 4}
{BRIDGE_Y {SE_NW} {NE_SW} {N_S} {IMAGESTEM}-joint-n-se-sw nw n ne se s sw 4 3 . . . 2}
# make sure that colinear adjacent bridges stay connected
{BRIDGECONNECT {N_S} n ne se s sw nw 1 0}
@ -171,46 +171,46 @@
{BRIDGECONNECT {SE_NW} se s sw nw n ne 2 2}
# normal corners
{CORNER {IMAGE}-joint-s-nw {N_S} {SE_NW} s nw se n sw ne 2 3 . . . .}
{CORNER {IMAGE}-joint-ne-s {N_S} {NE_SW} s ne sw n se nw . 3 2 . . .}
{CORNER {IMAGE}-joint-n-sw {NE_SW} {N_S} sw n s ne nw se . 2 3 . . .}
{CORNER {IMAGE}-joint-se-sw {NE_SW} {SE_NW} sw se nw ne s n . . 3 2 . .}
{CORNER {IMAGE}-joint-ne-nw {SE_NW} {NE_SW} nw ne sw se n s . . 2 3 . .}
{CORNER {IMAGE}-joint-s-nw {SE_NW} {N_S} nw s n se sw ne . . . 3 2 .}
{CORNER {IMAGE}-joint-n-se {N_S} {SE_NW} n se nw s ne sw . . . 2 3 .}
{CORNER {IMAGE}-joint-n-sw {N_S} {NE_SW} n sw ne s nw se . . . . 3 2}
{CORNER {IMAGE}-joint-ne-s {NE_SW} {N_S} ne s n sw se nw . . . . 2 3}
{CORNER {IMAGE}-joint-ne-nw {NE_SW} {SE_NW} ne nw se sw n s 2 . . . . 3}
{CORNER {IMAGE}-joint-se-sw {SE_NW} {NE_SW} se sw ne nw s n 3 . . . . 2}
{CORNER {IMAGE}-joint-n-se {SE_NW} {N_S} se n s nw ne sw 3 2 . . . .}
{CORNER {IMAGESTEM}-joint-s-nw {N_S} {SE_NW} s nw se n sw ne 2 3 . . . .}
{CORNER {IMAGESTEM}-joint-ne-s {N_S} {NE_SW} s ne sw n se nw . 3 2 . . .}
{CORNER {IMAGESTEM}-joint-n-sw {NE_SW} {N_S} sw n s ne nw se . 2 3 . . .}
{CORNER {IMAGESTEM}-joint-se-sw {NE_SW} {SE_NW} sw se nw ne s n . . 3 2 . .}
{CORNER {IMAGESTEM}-joint-ne-nw {SE_NW} {NE_SW} nw ne sw se n s . . 2 3 . .}
{CORNER {IMAGESTEM}-joint-s-nw {SE_NW} {N_S} nw s n se sw ne . . . 3 2 .}
{CORNER {IMAGESTEM}-joint-n-se {N_S} {SE_NW} n se nw s ne sw . . . 2 3 .}
{CORNER {IMAGESTEM}-joint-n-sw {N_S} {NE_SW} n sw ne s nw se . . . . 3 2}
{CORNER {IMAGESTEM}-joint-ne-s {NE_SW} {N_S} ne s n sw se nw . . . . 2 3}
{CORNER {IMAGESTEM}-joint-ne-nw {NE_SW} {SE_NW} ne nw se sw n s 2 . . . . 3}
{CORNER {IMAGESTEM}-joint-se-sw {SE_NW} {NE_SW} se sw ne nw s n 3 . . . . 2}
{CORNER {IMAGESTEM}-joint-n-se {SE_NW} {N_S} se n s nw ne sw 3 2 . . . .}
# these 3 macros define the default straight bridges
{TERRAIN_BASE_OV {N_S} {IMAGE}-n-s}
{TERRAIN_BASE_OV {NE_SW} {IMAGE}-ne-sw}
{TERRAIN_BASE_OV {SE_NW} {IMAGE}-se-nw}
{TERRAIN_BASE_OV {N_S} {IMAGESTEM}-n-s}
{TERRAIN_BASE_OV {NE_SW} {IMAGESTEM}-ne-sw}
{TERRAIN_BASE_OV {SE_NW} {IMAGESTEM}-se-nw}
# add ramps where straight bridges intersect Ys
{RAMP_BRIDGE {IMAGE} {N_S} ({N_S}, {NE_SW}, {SE_NW}) n ne se s sw nw 2 . . . . .}
{RAMP_BRIDGE {IMAGE} {NE_SW} ({N_S}, {NE_SW}, {SE_NW}) ne se s sw nw n . 2 . . . .}
{RAMP_BRIDGE {IMAGE} {SE_NW} ({N_S}, {NE_SW}, {SE_NW}) se s sw nw n ne . . 2 . . .}
{RAMP_BRIDGE {IMAGE} {N_S} ({N_S}, {NE_SW}, {SE_NW}) s sw nw n ne se . . . 2 . .}
{RAMP_BRIDGE {IMAGE} {NE_SW} ({N_S}, {NE_SW}, {SE_NW}) sw nw n ne se s . . . . 2 .}
{RAMP_BRIDGE {IMAGE} {SE_NW} ({N_S}, {NE_SW}, {SE_NW}) nw n ne se s sw . . . . . 2}
{RAMP_BRIDGE {IMAGESTEM} {N_S} ({N_S}, {NE_SW}, {SE_NW}) n ne se s sw nw 2 . . . . .}
{RAMP_BRIDGE {IMAGESTEM} {NE_SW} ({N_S}, {NE_SW}, {SE_NW}) ne se s sw nw n . 2 . . . .}
{RAMP_BRIDGE {IMAGESTEM} {SE_NW} ({N_S}, {NE_SW}, {SE_NW}) se s sw nw n ne . . 2 . . .}
{RAMP_BRIDGE {IMAGESTEM} {N_S} ({N_S}, {NE_SW}, {SE_NW}) s sw nw n ne se . . . 2 . .}
{RAMP_BRIDGE {IMAGESTEM} {NE_SW} ({N_S}, {NE_SW}, {SE_NW}) sw nw n ne se s . . . . 2 .}
{RAMP_BRIDGE {IMAGESTEM} {SE_NW} ({N_S}, {NE_SW}, {SE_NW}) nw n ne se s sw . . . . . 2}
# add ramps where straight bridges end on land
{RAMP_END {IMAGE} {WATER} {NOTERM} {N_S} n ne se s sw nw 1 0}
{RAMP_END {IMAGE} {WATER} {NOTERM} {NE_SW} ne se s sw nw n 2 1}
{RAMP_END {IMAGE} {WATER} {NOTERM} {SE_NW} se s sw nw n ne 2 2}
{RAMP_END {IMAGE} {WATER} {NOTERM} {N_S} s sw nw n ne se 1 2}
{RAMP_END {IMAGE} {WATER} {NOTERM} {NE_SW} sw nw n ne se s 0 2}
{RAMP_END {IMAGE} {WATER} {NOTERM} {SE_NW} nw n ne se s sw 0 1}
{RAMP_END {IMAGESTEM} {WATER} {NOTERM} {N_S} n ne se s sw nw 1 0}
{RAMP_END {IMAGESTEM} {WATER} {NOTERM} {NE_SW} ne se s sw nw n 2 1}
{RAMP_END {IMAGESTEM} {WATER} {NOTERM} {SE_NW} se s sw nw n ne 2 2}
{RAMP_END {IMAGESTEM} {WATER} {NOTERM} {N_S} s sw nw n ne se 1 2}
{RAMP_END {IMAGESTEM} {WATER} {NOTERM} {NE_SW} sw nw n ne se s 0 2}
{RAMP_END {IMAGESTEM} {WATER} {NOTERM} {SE_NW} nw n ne se s sw 0 1}
# add dock-style ends to bridges ending in water
{DOCK_END {IMAGE} {WATER} {N_S} s 1 0}
{DOCK_END {IMAGE} {WATER} {NE_SW} sw 2 1}
{DOCK_END {IMAGE} {WATER} {SE_NW} nw 2 2}
{DOCK_END {IMAGE} {WATER} {N_S} n 1 2}
{DOCK_END {IMAGE} {WATER} {NE_SW} ne 0 2}
{DOCK_END {IMAGE} {WATER} {SE_NW} se 0 1}
{DOCK_END {IMAGESTEM} {WATER} {N_S} s 1 0}
{DOCK_END {IMAGESTEM} {WATER} {NE_SW} sw 2 1}
{DOCK_END {IMAGESTEM} {WATER} {SE_NW} nw 2 2}
{DOCK_END {IMAGESTEM} {WATER} {N_S} n 1 2}
{DOCK_END {IMAGESTEM} {WATER} {NE_SW} ne 0 2}
{DOCK_END {IMAGESTEM} {WATER} {SE_NW} se 0 1}
#enddef

View file

@ -1,33 +1,33 @@
#textdomain wesnoth
#define BUILDING LETTER IMAGE
#define BUILDING LETTER IMAGELINE
[terrain_graphics]
[tile]
x=0
y=0
type={LETTER}
{IMAGE}
{IMAGELINE}
[/tile]
set_flag=building-{LETTER}
no_flag=building-{LETTER}
[/terrain_graphics]
#enddef
#define BUILDING_FLAG LETTER IMAGE FLAG
#define BUILDING_FLAG LETTER IMAGELINE FLAG
[terrain_graphics]
[tile]
x=0
y=0
type={LETTER}
has_flag={FLAG}
{IMAGE}
{IMAGELINE}
[/tile]
set_flag=building-{LETTER}
no_flag=building-{LETTER}
[/terrain_graphics]
#enddef
#define BUILDING_FLAG_PROB LETTER IMAGE FLAG PROBABILITY
#define BUILDING_FLAG_PROB LETTER IMAGELINE FLAG PROBABILITY
[terrain_graphics]
[tile]
x=0
@ -35,7 +35,7 @@
type={LETTER}
has_flag={FLAG}
set_flag=overlay
{IMAGE}
{IMAGELINE}
[/tile]
probability={PROBABILITY}
set_flag=building-{LETTER}
@ -43,13 +43,13 @@
[/terrain_graphics]
#enddef
#define BUILDING_PROBABILITY LETTER IMAGE PROBABILITY
#define BUILDING_PROBABILITY LETTER IMAGELINE PROBABILITY
[terrain_graphics]
[tile]
x=0
y=0
type={LETTER}
{IMAGE}
{IMAGELINE}
[/tile]
probability={PROBABILITY}
set_flag=building-{LETTER}

View file

@ -43,7 +43,7 @@
[/tile]
#enddef
#define CANYON LETTER IMAGE
#define CANYON LETTER IMAGESTEM
# Angles should not loop
[terrain_graphics]
@ -88,7 +88,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}-all
name={IMAGESTEM}-all
[/image]
no_flag="overlay"
set_flag="overlay"
@ -117,7 +117,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}-@R0-@R1-@R2-@R3-@R4
name={IMAGESTEM}-@R0-@R1-@R2-@R3-@R4
[/image]
no_flag=overlay
set_flag=overlay,canyon-nt-@R5
@ -145,7 +145,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}-@R0-@R1-@R2-@R3
name={IMAGESTEM}-@R0-@R1-@R2-@R3
[/image]
no_flag=overlay
set_flag=overlay,canyon-nt-@R4,canyon-nt-@R5
@ -173,7 +173,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}-@R0-@R1-@R2-@R4
name={IMAGESTEM}-@R0-@R1-@R2-@R4
[/image]
no_flag=overlay
set_flag=overlay,canyon-nt-@R3,canyon-nt-@R5
@ -200,7 +200,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}-@R0-@R1-@R2
name={IMAGESTEM}-@R0-@R1-@R2
[/image]
no_flag=overlay
set_flag=overlay,canyon-nt-@R3,canyon-nt-@R4,canyon-nt-@R5
@ -227,7 +227,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}-@R0-@R1-@R4
name={IMAGESTEM}-@R0-@R1-@R4
[/image]
no_flag="overlay"
set_flag=overlay,canyon-nt-@R2,canyon-nt-@R3,canyon-nt-@R5
@ -254,7 +254,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}-@R0-@R1-@R3
name={IMAGESTEM}-@R0-@R1-@R3
[/image]
no_flag=overlay
set_flag=overlay,canyon-nt-@R2,canyon-nt-@R4,canyon-nt-@R5
@ -280,7 +280,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}-@R0-@R1
name={IMAGESTEM}-@R0-@R1
[/image]
no_flag="overlay"
set_flag=overlay,canyon-nt-@R2,canyon-nt-@R3,canyon-nt-@R4,canyon-nt-@R5
@ -306,7 +306,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}-@R0-@R3
name={IMAGESTEM}-@R0-@R3
[/image]
no_flag="overlay"
set_flag=overlay,canyon-nt-@R1,canyon-nt-@R2,canyon-nt-@R4,canyon-nt-@R5
@ -332,7 +332,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}-@R0-@R2
name={IMAGESTEM}-@R0-@R2
[/image]
no_flag="overlay"
set_flag=overlay,canyon-nt-@R1,canyon-nt-@R3,canyon-nt-@R4,canyon-nt-@R5
@ -357,7 +357,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}-@R0
name={IMAGESTEM}-@R0
[/image]
no_flag="overlay"
set_flag=overlay,canyon-nt-@R1,canyon-nt-@R2,canyon-nt-@R3,canyon-nt-@R4,canyon-nt-@R5
@ -377,7 +377,7 @@
type={LETTER}
[image]
layer=-1000
name={IMAGE}
name={IMAGESTEM}
[/image]
no_flag="overlay"
set_flag=overlay,canyon-nt-@R0,canyon-nt-@R1,canyon-nt-@R2,canyon-nt-@R3,canyon-nt-@R4,canyon-nt-@R5

View file

@ -1,5 +1,5 @@
#textdomain wesnoth
#define TERRAIN_ADJACENT_CORNER_LAYER TERRAIN1 TERRAIN2 TERRAIN3 LAYER POS IMAGE
#define TERRAIN_ADJACENT_CORNER_LAYER TERRAIN1 TERRAIN2 TERRAIN3 LAYER POS IMAGESTEM
[terrain_graphics]
map="
3
@ -21,13 +21,13 @@
[image]
base={POS}
layer={LAYER}
name={IMAGE}-@R0
name={IMAGESTEM}-@R0
[/image]
rotations=ne,e,se,sw,w,nw
[/terrain_graphics]
#enddef
#define TERRAIN_ADJACENT_CORNER TERRAIN1 TERRAIN2 TERRAIN3 POS IMAGE
#define TERRAIN_ADJACENT_CORNER TERRAIN1 TERRAIN2 TERRAIN3 POS IMAGESTEM
[terrain_graphics]
map="
3
@ -48,13 +48,13 @@
[image]
base={POS}
name={IMAGE}-@R0
name={IMAGESTEM}-@R0
[/image]
rotations=ne,e,se,sw,w,nw
[/terrain_graphics]
#enddef
#define TERRAIN_ADJACENT_CORNER_FLAG1 TERRAIN1 TERRAIN2 TERRAIN3 POS FLAG IMAGE
#define TERRAIN_ADJACENT_CORNER_FLAG1 TERRAIN1 TERRAIN2 TERRAIN3 POS FLAG IMAGESTEM
[terrain_graphics]
map="
3
@ -76,13 +76,13 @@
[image]
base={POS}
name={IMAGE}-@R0
name={IMAGESTEM}-@R0
[/image]
rotations=ne,e,se,sw,w,nw
[/terrain_graphics]
#enddef
#define TERRAIN_ADJACENT_CORNER_PROB TERRAIN1 TERRAIN2 TERRAIN3 POS IMAGE PROB
#define TERRAIN_ADJACENT_CORNER_PROB TERRAIN1 TERRAIN2 TERRAIN3 POS IMAGESTEM PROB
[terrain_graphics]
map="
3
@ -105,14 +105,14 @@
[image]
base={POS}
name={IMAGE}-@R0
name={IMAGESTEM}-@R0
[/image]
probability={PROB}
rotations=ne,e,se,sw,w,nw
[/terrain_graphics]
#enddef
#define TERRAIN_ADJACENT_CORNER_FLAG1_PROB TERRAIN1 TERRAIN2 TERRAIN3 POS FLAG IMAGE PROB
#define TERRAIN_ADJACENT_CORNER_FLAG1_PROB TERRAIN1 TERRAIN2 TERRAIN3 POS FLAG IMAGESTEM PROB
[terrain_graphics]
map="
3
@ -136,14 +136,14 @@
[image]
base={POS}
name={IMAGE}-@R0
name={IMAGESTEM}-@R0
[/image]
rotations=ne,e,se,sw,w,nw
probability={PROB}
[/terrain_graphics]
#enddef
#define TERRAIN_ADJACENT_CORNER_FLAG2 TERRAIN1 TERRAIN2 TERRAIN3 POS FLAG IMAGE
#define TERRAIN_ADJACENT_CORNER_FLAG2 TERRAIN1 TERRAIN2 TERRAIN3 POS FLAG IMAGESTEM
[terrain_graphics]
map="
3
@ -165,13 +165,13 @@
[image]
base={POS}
name={IMAGE}-@R0
name={IMAGESTEM}-@R0
[/image]
rotations=ne,e,se,sw,w,nw
[/terrain_graphics]
#enddef
#define TERRAIN_ADJACENT_CORNER_FLAG3 TERRAIN1 TERRAIN2 TERRAIN3 POS FLAG IMAGE
#define TERRAIN_ADJACENT_CORNER_FLAG3 TERRAIN1 TERRAIN2 TERRAIN3 POS FLAG IMAGESTEM
[terrain_graphics]
map="
3
@ -193,7 +193,7 @@
[image]
base={POS}
name={IMAGE}-@R0
name={IMAGESTEM}-@R0
[/image]
rotations=ne,e,se,sw,w,nw
[/terrain_graphics]

View file

@ -1,6 +1,6 @@
#textdomain wesnoth
#define TERRAIN_ADJACENT_VERTICAL_FL TERRAIN ADJACENT IMAGE FLAG
#define TERRAIN_ADJACENT_VERTICAL_FL TERRAIN ADJACENT IMAGESTEM FLAG
[terrain_graphics]
map="
@ -17,7 +17,7 @@
[image]
base=36,4
name={IMAGE}-nw-n-ne
name={IMAGESTEM}-nw-n-ne
[/image]
[/tile]
[tile]
@ -55,7 +55,7 @@
[image]
base=36,4
name={IMAGE}-nw-n
name={IMAGESTEM}-nw-n
[/image]
[/tile]
[tile]
@ -87,7 +87,7 @@
[image]
base=36,4
name={IMAGE}-n-ne
name={IMAGESTEM}-n-ne
[/image]
[/tile]
[tile]
@ -119,7 +119,7 @@
[image]
base=36,4
name={IMAGE}-nw
name={IMAGESTEM}-nw
[/image]
[/tile]
[tile]
@ -145,7 +145,7 @@
[image]
base=36,4
name={IMAGE}-n
name={IMAGESTEM}-n
[/image]
[/tile]
[tile]
@ -171,7 +171,7 @@
[image]
base=36,4
name={IMAGE}-ne
name={IMAGESTEM}-ne
[/image]
[/tile]
[tile]
@ -197,7 +197,7 @@
[image]
base=36,68
name={IMAGE}-se-s-sw
name={IMAGESTEM}-se-s-sw
[/image]
[/tile]
[tile]
@ -235,7 +235,7 @@
[image]
base=36,68
name={IMAGE}-s-sw
name={IMAGESTEM}-s-sw
[/image]
[/tile]
[tile]
@ -267,7 +267,7 @@
[image]
base=36,68
name={IMAGE}-se-s
name={IMAGESTEM}-se-s
[/image]
[/tile]
[tile]
@ -299,7 +299,7 @@
[image]
base=36,68
name={IMAGE}-sw
name={IMAGESTEM}-sw
[/image]
[/tile]
[tile]
@ -325,7 +325,7 @@
[image]
base=36,68
name={IMAGE}-s
name={IMAGESTEM}-s
[/image]
[/tile]
[tile]
@ -351,7 +351,7 @@
[image]
base=36,68
name={IMAGE}-se
name={IMAGESTEM}-se
[/image]
[/tile]
[tile]
@ -364,6 +364,6 @@
#enddef
#define TERRAIN_ADJACENT_VERTICAL TERRAIN ADJACENT IMAGE
{TERRAIN_ADJACENT_VERTICAL_FL ({TERRAIN}) ({ADJACENT}) ({IMAGE}) overlay}
#define TERRAIN_ADJACENT_VERTICAL TERRAIN ADJACENT IMAGESTEM
{TERRAIN_ADJACENT_VERTICAL_FL ({TERRAIN}) ({ADJACENT}) ({IMAGESTEM}) overlay}
#enddef

View file

@ -1,11 +1,11 @@
#textdomain wesnoth-units
[unit]
#macro to define most of Walking Corpse
#define UNIT_BODY_SOULLESS BASE_IMAGE MOVETYPE MOVES HP
#define UNIT_BODY_SOULLESS BASE_IMAGESTEM MOVETYPE MOVES HP
id=Soulless
name= _ "Soulless"
race=undead
image="units/undead/{BASE_IMAGE}.png"
image="units/undead/{BASE_IMAGESTEM}.png"
{MAGENTA_IS_THE_TEAM_COLOR}
ellipse="misc/ellipse"
{TRAIT_FEARLESS_MUSTHAVE}
@ -21,7 +21,7 @@
usage=fighter
unit_description= _ "The technique of animating a dead body is unfortunately well-known to the dark arts; practitioners often use it to raise servants and soldiers from unwilling corpses. These shamblers are often numerous, but fragile; a touch of combat can waken them, though, making them far more formidable."+{SPECIAL_NOTES}+{SPECIAL_NOTES_PLAGUE}
die_sound={SOUND_LIST:ZOMBIE_HIT}
{DEFENSE_ANIM "units/undead/{BASE_IMAGE}-defend.png" "units/undead/{BASE_IMAGE}.png" {SOUND_LIST:ZOMBIE_HIT} }
{DEFENSE_ANIM "units/undead/{BASE_IMAGESTEM}-defend.png" "units/undead/{BASE_IMAGESTEM}.png" {SOUND_LIST:ZOMBIE_HIT} }
[resistance]
arcane=140
[/resistance]
@ -29,19 +29,19 @@
start_time=0
[frame]
duration=150
image="units/undead/{BASE_IMAGE}-die-1.png"
image="units/undead/{BASE_IMAGESTEM}-die-1.png"
[/frame]
[frame]
duration=150
image="units/undead/{BASE_IMAGE}-die-2.png"
image="units/undead/{BASE_IMAGESTEM}-die-2.png"
[/frame]
[frame]
duration=150
image="units/undead/{BASE_IMAGE}-die-3.png"
image="units/undead/{BASE_IMAGESTEM}-die-3.png"
[/frame]
[frame]
duration=150
image="units/undead/{BASE_IMAGE}-die-4.png"
image="units/undead/{BASE_IMAGESTEM}-die-4.png"
[/frame]
[frame]
duration=150
@ -88,7 +88,7 @@
[frame]
begin=-200
end=200
image="units/undead/{BASE_IMAGE}-attack-s.png"
image="units/undead/{BASE_IMAGESTEM}-attack-s.png"
sound=zombie-attack.wav
[/frame]
[/attack_anim]
@ -100,7 +100,7 @@
[frame]
begin=-200
end=200
image="units/undead/{BASE_IMAGE}-attack-n.png"
image="units/undead/{BASE_IMAGESTEM}-attack-n.png"
sound=zombie-attack.wav
[/frame]
[/attack_anim]
@ -112,7 +112,7 @@
[frame]
begin=-200
end=200
image="units/undead/{BASE_IMAGE}-attack.png"
image="units/undead/{BASE_IMAGESTEM}-attack.png"
sound=zombie-attack.wav
[/frame]
[/attack_anim]

View file

@ -1,11 +1,11 @@
#textdomain wesnoth-units
[unit]
#macro to define most of Walking Corpse
#define UNIT_BODY_WALKING_CORPSE BASE_IMAGE MOVETYPE MOVES HP
#define UNIT_BODY_WALKING_CORPSE BASE_IMAGESTEM MOVETYPE MOVES HP
id=Walking Corpse
name= _ "Walking Corpse"
race=undead
image="units/undead/{BASE_IMAGE}.png"
image="units/undead/{BASE_IMAGESTEM}.png"
{MAGENTA_IS_THE_TEAM_COLOR}
ellipse="misc/ellipse-nozoc"
{TRAIT_FEARLESS_MUSTHAVE}
@ -20,7 +20,7 @@
usage=fighter
unit_description= _ "Walking Corpses are the bodies of the dead, re-animated by dark magic. Though not especially dangerous to a trained soldier, the sight of one's former comrades amongst their number is frightening to say the least."+{SPECIAL_NOTES}+{SPECIAL_NOTES_PLAGUE}
die_sound={SOUND_LIST:ZOMBIE_WEAK_HIT}
{DEFENSE_ANIM "units/undead/{BASE_IMAGE}-defend.png" "units/undead/{BASE_IMAGE}.png" {SOUND_LIST:ZOMBIE_WEAK_HIT} }
{DEFENSE_ANIM "units/undead/{BASE_IMAGESTEM}-defend.png" "units/undead/{BASE_IMAGESTEM}.png" {SOUND_LIST:ZOMBIE_WEAK_HIT} }
[resistance]
arcane=140
[/resistance]
@ -28,19 +28,19 @@
start_time=0
[frame]
duration=150
image="units/undead/{BASE_IMAGE}-die-1.png"
image="units/undead/{BASE_IMAGESTEM}-die-1.png"
[/frame]
[frame]
duration=150
image="units/undead/{BASE_IMAGE}-die-2.png"
image="units/undead/{BASE_IMAGESTEM}-die-2.png"
[/frame]
[frame]
duration=150
image="units/undead/{BASE_IMAGE}-die-3.png"
image="units/undead/{BASE_IMAGESTEM}-die-3.png"
[/frame]
[frame]
duration=150
image="units/undead/{BASE_IMAGE}-die-4.png"
image="units/undead/{BASE_IMAGESTEM}-die-4.png"
[/frame]
[frame]
duration=150
@ -87,7 +87,7 @@
[frame]
begin=-200
end=200
image="units/undead/{BASE_IMAGE}-attack-s.png"
image="units/undead/{BASE_IMAGESTEM}-attack-s.png"
sound=zombie-attack.wav
[/frame]
[/attack_anim]
@ -99,7 +99,7 @@
[frame]
begin=-200
end=200
image="units/undead/{BASE_IMAGE}-attack-n.png"
image="units/undead/{BASE_IMAGESTEM}-attack-n.png"
sound=zombie-attack.wav
[/frame]
[/attack_anim]
@ -111,7 +111,7 @@
[frame]
begin=-200
end=200
image="units/undead/{BASE_IMAGE}-attack.png"
image="units/undead/{BASE_IMAGESTEM}-attack.png"
sound=zombie-attack.wav
[/frame]
[/attack_anim]

View file

@ -71,6 +71,8 @@ def argmatch(formals, actuals):
ftype = "range"
elif f in ("TYPE", "DESCRIPTION", "USER_DESCRIPTION", "TERRAIN"):
ftype = "string"
elif f.endswith("IMAGE"):
ftype = "image"
else:
ftype = None
# Deduce the type of the actual
@ -80,11 +82,18 @@ def argmatch(formals, actuals):
atype = "range"
elif a.startswith("{") and a.endswith("}") or a.startswith("$"):
atype = None # Can't tell -- it's a macro expansion
elif a.endswith(".png") or a.endswith(".jpg"):
atype = "image"
else:
atype = "string"
# Here's the compatibility rule
# Here's the compatibility logic. First, we catch the situations
# in which a more restricted actual type matches a more general
# formal one. Then we have a fallback rule checking for type
# equality or wildcarding.
if atype == "numeric" and ftype == "range":
pass
elif atype == "image" and ftype == "string":
pass
elif atype != ftype and ftype is not None and atype is not None:
return False
return True