Subversion Repositories duke3d_hrp

Rev

Rev 711 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 711 Rev 714
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
 
2
 
3
# Duke Nukem 3D CON/DEF/HRP File Extractor  v0.9.1  2019-09-17
3
# Duke Nukem 3D CON/DEF/HRP File Extractor  v0.9.2  2020-02-21
4
#
4
#
5
# Author:  LeoD
5
# Author:  LeoD
6
# License: ISC License -> https://opensource.org/licenses/isc-license.txt
6
# License: ISC License -> https://opensource.org/licenses/isc-license.txt
7
#
7
#
8
# This script extracts a working copy of your local Duke Nukem 3D High
8
# This script extracts a working copy of your local Duke Nukem 3D High
Line 236... Line 236...
236
    cp -pv voxelpack_art_license.txt "${EXTRACTDIR}"
236
    cp -pv voxelpack_art_license.txt "${EXTRACTDIR}"
237
    cp -pv duke3d.def                "${EXTRACTDIR}"
237
    cp -pv duke3d.def                "${EXTRACTDIR}"
238
    cp -pv duke3d_voxels.def         "${EXTRACTDIR}"
238
    cp -pv duke3d_voxels.def         "${EXTRACTDIR}"
239
    cp -pv dukegdx.def               "${EXTRACTDIR}"
239
    cp -pv dukegdx.def               "${EXTRACTDIR}"
240
    cp -pv voxels/pickups_gdx.def    "${EXTRACTDIR}/voxels/"
240
    cp -pv voxels/pickups_gdx.def    "${EXTRACTDIR}/voxels/"
-
 
241
    #cp -pv voxels/monsters.def       "${EXTRACTDIR}/voxels/"
-
 
242
    #cp -pv voxels/monsters/*.kvx     "${EXTRACTDIR}/voxels/monsters/"
-
 
243
    cp -pv voxels/hrp_undefines.def  "${EXTRACTDIR}/voxels/"
241
    cp -pv eduke.con                 "${EXTRACTDIR}"
244
    cp -pv eduke.con                 "${EXTRACTDIR}"
242
    if [ -d  scripts/ ] ; then
245
    if [ -d  scripts/ ] ; then
