| version 1.2 | | version 1.3 |
|---|
| | |
| * Functions to save/restore game state. | | * Functions to save/restore game state. |
| * | | * |
| * $Log$ | | * $Log$ |
| | | * Revision 1.3 1999/11/20 10:05:18 donut |
| | | * variable size menu patch from Jan Bobrowski. Variable menu font size support and a bunch of fixes for menus that didn't work quite right, by me (MPM). |
| | | * |
| * Revision 1.2 1999/06/14 23:44:12 donut | | * Revision 1.2 1999/06/14 23:44:12 donut |
| * Orulz' svgalib/ggi/noerror patches. | | * Orulz' svgalib/ggi/noerror patches. |
| * | | * |
| | |
| //added 6/15/99 - Owen Evans | | //added 6/15/99 - Owen Evans |
| #include "strutil.h" | | #include "strutil.h" |
| //end added | | //end added |
| | | #include "gamefont.h" |
| | | |
| | | |
| #ifndef SHAREWARE | | #ifndef SHAREWARE |
| | |
| // sc_last_item = citem; | | // sc_last_item = citem; |
| if ( citem > 0 ) { | | if ( citem > 0 ) { |
| if ( sc_bmp[citem-1] ) { | | if ( sc_bmp[citem-1] ) { |
| gr_set_current_canvas( NULL ); | | // gr_set_current_canvas( NULL ); |
| | | if (SWIDTH>320 || SHEIGHT>200){ |
| | | grs_canvas *tmp,*old; |
| | | int w; |
| | | old=grd_curcanv; |
| | | w=SWIDTH/(320.0/THUMBNAIL_W); |
| | | tmp=gr_create_sub_canvas(grd_curcanv, (grd_curcanv->cv_bitmap.bm_w-w)/2, |
| | | items[0].y-5, w, SHEIGHT/(200.0/sc_bmp[citem-1]->bm_h)); |
| | | gr_set_current_canvas(tmp); |
| | | show_fullscr( sc_bmp[citem-1] ); |
| | | // gr_set_current_canvas(NULL); |
| | | gr_set_current_canvas(old); |
| | | gr_free_sub_canvas(tmp); |
| | | }else |
| gr_bitmap( (grd_curcanv->cv_bitmap.bm_w-THUMBNAIL_W)/2,items[0].y-5, sc_bmp[citem-1] ); | | gr_bitmap( (grd_curcanv->cv_bitmap.bm_w-THUMBNAIL_W)/2,items[0].y-5, sc_bmp[citem-1] ); |
| } | | } |
| } | | } |
| | |
| char filename[NUM_SAVES][20]; | | char filename[NUM_SAVES][20]; |
| char desc[NUM_SAVES][DESC_LENGTH + 16]; | | char desc[NUM_SAVES][DESC_LENGTH + 16]; |
| char id[5]; | | char id[5]; |
| | | char thumbnailtext[15]; |
| int valid; | | int valid; |
| | | |
| nsaves=0; | | nsaves=0; |
| m[0].type = NM_TYPE_TEXT; m[0].text = "\n\n\n\n"; | | m[0].type = NM_TYPE_TEXT; |
| | | { |
| | | int w,h,h2,aw; |
| | | grd_curcanv->cv_font = Gamefonts[GFONT_MEDIUM_1]; |
| | | gr_get_string_size("\n",&w,&h,&aw); |
| | | gr_get_string_size("\n\n",&w,&h2,&aw);//adding successive newlines increases less than the size of a single |
| | | h2=h2-h; |
| | | aw=(SHEIGHT/(200.0/THUMBNAIL_H)-h)/h2+1; |
| | | if (aw>=14) Error("state_get_restore_file: aw too big\n"); |
| | | memset(thumbnailtext,'\n',aw); |
| | | thumbnailtext[aw]=0; |
| | | m[0].text = thumbnailtext; |
| | | } |
| for (i=0;i<NUM_SAVES; i++ ) { | | for (i=0;i<NUM_SAVES; i++ ) { |
| sc_bmp[i] = NULL; | | sc_bmp[i] = NULL; |
| if (!multi) | | if (!multi) |