| version 1.3 | | version 1.4 |
|---|
| | |
| * Routines to display title screens... | | * Routines to display title screens... |
| * | | * |
| * $Log$ | | * $Log$ |
| | | * Revision 1.4 1999/11/20 10:05:19 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.3 1999/10/18 03:20:47 donut | | * Revision 1.3 1999/10/18 03:20:47 donut |
| * fixed load_screen_text() to work with briefings with no extension | | * fixed load_screen_text() to work with briefings with no extension |
| * | | * |
| | |
| int Current_color = 0; | | int Current_color = 0; |
| int Erase_color; | | int Erase_color; |
| | | |
| | | // added by Jan Bobrowski for variable-size menu screen |
| | | static int rescale_x(int x) |
| | | { |
| | | return x * GWIDTH / 320; |
| | | } |
| | | |
| | | static int rescale_y(int y) |
| | | { |
| | | return y * GHEIGHT / 200; |
| | | } |
| | | |
| int local_key_inkey(void) | | int local_key_inkey(void) |
| { | | { |
| int rval; | | int rval; |
| | |
| gr_palette_clear(); | | gr_palette_clear(); |
| #endif | | #endif |
| gr_set_current_canvas( NULL ); | | gr_set_current_canvas( NULL ); |
| gr_bitmap( 0, 0, &title_bm ); | | show_fullscr(&title_bm); |
| //added on 9/13/98 by adb to make update-needing arch's work | | //added on 9/13/98 by adb to make update-needing arch's work |
| gr_update(); | | gr_update(); |
| //end addition - adb | | //end addition - adb |
| | |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| void init_spinning_robot(void) | | void init_spinning_robot(void) |
| { | | { |
| Robot_angles.p += 0; | | // Robot_angles.p += 0; |
| Robot_angles.b += 0; | | // Robot_angles.b += 0; |
| Robot_angles.h += 0; | | // Robot_angles.h += 0; |
| | | |
| | | int x = rescale_x(138); |
| | | int y = rescale_y(55); |
| | | int w = rescale_x(166); |
| | | int h = rescale_y(138); |
| | | |
| Robot_canv = gr_create_sub_canvas(grd_curcanv, 138, 55, 166, 138); | | Robot_canv = gr_create_sub_canvas(grd_curcanv, x, y, w, h); |
| } | | } |
| | | |
| // ----------------------------------------------------------------------------- | | // ----------------------------------------------------------------------------- |
| | |
| { | | { |
| int pcx_error; | | int pcx_error; |
| | | |
| if ((pcx_error=pcx_read_bitmap( Briefing_screens[screen_num].bs_name, &grd_curcanv->cv_bitmap, grd_curcanv->cv_bitmap.bm_type, New_pal ))!=PCX_ERROR_NONE) { | | if ((pcx_error=pcx_read_fullscr( Briefing_screens[screen_num].bs_name, New_pal ))!=PCX_ERROR_NONE) { |
| printf( "File '%s', PCX load error: %s\n (It's a briefing screen. Does this cause you pain?)\n",Briefing_screens[screen_num].bs_name, pcx_errormsg(pcx_error)); | | printf( "File '%s', PCX load error: %s\n (It's a briefing screen. Does this cause you pain?)\n",Briefing_screens[screen_num].bs_name, pcx_errormsg(pcx_error)); |
| //printf(0, "File '%s', PCX load error: %s (%i)\n (It's a briefing screen. Does this cause you pain?)\n",Briefing_screens[screen_num].bs_name, pcx_errormsg(pcx_error), pcx_error); // adb: huh? | | //printf(0, "File '%s', PCX load error: %s (%i)\n (It's a briefing screen. Does this cause you pain?)\n",Briefing_screens[screen_num].bs_name, pcx_errormsg(pcx_error), pcx_error); // adb: huh? |
| Int3(); | | Int3(); |
| | |
| int tab_stop=0; | | int tab_stop=0; |
| int flashing_cursor=0; | | int flashing_cursor=0; |
| int new_page=0; | | int new_page=0; |
| | | int text_ulx = rescale_x(bsp->text_ulx); |
| | | int text_uly = rescale_y(bsp->text_uly); |
| | | |
| Bitmap_name[0] = 0; | | Bitmap_name[0] = 0; |
| | | |
| | |
| // mprintf((0, "Going to print message [%s] at x=%i, y=%i\n", message, x, y)); | | // mprintf((0, "Going to print message [%s] at x=%i, y=%i\n", message, x, y)); |
| gr_set_curfont( GAME_FONT ); | | gr_set_curfont( GAME_FONT ); |
| | | |
| init_char_pos(bsp->text_ulx, bsp->text_uly); | | init_char_pos(text_ulx, text_uly); |
| | | |
| while (!done) { | | while (!done) { |
| ch = *message++; | | ch = *message++; |
| | |
| //End D1X addition | | //End D1X addition |
| } | | } |
| } else if (ch == '\t') { // Tab | | } else if (ch == '\t') { // Tab |
| if (Briefing_text_x - bsp->text_ulx < tab_stop) | | if (Briefing_text_x - text_ulx < tab_stop) |
| Briefing_text_x = bsp->text_ulx + tab_stop; | | Briefing_text_x = text_ulx + tab_stop; |
| } else if ((ch == ';') && (prev_ch == 10)) { | | } else if ((ch == ';') && (prev_ch == 10)) { |
| while (*message++ != 10) | | while (*message++ != 10) |
| ; | | ; |
| | |
| } else if (ch == 10) { | | } else if (ch == 10) { |
| if (prev_ch != '\\') { | | if (prev_ch != '\\') { |
| prev_ch = ch; | | prev_ch = ch; |
| Briefing_text_y += 8; | | Briefing_text_y += GAME_FONT->ft_h+GAME_FONT->ft_h*3/5; |
| Briefing_text_x = bsp->text_ulx; | | Briefing_text_x = text_ulx; |
| if (Briefing_text_y > bsp->text_uly + bsp->text_height) { | | if (Briefing_text_y > text_uly + rescale_y(bsp->text_height)) { |
| load_briefing_screen(screen_num); | | load_briefing_screen(screen_num); |
| Briefing_text_x = bsp->text_ulx; | | Briefing_text_x = text_ulx; |
| Briefing_text_y = bsp->text_uly; | | Briefing_text_y = text_uly; |
| } | | } |
| } else { | | } else { |
| if (ch == 13) | | if (ch == 13) |
| | |
| if ((key_check == KEY_SPACEBAR) || (key_check == KEY_ENTER)) | | if ((key_check == KEY_SPACEBAR) || (key_check == KEY_ENTER)) |
| delay_count = 0; | | delay_count = 0; |
| | | |
| if (Briefing_text_x > bsp->text_ulx + bsp->text_width) { | | if (Briefing_text_x > text_ulx + rescale_x(bsp->text_width)) { |
| Briefing_text_x = bsp->text_ulx; | | Briefing_text_x = text_ulx; |
| Briefing_text_y += 8; | | Briefing_text_y += GAME_FONT->ft_h+GAME_FONT->ft_h*3/5; |
| } | | } |
| | | |
| if ((new_page) || (Briefing_text_y > bsp->text_uly + bsp->text_height)) { | | if ((new_page) || (Briefing_text_y > text_uly + rescale_y(bsp->text_height))) { |
| fix start_time = 0; | | fix start_time = 0; |
| fix time_out_value = 0; | | fix time_out_value = 0; |
| int keypress; | | int keypress; |
| | |
| } | | } |
| | | |
| load_briefing_screen(screen_num); | | load_briefing_screen(screen_num); |
| Briefing_text_x = bsp->text_ulx; | | Briefing_text_x = text_ulx; |
| Briefing_text_y = bsp->text_uly; | | Briefing_text_y = text_uly; |
| delay_count = KEY_DELAY_DEFAULT; | | delay_count = KEY_DELAY_DEFAULT; |
| } | | } |
| } | | } |
| | |
| #else | | #else |
| gr_palette_clear(); | | gr_palette_clear(); |
| #endif | | #endif |
| gr_bitmap( 0, 0, &briefing_bm ); | | show_fullscr(&briefing_bm ); |
| | | |
| //added on 9/13/98 by adb to make arch's requiring updates work | | //added on 9/13/98 by adb to make arch's requiring updates work |
| gr_update(); | | gr_update(); |