mail[Wesnoth-commits] r43572 - /trunk/data/core/terrain-graphics/rails.cfg


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by jeremy . rosen on June 18, 2010 - 21:05:
Author: boucman
Date: Fri Jun 18 21:05:48 2010
New Revision: 43572

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43572&view=rev
Log:
start merging rails with bridges, use common macros whenever possible

Modified:
    trunk/data/core/terrain-graphics/rails.cfg

Modified: trunk/data/core/terrain-graphics/rails.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/terrain-graphics/rails.cfg?rev=43572&r1=43571&r2=43572&view=diff
==============================================================================
--- trunk/data/core/terrain-graphics/rails.cfg (original)
+++ trunk/data/core/terrain-graphics/rails.cfg Fri Jun 18 21:05:48 2010
@@ -2,128 +2,34 @@
 # Mine rail graphics
 #
 
-#define IMAGE_L_N LAYER NAME
+#define IMAGE_LN LAYER NAME
     [image]
         layer={LAYER}
         name={BUILD_IMAGE IMAGE_SINGLE {NAME} ()}
     [/image]
 #enddef
-
-#define IMAGEC_L_N LAYER NAME
-    [image]
-        layer={LAYER}
-       center=90,144
-        name={BUILD_IMAGE IMAGE_SINGLE {NAME} ()}
-    [/image]
-#enddef
-
-# this macro produces Y intersections
-#define BRIDGE_Y BRIDGETYPE1_NAME BRIDGETYPE2_NAME BRIDGETYPE3_NAME Y_IMAGE 
R0 R1 R2 R3 R4 R5 S0 S1 S2 S3 S4 S5
-    [terrain_graphics]
-        map="
-,  {S1}
-{S0},   {S2}
-,  1
-{S5},   {S3}
-,  {S4}"
-        [tile]
-            pos=1
-            type={BRIDGETYPE1_NAME}
-            no_flag=overlay,angle_{R0},angle_{R2},angle_{R4}
-            set_flag=overlay,angle_{R1},angle_{R5},angle_{R3}
-        [/tile]
-        [tile]
-            pos=2
-            no_flag=angle_{R3},angle_{R1}
-            set_flag=angle_{R2}
-            type={BRIDGETYPE2_NAME}
-        [/tile]
-        [tile]
-            pos=3
-            no_flag=angle_{R3},angle_{R5}
-            set_flag=angle_{R4}
-            type={BRIDGETYPE3_NAME}
-        [/tile]
-        [tile]
-            pos=4
-            type=!,{BRIDGETYPE1_NAME}
-            set_flag=angleaway_{R3}
-        [/tile]
-        {IMAGEC_L_N -80 {Y_IMAGE}}
-    [/terrain_graphics]
-#enddef
-
-# this macro keeps colinear bridges connected, it does not add images
-#define BRIDGECONNECT BRIDGETYPE_NAME R0 R1 R2 R3 R4 R5 X Y
+# this macro adds switches at track intersections
+#define RAIL_SWITCH_LF IMAGESTEM BRIDGETYPE_NAME BRIDGETYPE_JOIN_NAME LAYER 
FLAG SWITCHSIDE_AFFIX MAINRAIL_AFFIX SWITCH_REVERSE_AFFIX X Y
     [terrain_graphics]
         [tile]
             x=1
             y=1
             type={BRIDGETYPE_NAME}
