get rid canal_p really silly code (that was encode/decode game data !)
svn-id: r30994
This commit is contained in:
parent
61f7594866
commit
57be6b5a2e
2 changed files with 3 additions and 47 deletions
|
@ -1410,13 +1410,13 @@ void DrasculaEngine::para_cargar(char nom_game[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *getLine(Common::File *fp, char *buf, int len) {
|
static char *getLine(Common::File *fp, char *buf, int len) {
|
||||||
int c;
|
byte c;
|
||||||
char *b;
|
char *b;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
b = buf;
|
b = buf;
|
||||||
while (!fp->eos()) {
|
while (!fp->eos()) {
|
||||||
c = fp->readByte() ^ 0xff;
|
c = ~fp->readByte();
|
||||||
if (c == '\r')
|
if (c == '\r')
|
||||||
continue;
|
continue;
|
||||||
if (c == '\n')
|
if (c == '\n')
|
||||||
|
@ -1444,7 +1444,6 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
|
||||||
hay_nombre = 0;
|
hay_nombre = 0;
|
||||||
|
|
||||||
strcpy(para_codificar, nom_fich);
|
strcpy(para_codificar, nom_fich);
|
||||||
canal_p(para_codificar);
|
|
||||||
strcpy(datos_actuales, nom_fich);
|
strcpy(datos_actuales, nom_fich);
|
||||||
|
|
||||||
buffer_teclado();
|
buffer_teclado();
|
||||||
|
@ -1455,7 +1454,6 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
|
||||||
error("missing data file");
|
error("missing data file");
|
||||||
}
|
}
|
||||||
int size = ald->size();
|
int size = ald->size();
|
||||||
|
|
||||||
getLine(ald, buffer, size);
|
getLine(ald, buffer, size);
|
||||||
sscanf(buffer, "%s", num_room);
|
sscanf(buffer, "%s", num_room);
|
||||||
strcat(num_room, ".alg");
|
strcat(num_room, ".alg");
|
||||||
|
@ -1561,7 +1559,6 @@ martini:
|
||||||
}
|
}
|
||||||
delete ald;
|
delete ald;
|
||||||
ald = NULL;
|
ald = NULL;
|
||||||
canal_p(para_codificar);
|
|
||||||
|
|
||||||
if (num_ejec == 2) {
|
if (num_ejec == 2) {
|
||||||
if (martin == 0) {
|
if (martin == 0) {
|
||||||
|
@ -3461,14 +3458,12 @@ void DrasculaEngine::carga_partida(const char *nom_game) {
|
||||||
int l, n_ejec2;
|
int l, n_ejec2;
|
||||||
Common::InSaveFile *sav;
|
Common::InSaveFile *sav;
|
||||||
|
|
||||||
canal_p(nom_game);
|
if (!(sav = _saveFileMan->openForLoading(nom_game))) {
|
||||||
if (!(sav = _saveFileMan->openForLoading("nom_game"))) {
|
|
||||||
error("missing savegame file");
|
error("missing savegame file");
|
||||||
}
|
}
|
||||||
|
|
||||||
n_ejec2 = sav->readSint32LE();
|
n_ejec2 = sav->readSint32LE();
|
||||||
if (n_ejec2 != num_ejec) {
|
if (n_ejec2 != num_ejec) {
|
||||||
canal_p(nom_game);
|
|
||||||
strcpy(nom_partida, nom_game);
|
strcpy(nom_partida, nom_game);
|
||||||
error("TODO");
|
error("TODO");
|
||||||
salir_al_dos(n_ejec2);
|
salir_al_dos(n_ejec2);
|
||||||
|
@ -3488,41 +3483,6 @@ void DrasculaEngine::carga_partida(const char *nom_game) {
|
||||||
|
|
||||||
lleva_objeto = sav->readSint32LE();
|
lleva_objeto = sav->readSint32LE();
|
||||||
objeto_que_lleva = sav->readSint32LE();
|
objeto_que_lleva = sav->readSint32LE();
|
||||||
|
|
||||||
canal_p(nom_game);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DrasculaEngine::canal_p(const char *fich){
|
|
||||||
return;
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
Common::File ald2, ald3;
|
|
||||||
|
|
||||||
char fich2[13];
|
|
||||||
char car;
|
|
||||||
|
|
||||||
strcpy(fich2, "top");
|
|
||||||
|
|
||||||
ald3.open(fich);
|
|
||||||
if (!ald3.isOpen()) {
|
|
||||||
error("no puedo abrir el archivo codificado");
|
|
||||||
}
|
|
||||||
|
|
||||||
ald2.open(fich2, Common::File::kFileWriteMode);
|
|
||||||
if (!ald2.isOpen()) {
|
|
||||||
error("no puedo abrir el archivo destino");
|
|
||||||
}
|
|
||||||
|
|
||||||
car = ald3.readByte();
|
|
||||||
while (!ald3.eos()) {
|
|
||||||
ald2.writeByte(codifica(car));
|
|
||||||
car = ald3.readByte();
|
|
||||||
}
|
|
||||||
|
|
||||||
ald2.close();
|
|
||||||
ald3.close();
|
|
||||||
//remove(fich); // FIXME: Not portable
|
|
||||||
//rename(fich2, fich); // FIXME: Not portable
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::puertas_cerradas(int l) {
|
void DrasculaEngine::puertas_cerradas(int l) {
|
||||||
|
@ -5177,7 +5137,6 @@ void DrasculaEngine::graba_partida(char nom_game[]) {
|
||||||
warning("Can't write file '%s'. (Disk full?)", nom_game);
|
warning("Can't write file '%s'. (Disk full?)", nom_game);
|
||||||
|
|
||||||
delete out;
|
delete out;
|
||||||
canal_p(nom_game);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::aumenta_num_frame() {
|
void DrasculaEngine::aumenta_num_frame() {
|
||||||
|
@ -5450,7 +5409,6 @@ void DrasculaEngine::conversa(const char *nom_fich) {
|
||||||
rompo_y_salgo = 0;
|
rompo_y_salgo = 0;
|
||||||
|
|
||||||
strcpy(para_codificar, nom_fich);
|
strcpy(para_codificar, nom_fich);
|
||||||
canal_p(para_codificar);
|
|
||||||
|
|
||||||
if (num_ejec == 5)
|
if (num_ejec == 5)
|
||||||
sin_verbo();
|
sin_verbo();
|
||||||
|
@ -5486,7 +5444,6 @@ void DrasculaEngine::conversa(const char *nom_fich) {
|
||||||
sscanf(buffer, "%d", &respuesta3);
|
sscanf(buffer, "%d", &respuesta3);
|
||||||
delete ald;
|
delete ald;
|
||||||
ald = NULL;
|
ald = NULL;
|
||||||
canal_p(para_codificar);
|
|
||||||
|
|
||||||
if (num_ejec == 2 && !strcmp(nom_fich, "op_5.cal") && flags[38] == 1 && flags[33] == 1) {
|
if (num_ejec == 2 && !strcmp(nom_fich, "op_5.cal") && flags[38] == 1 && flags[33] == 1) {
|
||||||
strcpy(frase3, TEXT405);
|
strcpy(frase3, TEXT405);
|
||||||
|
|
|
@ -625,7 +625,6 @@ public:
|
||||||
int music_status();
|
int music_status();
|
||||||
void refresca_pantalla();
|
void refresca_pantalla();
|
||||||
void carga_partida(const char *);
|
void carga_partida(const char *);
|
||||||
void canal_p(const char *);
|
|
||||||
void puertas_cerradas(int);
|
void puertas_cerradas(int);
|
||||||
void animafin_sound_corte();
|
void animafin_sound_corte();
|
||||||
void color_hare();
|
void color_hare();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue