|
From: <diz...@us...> - 2007-10-09 16:54:36
|
Revision: 88
http://fortress.svn.sourceforge.net/fortress/?rev=88&view=rev
Author: dizzutch
Date: 2007-10-09 09:54:39 -0700 (Tue, 09 Oct 2007)
Log Message:
-----------
added animation sequence generator
Modified Paths:
--------------
trunk/mapgen/MapGenerator.java
Added Paths:
-----------
trunk/tools/
trunk/tools/generate_anim.sh
Modified: trunk/mapgen/MapGenerator.java
===================================================================
--- trunk/mapgen/MapGenerator.java 2007-09-15 17:41:53 UTC (rev 87)
+++ trunk/mapgen/MapGenerator.java 2007-10-09 16:54:39 UTC (rev 88)
@@ -23,18 +23,15 @@
this.width = width;
this.height = height;
this.map = new MapSection[this.width][this.height];
- for(int h = 0; h < height; h++) {
- for(int w = 0; w < width; w++) {
+ for(int h = 0; h < height; h++)
+ for(int w = 0; w < width; w++)
this.map[h][w] = new MapSection();
- }
- }
}
public void printMap() {
for(int h = 0; h < this.height; h++) {
- for (int w = 0; w < this.width; w++) {
+ for (int w = 0; w < this.width; w++)
System.out.print(this.map[h][w].getHeight() + " ");
- }
System.out.println();
}
}
Added: trunk/tools/generate_anim.sh
===================================================================
--- trunk/tools/generate_anim.sh (rev 0)
+++ trunk/tools/generate_anim.sh 2007-10-09 16:54:39 UTC (rev 88)
@@ -0,0 +1,66 @@
+#!/bin/bash
+#version 0.1
+#Jule Slootbeek jsl...@gm...
+
+if [ ! $1 ]
+then
+ echo "Usage: $0 [animation]"
+ exit
+fi
+
+animation=$1;
+
+#make sure animation exists
+if [ ! -d $animation ]
+then
+ echo "$animation does not exist"
+ exit
+fi
+
+cd $animation
+
+#directions: east, north, northeast, south and southeast
+
+#create west, southwest and northwest
+for frame in $(ls *fe_*);
+do
+ src=$frame
+ tgt=$(echo $frame | sed -e "s/fe_/fw_/")
+ convert ${src} -flop ${tgt}
+done
+
+for frame in $(ls *fne_*);
+do
+ src=$frame
+ tgt=$(echo $frame | sed -e "s/fne_/fnw_/")
+ convert ${src} -flop ${tgt}
+done
+
+for frame in $(ls *fse_*);
+do
+ src=$frame
+ tgt=$(echo $frame | sed -e "s/fse_/fsw_/")
+ convert ${src} -flop ${tgt}
+done
+
+#generate lines
+for direction in e w n s ne se nw sw;
+do
+ cmd="convert "
+ for file in $(ls ${animation}_f${direction}_[0-9]*.png);
+ do
+ cmd="${cmd} $file "
+ done
+ cmd="${cmd} +append ${animation}_f${direction}_sequence.png"
+ $(${cmd})
+done
+
+#generate complete sequence
+cmd="convert "
+for sequence in $(ls *${animation}_f*_sequence*);
+do
+ cmd="${cmd} $sequence "
+done
+cmd="${cmd} -append ${animation}_sequence.png"
+
+$(${cmd})
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|