3 # simple shader parsing "framework"
7 echo "$1" | sed 's/^"//; s/"$//; s/\.\(tga\|jpg\|png\)$//'
10 parse_shaderstage_pre()
12 : replace this function after including
14 parse_shaderstage_line()
16 : replace this function after including
18 parse_shaderstage_post()
20 : replace this function after including
25 while read shaderparser_L shaderparser_A1 shaderparser_Aother; do
26 case "`echo "$shaderparser_L" | tr A-Z a-z`" in
28 err "brace nesting error in $parsing_shader"
36 parse_shaderstage_line "$shaderparser_L" "$shaderparser_A1" "$shaderparser_Aother"
40 parse_shaderstage_post
45 : replace this function after including
49 : replace this function after including
53 : replace this function after including
58 while read shaderparser_L shaderparser_A1 shaderparser_Aother; do
59 case "`echo "$shaderparser_L" | tr A-Z a-z`" in
69 parse_shader_line "$shaderparser_L" "$shaderparser_A1" "$shaderparser_Aother"
76 parse_shaderfile_pre()
78 : replace this function after including
80 parse_shaderfile_post()
82 : replace this function after including
87 while read shaderparser_L; do
88 case "$shaderparser_L" in
93 err "brace nesting error in $parsing_shader"
98 parsing_shader="`shader_normalize "$shaderparser_L"`"
99 if [ x"$shaderparser_L" != x"$parsing_shader" ]; then
100 warn "normalized shader name $shaderparser_L to $parsing_shader"
105 parse_shaderfile_post
108 shaderparser_strip_comments()
110 sed 's,//.*,,g; s,\r, ,g; s,\shaderparser_t, ,g; s, *, ,g; s, $,,; s,^ ,,; /^$/ d'
115 shaderparser_t=`mktemp || echo ".temp"`
116 for shaderparser_X in "$@"; do
117 shaderparser_strip_comments < "$shaderparser_X" > "$shaderparser_t"
118 parsing_shaderfile="$shaderparser_X"
119 parse_shaderfile < "$shaderparser_t"
121 rm -f "$shaderparser_t"