Subversion Repositories duke3d_hrp

Rev

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

Rev 330 Rev 331
Line 12... Line 12...
12
# MinGW/MSYS performance is horrible, better go Linux. Even my virtual Debian
12
# MinGW/MSYS performance is horrible, better go Linux. Even my virtual Debian
13
# machine accessing the Windows drive is 5 to 10 times faster.
13
# machine accessing the Windows drive is 5 to 10 times faster.
14
# But it still sucks. This needs to become a Perl script one day.
14
# But it still sucks. This needs to become a Perl script one day.
15
# Or maybe MSYS bash gets finally updated to 4.* and I'll use its regex engine.
15
# Or maybe MSYS bash gets finally updated to 4.* and I'll use its regex engine.
16
 
16
 
-
 
17
DEF_TOP=UNDEFINED
17
SET_VERSION=YES # [YES|NO]
18
SET_VERSION=YES            # [YES|NO]
18
EXTRACT_COMMENTED_FILES=NO # [YES|NO]
19
EXTRACT_COMMENTED_FILES=NO # [YES|NO]
19
DUKEPLUS_POLYMOST_COMPATIBILTY_APPROACH=none # [none|polymost|polymer|mixed]
20
DUKEPLUS_POLYMOST_COMPATIBILTY_APPROACH=none # [none|polymost|polymer|mixed]
20
 
21
 
21
ask()
22
ask()
22
{
23
{
Line 188... Line 189...
188
    echo "Copying skyboxes ..."
189
    echo "Copying skyboxes ..."
189
    tar_copy_dir "highres/skyboxes" "${EXTRACTDIR}/highres/skyboxes"
190
    tar_copy_dir "highres/skyboxes" "${EXTRACTDIR}/highres/skyboxes"
190
    cd "${WORKDIR}"
191
    cd "${WORKDIR}"
191
  fi
192
  fi
192
 
193
 
-
 
194
  if [ "${HRPTYPE}" = "default" ] ; then
-
 
195
    cp -pv  "${DEF_TOP}"          "${EXTRACTDIR}/${DEF_TOP}"
-
 
196
    echo            "\`*.txt' -> \`${EXTRACTDIR}/*.txt'"
-
 
197
    cp -p  *.txt                  "${EXTRACTDIR}"
-
 
198
  fi
-
 
199
 
193
} # copy_known_files()
200
} # copy_known_files()
194
 
201
 
195
 
202
 
196
polymost_mhk_patch()
203
polymost_mhk_patch()
197
{
204
{
Line 408... Line 415...
408
        # Mastering the backslash :-) ... hm, no big performance gain ... :
415
        # Mastering the backslash :-) ... hm, no big performance gain ... :
409
        HRP_FILE=`echo "${DEF_LINE}" | sed -r --posix s/\\(^.*file\\ *\"\\)\\([^\"]*\\)\\(.*\\)/\\\2/`
416
        HRP_FILE=`echo "${DEF_LINE}" | sed -r --posix s/\\(^.*file\\ *\"\\)\\([^\"]*\\)\\(.*\\)/\\\2/`
410
        # Ignore comments WIP:
417
        # Ignore comments WIP:
411
        #HRP_FILE=`echo "${DEF_LINE}" | sed -r --posix s/\\(^.*file\\ *\\)\\(\\"\\(.*\\)\\"\\)\\(.*\\)/\\\3/`
418
        #HRP_FILE=`echo "${DEF_LINE}" | sed -r --posix s/\\(^.*file\\ *\\)\\(\\"\\(.*\\)\\"\\)\\(.*\\)/\\\3/`
412
        ;;
419
        ;;
413
      model)
420
      model|voxel)
414
        HRP_FILE=`echo "${DEF_LINE}" | sed -r --posix s/\\(^.*model\\ *\"\\)\\([^\"]*\\)\\(.*\\)/\\\2/`
421
        HRP_FILE=`echo "${DEF_LINE}" | sed -r --posix s/\\(^.*${HRP_TERM}\\ *\"\\)\\([^\"]*\\)\\(.*\\)/\\\2/`
415
        ;;
-
 
416
      voxel)
-
 
417
        HRP_FILE=`echo "${DEF_LINE}" | sed -r --posix s/\\(^.*voxel\\ *\"\\)\\([^\"]*\\)\\(.*\\)/\\\2/`
