diff options
Diffstat (limited to 'Xenogears/script-comp.cpp')
-rw-r--r-- | Xenogears/script-comp.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Xenogears/script-comp.cpp b/Xenogears/script-comp.cpp index 76eab1d..9f8520c 100644 --- a/Xenogears/script-comp.cpp +++ b/Xenogears/script-comp.cpp @@ -17,7 +17,7 @@ void process_one_file(Handle * f, Handle * d, int n) { char zeros[4] = {0, 0, 0, 0}, * datas; long script_position, true_length, delta, data_length; Handle * f_part; - + char tmpNm[256]; printm(M_BARE, " Copying header\n"); f->seek(0x14c); @@ -34,14 +34,16 @@ void process_one_file(Handle * f, Handle * d, int n) { datas = (char *) malloc(data_length); f->read(datas, data_length); - printm(M_BARE, " Processing script\n"); - nom_du_fichier = String("xeno_d1/ROOMS/") + n + "/script.comp"; + printm(M_BARE, " Processing script\n");
+ char tmpNm[256];
+ sprintf(tmpNm,"xeno_d1/ROOMS/%04d/script.comp",n); + nom_du_fichier = String(tmpNm); f_part = new Input(nom_du_fichier); true_length = f_part->GetSize(); - script_position = d->seek(0); - d->seek(0x14c); + script_position = d->tell();
+ d->seek(0x14c); d->write(&script_position, 4); d->seek(0x128); d->write(&true_length, 4); @@ -59,9 +61,9 @@ void process_one_file(Handle * f, Handle * d, int n) { printm(M_BARE, " Processing extra datas\n"); script_position = d->tell(); d->seek(0x150); - d->write(&script_position, 4); - d->seek(0); - + d->write(&script_position, 4);
+
+ d->seek(0,SEEK_END); d->write(datas, data_length); free(datas); @@ -74,7 +76,7 @@ virtual int startup() throw (GeneralException) int num = 0; String nom_du_fichier; - for (i = 384; i < 1844; i = i + 2) { + for (i = 384; i < 1844; i = i + 2) {
printm(M_BARE, "CD1 - File %d -> Script %d\n", i, num); nom_du_fichier.set("xeno_d1/ROOMS/%04d.out", i); f_script_comp = new Input(nom_du_fichier); @@ -88,7 +90,7 @@ virtual int startup() throw (GeneralException) num++; } num = 0; - + /* for (i = 379; i < 1838; i = i + 2) { printm(M_BARE, "CD2 - File %d -> Script %d\n", i, num); @@ -102,7 +104,7 @@ virtual int startup() throw (GeneralException) delete f_script_comp; delete f_new_script; num++; - } + }*/ printm(M_BARE, "Done !\n"); return 0; |