243
      cp -pv scripts/*.con           "${EXTRACTDIR}/scripts/"
246
      cp -pv scripts/*.con           "${EXTRACTDIR}/scripts/"
244
    fi
247
    fi
245
    ### LeoD ###
248
    ### LeoD ###
246
    if [ -f  EDUKE.CON ] ; then
249
    if [ -f  EDUKE.CON ] ; then
247
      cp -pv EDUKE.CON               "${EXTRACTDIR}"
250
      cp -pv EDUKE.CON               "${EXTRACTDIR}"
248
    fi
251
    fi
249
    if [ -d   voxels/scripts/ ] ; then
252
    if [ -d   voxels/scripts/ ] ; then
-
 
253
      #cp -pv voxels/scripts/faucet2.con    "${EXTRACTDIR}/voxels/scripts/"
250
      #cp -pv voxels/scripts/freezeammo.con "${EXTRACTDIR}/voxels/scripts/"
254
      #cp -pv voxels/scripts/freezeammo.con "${EXTRACTDIR}/voxels/scripts/"
251
      #cp -pv voxels/scripts/holoduke.con   "${EXTRACTDIR}/voxels/scripts/"
255
      #cp -pv voxels/scripts/holoduke.con   "${EXTRACTDIR}/voxels/scripts/"
252
      #cp -pv voxels/scripts/pigtank.con    "${EXTRACTDIR}/voxels/scripts/"
256
      #cp -pv voxels/scripts/pigtank.con    "${EXTRACTDIR}/voxels/scripts/"
253
      #cp -pv voxels/scripts/rotation.con   "${EXTRACTDIR}/voxels/scripts/"
257
      #cp -pv voxels/scripts/rotation.con   "${EXTRACTDIR}/voxels/scripts/"
254
      cp  -pv voxels/scripts/*.con          "${EXTRACTDIR}/voxels/scripts/"
258
      cp  -pv voxels/scripts/*.con          "${EXTRACTDIR}/voxels/scripts/"
Line 550... Line 554...
550
        ;;
554
        ;;
551
    esac ; fi
555
    esac ; fi
552
 
556
 
553
    if [ "${HRP_FILE}" ] ; then
557
    if [ "${HRP_FILE}" ] ; then
554
      extract_file "${HRP_FILE}"
558
      extract_file "${HRP_FILE}"
-
 
559
      HRP_FILE=""
555
    fi
560
    fi
556
 
561
 
557
  done
562
  done
558
} # parse_defs()
563
} # parse_defs()
559
 
564
 
Line 842... Line 847...
842
        fi
847
        fi
843
      elif [ -f "duke3d.def" ] ; then
848
      elif [ -f "duke3d.def" ] ; then
844
        DEF_TOP="duke3d.def"
849
        DEF_TOP="duke3d.def"
845
        info "Auto mode found ${DEF_TOP}"
850
        info "Auto mode found ${DEF_TOP}"
846
        parse_defs "${DEF_TOP}"
851
        parse_defs "${DEF_TOP}"
-
 
852
      elif [ -f "dukegdx.def" ] ; then
-
 
853
        DEF_TOP="dukegdx.def"
-
 
854
        info "Auto mode found ${DEF_TOP}"
-
 
855
        parse_defs "${DEF_TOP}"
847
      fi
856
      fi
848
    elif [ -f "duke3d.def" ] ; then
857
    elif [ -f "duke3d.def" ] ; then
849
      DEF_TOP="duke3d.def"
858
      DEF_TOP="duke3d.def"
850
      info "Auto mode found ${DEF_TOP}"
859
      info "Auto mode found ${DEF_TOP}"
851
      parse_defs "${DEF_TOP}"
860
      parse_defs "${DEF_TOP}"
-
 
861
    elif [ -f "dukegdx.def" ] ; then
-
 
862
      DEF_TOP="dukegdx.def"
-
 
863
      info "Auto mode found ${DEF_TOP}"
-
 
864
      parse_defs "${DEF_TOP}"
852
    else
865
    else
853
      exit_on_error "Please report to LeoD"
866
      exit_on_error "Please report to LeoD"
854
    fi
867
    fi
-
 
868
 
855
  fi
869
  fi
856
 
870
 
857
  info "Copying  'known' files ..."
871
  info "Copying  'known' files ..."
858
  copy_known_files
872
  copy_known_files
859
 
873
 
Line 861... Line 875...
861
  delete_empty_folders
875
  delete_empty_folders
862
 
876
 
863
  #date +%F" "%H:%M:%S
877
  #date +%F" "%H:%M:%S
864
 
878
 
865
  #echo "Command line example for creating a ZIP package:"
879
  #echo "Command line example for creating a ZIP package:"
866
  #echo "sh -c \"cd ${EXTRACTDIR}; zip -9rqn .jpg:.png:.zip ${EXTRACTDIR}.zip\
880
  #echo "sh -c \"cd ${EXTRACTDIR}; zip -9rqn .jpg:.png:.svn:.zip \
867
  #highpal highres maphacks *.def *.txt\""
881
  #      ${EXTRACTDIR}.zip highpal highres maphacks *.def *.txt\""
868
} # main()
882
} # main()
869
 
883
 
870
 
884
 
871
 
885
 
872
PRGPATH=$0
886
PRGPATH=$0
Line 935... Line 949...
935
    ${PRGPATH} sw_highres y
949
    ${PRGPATH} sw_highres y
936
    ;;
950
    ;;
937
  auto)
951
  auto)
938
    SET_VERSION=NO
952
    SET_VERSION=NO
939
    EXTRACT_COMMENTED_FILES=NO
953
    EXTRACT_COMMENTED_FILES=NO
940
    if [ -f "EDUKE.CON" ] || [ -f "GAME.CON" ] || [ -f "duke3d.def" ] ; then
954
    if [ -f "EDUKE.CON" ] || [ -f "GAME.CON" ] || [ -f "duke3d.def" ] || [ -f "dukegdx.def" ] ; then
941
      main $HRPTYPE
955
      main $HRPTYPE
942
    else
956
    else
943
      exit_on_error "Auto mode found no suitable toplevel file (EDUKE.CON|GAME.CON|duke3d.def)."
957
      exit_on_error "Auto mode found no suitable toplevel file (EDUKE.CON|GAME.CON|duke3d.def|dukegdx.def)."
944
    fi
958
    fi
945
    ;;
959
    ;;
946
  unused)
960
  unused)
947
    exit_on_error "Option \"$1\" not yet implemented."
961
    exit_on_error "Option \"$1\" not yet implemented."
948
    ;;
962
    ;;