#!/bin/bash # version 2.12 reponse=$1 BASE=/rab/fgdata FGROOT=/stockage/logiciels/fg/fgdata CONFIG=/rab/fg-dds/config_dds # here are included functions extracted from the fg-check script (in flightgear/scripts/tools/fg-check) function ERROR { echo -e "\e[31;1m$*\e[m"; } function LOG { echo -e "\e[35m$*\e[m"; } function RESULT { echo -e "\t$*"; } function check_space { LOG "checking for spaces in filenames ..." > space-list find .|grep " "|while read i; do RESULT "$i" >> space-list; done cat space-list } function upper_check { LOG "checking for upper-case extensions ..." find .|while read i; do case "$i" in .|..|CVS/*|*/CVS/*|*.Opt|*.README|*.Po|*.TXT) continue ;; esac base=${i##*/} ext=${base##*.} [ "$base" == "$ext" ] && continue # has no extension ext=${ext//[^a-zA-Z]/} [ "$ext" ] || continue # only non-letters lcext=$(echo $ext|sed -e 's,\(.*\),\L\1,') [ "$ext" != "$lcext" ] && RESULT "$i" done } function dos_ending_check { LOG "checking for DOS line endings ..." find . -type f|while read i; do desc=$(file -b "$i") case "$desc" in *text*) grep " $" "$i" >/dev/null && RESULT "$i" ;; esac done } function thumbmail { LOG "checking for thumbnail file size (expected JPEG 171x128)" find . -name thumbnail.jpg|while read i; do id=$(identify "$i") if ! echo $id|grep "JPEG 171x128" >/dev/null; then RESULT "$i ... $id" fi done } function userarchive { LOG "checking for 'userarchive' flags (not allowed in aircraft XML files) ..." find . -name \*.xml|while read i; do if grep "userarchive" $i >/dev/null; then RESULT "$i" fi done } function xml { LOG "checking for XML syntax ..." find . -name \*.xml|while read i; do xmllint $i >/dev/null || RESULT "... in file \e[36m$i\e[m" done } function boucle { LOG "checking for 'if (foo) delete foo;' ..." find . -iregex ".*\.\([ch]\(xx\|pp\)\|cc\|h\)$"|while read i; do perl -e ' my $i = 0; my $name = $ARGV[0]; undef $/; $_ = <>; s/(if\s*\(([^\)]+)\)\s*delete(?:\s+|\s*\[\]\s*)\2\s*;)/print "$1\n" and $i++/ges; print "\t... \033[36min file $name\033[m\n" if $i; ' "$i"; done } function stereo_search { LOG "checking for stereo sound files" find . -name "*.wav" -exec soxi {} + | grep -B1 Chan \ | grep -B1 ": 2" | grep / | sed s%"Input File : '"%%g | sed s/"'"//g > liste_stereo.txt cat liste_stereo.txt #while read line; do echo $line; done < liste_stereo.txt } function stereo_to_mono { stereo_search LOG "converting to mono, same frequency and same bit depth" while read line; do echo "$line"; sox --no-dither "$line" -c1 temp.wav; mv temp.wav "$line"; done < liste_stereo.txt } function totale { check_space stereo_search upper_check dos_ending_check thumbmail userarchive xml boucle } # end of fg-check functions # search for non dds image in .ac, .xml and .eff file function non_dds_occurence { LOG "checking for non .dds extensions in ac, xml and eff files" for h in {*.ac,*.xml,*.eff}; do for i in `find . -name "$h"`; do for j in {\\.rgb,\\.png,\\.jpg}; do grep -l "$j" $i done done done } # preliminary step before converting: convert to .png, and be sure to have 2^x size function to_png_flip { wx=`convert $1 -format "%[fx:2^(round(log(w)/log(2)))]" info:` hx=`convert $1 -format "%[fx:2^(round(log(h)/log(2)))]" info:` convert $1 -flip -resize ${wx}x${hx}! $2 } # same with alpha removal function to_png_flip_no_alpha { wx=`convert $1 -format "%[fx:2^(round(log(w)/log(2)))]" info:` hx=`convert $1 -format "%[fx:2^(round(log(h)/log(2)))]" info:` convert $1 -alpha off -flip -resize ${wx}x${hx}! $2 } # same for normalmaps function to_png_flip_negate { wx=`convert $1 -format "%[fx:2^(round(log(w)/log(2)))]" info:` hx=`convert $1 -format "%[fx:2^(round(log(h)/log(2)))]" info:` convert $1 -flip -negate -resize ${wx}x${hx}! $2 } # make a tar from the current folder in ../ function tar_current_folder { for i in `pwd | sed 's_.*/__g'`; do echo $i; tar --exclude-tag-all=tar-ignore -czf ../$i\_dds.tar.gz ../$i; done } # restore an initial fgdata copy function create_initial_copy { cat $CONFIG/data_list | while read i; do if [ -f "$FGROOT"/"$i" ] then if [ -f "$BASE"/"$i" ] then echo "file $BASE/$i exist" else echo "copying $BASE/$i" cp "$FGROOT"/"$i" "$BASE"/ fi else if [ -d "$FGROOT"/"$i" ] then if [ -d "$BASE"/"$i" ] then echo "folder $BASE/$i exist" else echo "copying folder $BASE/$i" cp -r "$FGROOT"/"$i" "$BASE"/ fi fi fi done } # copy initial aircrafts function copy_aircrafts { if [ ! -d "$BASE"/Aircraft ] then mkdir "$BASE"/Aircraft fi cat $CONFIG/plane_list > $CONFIG/list_temp echo Generic >> $CONFIG/list_temp echo Instruments >> $CONFIG/list_temp echo Instruments-3d >> $CONFIG/list_temp cat $CONFIG/list_temp | while read i; do if [ -d $FGROOT/Aircraft/$i ] then if [ -d $BASE/Aircraft/$i ] then echo "$i already in the destination folder" else cp -r "$FGROOT"/Aircraft/"$i" "$BASE"/Aircraft/ echo "$i copied" fi else echo "no $i plane in fgroot/Aircraft" fi done rm $CONFIG/list_temp } function manual_affect { if [ -d .dds ] then echo ".dds exist" else mkdir .dds fi > .dds/liste > .dds/init_safe > .dds/init_bc3 > .dds/init_normal > .dds/init_keep # populate liste echo "check the textures to convert" echo "1: safe" echo "2: bc3" echo "3: normal" echo "4: keep" echo "5: bc3 keep" echo "6: normal keep" for i in {\*.jpg,\*.png,\*.rgb}; do find . -name "$i" >> .dds/liste; done for i in `cat .dds/liste`; do min=`identify -verbose $i | grep -A1 Alpha | grep min | awk '{print $2}'` size=`identify $i | awk '{print $3}'` echo $i": "$size", alpha:"$min read manual_choice case $manual_choice in 1) echo $i >> .dds/init_safe;; 2) echo $i >> .dds/init_bc3;; 3) echo $i >> .dds/init_normal;; 4) echo $i >> .dds/init_keep;; 5) echo $i >> .dds/init_keep; echo $i >> .dds/init_bc3;; 6) echo $i >> .dds/init_keep; echo $i >> .dds/init_normal;; *) ;; esac echo done > .dds/init_liste cat .dds/init_safe >> .dds/init_liste cat .dds/init_bc3 >> .dds/init_liste cat .dds/init_normal >> .dds/init_liste } # function to check if the alpha layer is full opaque (255) if so # convert image files and change name extensions in .ac and .xml locally function texture_check { if [ -d .dds ] then echo ".dds exist" else mkdir .dds fi path=`pwd | sed s%$BASE/%%` echo "$path" > .dds/bc1 > .dds/bc3 > .dds/safe > .dds/normal > .dds/added > .dds/.tar-ignore if [ -f $CONFIG/$path/init_safe ] then cat $CONFIG/$path/init_safe >> .dds/safe cat $CONFIG/$path/init_safe >> .dds/init_liste fi if [ -f $CONFIG/$path/init_keep ] then cp $CONFIG/$path/init_keep .dds/ fi if [ -f $CONFIG/$path/init_normal ] then cat $CONFIG/$path/init_normal >> .dds/normal cat $CONFIG/$path/init_normal >> .dds/init_liste fi if [ -f $CONFIG/$path/init_bc3 ] then cat $CONFIG/$path/init_bc3 >> .dds/bc3 cat $CONFIG/$path/init_bc3 >> .dds/init_liste fi echo echo "check the textures to convert" for i in {\*.jpg,\*.png,\*.rgb}; do find . -name "$i" >> .dds/added; done # taking care of preaffected textures if [ -f .dds/init_liste ] then > .dds/temp > .dds/init_sed for i in `cat .dds/init_liste`; do echo $i | sed 's%/%\\/%g' >> .dds/temp; done for i in `cat .dds/temp`; do echo "/"$i"/d" >> .dds/init_sed; done rm .dds/temp sed -i -f .dds/init_sed .dds/added fi if [ -f .dds/init_safe ] then cat .dds/init_safe >> .dds/safe fi if [ -f .dds/init_bc3 ] then cat .dds/init_bc3 >> .dds/bc3 fi if [ -f .dds/init_normal ] then cat .dds/init_normal >> .dds/normal fi # guess from names for i in `cat .dds/added`; do echo; if [[ "$i" =~ (.*)splash(.*) ]] then echo $i" : safe" echo $i >> .dds/safe elif [[ "$i" =~ (.*)thumb(.*) ]] then echo $i" : safe" echo $i >> .dds/safe elif [[ "$i" =~ (.*)Splash(.*) ]] then echo $i" : safe" echo $i >> .dds/safe elif [[ "$i" =~ (.*).mask.png(.*) ]] then echo $i" : safe" echo $i >> .dds/safe elif echo $i | grep -iqF normal then echo $i" : normal" echo $i >> .dds/normal elif echo $i | grep -iqF bump then echo $i" : nmap" echo $i >> .dds/normal elif echo $i | grep -iqF nmap then echo $i" : nmap" echo $i >> .dds/normal elif echo $i | grep -iqF nm.png then echo $i" : nmap" echo $i >> .dds/normal elif identify -verbose $i | grep -qF alpha: then echo $i" : bc3" echo $i >> .dds/bc3 else echo $i" : bc1"; echo $i >> .dds/bc1 fi done cat .dds/bc1 > .dds/converted cat .dds/bc3 >> .dds/converted cat .dds/normal >> .dds/converted cat .dds/converted | sed 's_.*/__g' > .dds/name-short sort -u .dds/name-short > .dds/sorted-name if [ -f .dds/init_keep ] then > .dds/keep_sed for i in `cat .dds/init_keep`; do echo $i | sed 's%/%\\/%g' >> .dds/temp; done for i in `cat .dds/temp`; do echo "/"$i"/d" >> .dds/keep_sed; done rm .dds/temp sed -f .dds/keep_sed .dds/converted > .dds/to_remove else cat .dds/converted > .dds/to_remove fi } function test_bc3 { mv .dds/bc3 .dds/bc3tmp > .dds/bc3 for i in `cat .dds/bc3tmp`; do min=`identify -verbose $i | grep -A1 Alpha | grep min | awk '{print $2}'` echo $min if [ "$min" = 255 ] then echo $i >> .dds/bc1 echo $i ": bc1" else echo $i >> .dds/bc3 echo $i ": bc3" fi done } # convertir les texture de bc1 en bc1: function bc1 { echo LOG "####################### bc1 ###########################" echo echo for i in `cat .dds/bc1`; do echo $i if [ -e ${i%.???}.dds ] then echo ".dds exist, skiping conversion"; echo; echo else to_png_flip_no_alpha $i temp.png nvcompress -bc1 temp.png ${i%.???}.dds 1>/dev/null; echo; echo; rm temp.png fi done } function bc3 { echo LOG "####################### bc3 #############################" echo echo for i in `cat .dds/bc3`; do echo $i if [ -e ${i%.???}.dds ] then echo ".dds exist, skiping conversion"; echo; echo else to_png_flip $i temp.png nvcompress -bc3 temp.png ${i%.???}.dds 1>/dev/null; rm temp.png; echo; echo; fi done } function normal { echo LOG "###################### normal ##########################" echo echo for i in `cat .dds/normal`; do echo $i if [ -e ${i%.???}.dds ] then echo ".dds exist, skiping conversion"; echo; echo else to_png_flip_negate $i temp.png nvcompress -normal -tonormal -bc5 temp.png ${i%.???}.dds 1>/dev/null; rm temp.png; echo; echo fi done } function eff_search { echo echo "eff" for i in `cat .dds/normal | sed 's_.*/__g'`; do echo $i; for j in `find . -name "*.eff"`; do grep -l $i $j; \ grep -B3 $i $j; done; done for i in `find . -name "*.eff"`; do sed -i 's/ 0/ 1/g' $i; done for i in `find . -name "*.eff"`; do sed -i 's/0/1/g' $i; done } function permute_extension { LOG "change name extension in ac, xml and eff files" > .dds/sed for i in `cat .dds/sorted-name`; do echo "s%"$i"%"${i%.???}".dds%g" >> .dds/sed; done echo echo "changing name extension in .ac" echo for j in `find . -name "*.ac"`; do \ echo $j; sed -i -f .dds/sed $j; done echo echo "changing name extension in .xml" echo for j in `find . -name "*.xml"`; do \ echo $j; sed -i -f .dds/sed $j; done echo echo "changing name extension in .eff" echo for j in `find . -name "*.eff"`; do \ echo $j; sed -i -f .dds/sed $j; done #rm -r .dds pwd } function folder_conversion { if [ -f .dds/done ] then echo ".dds/done present, skipping conversion" else echo LOG " start folder conversion:" texture_check bc1 bc3 normal permute_extension > .dds/done fi } # change path for file from generic function generic_apply { echo LOG "using dds in generic call too" echo for i in {*.ac,*.xml,*.eff}; do for j in `find . -name "$i"`; do echo $j; sed -i -f $BASE/.dds/generic.sed $j done done } # remove converted texture function clean_converted { LOG "clean converted" if [ -f .dds/to_remove ] then for i in `cat .dds/to_remove`; do rm $i; done fi } function buildings_texture { cd $BASE/Textures if [ ! -e .dds/done ] then if [ ! -d .dds ]; then mkdir .dds; fi echo "buildings.png" > .dds/bc1 echo "buildings-caribbean.png" >> .dds/bc1 bc1 > .dds/done fi cd - } # convert all folders 1 level below function convert_1_lvl { LOG "1 lvl" for h in */; do echo; LOG "******** " $h " **********"; cd $h; plane_convert_2; echo; cd -; done } #convert all folders 2 levels below function convert_2_lvl { LOG "2 lvl" for h in */*/; do echo; LOG "******** " $h " **********"; cd $h; plane_convert_2; echo; cd -; done } # convert the AI folder from fgdata function AI_conversion { LOG "AI Aircraft" cd $BASE/AI/Aircraft for i in */; do cd $i plane_convert_2 cd - done cd ../.. } # preliminary step before converting Textures/Terrain to avoid name conflicts function prepare_texture { if [ -f $CONFIG/rename_texture ] then > $BASE/.dds/sed-texture cat $CONFIG/rename_texture | while read i; do echo "s%Terrain/"$i"%Terrain/"${i%.???}"-expng.png%g" >> $BASE/.dds/sed-texture cd $BASE/Textures/Terrain if [ -f $i ] then mv $i ${i%.png}-expng.png cd - 1>/dev/null fi cd $BASE/Textures.high/Terrain if [ -f $i ] then mv $i ${i%.png}-expng.png cd - 1>/dev/null fi done cd $BASE/Materials find . -name "*.xml" -exec sed -i -f $BASE/.dds/sed-texture {} + cd - 1>/dev/null fi } # convert the Models folder from fgdata function Models_conversion { LOG "Models conversion, except Weather" cd $BASE/Models ls -d */ | grep -v Weather | while read i; do cd $i plane_convert_2 cd - done cd .. } # initialise folder to store generic/texture/weather textures function init_base { LOG "init base" if [ -d $BASE/.dds ] then echo ".dds exist" else mkdir $BASE/.dds fi > $BASE/.dds/generic > $BASE/.dds/weather > $BASE/.dds/texture > $BASE/.dds/texture_high } # convert Aircraft/Generic to dds and save texture list function generic { cd $BASE/Aircraft/Generic if [ -f .dds/done ] then echo ".dds/done exist, skipping Generic" else LOG "converting Generic" texture_check test_bc3 bc1 bc3 normal eff_search permute_extension if [ ! -d $BASE/.dds ]; then mkdir $BASE/.dds; fi for i in {bc1,bc3,normal}; do cat .dds/$i | sed 's%\./%Generic/%g' >> $BASE/.dds/generic; done for i in `cat $BASE/.dds/generic`; do echo "s%"$i"%"${i%.???}".dds%g" >> $BASE/.dds/generic.sed; done > .dds/done fi cd - } # convert Texture and Texture.high function texture { cd $BASE/Textures folder_conversion clean_converted cat .dds/converted | sed 's%\./%%g' >> $BASE/.dds/texture cd - cd $BASE/Textures.high folder_conversion clean_converted cat .dds/converted | sed 's%\./%%g' >> $BASE/.dds/texture_high sort -u $BASE/.dds/texture > tmp; mv tmp $BASE/.dds/texture sort -u $BASE/.dds/texture_high > tmp; mv tmp $BASE/.dds/texture_high > $BASE/.dds/texture_high.sed > $BASE/.dds/texture.sed for i in `cat $BASE/.dds/texture`; do echo "s%"$i"%"${i%.???}".dds%g" >> $BASE/.dds/texture.sed; done for i in `cat $BASE/.dds/texture_high`; do echo "s%"$i"%"${i%.???}".dds%g" >> $BASE/.dds/texture_high.sed; done cd - } function texture_bis { buildings_texture #prepare_texture cd $BASE/Textures/Runway folder_conversion clean_converted cat .dds/converted | sed 's%\./%Runway/%g' >> $BASE/.dds/texture sed -i 's%0.0%1.0%g' $BASE/Effects/runway.eff cd - cd $BASE/Textures.high/Runway folder_conversion clean_converted cat .dds/converted | sed 's%\./%Runway/%g' >> $BASE/.dds/texture_high cd - cd $BASE/Textures/Signs folder_conversion clean_converted cat .dds/converted | sed 's%\./%Signs/%g' >> $BASE/.dds/texture cd - cd $BASE/Textures.high/Signs folder_conversion clean_converted cat .dds/converted | sed 's%\./%Signs/%g' >> $BASE/.dds/texture_high cd - cd $BASE/Textures/Symbols folder_conversion clean_converted cat .dds/converted | sed 's%\./%Symbols/%g' >> $BASE/.dds/texture cd - cd $BASE/Textures/Trees folder_conversion clean_converted cat .dds/converted | sed 's%\./%Trees/%g' >> $BASE/.dds/texture cd - cd $BASE/Textures.high/Trees folder_conversion clean_converted cat .dds/converted | sed 's%\./%Trees/%g' >> $BASE/.dds/texture_high cd - cd $BASE/Textures/Terrain folder_conversion clean_converted cat .dds/converted | sed 's%\./%Terrain/%g' >> $BASE/.dds/texture cd - cd $BASE/Textures.high/Terrain folder_conversion clean_converted cat .dds/converted | sed 's%\./%Terrain/%g' >> $BASE/.dds/texture_high cd - cd $BASE/Textures/Terrain.winter folder_conversion clean_converted cat .dds/converted | sed 's%\./%Terrain.winter/%g' >> $BASE/.dds/texture cd - cd $BASE/Textures.high/Terrain.winter folder_conversion clean_converted cat .dds/converted | sed 's%\./%Terrain.winter/%g' >> $BASE/.dds/texture_high cd - cd $BASE/Textures/Sky folder_conversion cat .dds/converted | sed 's%\./%Sky/%g' >> $BASE/.dds/texture cd - cd $BASE/Textures/Water folder_conversion clean_converted cat .dds/converted | sed 's%\./%Water/%g' >> $BASE/.dds/texture sed -i 's%0.0%1.0%g' $BASE/Effects/water.eff sed -i 's%0.0%1.0%g' $BASE/Effects/water-inland.eff cd - sort -u $BASE/.dds/texture > tmp; mv tmp $BASE/.dds/texture sort -u $BASE/.dds/texture_high > tmp; mv tmp $BASE/.dds/texture_high > $BASE/.dds/texture_high.sed > $BASE/.dds/texture.sed for i in `cat $BASE/.dds/texture`; do echo "s%"$i"%"${i%.???}".dds%g" >> $BASE/.dds/texture.sed; done for i in `cat $BASE/.dds/texture_high`; do echo "s%"$i"%"${i%.???}".dds%g" >> $BASE/.dds/texture_high.sed; done } #convert Models/Weather textures function weather { if [ -d $CONFIG/Models/Weather ] then cp $CONFIG/Models/Weather/*.dds $BASE/Models/Weather/ fi cd $BASE/Models/Weather #totale plane_convert_2 cat .dds/converted | sed 's%\./%Weather/%g'>> $BASE/.dds/weather cd - sort -u $BASE/.dds/weather > tmp; mv tmp $BASE/.dds/weather for i in `cat $BASE/.dds/weather`; do echo "s%"$i"%"${i%.???}".dds%g" >> $BASE/.dds/weather.sed; done } # convert Instruments & Instrument-3d function instru_convert { cd $BASE/Aircraft/Instruments folder_conversion clean_converted cd - cd $BASE/Aircraft/Instruments-3d folder_conversion clean_converted cd - } # change extension from texture folders in material files function materials { cd $BASE/Materials for i in `find . -name "*.xml"`; do echo $i sed -i -f $BASE/.dds/texture_high.sed $i sed -i -f $BASE/.dds/texture.sed $i done cd - } # change extension in environment function environment { cd $BASE/Environment for i in `find . -name "*.xml"`; do echo $i sed -i -f $BASE/.dds/texture_high.sed $i sed -i -f $BASE/.dds/texture.sed $i sed -i -f $BASE/.dds/weather.sed $i done cd - } # same for effects function effects { cd $BASE/Effects for i in `find . -name "*.eff"`; do echo $i sed -i -f $BASE/.dds/texture.sed $i sed -i -f $BASE/.dds/texture_high.sed $i sed -i -f $BASE/.dds/weather.sed $i sed -i -f $BASE/.dds/generic.sed $i done cd - } # same for nasal files function nasal { cd $BASE/Nasal for i in `find . -name "*.nas"`; do echo $i sed -i -f $BASE/.dds/texture.sed $i sed -i -f $BASE/.dds/texture_high.sed $i sed -i -f $BASE/.dds/weather.sed $i sed -i -f $BASE/.dds/generic.sed $i done } function try_again { > $BASE/.dds/texture.sed for i in `cat $BASE/.dds/change`; do echo "s%"$i"%"${i%.???}".dds%g" >> $BASE/.dds/texture.sed; done for i in `cat $BASE/.dds/keep`; do echo "s%"${i%.???}".dds%"$i"%g" >> $BASE/.dds/texture.sed; done cat $BASE/.dds/corr >> $BASE/.dds/texture.sed materials environment effects } function scenery { LOG "scenery" cd $BASE/Scenery/Objects convert_2_lvl cd - cd $BASE/Scenery/Terrain convert_2_lvl cd - } # convert a plane without generic dds function plane_convert { if [ -f .dds/done ] then echo ".dds/done present, skipping conversion" else LOG " start conversion" texture_check test_bc3 bc1 bc3 normal eff_search permute_extension clean_converted > .dds/done fi } # convert a plane with generic dds function plane_convert_2 { if [ -f .dds/done ] then echo ".dds/done present, skipping conversion" else LOG " start conversion" texture_check test_bc3 bc1 bc3 normal eff_search permute_extension generic_apply clean_converted > .dds/done fi } # convert the Aircraft folder (except Generic) avoiding already converted function Aircraft_convert { cd $BASE/Aircraft ls -d */| grep Generic -v > plane_list cat plane_list | while read folder_name; do cd $folder_name echo "converting $folder_name" plane_convert_2 cd - done rm plane_list } # create fgdata dds from fgroot function fgdata_convert { if [ ! -d $BASE ]; then mkdir $BASE; fi # fgdata and Aircraft copy: create_initial_copy # note: forgeting Aircraft-uiuc copy_aircrafts #using $CONFIG/plane_list generic Aircraft_convert AI_conversion scenery weather Models_conversion texture_bis environment materials effects } # clean: remove all .dds folders function remove_trace { cd $BASE find . -name ".dds" | while read i; do rm -r $i cd - 1>/dev/null done } function fgdata_convert_mt { if [ ! -d $BASE ]; then mkdir $BASE; fi if [ ! -d $BASE/.dds ]; then mkdir $BASE/.dds; fi if [ ! -d $BASE/.dd/log ]; then mkdir $BASE/.dds/log; fi # fgdata and Aircraft copy: echo "try to use multiple core during the conversion"; echo create_initial_copy # note: forgeting Aircraft-uiuc echo copy_aircrafts #using $CONFIG/plane_list init_base echo; echo "generic"; echo generic 1>$BASE/.dds/log/generic echo; echo "multithreaded data conversion"; echo AI_conversion 1>$BASE/.dds/log/ai & texture_bis 1>$BASE/.dds/log/texture Models_conversion 1>$BASE/.dds/log/models Aircraft_convert 1>$BASE/.dds/log/aircraft scenery 1>$BASE/.dds/log/scenery weather 1>$BASE/.dds/log/weather wait echo; echo "names changes"; echo environment 1>$BASE/.dds/log/environment materials 1>$BASE/.dds/log/material effects 1>$BASE/.dds/log/effects nasal 1>$BASE/.dds/log/nasal wait } # main program if [ -z $reponse ] then echo "faites votre choix:" echo "1: chercher erreurs" echo "2: convertir un dossier" echo "3: generic" echo "4: textures" echo "5: weather" echo "6: init base" echo "7: materials" echo "8: environment" echo "9: effects" echo "10: tar current folder" echo "11: convert 1lvl" echo "12: convert 2 lvl" echo "13: manual selection" echo "14: clean converted" echo "15: fgdata conversion" echo "16: AI conversion" echo "17: plane conversion" echo "18: apply generic dds" echo "19: search for non dds call" echo "20: create fgdata multi-threaded " echo "21: test" echo "22: models" echo "23: scenery" echo "24: plane with generic dds" echo "25: stereo to mono sound file conversion" echo "26: create initial fgdata copy" echo "27: copy selected planes" echo "28: convert all the planes" echo "29: texture bis" echo "30: clean the converted fgdata" echo "your choice ?" read reponse fi case $reponse in 1) totale ;; 2) folder_conversion ;; 3) generic ;; 4) texture ;; 5) weather ;; 6) init_base ;; 7) materials ;; 8) environment ;; 9) effects ;; 10) tar_current_folder ;; 11) convert_1_lvl;; 12) convert_2_lvl;; 13) manual_affect;; 14) clean_converted;; 15) fgdata_convert;; 16) AI_conversion;; 17) plane_convert;; 18) generic_apply;; 19) non_dds_occurence;; 20) fgdata_convert_mt;; 21) try_again;; 22) Models_conversion;; 23) scenery;; 24) plane_convert_2;; 25) stereo_to_mono;; 26) create_initial_copy;; 27) copy_aircrafts;; 28) Aircraft_convert;; 29) texture_bis;; 30) remove_trace;; *) echo "fin" ;; esac beep -f 10000 -l 50 -r 3 -d 200