[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.321,1.322 simon.h,1.96,1.97
Travis Howell
kirben at users.sourceforge.net
Wed Oct 22 03:01:02 CEST 2003
Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1:/tmp/cvs-serv2622/simon
Modified Files:
simon.cpp simon.h
Log Message:
Add load/save game failture messages from original games.
Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.321
retrieving revision 1.322
diff -u -d -r1.321 -r1.322
--- simon.cpp 21 Oct 2003 11:45:46 -0000 1.321
+++ simon.cpp 22 Oct 2003 09:17:31 -0000 1.322
@@ -2829,10 +2829,10 @@
// do_save
if (!save_game(_saveload_row_curpos + unk132_result, buf + unk132_result * 18))
- warning("Save failed");
+ o_file_error(_fcs_ptr_array_3[5], true);
} else {
if (!load_game(_saveload_row_curpos + i))
- warning("Load failed");
+ o_file_error(_fcs_ptr_array_3[5], false);
}
get_out:;
@@ -2856,6 +2856,56 @@
}
#endif
+}
+
+void SimonEngine::o_file_error(FillOrCopyStruct *fcs, bool save_error) {
+ HitArea *ha;
+ char *string, *string2;
+
+ if (save_error) {
+ string = "\r Save failed.";
+ string2 = "\r Disk error.";
+ } else {
+ string = "\r Load failed.";
+ string2 = "\r File not found.";
+ }
+
+ video_putchar(fcs, 0xC);
+ for (; *string; string++)
+ video_putchar(fcs, *string);
+ for (; *string2; string2++)
+ video_putchar(fcs, *string2);
+
+ fcs->textColumn = (fcs->width >> 1) - 3;
+ fcs->textRow = fcs->height - 1; //height
+ fcs->textLength = 0; // left allign
+
+ string = "[ OK ]";
+ for (; *string; string++)
+ video_putchar(fcs, *string);
+
+ ha = findEmptyHitArea();
+ ha->x = (fcs->width >> 1) + fcs->x - 3 << 3;
+ ha->y = (fcs->height << 3) + fcs->y - 8;
+ ha->width = 48;
+ ha->height = 8;
+ ha->flags = 0x20;
+ ha->id = 0x7FFF;
+ ha->layer = 0x3EF;
+
+loop:;
+ _last_hitarea = _last_hitarea_3 = 0;
+
+ do {
+ delay(1);
+ } while (_last_hitarea_3 == 0);
+
+ ha = _last_hitarea;
+ if (ha == NULL || ha->id != 0x7FFF)
+ goto loop;
+
+ // Return
+ delete_hitarea(0x7FFF);
}
void SimonEngine::o_wait_for_vga(uint a) {
Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- simon.h 21 Oct 2003 11:45:46 -0000 1.96
+++ simon.h 22 Oct 2003 09:17:31 -0000 1.97
@@ -790,6 +790,7 @@
int o_unk_132_helper(bool *b, char *buf);
void o_clear_character(FillOrCopyStruct *fcs, int x, byte b = 0);
void savegame_dialog(char *buf);
+ void o_file_error(FillOrCopyStruct *fcs, bool save_error);
int count_savegames();
int display_savegame_list(int curpos, bool load, char *dst);
More information about the Scummvm-git-logs
mailing list