diff options
Diffstat (limited to 'PE/rebuildmenus.cpp')
-rw-r--r-- | PE/rebuildmenus.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/PE/rebuildmenus.cpp b/PE/rebuildmenus.cpp new file mode 100644 index 0000000..76b3e97 --- /dev/null +++ b/PE/rebuildmenus.cpp @@ -0,0 +1,67 @@ +#include <Main.h> +#include <Input.h> +#include <Output.h> + +CODE_BEGINS +virtual int startup(void) throw (GeneralException) { + int i, p; + Handle * inter = new Output("concat.out"); + Handle * f, * out; + String fname; + + inter->writeU32(4); + + for (i = 0; i < 4; i++) { + inter->writeU32(0); + } + + for (i = 0; i < 4; i++) { + fname = "menus" + String(i) + ".out"; + f = new Input(fname); + + p = inter->tell(); + + inter->seek(i * 4 + 4); + inter->writeU32(p); + inter->seek(0, SEEK_END); + + copy(f, inter); + + delete f; + } + + delete inter; + + out = new Output("menus.bin"); + out->writeU32(11); + + for (i = 0; i < 11; i++) { + out->writeU32(0); + } + + for (i = 0; i < 11; i++) { + if (i == 0) { + fname = "concat.out"; + } else if (i < 10) { + fname = "../../various/0001/0" + String(i) + ".out"; + } else { + fname = "../../various/0001/10.out"; + } + f = new Input(fname); + + p = out->tell(); + + out->seek(i * 4 + 4); + out->writeU32(p); + out->seek(0, SEEK_END); + + copy(f, out); + + delete f; + } + + delete out; + + return 0; +} +CODE_ENDS |