enigma-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Enigma-cvs] enigma/data/levels 00makepreviews.sh,1.5,1.6


From: Ralf Westram <address@hidden>
Subject: [Enigma-cvs] enigma/data/levels 00makepreviews.sh,1.5,1.6
Date: Mon, 27 Oct 2003 12:02:09 +0000

Update of /cvsroot/enigma/enigma/data/levels
In directory subversions:/tmp/cvs-serv14239/data/levels

Modified Files:
        00makepreviews.sh 
Log Message:
- fix for new screenshot location
- added directory m_tutor



Index: 00makepreviews.sh
===================================================================
RCS file: /cvsroot/enigma/enigma/data/levels/00makepreviews.sh,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** 00makepreviews.sh   16 Aug 2003 23:48:06 -0000      1.5
--- 00makepreviews.sh   27 Oct 2003 12:02:07 -0000      1.6
***************
*** 1,33 ****
  #!/bin/bash
  
! for bmp in ../../*.bmp; do
!     base=`basename $bmp .bmp`
!     png="$base.png"
!     if [ -f $bmp ]; then
!         if [ $bmp -nt $png ]; then
!             echo "creating $png"
!             convert -crop 640x416+0+0 -scale 120x78 $bmp $png
! #           mogrify -crop 640x416+0+0 $png
! #           mogrify -scale 20% $png
          fi
      fi
! done
  
! if test -d ../../Sokoban; then
!     for bmp in ../../Sokoban/*.bmp; do
!         base=`basename $bmp .bmp`
!         png="Sokoban/$base.png"
!         if [ -f $bmp ]; then
!             if [ $bmp -nt $png ]; then
!                 echo "creating $png"
!                 convert -crop 640x416+0+0 -scale 120x78 $bmp $png
!             fi
          fi
      done
  fi
  
! # if pngcrush is installed crush previews
! if [ -x /usr/local/bin/pngcrush ] ; then
!     NEWPREVIEWS=`find . -name "*.png" -cmin -2`
!     ./04crushprevievs.sh $NEWPREVIEWS
  fi
--- 1,51 ----
  #!/bin/bash
  
! SCREENSHOTS=../../screenshots
! 
! update_if_newer()  {
!     if [ -f $1 ]; then
!         if [ $1 -nt $2 ]; then
!             echo "creating $2"
!             convert -crop 640x416+0+0 -scale 120x78 $1 $2
          fi
      fi
! }
  
! update_for_subdir() {
!     if [ -d $1 ]; then
!         if [ -d $SCREENSHOTS/$1 ]; then
!             for bmp in $SCREENSHOTS/$1/*.bmp; do
!                 base=`basename $bmp .bmp`
!                 png="$1/$base.png"
!                 update_if_newer $bmp $png
!             done
          fi
+     else
+         echo "Error: no such directory '$1'"
+     fi
+ }
+ 
+ if [ -d $SCREENSHOTS ]; then
+     for bmp in $SCREENSHOTS/*.bmp; do
+         base=`basename $bmp .bmp`
+         png="$base.png"
+         update_if_newer $bmp $png
      done
+ 
+     update_for_subdir Sokoban
+     update_for_subdir m_tutor
  fi
  
! NEWPREVIEWS=`find . -name "*.png" -cmin -5`
! COUNT=`echo $NEWPREVIEWS | wc -w`
! 
! if [ $COUNT = 0 ]; then
!     echo "All existing previews were up-to-date."
! else
!     # if pngcrush is installed crush previews
!     if [ -x /usr/local/bin/pngcrush ] ; then
!         ./04crushprevievs.sh $NEWPREVIEWS
!     fi
! 
!     echo "$COUNT preview(s) updated."
  fi





reply via email to

[Prev in Thread] Current Thread [Next in Thread]