pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3457 - in trunk/pingus: . contrib


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3457 - in trunk/pingus: . contrib
Date: Thu, 1 Nov 2007 13:09:35 +0100

Author: grumbel
Date: 2007-11-01 13:09:34 +0100 (Thu, 01 Nov 2007)
New Revision: 3457

Modified:
   trunk/pingus/TODO
   trunk/pingus/contrib/levelconvert.sh
   trunk/pingus/contrib/xml2sexpr.rb
Log:
- fixed bool/int issue

Modified: trunk/pingus/TODO
===================================================================
--- trunk/pingus/TODO   2007-11-01 09:38:06 UTC (rev 3456)
+++ trunk/pingus/TODO   2007-11-01 12:09:34 UTC (rev 3457)
@@ -133,12 +133,12 @@
 
 * Level Converter needs to be finalized:
 
+  - convert all levels and check all classic levels for issues
+
   - level converter has a bug that causes some object types to be
     ignored (startpos and likely the other more excotic worldobj
     things)
 
-  - level converter writes 0/1 instead of #t/#f
-
   - fix the level convert script and write test cases for it
 
   - Loading data/levels/playable/chouser02.pingus in Editor and saving
@@ -147,10 +147,6 @@
     then in-game) [Currently worked around in editor code, should be
     fixed in the converter]
 
-  - convert all levels and check all classic levels for issues (run
-    branches/pingus_sdl/contribl/levelconvert.sh from SVN toplevel
-    dir)
-
 * GUI doesn't behave well if the user for example clicks a menu item
   twice in a single frame, leads to duplicate Screens on the stack ond
   other weird issues

Modified: trunk/pingus/contrib/levelconvert.sh
===================================================================
--- trunk/pingus/contrib/levelconvert.sh        2007-11-01 09:38:06 UTC (rev 
3456)
+++ trunk/pingus/contrib/levelconvert.sh        2007-11-01 12:09:34 UTC (rev 
3457)
@@ -1,13 +1,14 @@
-#!/bin/sh
+#!/bin/bash
 
 set -e
-trap errmsg ERR
 
 function errmsg() {
     echo "ERROR: Critical failure :ERROR"
 }
 
-if [ ! \( -d "branches/pingus_sdl" \) ]; then
+trap errmsg ERR
+
+if [ ! \( -d "trunk/pingus" \) ]; then
     echo "You must call this script from the top level of the SVN repository"
     exit 1
 fi
@@ -15,23 +16,23 @@
 for IN in "$@"; do
     PREFIX=$(echo $IN | sed "s/\(.*\)data\/levels\/.*/\1/")
     TMP=$(tempfile)
-    OUT="branches/pingus_sdl/${IN##${PREFIX}}"
+    OUT="trunk/pingus/${IN##${PREFIX}}"
     # echo "Prefix: $PREFIX"
     echo "IN:     $IN"
     echo "OUT:    $OUT"
     if true; then
         xsltproc \
             -o "$TMP" \
-            branches/pingus_sdl/contrib/pingusv1tov2.xsl \
+            trunk/pingus/contrib/pingusv1tov2.xsl \
             "$IN"
-        branches/pingus_sdl/xml2sexpr.rb "$TMP" "$IN" > "${OUT}"        
+        trunk/pingus/contrib/xml2sexpr.rb "$TMP" "$IN" > "${OUT}"        
     else
         xalan \
             -indent 0 \
-            -xsl branches/pingus_sdl/contrib/pingusv1tov2.xsl \
+            -xsl trunk/pingus/contrib/pingusv1tov2.xsl \
             -in "$IN" \
             -out "$TMP"
-        branches/pingus_sdl/xml2sexpr.rb "$TMP" "$IN" > "${OUT}"
+        trunk/pingus/contrib/xml2sexpr.rb "$TMP" "$IN" > "${OUT}"
     fi
     rm "$TMP"
     echo "Conversion ok"

Modified: trunk/pingus/contrib/xml2sexpr.rb
===================================================================
--- trunk/pingus/contrib/xml2sexpr.rb   2007-11-01 09:38:06 UTC (rev 3456)
+++ trunk/pingus/contrib/xml2sexpr.rb   2007-11-01 12:09:34 UTC (rev 3457)
@@ -76,11 +76,11 @@
    [/^\/pingus-level\/objects\/surface-background\/blue$/,  :integer],
    [/^\/pingus-level\/objects\/surface-background\/scroll-x$/,  :float],
    [/^\/pingus-level\/objects\/surface-background\/scroll-y$/,  :float],
-   [/^\/pingus-level\/objects\/surface-background\/para-x$/,  :float],
-   [/^\/pingus-level\/objects\/surface-background\/para-y$/,  :float],
-   [/^\/pingus-level\/objects\/surface-background\/stretch-x$/,  :integer],
-   [/^\/pingus-level\/objects\/surface-background\/stretch-y$/,  :integer],
-   [/^\/pingus-level\/objects\/surface-background\/keep-aspect$/,  :integer],
+   [/^\/pingus-level\/objects\/surface-background\/para-x$/,    :float],
+   [/^\/pingus-level\/objects\/surface-background\/para-y$/,    :float],
+   [/^\/pingus-level\/objects\/surface-background\/stretch-x$/,   :bool],
+   [/^\/pingus-level\/objects\/surface-background\/stretch-y$/,   :bool],
+   [/^\/pingus-level\/objects\/surface-background\/keep-aspect$/, :bool],
 
    [/^\/pingus-level\/objects\/conveyorbelt$/, :section],
    [/^\/pingus-level\/objects\/conveyorbelt\/width$/, :integer],
@@ -238,6 +238,16 @@
         }
       }
       print ")"
+    when :bool
+      print "#{indent}(#{el.name} "
+      el.children.each{|child|
+        if child.value.to_i == 0 then
+          print "#f"
+        else
+          print "#t"
+        end
+      }
+      print ")"
     when :integer
       print "#{indent}(#{el.name} "
       el.children.each{|child|





reply via email to

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