Skip to content

Commit 1c7bc80

Browse files
author
bagheadspidey
committed
test
1 parent ec7dabd commit 1c7bc80

File tree

11 files changed

+108
-145
lines changed

11 files changed

+108
-145
lines changed

build-linux.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
echo building unwad
55

66
cd include/minizip
7-
./build.sh
7+
gcc -c \
8+
-Dunix=1 \
9+
minizip.c miniunz.c zip.c unzip.c ioapi.c
810
cd ../..
911

1012
g++ -Wall \
@@ -16,5 +18,17 @@ include/minizip/minizip.o include/minizip/ioapi.o include/minizip/zip.o include/
1618

1719
strip unwad
1820

21+
echo building unwad.static
22+
23+
g++ -Wall \
24+
-I./include/pngpp -I./include \
25+
unwad.cpp qmus2mid.cpp \
26+
include/minizip/minizip.o include/minizip/ioapi.o include/minizip/zip.o include/minizip/unzip.o \
27+
/usr/lib/libmagic.a /usr/lib/libpng.a /usr/lib/libz.a \
28+
-o unwad.static
29+
30+
strip unwad.static
31+
1932
cd include/minizip
20-
rm *.o
33+
rm *.o
34+
cd ../..

build.bat

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
g++ -Wall -DMSW=1 unwad.cpp qmus2mid.cpp -I./include -I./include/pngpp -Ldll -lmagic1 -lzlib1 -lregex2 -llibpng13 -o unwad.exe
1+
echo X X
2+
echo X X
3+
echo X Warning: this batch file has not been tested. X
4+
echo X X
5+
echo X X
6+
7+
g++ filechars.cpp -o filechars.exe
8+
filechars readme.txt
9+
del filechars.exe
10+
11+
cd include\minizip
12+
gcc -c -DWIN32=1 -I.\include -I.. minizip.c miniunz.c zip.c unzip.c iowin32.c ioapi.c
13+
cd ..\..
14+
15+
g++ -Wall -DMSW=1 unwad.cpp qmus2mid.cpp -I./include -I./include/pngpp -Ldll -lmagic1 -lzlib1 -lregex2 -llibpng13 -o unwad.exe
16+
17+
cd include\minizip
18+
del *.o
19+
cd ..\..

build.sh

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
11

22
# build for linux and windows
33

4-
gcc -lstdc++ filechars.cpp -o filechars
4+
echo converting text files
5+
6+
g++ filechars.cpp -o filechars
57
./filechars readme.txt
68
rm filechars
79

810
./build-linux.sh
911

