author | ecalot
<ecalot> 2004-08-24 04:42:20 UTC |
committer | ecalot
<ecalot> 2004-08-24 04:42:20 UTC |
parent | 84fd2e6d4d67772d2f52f1ed90afc493da2add14 |
stuff/data/FORMAT | +0 | -30 |
stuff/data/bin/makeindex | +0 | -0 |
stuff/data/bin/pr | +0 | -0 |
stuff/data/bin/src/makeindex.c | +0 | -72 |
stuff/data/def/RES_ANIM_COUCH.def | +0 | -16 |
stuff/data/def/RES_ANIM_JUMP.def | +0 | -22 |
stuff/data/def/RES_ANIM_JUMPRUN.def | +0 | -14 |
stuff/data/def/RES_ANIM_NORMAL.def | +0 | -6 |
stuff/data/def/RES_ANIM_RUN.def | +0 | -11 |
stuff/data/def/RES_ANIM_RUN_START.def | +0 | -9 |
stuff/data/def/RES_ANIM_RUN_STOP.def | +0 | -7 |
stuff/data/def/RES_ANIM_RUN_TURN.def | +0 | -16 |
stuff/data/def/RES_ANIM_TORCH.def | +0 | -12 |
stuff/data/def/RES_ANIM_TURNING.def | +0 | -11 |
stuff/data/def/RES_ANIM_TURNRUN.def | +0 | -16 |
stuff/data/def/RES_ANIM_WALKING.def | +0 | -15 |
stuff/data/def/RES_GUARD_1.def | +0 | -11 |
stuff/data/def/RES_IMG_BACKGROUND.def | +0 | -4 |
stuff/data/def/RES_IMG_ENV_DUNGEON.def | +0 | -28 |
stuff/data/def/RES_IMG_MAIN_BACKGROUND.def | +0 | -8 |
stuff/data/def/RES_IMG_TEXT_BACKGROUND.def | +0 | -8 |
stuff/data/def/RES_LEVEL_1.def | +0 | -3 |
stuff/data/makedat | +0 | -127 |
stuff/data/result/.cvsignore | +0 | -4 |
stuff/data/result/types.h | +0 | -7 |
stuff/data/type | +0 | -46 |
stuff/data/xml/.cvsignore | +0 | -1 |
stuff/data/xml/gen1.xml | +0 | -38 |
stuff/data/xml/gen2.xml | +0 | -56 |
diff --git a/stuff/data/FORMAT b/stuff/data/FORMAT deleted file mode 100644 index 48090c9..0000000 --- a/stuff/data/FORMAT +++ /dev/null @@ -1,30 +0,0 @@ -Format of .def files: - -[FILE] -[TYPE] -[number 1] -[number 2] -[number 3] -... - -Where FILE is the dat file where the resource is and type is the -resource type according to "type" program. - -use: - - ./type [ACTION] - where ACTION is - - list: to see a list of valid .def file types - - add: to add a new type - - del: to remove a type - - ren: to rename a type (not tested) - - ./makedat - to compile all .def resources in def file - -Both scripts will save the output files in the result directory. -There are symbolic links from the places where those files are -needed. This means that every time you run a makedat, the binary -version of freeprince has their resources updated too. - -Note: a new build compilation is needed because the .h files are -different now. Use "make build" in the freeprince src directory. - diff --git a/stuff/data/bin/makeindex b/stuff/data/bin/makeindex deleted file mode 100755 index bea7fc6..0000000 Binary files a/stuff/data/bin/makeindex and /dev/null differ diff --git a/stuff/data/bin/pr b/stuff/data/bin/pr deleted file mode 100755 index 0f9a1c9..0000000 Binary files a/stuff/data/bin/pr and /dev/null differ diff --git a/stuff/data/bin/src/makeindex.c b/stuff/data/bin/src/makeindex.c deleted file mode 100644 index 82ce478..0000000 --- a/stuff/data/bin/src/makeindex.c +++ /dev/null @@ -1,72 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> - -int main(int c, char** files) { - char* def; - char* index; - FILE* fpd; - FILE* fpi; - char filename[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - char filenameaux[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - unsigned short int i,j; - unsigned short int numbers[500]; - - if (c!=3) { - fprintf(stderr,"Syntax: %s file.def file.index\n",files[0]); - exit(1); - } - - def=files[1]; - index=files[2]; - - //Start processing the file - - //Open files - fpd=fopen(def,"rt"); - if (fpd==NULL) { - fprintf(stderr,"Definition file (%s) not found\n",def); - exit(1); - } - fpi=fopen(index,"wb"); - if (fpi==NULL) { - fprintf(stderr,"Index file (%s) not saved\n",index); - fclose(fpd); - exit(1); - } - - //process filename - fgets(filename,sizeof(filename),fpd); - for(i=0,j=0;filename[i];i++) { - if (filename[i]==' ') { - j=14; - continue; - } - if (filename[i]=='\n') break; - filenameaux[j]=filename[i]; - j++; - } - fwrite(filenameaux,1,28,fpi); - - //resd numbers - i=0; - while (!feof(fpd)) { - fgets(filename,sizeof(filename),fpd); - numbers[i]=atoi(filename); - i++; - } - i--; //ignore feof - - i--; //the first number is the type - - //write numbers - fwrite(&i,1,2,fpi); - i++; - fwrite(numbers,i,2,fpi); - - //end files - fclose(fpi); - fclose(fpd); - - exit(0); -} - diff --git a/stuff/data/def/RES_ANIM_COUCH.def b/stuff/data/def/RES_ANIM_COUCH.def deleted file mode 100644 index aa3df9f..0000000 --- a/stuff/data/def/RES_ANIM_COUCH.def +++ /dev/null @@ -1,16 +0,0 @@ -kid.dat -IMG -400 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 diff --git a/stuff/data/def/RES_ANIM_JUMP.def b/stuff/data/def/RES_ANIM_JUMP.def deleted file mode 100644 index 53d86d6..0000000 --- a/stuff/data/def/RES_ANIM_JUMP.def +++ /dev/null @@ -1,22 +0,0 @@ -kid.dat -IMG -400 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 diff --git a/stuff/data/def/RES_ANIM_JUMPRUN.def b/stuff/data/def/RES_ANIM_JUMPRUN.def deleted file mode 100644 index da9a97c..0000000 --- a/stuff/data/def/RES_ANIM_JUMPRUN.def +++ /dev/null @@ -1,14 +0,0 @@ -kid.dat -IMG -400 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 diff --git a/stuff/data/def/RES_ANIM_NORMAL.def b/stuff/data/def/RES_ANIM_NORMAL.def deleted file mode 100644 index 4925171..0000000 --- a/stuff/data/def/RES_ANIM_NORMAL.def +++ /dev/null @@ -1,6 +0,0 @@ -kid.dat -IMG -400 -415 -415 -415 diff --git a/stuff/data/def/RES_ANIM_RUN.def b/stuff/data/def/RES_ANIM_RUN.def deleted file mode 100644 index bbdee82..0000000 --- a/stuff/data/def/RES_ANIM_RUN.def +++ /dev/null @@ -1,11 +0,0 @@ -kid.dat -IMG -400 -407 -408 -409 -410 -411 -412 -413 -414 diff --git a/stuff/data/def/RES_ANIM_RUN_START.def b/stuff/data/def/RES_ANIM_RUN_START.def deleted file mode 100644 index 062588f..0000000 --- a/stuff/data/def/RES_ANIM_RUN_START.def +++ /dev/null @@ -1,9 +0,0 @@ -kid.dat -IMG -400 -401 -402 -403 -404 -405 -406 diff --git a/stuff/data/def/RES_ANIM_RUN_STOP.def b/stuff/data/def/RES_ANIM_RUN_STOP.def deleted file mode 100644 index e7ea0fd..0000000 --- a/stuff/data/def/RES_ANIM_RUN_STOP.def +++ /dev/null @@ -1,7 +0,0 @@ -kid.dat -IMG -400 -465 -466 -467 -468 diff --git a/stuff/data/def/RES_ANIM_RUN_TURN.def b/stuff/data/def/RES_ANIM_RUN_TURN.def deleted file mode 100644 index a5b64c6..0000000 --- a/stuff/data/def/RES_ANIM_RUN_TURN.def +++ /dev/null @@ -1,16 +0,0 @@ -kid.dat -IMG -400 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 diff --git a/stuff/data/def/RES_ANIM_TORCH.def b/stuff/data/def/RES_ANIM_TORCH.def deleted file mode 100644 index 99475d4..0000000 --- a/stuff/data/def/RES_ANIM_TORCH.def +++ /dev/null @@ -1,12 +0,0 @@ -prince.dat -IMG -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 diff --git a/stuff/data/def/RES_ANIM_TURNING.def b/stuff/data/def/RES_ANIM_TURNING.def deleted file mode 100644 index 4ecd5de..0000000 --- a/stuff/data/def/RES_ANIM_TURNING.def +++ /dev/null @@ -1,11 +0,0 @@ -kid.dat -IMG -400 -445 -446 -447 -448 -449 -450 -451 -452 \ No newline at end of file diff --git a/stuff/data/def/RES_ANIM_TURNRUN.def b/stuff/data/def/RES_ANIM_TURNRUN.def deleted file mode 100644 index a5b64c6..0000000 --- a/stuff/data/def/RES_ANIM_TURNRUN.def +++ /dev/null @@ -1,16 +0,0 @@ -kid.dat -IMG -400 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 diff --git a/stuff/data/def/RES_ANIM_WALKING.def b/stuff/data/def/RES_ANIM_WALKING.def deleted file mode 100644 index a21b2e4..0000000 --- a/stuff/data/def/RES_ANIM_WALKING.def +++ /dev/null @@ -1,15 +0,0 @@ -kid.dat -IMG -400 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 \ No newline at end of file diff --git a/stuff/data/def/RES_GUARD_1.def b/stuff/data/def/RES_GUARD_1.def deleted file mode 100644 index bd3f8b2..0000000 --- a/stuff/data/def/RES_GUARD_1.def +++ /dev/null @@ -1,11 +0,0 @@ -prince.dat guard1.dat -IMG_PALETTED -200 -320 -321 -322 -323 -324 -325 -326 -327 diff --git a/stuff/data/def/RES_IMG_BACKGROUND.def b/stuff/data/def/RES_IMG_BACKGROUND.def deleted file mode 100644 index 0227915..0000000 --- a/stuff/data/def/RES_IMG_BACKGROUND.def +++ /dev/null @@ -1,4 +0,0 @@ -pv.dat -IMG -950 -951 diff --git a/stuff/data/def/RES_IMG_ENV_DUNGEON.def b/stuff/data/def/RES_IMG_ENV_DUNGEON.def deleted file mode 100644 index 38e1182..0000000 --- a/stuff/data/def/RES_IMG_ENV_DUNGEON.def +++ /dev/null @@ -1,28 +0,0 @@ -vdungeon.dat -IMG -200 -297 -300 -298 -1327 -1333 -1230 -1231 -241 -242 -243 -269 -270 -271 -272 -273 -274 -235 -296 -236 -347 -348 -349 -350 -351 -232 diff --git a/stuff/data/def/RES_IMG_MAIN_BACKGROUND.def b/stuff/data/def/RES_IMG_MAIN_BACKGROUND.def deleted file mode 100644 index dc352a4..0000000 --- a/stuff/data/def/RES_IMG_MAIN_BACKGROUND.def +++ /dev/null @@ -1,8 +0,0 @@ -title.dat -IMG -50 -51 -52 -53 -54 -55 diff --git a/stuff/data/def/RES_IMG_TEXT_BACKGROUND.def b/stuff/data/def/RES_IMG_TEXT_BACKGROUND.def deleted file mode 100644 index 9c1fcaa..0000000 --- a/stuff/data/def/RES_IMG_TEXT_BACKGROUND.def +++ /dev/null @@ -1,8 +0,0 @@ -title.dat -IMG -40 -41 -42 -43 -44 -45 diff --git a/stuff/data/def/RES_LEVEL_1.def b/stuff/data/def/RES_LEVEL_1.def deleted file mode 100644 index f64851f..0000000 --- a/stuff/data/def/RES_LEVEL_1.def +++ /dev/null @@ -1,3 +0,0 @@ -levels.dat -LVL -2001 diff --git a/stuff/data/makedat b/stuff/data/makedat deleted file mode 100755 index f2e3e89..0000000 --- a/stuff/data/makedat +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash - -#configure colors -NO_COLOR="\033[0m" -LGREEN="\033[01;32m" -LRED="\033[01;31m" - -SDONE="[$LGREEN Done$NO_COLOR ]" -SOK="[$LGREEN OK $NO_COLOR ]" -SFAIL="[$LRED Fail$NO_COLOR ]" - -#setup -numberstart=1 -VARDEFINE="#define" -VARDEFSTART="DATA_START_ITEMS" -VARDEFEND="DATA_END_ITEMS" - -#check for dirs -if [ -d def ] -then - FAIL=0 -else - FAIL=1 - echo "Directory def does not exist" >> error_log -fi - -FILES=`ls def/*.def 2>/dev/null` - -if [ -z "$FILES" -a $FAIL == 0 ] -then - FAIL=1 - echo "Directory def does not contain information" >> error_log -fi - -#initializes output files -number=$numberstart -mkdir -p result -mkdir -p proc -mkdir -p index -mkdir -p xml -echo -n "Generating header and xml files " -cp -f result/data.h result/data.h.bak 2>/dev/null >/dev/null -echo -e "/* data.h: Auto generated file header for resources */\n">result/data.h -cat xml/gen1.xml > xml/resources.xml - -#process and add all definitions to the xml and h files -if [ $FAIL == 0 ] -then - for definition in def/*.def - do - #define variables and convert the resource type - definition=`echo $definition|sed -e "s/def\/\(.*\)\.def/\1/g"` - FDEF="def/$definition.def" - FPROC="proc/$definition.p" - FINDEX="index/$definition.index" - TYPE=`sed -e '1,1d' -e '3,$d' $FDEF` - LINEX="^$VARDEFINE RES_TYPE_$TYPE \([0-9]*\)\$" - ID=`grep -e "$LINEX" result/types.h|sed -e "s/$LINEX/\1/g"` - - if [ -z "$ID" ] - then - FAIL=1 - echo "Invalid type $TYPE in $FDEF" >> error_log - fi - - #convert def files to proc files - #process images - grep -q -e '^IMG$' $FDEF - if [ $? == 0 ] - then - sed -e '2,$d' $FDEF > $FPROC - PAL=`sed -e '1,2d' -e '4,$d' $FDEF` - echo -n -e "$ID\n$PAL\n" >> $FPROC - sed -e '1,3d' $FDEF|while read frameline - do - frame=`echo "$frameline" | sed -e 's/^\([0-9]*\).*$/\1/g'` - #bottom=`echo "$frameline" | sed -e 's/^.* [Bb]:\([0-9]*\).*$/\1/g' -e "s/^$frameline\$/0/g"` - #left=`echo "$frameline" | sed -e 's/^.* [Ll]:\([0-9]*\).*$/\1/g' -e "s/^$frameline\$/0/g"` - #right=`echo "$frameline" | sed -e 's/^.* [Rr]:\([0-9]*\).*$/\1/g' -e "s/^$frameline\$/0/g"` - #echo -n -e "$frame\n$bottom\n$left\n$right\n">>$FPROC - echo -n -e "$frame\n">>$FPROC - done - else - sed -e "2,1s/.*/$ID/g" $FDEF > $FPROC - fi - - #convert proc files to index files - bin/makeindex $FPROC $FINDEX - - #add logs - echo " <item value=\"$number\" path=\"$definition.index\">$definition</item>" >> xml/resources.xml - echo "$VARDEFINE $definition $number" >> result/data.h - - number=`expr $number + 1` - done -fi - -#finish files -cat xml/gen2.xml >> xml/resources.xml -echo -e "\n$VARDEFINE $VARDEFSTART $numberstart\n$VARDEFINE $VARDEFEND $number" >> result/data.h -if [ $FAIL == 1 ] -then - echo -e "$SFAIL" -else - echo -e "$SOK" - - #generate the dat file using the proceced indexes and the xml file - echo -n "Generating dat file " - bin/pr --import=index --force --backup=bak --resource=xml/resources.xml result 2>/dev/null >/dev/null - FAIL=$? - if [ $FAIL == 0 ] ; then - echo -e "$SOK" - else - echo "PR error number $FAIL" >> error_log - echo -e "$SFAIL" - fi -fi - -#print errors and exit -if [ $FAIL != 0 ] -then - echo -e "\nPlease correct the following errors:\n" - cat error_log > /dev/stderr - rm error_log -fi - - diff --git a/stuff/data/result/.cvsignore b/stuff/data/result/.cvsignore deleted file mode 100644 index 20d524f..0000000 --- a/stuff/data/result/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -data.h -data.h.bak -main.dat -main.dat.bak diff --git a/stuff/data/result/types.h b/stuff/data/result/types.h deleted file mode 100644 index f766930..0000000 --- a/stuff/data/result/types.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Defined types for freeprince resources*/ - -#define RES_TYPE_IMG 0 -#define RES_TYPE_IMG_PALETTED 1 -#define RES_TYPE_SND_MIDI 4 -#define RES_TYPE_SND_WAVE 5 -#define RES_TYPE_LVL 6 diff --git a/stuff/data/type b/stuff/data/type deleted file mode 100755 index 952fb15..0000000 --- a/stuff/data/type +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -case "$1" in - add) - if [ -z "$2" ] - then - echo "Please add a type name" - exit 1 - fi - MAX=`grep "#define RES_TYPE" result/types.h | sed -e "s/#define RES_TYPE.* \([0-9]*\)/\1/g" | awk 'BEGIN {c=-1} {c=(c>$1)?c:$1} END {printf "%d\n",c+1}'` - echo "#define RES_TYPE_$2 $MAX" >> result/types.h - echo "Added define $2 with value $MAX" - exit 0 - ;; - del) - if [ -z "$2" ] - then - echo "Please add a type name to delete" - exit 1 - fi - - MATCH=`grep -c "#define RES_TYPE_$2" result/types.h` - if [ $MATCH != 1 ] - then - echo "There are $MATCH matches, try another pattern" - exit 1 - fi - cat result/types.h | grep -v "#define RES_TYPE_$2" > result/types.h - echo "Define removed" - exit 0 - ;; - list) - grep '#define' result/types.h|sed 's/#define RES_TYPE_\(.*\) [0-9]*$/\1/g'|sort - exit 0 - ;; - ren) - . $0 del $2 - . $0 add $1 - exit 0 - ;; - *) - echo "Usage: $0 {list|add|del|ren|help}" - exit 1 - ;; -esac - diff --git a/stuff/data/xml/.cvsignore b/stuff/data/xml/.cvsignore deleted file mode 100644 index 27970e6..0000000 --- a/stuff/data/xml/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -resources.xml diff --git a/stuff/data/xml/gen1.xml b/stuff/data/xml/gen1.xml deleted file mode 100644 index b6f4a8c..0000000 --- a/stuff/data/xml/gen1.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" ?> -<!DOCTYPE note SYSTEM "http://www.princed.com.ar/standrds/xml/resources/std1.dtd"> -<!-- - Princed V3 - Prince of Persia Level Editor for PC Version - Copyright (C) 2003 Princed Development Team - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - The authors of this program may be contacted at http://forum.princed.com.ar ---> - -<!-- -resources.xml: Princed Resources : Resource tree - - Copyright 2004 Princed Development Team - Created: 04 Jun 2004 - - Author: Enrique Calot (ecalot@users.sourceforge.net) - Version: 0.1 (2004-Jun-13) - - Note: - DO NOT remove this copyright notice ---> - -<resources version="0.1"> - <folder name="resource information" itemtype="binary" file="main.dat"> diff --git a/stuff/data/xml/gen2.xml b/stuff/data/xml/gen2.xml deleted file mode 100644 index 4ea6204..0000000 --- a/stuff/data/xml/gen2.xml +++ /dev/null @@ -1,56 +0,0 @@ - </folder> -</resources> - -<!-- -File Format: - -Attributes: - resources: - o version: the version of the file (mandatory) - folder: - o type (inheritable): the type of the folder - * game - * none - o itemtype (inheritable): the type of the items below (if not specified) - * autodetect - * level - * image - * wave - * midi - * binary - * palette - * pcspeaker - * information - * (...): extensible - Note: - - See PR readme for details on item types - - If no type is provided, PR will try to autodetect it - o palette (inheritable): - * number: the palette ID associated to the images in this folder if applicable - * "monochrome": this means the image has a black and white monochrome palette - Notes: - - the palette attribute will be ignored in resources other than images. - - if the number value is not a valid palette, the image will be extracted in other - palette from the file or a random generated palette. - o name (not inheritable): the name of the folder - o desc (not inheritable): a description - o path (partially inheritable): a path where the folder is extracted to. - Contained items will inherit this path. There must be only one path per item. - If missing PR will use unknown/(filename)/(type desc)(item id).(type extension) - o file (inheritable): the file where the item is located - item: - o value: the item ID (mandatory) - o file: see itemtype file (mandatory but may be inherited from a folder) - o itemtype: see folder itemtype. May be inherited, omissions means autodetect - o palette: see folder palette. Mandatory for image types but may be inherited, - when omited a ramdom palette will be used. - o desc: a description - o path: the name of the file it will be extracted - o number or levelnumber: an additional resource or level number - -Distributed versions if this file are read only and MUST have the GPL header, -if you want to help please contact us in www.princed.com.ar. Find DTDs in the -princed home page. - ---> -