summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/blender-scripts.py4
-rwxr-xr-xtools/check-levels.sh18
-rwxr-xr-xtools/mission-time-loop.sh5
-rwxr-xr-xtools/mission-time.sh9
-rwxr-xr-xtools/update-license.sh12
5 files changed, 42 insertions, 6 deletions
diff --git a/tools/blender-scripts.py b/tools/blender-scripts.py
index c2361c7..d2273d6 100644
--- a/tools/blender-scripts.py
+++ b/tools/blender-scripts.py
@@ -2,12 +2,12 @@
# Script for exporting Blender models (meshes) to Colobot model files
# (text format)
#
-# Copyright (C) 2012, PPC (Polish Portal of Colobot)
+# Copyright (C) 2012-2014, TerranovaTeam
#
bl_info = {
"name": "Colobot Model Format (.txt)",
- "author": "PPC (Polish Portal of Colobot)",
+ "author": "TerranovaTeam",
"version": (0, 0, 2),
"blender": (2, 6, 4),
"location": "File > Export > Colobot (.txt)",
diff --git a/tools/check-levels.sh b/tools/check-levels.sh
index 22544fb..127375f 100755
--- a/tools/check-levels.sh
+++ b/tools/check-levels.sh
@@ -2,8 +2,18 @@
# Runs every level in scenetest mode
-levels=`ls /usr/local/share/games/colobot/levels | cut -d "." -f 1`
-for level in $levels; do
- echo $level
- colobot -runscene $level -scenetest -loglevel warn
+categories=`ls /usr/local/share/games/colobot/levels`
+for category in $categories; do
+ if [ "$category" = "other" ]; then continue; fi
+ chapters=`ls /usr/local/share/games/colobot/levels/$category`
+ for chapter in $chapters; do
+ chapter=`echo -n $chapter | tail -c 1`
+ levels=`ls /usr/local/share/games/colobot/levels/$category/chapter00$chapter`
+ for level in $levels; do
+ if [ ! -d /usr/local/share/games/colobot/levels/$category/chapter00$chapter/$level ]; then continue; fi
+ level=`echo -n $level | cut -d . -f 1 | tail -c 3`
+ echo $category$chapter$level
+ colobot -runscene $category$chapter$level -scenetest -loglevel warn
+ done
+ done
done
diff --git a/tools/mission-time-loop.sh b/tools/mission-time-loop.sh
new file mode 100755
index 0000000..22d6107
--- /dev/null
+++ b/tools/mission-time-loop.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+# Works like mission-time.sh but execures in a loop
+while [ true ]; do
+ ./mission-time.sh $@
+done
diff --git a/tools/mission-time.sh b/tools/mission-time.sh
new file mode 100755
index 0000000..36c65e7
--- /dev/null
+++ b/tools/mission-time.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Returns mission time on stdout for a mission given on the commandline
+# Make sure the level actually uses MissionTimer, or the script will hang!
+
+colobot -headless -runscene $@ 2>&1 | while read -r line; do
+ if [[ $line =~ Mission[[:space:]]time:[[:space:]]([0-9:.]*) ]]; then
+ echo ${BASH_REMATCH[1]}
+ fi
+done
diff --git a/tools/update-license.sh b/tools/update-license.sh
new file mode 100755
index 0000000..870e173
--- /dev/null
+++ b/tools/update-license.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+# Replaces license text with contents of file provided as an argument
+if [ ! $# -eq 1 ]; then
+ echo "Usage: $0 [file with new license header]"
+ exit 1
+fi
+find . -name "*.cpp" -or -name "*.h" | while read file; do
+ echo $file
+ sed '/\/\/ \* This.*/,/If not\, see.*/d' $file > $file.tmp
+ cat $1 $file.tmp > $file
+ rm $file.tmp
+done