-            no_flag=angle_{R1},angle_{R5}
-            set_flag=angle_{R0}
-        [/tile]
-        [tile]
-            x={X}
-            y={Y}
-            type={BRIDGETYPE_NAME}
-            no_flag=angle_{R2},angle_{R4}
-            set_flag=angle_{R3}
-        [/tile]
-    [/terrain_graphics]
-#enddef
-
-# this macro handles the normal corners
-#define CORNER ANGLE_IMAGE BRIDGETYPE1_NAME BRIDGETYPE2_NAME A1 A2 A3 A4 A5 
A6 S0 S1 S2 S3 S4 S5
-    [terrain_graphics]
-        map="
-,  {S1}
-{S0},   {S2}
-,  1
-{S5},   {S3}
-,  {S4}"
-        [tile]
-            pos=1
-            type={BRIDGETYPE1_NAME}
-            no_flag=overlay,angle_{A3},angle_{A4},angle_{A5},angle_{A6}
-            set_flag=overlay,angle_{A1},angle_{A2}
-        [/tile]
-            {IMAGEC_L_N -80 {ANGLE_IMAGE}}
-        [tile]
-            pos=2
-            type={BRIDGETYPE2_NAME}
-            no_flag=angle_{A1},angle_{A6}
-            set_flag=angle_{A3}
-        [/tile]
-        [tile]
-            pos=3
-            set_flag=angleaway_{A1}
-        [/tile]
-    [/terrain_graphics]
-#enddef
-
-# this macro adds switches at track intersections
-#define RAIL_SWITCH IMAGESTEM BRIDGETYPE_NAME BRIDGETYPE_JOIN_NAME 
SWITCHSIDE_AFFIX MAINRAIL_AFFIX SWITCH_REVERSE_AFFIX X Y
-    [terrain_graphics]
-        [tile]
-            x=1
-            y=1
-            type={BRIDGETYPE_NAME}
-            set_flag=angle_{SWITCH_REVERSE_AFFIX}
+            set_flag={FLAG}-{SWITCH_REVERSE_AFFIX}
         [/tile]
         [tile]
             x={X}
             y={Y}
             type={BRIDGETYPE_JOIN_NAME}
-            no_flag=angleaway_{SWITCHSIDE_AFFIX}, angle_{SWITCHSIDE_AFFIX}, 
angle_{SWITCH_REVERSE_AFFIX}
-            set_flag=angleaway_{SWITCHSIDE_AFFIX}
-            {IMAGE_L_N -80 
({IMAGESTEM}-switch-{SWITCHSIDE_AFFIX}-{MAINRAIL_AFFIX})}
+            no_flag={FLAG}-away-{SWITCHSIDE_AFFIX}, 
{FLAG}-{SWITCHSIDE_AFFIX}, {FLAG}-{SWITCH_REVERSE_AFFIX}
+            set_flag={FLAG}-away-{SWITCHSIDE_AFFIX}
+            {IMAGE_LN {LAYER} 
({IMAGESTEM}-switch-{SWITCHSIDE_AFFIX}-{MAINRAIL_AFFIX})}
         [/tile]
     [/terrain_graphics]
 #enddef
 
 # this macro adds ends wherever rails don't join with another track
-#define RAIL_END IMAGESTEM BRIDGETYPE_NAME TRACKSIDE_AFFIX X Y
+#define RAIL_END_LF IMAGESTEM BRIDGETYPE_NAME TRACKSIDE_AFFIX LAYER FLAG X Y
     [terrain_graphics]
         [tile]
             x=1
@@ -133,64 +39,83 @@
         [tile]
             x={X}
             y={Y}
-            no_flag=angleaway_{TRACKSIDE_AFFIX}, angle_{TRACKSIDE_AFFIX}
-            {IMAGE_L_N -80 {IMAGESTEM}-{TRACKSIDE_AFFIX}-end}
+            no_flag={FLAG}-away-{TRACKSIDE_AFFIX}, {FLAG}-{TRACKSIDE_AFFIX}
+            {IMAGE_LN {LAYER} {IMAGESTEM}-{TRACKSIDE_AFFIX}-end}
         [/tile]
     [/terrain_graphics]
 #enddef
-#define RAILWAY SE_NW_VALUE N_S_VALUE NE_SW_VALUE IMAGESTEM
+#define RAILWAY_LF SE_NW_VALUE N_S_VALUE NE_SW_VALUE LAYER FLAG IMAGESTEM
 
     # find Y intersections