-
 
418
        ;;
422
        ;;
419
      front|right|back|left|top|down)
423
      front|right|back|left|top|down)
420
        #HRP_FILE=`echo "${DEF_LINE}" | sed -r s/^.*${HRP_TERM}\ *\"//g | sed s/\".*//`
424
        #HRP_FILE=`echo "${DEF_LINE}" | sed -r s/^.*${HRP_TERM}\ *\"//g | sed s/\".*//`
421
        HRP_FILE=`echo "${DEF_LINE}" | sed -r --posix s/\\(^.*${HRP_TERM}\\ *\"\\)\\([^\"]*\\)\\(.*\\)/\\\2/`
425
        HRP_FILE=`echo "${DEF_LINE}" | sed -r --posix s/\\(^.*${HRP_TERM}\\ *\"\\)\\([^\"]*\\)\\(.*\\)/\\\2/`
422
        ;;
426
        ;;
Line 509... Line 513...
509
    parse_defs highres/sw.def
513
    parse_defs highres/sw.def
510
  fi
514
  fi
511
  if [ "${HRPTYPE}" = "sw_lowres" ] ; then
515
  if [ "${HRPTYPE}" = "sw_lowres" ] ; then
512
    parse_defs lowres/sw.def
516
    parse_defs lowres/sw.def
513
  fi
517
  fi
-
 
518
  if [ "${HRPTYPE}" = "default" ] ; then
-
 
519
    parse_defs "${DEF_TOP}"
-
 
520
  fi
514
 
521
 
515
  echo "### Deleting empty directories in ${EXTRACTDIR} ... ###"
522
  echo "### Deleting empty directories in ${EXTRACTDIR} ... ###"
516
  delete_empty_folders
523
  delete_empty_folders
517
 
524
 
518
  date +%F" "%H:%M:%S
525
  date +%F" "%H:%M:%S
Line 536... Line 543...
536
cd               "${HRPROOT}"
543
cd               "${HRPROOT}"
537
echo  "PWD     :  ${WORKDIR}"
544
echo  "PWD     :  ${WORKDIR}"
538
echo  "HRPROOT :  ${HRPROOT}"
545
echo  "HRPROOT :  ${HRPROOT}"
539
 
546
 
540
if [ ! -f "./duke3d.def" ] ; then
547
if [ ! -f "./duke3d.def" ] ; then
-
 
548
  if [ ! -f "./${HRPTYPE}.def" ] ; then
541
  echo "ERROR : ./duke3d.def not found. This is no HRP root directory. Exit."
549
    echo "ERROR : ./duke3d.def or ./${HRPTYPE}.def not found. This is no HRP root directory. Exit."
542
  exit 1
550
    exit 1
-
 
551
  fi
543
fi
552
fi
544
 
553
 
545
case "$HRPTYPE" in
554
case "$HRPTYPE" in
546
  polymer|polymost_override|polymost)
555
  polymer|polymost_override|polymost)
547
    main $HRPTYPE
556
    main $HRPTYPE
Line 591... Line 600...
591
    ;;
600
    ;;
592
  debug)
601
  debug)
593
    echo "Nothing to debug."
602
    echo "Nothing to debug."
594
    ;;
603
    ;;
595
  *)
604
  *)
-
 
605
    if [ -f "${HRPTYPE}.def" ] ; then
-
 
606
      DEF_TOP="${HRPTYPE}.def"
-
 
607
      HRPTYPE=default
-
 
608
      SET_VERSION=NO
-
 
609
      EXTRACT_COMMENTED_FILES=NO
-
 
610
      main $HRPTYPE
-
 
611
    else
-
 
612
      echo "Usage: ${0} {HRPTYPE|TOP_DEF} [v VERSION]"
596
    echo "Usage: ${0} {full|polymer|polymost_override|polymost|both|all} [v VERSION]"
613
      echo "HRPTYPEs: {full|polymer|polymost_override|polymost|both|all}"
-
 
614
      echo "HRPTYPEs: {sw_highres|sw_lowres|sw_both}"
-
 
615
      echo "TOP_DEF:  {Filename without extension}"
597
    exit 1
616
      exit 1
-
 
617
    fi
598
    ;;
618
    ;;
599
esac
619
esac
600
 
620
 
601
exit 0
621
exit 0