10-
./cross-compile.sh
12+
./cross-compile.sh
13+
14+
rm *.txt.h
15+
16+
echo preparing release packages
17+
18+
mkdir release/l; mkdir release/w
19+
export l=./release/l/unwad/
20+
export w=./release/w/unwad/
21+
mkdir $l; mkdir $w
22+
mkdir $l/magic; mkdir $w/magic
23+
cp magic/* $l/magic; cp magic/* $w/magic
24+
cp *.txt $l; cp *.txt $w
25+
mv unwad.static $l/unwad
26+
mv unwad.exe $w; cp *.dll $w
27+
28+
cd ./release/l/
29+
rm ../linux/unwad.tar.gz
30+
tar -cvvf ../linux/unwad.tar unwad/
31+
gzip ../linux/unwad.tar
32+
33+
cd ../w/
34+
rm ../windows/unwad.zip
35+
zip -r ../windows/unwad.zip unwad/
36+
37+
cd ../.. ; rm -r release/l; rm -r release/w

cross-compile.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
echo cross-compiling unwad.exe for windows
55

66
cd include/minizip
7-
./cross-compile.sh
7+
i586-mingw32msvc-gcc -c \
8+
-DWIN32=1 \
9+
-I./include -I.. \
10+
minizip.c miniunz.c zip.c unzip.c iowin32.c ioapi.c
811
cd ../..
912

1013
i586-mingw32msvc-g++ -Wall \
@@ -20,4 +23,5 @@ include/minizip/minizip.o include/minizip/ioapi.o include/minizip/iowin32.o incl
2023
i586-mingw32msvc-strip unwad.exe
2124

2225
cd include/minizip
23-
rm *.o
26+
rm *.o
27+
cd ../..

filechars.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
#include <vector>
44
#include <string>
5-
#include <fstream>
65
#include <sstream>
6+
#include <fstream>
77

88
using namespace std;
99

10-
// escape control chars and wrap with quotes
10+
// escape special chars and add line breaks
1111
string prepareLine(string instr)
1212
{
1313
stringstream ss("");
@@ -32,7 +32,6 @@ string cleanFileName(char *fn)
3232
return ss.str();
3333
}
3434

35-
// write string declaration given a variable name
3635
string header(string varname)
3736
{
3837
return "const char *" + varname + " = \"\\\n";
@@ -68,8 +67,8 @@ int main(int argc,char **argv)
6867
}
6968
catch (exception const &error)
7069
{
71-
printf("%s: exception: %s \n",argv[0], error.what());
72-
return EXIT_FAILURE;
70+
printf("%s: exception: %s \n",argv[0], error.what());
71+
return EXIT_FAILURE;
7372
}
7473
return EXIT_SUCCESS;
7574
}

readme.txt

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,28 @@ unwad [options] <wad> [<wad2> ...]
5959
-g N is interpreted as a replacement in the form of
6060
s/((.{N}).*)/\2/\1 where N is a one-digit integer.
6161

62-
-w Convert sounds to WAV format instead of FLAC.
63-
(not implemented)
64-
65-
Operations that deal with lump names occur in the same order as the
66-
options are listed. For example:
67-
68-
* If you don't use the -u option (uppercase), any regex should look for
69-
lower-case lump names.
62+
-i <F> Convert images to format F. F can be one of either
63+
"png" or "raw" (without the quotes). Default image
64+
format is png.
65+
(planned feature, not implemented yet)
66+
67+
-n <F> Convert sounds to format F. F can be one of either
68+
"wav", "au", or "raw" (without the quotes). Default
69+
sound format is wav.
70+
(planned feature, not implemented yet)
71+
72+
-m <F> Convert music to format F. F can be one of either
73+
"mid" or "raw" (without the quotes). Default music
74+
format is mid.
75+
(planned feature, not implemented yet)
76+
77+
--raw Don't do any conversion (same as -i raw -n raw -m raw).
78+
Subsequent -i, -n, or -m arguments will override --raw
79+
for that lump type.
80+
(planned feature, not implemented yet)
81+
82+
All regular expressions are case-insensitive. Operations that deal with
83+
lump names occur in the same order as the options are listed.
7084

7185
* If you use both -f and -r, -f should look for lump names as they
7286
would appear before being renamed by -r.
@@ -94,15 +108,20 @@ should all be escaped so the command line doesn't eat them.
94108

95109
Example usage:
96110

111+
# extract all lumps from DOOM2.WAD
112+
unwad DOOM2.WAD
113+
114+
# extract the PLAYPAL lump from DOOM2.WAD
115+
unwad -f a/playpal DOOM2.WAD
116+
97117
# extract all lumps from mypwad.wad, using palette file "playpal.lump"
98118
unwad -p playpal.lump mypwad.wad
99119

100120
# extract all archvile sprites and noises from DOOM2.WAD
101121
unwad -t sn -f n/dsvi -f s/vile DOOM2.WAD
102122

103-
# export all rock and slime flats from DOOM2.WAD
104-
# (notice you must escape the pipe character so the command line
105-
# doesn't eat it!)
123+
# export all rock and slime flats from DOOM2.WAD. Notice the escape
124+
# character (back slash) before '|'.
106125
unwad -t f -f f/rock\|slime DOOM2.WAD
107126

108127
# extract all sprites and noises from HERETIC.WAD, renaming sprites
@@ -112,4 +131,4 @@ Example usage:
112131

113132
# extract all lumps from DOOM2.WAD, leaving lump names in upper-case,
114133
# ignoring unknown lumps beginning with "DP" (pc speaker sounds)
115-
unwad -u -f u/!^DP DOOM2.WAD
134+
unwad -u -f u/!^dp DOOM2.WAD

readme.txt.h

Lines changed: 0 additions & 118 deletions
This file was deleted.

release/linux/unwad.tar.gz

288 KB
Binary file not shown.

release/windows/unwad.zip

643 KB
Binary file not shown.

unwad

3.07 KB
Binary file not shown.

0 commit comments

Comments
 (0)