-    {BRIDGE_Y {N_S_VALUE} {SE_NW_VALUE} {NE_SW_VALUE} 
{IMAGESTEM}-joint-ne-s-nw n ne se s sw nw 2 4 3 . . .}
-    {BRIDGE_Y {NE_SW_VALUE} {N_S_VALUE} {SE_NW_VALUE} 
{IMAGESTEM}-joint-n-se-sw ne se s sw nw n . 2 4 3 . .}
-    {BRIDGE_Y {SE_NW_VALUE} {NE_SW_VALUE} {N_S_VALUE} 
{IMAGESTEM}-joint-ne-s-nw se s sw nw n ne . . 2 4 3 .}
-    {BRIDGE_Y {N_S_VALUE} {SE_NW_VALUE} {NE_SW_VALUE} 
{IMAGESTEM}-joint-n-se-sw s sw nw n ne se . . . 2 4 3}
-    {BRIDGE_Y {NE_SW_VALUE} {N_S_VALUE} {SE_NW_VALUE} 
{IMAGESTEM}-joint-ne-s-nw sw nw n ne se s 3 . . . 2 4}
-    {BRIDGE_Y {SE_NW_VALUE} {NE_SW_VALUE} {N_S_VALUE} 
{IMAGESTEM}-joint-n-se-sw nw n ne se s sw 4 3 . . . 2}
+    {TRACK_Y_LF {N_S_VALUE} {SE_NW_VALUE} {NE_SW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-ne-s-nw n ne se s sw nw 2 4 3 * * *}
+    {TRACK_Y_LF {NE_SW_VALUE} {N_S_VALUE} {SE_NW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-n-se-sw ne se s sw nw n * 2 4 3 * *}
+    {TRACK_Y_LF {SE_NW_VALUE} {NE_SW_VALUE} {N_S_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-ne-s-nw se s sw nw n ne * * 2 4 3 *}
+    {TRACK_Y_LF {N_S_VALUE} {SE_NW_VALUE} {NE_SW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-n-se-sw s sw nw n ne se * * * 2 4 3}
+    {TRACK_Y_LF {NE_SW_VALUE} {N_S_VALUE} {SE_NW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-ne-s-nw sw nw n ne se s 3 * * * 2 4}
+    {TRACK_Y_LF {SE_NW_VALUE} {NE_SW_VALUE} {N_S_VALUE} {LAYER} {FLAG} 
{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_VALUE}   n ne se s sw nw 1 0}
-    {BRIDGECONNECT {NE_SW_VALUE} ne se s sw nw n 2 1}
-    {BRIDGECONNECT {SE_NW_VALUE} se s sw nw n ne 2 2}
+    {TRACK_CONNECT_F {N_S_VALUE}   {FLAG} n ne se s sw nw 1 0}
+    {TRACK_CONNECT_F {NE_SW_VALUE} {FLAG} ne se s sw nw n 2 1}
+    {TRACK_CONNECT_F {SE_NW_VALUE} {FLAG} se s sw nw n ne 2 2}
 
     # normal corners
-    {CORNER {IMAGESTEM}-joint-s-nw  {N_S_VALUE}   {SE_NW_VALUE} s  nw se n  
sw ne 2 3 . . . .}
-    {CORNER {IMAGESTEM}-joint-ne-s  {N_S_VALUE}   {NE_SW_VALUE} s  ne sw n  
se nw . 3 2 . . .}
-    {CORNER {IMAGESTEM}-joint-n-sw  {NE_SW_VALUE} {N_S_VALUE}   sw n  s  ne 
nw se . 2 3 . . .}
-    {CORNER {IMAGESTEM}-joint-se-sw {NE_SW_VALUE} {SE_NW_VALUE} sw se nw ne 
s  n  . . 3 2 . .}
-    {CORNER {IMAGESTEM}-joint-ne-nw {SE_NW_VALUE} {NE_SW_VALUE} nw ne sw se 
n  s  . . 2 3 . .}
-    {CORNER {IMAGESTEM}-joint-s-nw  {SE_NW_VALUE} {N_S_VALUE}   nw s  n  se 
sw ne . . . 3 2 .}
-    {CORNER {IMAGESTEM}-joint-n-se  {N_S_VALUE}   {SE_NW_VALUE} n  se nw s  
ne sw . . . 2 3 .}
-    {CORNER {IMAGESTEM}-joint-n-sw  {N_S_VALUE}   {NE_SW_VALUE} n  sw ne s  
nw se . . . . 3 2}
-    {CORNER {IMAGESTEM}-joint-ne-s  {NE_SW_VALUE} {N_S_VALUE}   ne s  n  sw 
se nw . . . . 2 3}
-    {CORNER {IMAGESTEM}-joint-ne-nw {NE_SW_VALUE} {SE_NW_VALUE} ne nw se sw 
n  s  2 . . . . 3}
-    {CORNER {IMAGESTEM}-joint-se-sw {SE_NW_VALUE} {NE_SW_VALUE} se sw ne nw 
s  n  3 . . . . 2}
-    {CORNER {IMAGESTEM}-joint-n-se  {SE_NW_VALUE} {N_S_VALUE}   se n  s  nw 
ne sw 3 2 . . . .}
+    {TRACK_CORNER_LF {N_S_VALUE}   {SE_NW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-s-nw  s  nw se n  sw ne 2 3 * * * *}
+    {TRACK_CORNER_LF {N_S_VALUE}   {NE_SW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-ne-s  s  ne sw n  se nw * 3 2 * * *}
+    {TRACK_CORNER_LF {NE_SW_VALUE} {N_S_VALUE}   {LAYER} {FLAG} 
{IMAGESTEM}-joint-n-sw  sw n  s  ne nw se * 2 3 * * *}
+    {TRACK_CORNER_LF {NE_SW_VALUE} {SE_NW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-se-sw sw se nw ne s  n  * * 3 2 * *}
+    {TRACK_CORNER_LF {SE_NW_VALUE} {NE_SW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-ne-nw nw ne sw se n  s  * * 2 3 * *}
+    {TRACK_CORNER_LF {SE_NW_VALUE} {N_S_VALUE}   {LAYER} {FLAG} 
{IMAGESTEM}-joint-s-nw  nw s  n  se sw ne * * * 3 2 *}
+    {TRACK_CORNER_LF {N_S_VALUE}   {SE_NW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-n-se  n  se nw s  ne sw * * * 2 3 *}
+    {TRACK_CORNER_LF {N_S_VALUE}   {NE_SW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-n-sw  n  sw ne s  nw se * * * * 3 2}
+    {TRACK_CORNER_LF {NE_SW_VALUE} {N_S_VALUE}   {LAYER} {FLAG} 
{IMAGESTEM}-joint-ne-s  ne s  n  sw se nw * * * * 2 3}
+    {TRACK_CORNER_LF {NE_SW_VALUE} {SE_NW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-ne-nw ne nw se sw n  s  2 * * * * 3}
+    {TRACK_CORNER_LF {SE_NW_VALUE} {NE_SW_VALUE} {LAYER} {FLAG} 
{IMAGESTEM}-joint-se-sw se sw ne nw s  n  3 * * * * 2}
+    {TRACK_CORNER_LF {SE_NW_VALUE} {N_S_VALUE}   {LAYER} {FLAG} 
{IMAGESTEM}-joint-n-se  se n  s  nw ne sw 3 2 * * * *}
 
     # these 3 macros define the default straight bridges
-    {OVERLAY_L {N_S_VALUE}   -80 {IMAGESTEM}-n-s}
-    {OVERLAY_L {NE_SW_VALUE} -80 {IMAGESTEM}-ne-sw}
-    {OVERLAY_L {SE_NW_VALUE} -80 {IMAGESTEM}-se-nw}
+    {TRACK_LF {N_S_VALUE}   {LAYER} {FLAG} {IMAGESTEM}-n-s}
+    {TRACK_LF {NE_SW_VALUE} {LAYER} {FLAG} {IMAGESTEM}-ne-sw}
+    {TRACK_LF {SE_NW_VALUE} {LAYER} {FLAG} {IMAGESTEM}-se-nw}
 
     # add switches that are not Ys
-    {RAIL_SWITCH {IMAGESTEM} {N_S_VALUE}   {NE_SW_VALUE} s  ne n  1 0}
-    {RAIL_SWITCH {IMAGESTEM} {N_S_VALUE}   {SE_NW_VALUE} s  nw n  1 0}
-    {RAIL_SWITCH {IMAGESTEM} {NE_SW_VALUE} {N_S_VALUE}   sw n  ne 2 1}
-    {RAIL_SWITCH {IMAGESTEM} {NE_SW_VALUE} {SE_NW_VALUE} sw se sw 2 1}
-    {RAIL_SWITCH {IMAGESTEM} {SE_NW_VALUE} {N_S_VALUE}   nw s  se 2 2}
-    {RAIL_SWITCH {IMAGESTEM} {SE_NW_VALUE} {NE_SW_VALUE} nw ne nw 2 2}
-    {RAIL_SWITCH {IMAGESTEM} {N_S_VALUE}   {NE_SW_VALUE} n  sw s  1 2}
-    {RAIL_SWITCH {IMAGESTEM} {N_S_VALUE}   {SE_NW_VALUE} n  se s  1 2}
-    {RAIL_SWITCH {IMAGESTEM} {NE_SW_VALUE} {N_S_VALUE}   ne s  sw 0 2}
-    {RAIL_SWITCH {IMAGESTEM} {NE_SW_VALUE} {SE_NW_VALUE} ne nw ne 0 2}
-    {RAIL_SWITCH {IMAGESTEM} {SE_NW_VALUE} {N_S_VALUE}   se n  nw 0 1}
-    {RAIL_SWITCH {IMAGESTEM} {SE_NW_VALUE} {NE_SW_VALUE} se sw se 0 1}
+    {RAIL_SWITCH_LF {IMAGESTEM} {N_S_VALUE}   {NE_SW_VALUE} {LAYER}  {FLAG} 
s  ne n  1 0}
+    {RAIL_SWITCH_LF {IMAGESTEM} {N_S_VALUE}   {SE_NW_VALUE} {LAYER}  {FLAG} 
s  nw n  1 0}
+    {RAIL_SWITCH_LF {IMAGESTEM} {NE_SW_VALUE} {N_S_VALUE}   {LAYER}  {FLAG} 
sw n  ne 2 1}
+    {RAIL_SWITCH_LF {IMAGESTEM} {NE_SW_VALUE} {SE_NW_VALUE} {LAYER}  {FLAG} 
sw se sw 2 1}
+    {RAIL_SWITCH_LF {IMAGESTEM} {SE_NW_VALUE} {N_S_VALUE}   {LAYER}  {FLAG} 
nw s  se 2 2}
+    {RAIL_SWITCH_LF {IMAGESTEM} {SE_NW_VALUE} {NE_SW_VALUE} {LAYER}  {FLAG} 
nw ne nw 2 2}
+    {RAIL_SWITCH_LF {IMAGESTEM} {N_S_VALUE}   {NE_SW_VALUE} {LAYER}  {FLAG} 
n  sw s  1 2}
+    {RAIL_SWITCH_LF {IMAGESTEM} {N_S_VALUE}   {SE_NW_VALUE} {LAYER}  {FLAG} 
n  se s  1 2}
+    {RAIL_SWITCH_LF {IMAGESTEM} {NE_SW_VALUE} {N_S_VALUE}   {LAYER}  {FLAG} 
ne s  sw 0 2}
+    {RAIL_SWITCH_LF {IMAGESTEM} {NE_SW_VALUE} {SE_NW_VALUE} {LAYER}  {FLAG} 
ne nw ne 0 2}
+    {RAIL_SWITCH_LF {IMAGESTEM} {SE_NW_VALUE} {N_S_VALUE}   {LAYER}  {FLAG} 
se n  nw 0 1}
+    {RAIL_SWITCH_LF {IMAGESTEM} {SE_NW_VALUE} {NE_SW_VALUE} {LAYER}  {FLAG} 
se sw se 0 1}
 
     # add basic end to anything left
-    {RAIL_END {IMAGESTEM} {N_S_VALUE}   s  1 0}
-    {RAIL_END {IMAGESTEM} {NE_SW_VALUE} sw 2 1}
-    {RAIL_END {IMAGESTEM} {SE_NW_VALUE} nw 2 2}
-    {RAIL_END {IMAGESTEM} {N_S_VALUE}   n  1 2}
-    {RAIL_END {IMAGESTEM} {NE_SW_VALUE} ne 0 2}
-    {RAIL_END {IMAGESTEM} {SE_NW_VALUE} se 0 1}
+    {RAIL_END_LF {IMAGESTEM} {N_S_VALUE}   {LAYER}  {FLAG} s  1 0}
+    {RAIL_END_LF {IMAGESTEM} {NE_SW_VALUE} {LAYER}  {FLAG} sw 2 1}
+    {RAIL_END_LF {IMAGESTEM} {SE_NW_VALUE} {LAYER}  {FLAG} nw 2 2}
+    {RAIL_END_LF {IMAGESTEM} {N_S_VALUE}   {LAYER}  {FLAG} n  1 2}
+    {RAIL_END_LF {IMAGESTEM} {NE_SW_VALUE} {LAYER}  {FLAG} ne 0 2}
+    {RAIL_END_LF {IMAGESTEM} {SE_NW_VALUE} {LAYER}  {FLAG} se 0 1}
 #enddef
+
+#meta-macro RAILWAY SE_NW_TERRAIN N_S_TERRAIN NE_SW_TERRAIN L=LAYER=-80 
F=FLAG=overlay IMAGESTEM
+
+#####################################################################################################
+###############        AUTO GENERATED CODE        
###################################################
+#####################################################################################################
+#The following code is autogenerated by expand-terrain-macros.py
+#generated from: #meta-macro RAILWAY SE_NW_TERRAIN N_S_TERRAIN NE_SW_TERRAIN 
L=LAYER=-80 F=FLAG=overlay IMAGESTEM
+#Please do not modify
+#define RAILWAY_F SE_NW_TERRAIN N_S_TERRAIN NE_SW_TERRAIN FLAG IMAGESTEM
+    {RAILWAY_LF ({SE_NW_TERRAIN}) ({N_S_TERRAIN}) ({NE_SW_TERRAIN}) -80 
({FLAG}) ({IMAGESTEM})}
+#enddef
+#define RAILWAY_L SE_NW_TERRAIN N_S_TERRAIN NE_SW_TERRAIN LAYER IMAGESTEM
+    {RAILWAY_LF ({SE_NW_TERRAIN}) ({N_S_TERRAIN}) ({NE_SW_TERRAIN}) 
({LAYER}) overlay ({IMAGESTEM})}
+#enddef
+#define RAILWAY SE_NW_TERRAIN N_S_TERRAIN NE_SW_TERRAIN IMAGESTEM
+    {RAILWAY_LF ({SE_NW_TERRAIN}) ({N_S_TERRAIN}) ({NE_SW_TERRAIN}) -80 
overlay ({IMAGESTEM})}
+#enddef
+#end of generated code




Related Messages


Powered by MHonArc, Updated Fri Jun 18 22:20:15 2010