2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/GameHelp/ContextHelp.cpp $
15 * Functions to drive the context-sensitive help
18 * Revision 1.8 2005/03/29 02:18:47 taylor
19 * Various 64-bit platform fixes
20 * Fix compiler errors with MAKE_FS1 and fix gr_set_bitmap() too
21 * Make sure that turrets can fire at asteroids for FS1 (needed for a couple missions)
22 * Streaming audio support (big thanks to Pierre Willenbrock!!)
23 * Removed dependance on strings.tbl for FS1 since we don't actually need it now
25 * Revision 1.7 2004/09/20 01:31:44 theoddone33
28 * Revision 1.6 2003/06/11 18:30:32 taylor
31 * Revision 1.5 2003/05/25 02:30:42 taylor
34 * Revision 1.4 2002/06/17 06:33:09 relnev
35 * ryan's struct patch for gcc 2.95
37 * Revision 1.3 2002/06/09 04:41:17 relnev
38 * added copyright header
40 * Revision 1.2 2002/05/07 03:16:44 theoddone33
41 * The Great Newline Fix
43 * Revision 1.1.1.1 2002/05/03 03:28:09 root
47 * 16 8/22/99 4:22p Jefff
48 * removed 2nd tech room overlay stuff
50 * 15 8/09/99 5:54p Jefff
51 * tech room overlay changes
53 * 14 7/27/99 7:18p Jefff
54 * fixed a debug function for adjsuting overlays in-game
56 * 13 7/20/99 1:49p Dave
57 * Peter Drake build. Fixed some release build warnings.
59 * 12 7/16/99 10:07a Jefff
60 * Removed legacy bitmap overlay code
62 * 11 7/16/99 10:04a Jefff
64 * 10 7/15/99 9:20a Andsager
65 * FS2_DEMO initial checkin
67 * 9 7/11/99 6:40p Jefff
69 * 8 7/08/99 6:25p Jefff
70 * got new help system working
72 * 7 6/03/99 10:15p Dave
73 * Put in temporary main hall screen.
75 * 6 3/25/99 8:32p Neilk
76 * temporary barracks help removal
78 * 5 2/15/99 9:37a Dave
79 * Removed infinite loop from context help parse code.
81 * 4 2/11/99 4:05p Neilk
84 * 3 1/29/99 2:37p Neilk
85 * foundation for a new help system
87 * 2 10/07/98 10:52a Dave
90 * 1 10/07/98 10:48a Dave
92 * 92 5/06/98 11:49p Lawrance
93 * Add help overlay for command brief
95 * 91 5/05/98 1:49a Lawrance
96 * Add in missing help overlays
98 * 90 4/25/98 2:00p Dave
99 * Installed a bunch of multiplayer context help screens. Reworked ingame
100 * join ship select screen. Fix places where network timestamps get hosed.
102 * 89 4/20/98 12:03a Lawrance
103 * make gray help shader lighter
105 * 88 4/11/98 7:59p Lawrance
106 * Add support for help overlays
108 * 87 3/12/98 5:36p John
109 * Took out any unused shaders. Made shader code take rgbc instead of
110 * matrix and vector since noone used it like a matrix and it would have
111 * been impossible to do in hardware. Made Glide implement a basic
112 * shader for online help.
114 * 86 3/09/98 9:55p Lawrance
115 * split off gameplay help, rip out obsolete code
117 * 85 3/05/98 11:15p Hoffoss
118 * Changed non-game key checking to use game_check_key() instead of
121 * 84 2/28/98 9:47p Lawrance
122 * Fix couple of typos
124 * 83 2/28/98 7:02p Lawrance
125 * overhaul on-line help
130 #include "contexthelp.h"
131 #include "gamesequence.h"
132 #include "freespace.h"
133 #include "mainhallmenu.h"
140 #include "controlsconfig.h"
141 #include "techmenu.h"
143 #include "localize.h"
144 #include "alphacolors.h"
147 ////////////////////////////////////////////////////////////////////
148 // private function prototypes / structs
149 ////////////////////////////////////////////////////////////////////
150 void parse_helptbl();
151 void help_overlay_blit(int overlay_id);
152 void help_overlay_init();
156 int x_begin, y_begin, x_end, y_end;
160 vector vtx[HELP_MAX_PLINE_VERTICES];
161 vector *pvtx[HELP_MAX_PLINE_VERTICES];
166 int x_coord, y_coord;
171 int x_coord, y_coord;
175 int x_coord, y_coord;
176 } help_right_bracket;
179 help_pline plinelist[GR_NUM_RESOLUTIONS][HELP_MAX_ITEM];
180 help_text textlist[GR_NUM_RESOLUTIONS][HELP_MAX_ITEM];
181 help_left_bracket lbracketlist[GR_NUM_RESOLUTIONS][HELP_MAX_ITEM];
182 help_right_bracket rbracketlist[GR_NUM_RESOLUTIONS][HELP_MAX_ITEM];
190 const char *Help_overlays[MAX_HELP_OVERLAYS] = {
197 "Briefing_Help_Overlay_Demo",
198 "main_help_overlay_demo",
206 "main_help_overlay2",
215 // new help.tbl file way
216 const char *help_overlay_section_names[MAX_HELP_OVERLAYS] = {
217 "$ship", // ship_help
218 "$weapon", // weapon_help
219 "$briefing", // briefing
220 "$main", // main help overlay
221 "$barracks", // barracks
222 "$control", // control help
223 "$debrief", // debrief help
224 "$multicreate", // multicreate help
225 "$multistart", // multistart help
226 "$multijoin", // multijoin help
227 "$main2", // main help overlay2
228 "$hotkey", // hotkey help
229 "$campaign", // campaign help
230 "$simulator", // simulator help
231 "$tech", // tech help
232 "$command" // command help
235 ////////////////////////////////////////////////////////////////////
237 ////////////////////////////////////////////////////////////////////
240 ////////////////////////////////////////////////////////////////////
242 ////////////////////////////////////////////////////////////////////
244 static int help_left_bracket_bitmap;
245 static int help_right_bracket_bitmap;
247 static help_overlay help_overlaylist[MAX_HELP_OVERLAYS];
249 static int current_helpid = -1; // the currently active overlay_id, only really used for the debug console funxions
250 int Help_overlay_flags;
251 static int Source_game_state; // state from where F1 was pressed
254 static int Overlay = -1;
257 ////////////////////////////////////////////////////////////////////
259 ////////////////////////////////////////////////////////////////////
262 // query whether a help overlay is active (ie being displayed)
263 int help_overlay_active(int overlay_id)
265 SDL_assert(overlay_id >= 0 && overlay_id < MAX_HELP_OVERLAYS);
266 return Help_overlay_flags & (1<<overlay_id);
269 // stop displaying a help overlay
270 void help_overlay_set_state(int overlay_id, int state)
272 SDL_assert(overlay_id >= 0 && overlay_id < MAX_HELP_OVERLAYS);
275 Help_overlay_flags |= (1<<overlay_id);
276 current_helpid = overlay_id;
278 Help_overlay_flags &= ~(1<<overlay_id);
279 //current_helpid = -1;
284 // load in the bitmap for a help overlay
285 // FIXME - leftover from the old bitmap overlay days - prune this out sometime
286 void help_overlay_load(int overlay_id)
291 // unload a bitmap of a help overlay
292 // FIXME - leftover from the old bitmap overlay days - prune this out sometime
293 void help_overlay_unload(int overlay_id)
304 // maybe blit a bitmap of a help overlay to the screen
305 void help_overlay_maybe_blit(int overlay_id)
307 SDL_assert(overlay_id >= 0 && overlay_id < MAX_HELP_OVERLAYS);
309 if ( Help_overlay_flags & (1<<overlay_id) ) {
310 context_help_grey_screen();
311 help_overlay_blit(overlay_id);
315 // reset the flags for the help overlays
316 void help_overlay_reset_all()
318 Help_overlay_flags = 0;
321 // Set up Grey_shader, which is used game-wide to grey out background when using help overlays
322 void create_grey_shader()
328 // The c matrix brightens everything a bit.
332 gr_create_shader( &Grey_shader, tmp, tmp, tmp, c );
335 // called at game startup to init all help related data
336 void context_help_init()
338 create_grey_shader();
339 help_overlay_reset_all();
343 // called in game_shutdown() to clean up help stuff
344 void context_help_close()
349 for (i=0; i<MAX_HELP_OVERLAYS; i++) {
350 for (j=0; j<HELP_MAX_ITEM; j++) {
351 if (help_overlaylist[i].textlist[GR_640][j].string != NULL) {
352 free(help_overlaylist[i].textlist[GR_640][j].string);
353 help_overlaylist[i].textlist[GR_640][j].string = NULL;
360 void context_help_grey_screen()
362 gr_set_shader(&Grey_shader);
363 gr_shade(0,0,gr_screen.clip_width, gr_screen.clip_height);
366 // launch_context_help() will switch to a context sensitive help state
367 void launch_context_help()
369 // look at the state the game was in when F1 was pressed
370 Source_game_state = gameseq_get_state();
372 switch (Source_game_state) {
374 case GS_STATE_MAIN_MENU:
375 #if !defined(PRESS_TOUR_BUILD) && !defined(PD_BUILD)
377 main_hall_num = (main_hall_id() == 0) ? MH_OVERLAY : MH2_OVERLAY;
378 if ( !help_overlay_active(main_hall_num) ) {
379 help_overlay_set_state(main_hall_num, 1);
382 help_overlay_set_state(main_hall_num, 0);
387 case GS_STATE_GAME_PLAY:
388 case GS_STATE_GAME_PAUSED:
389 case GS_STATE_TRAINING_PAUSED:
390 gameseq_post_event(GS_EVENT_GAMEPLAY_HELP);
393 case GS_STATE_BRIEFING:
394 if ( !help_overlay_active(BR_OVERLAY) ) {
395 help_overlay_set_state(BR_OVERLAY, 1);
398 help_overlay_set_state(BR_OVERLAY, 0);
402 case GS_STATE_SHIP_SELECT:
403 if ( !help_overlay_active(SS_OVERLAY) ) {
404 help_overlay_set_state(SS_OVERLAY, 1);
407 help_overlay_set_state(SS_OVERLAY, 0);
411 case GS_STATE_WEAPON_SELECT:
412 if ( !help_overlay_active(WL_OVERLAY) ) {
413 help_overlay_set_state(WL_OVERLAY, 1);
416 help_overlay_set_state(WL_OVERLAY, 0);
420 case GS_STATE_BARRACKS_MENU:
421 if ( !help_overlay_active(BARRACKS_OVERLAY) ) {
422 help_overlay_set_state(BARRACKS_OVERLAY, 1);
425 help_overlay_set_state(BARRACKS_OVERLAY, 0);
429 case GS_STATE_CONTROL_CONFIG:
430 if ( !help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
431 help_overlay_set_state(CONTROL_CONFIG_OVERLAY, 1);
434 help_overlay_set_state(CONTROL_CONFIG_OVERLAY, 0);
438 case GS_STATE_DEBRIEF:
439 if ( !help_overlay_active(DEBRIEFING_OVERLAY) ) {
440 help_overlay_set_state(DEBRIEFING_OVERLAY, 1);
443 help_overlay_set_state(DEBRIEFING_OVERLAY, 0);
447 case GS_STATE_MULTI_HOST_SETUP:
448 if ( !help_overlay_active(MULTI_CREATE_OVERLAY) ) {
449 help_overlay_set_state(MULTI_CREATE_OVERLAY, 1);
452 help_overlay_set_state(MULTI_CREATE_OVERLAY, 0);
456 case GS_STATE_MULTI_START_GAME:
457 if ( !help_overlay_active(MULTI_START_OVERLAY) ) {
458 help_overlay_set_state(MULTI_START_OVERLAY, 1);
461 help_overlay_set_state(MULTI_START_OVERLAY, 0);
465 case GS_STATE_MULTI_JOIN_GAME:
466 if ( !help_overlay_active(MULTI_JOIN_OVERLAY) ) {
467 help_overlay_set_state(MULTI_JOIN_OVERLAY, 1);
470 help_overlay_set_state(MULTI_JOIN_OVERLAY, 0);
474 case GS_STATE_HOTKEY_SCREEN:
475 if ( !help_overlay_active(HOTKEY_OVERLAY) ) {
476 help_overlay_set_state(HOTKEY_OVERLAY, 1);
479 help_overlay_set_state(HOTKEY_OVERLAY, 0);
483 case GS_STATE_CAMPAIGN_ROOM:
484 if ( !help_overlay_active(CAMPAIGN_ROOM_OVERLAY) ) {
485 help_overlay_set_state(CAMPAIGN_ROOM_OVERLAY, 1);
488 help_overlay_set_state(CAMPAIGN_ROOM_OVERLAY, 0);
492 case GS_STATE_SIMULATOR_ROOM:
493 if ( !help_overlay_active(SIM_ROOM_OVERLAY) ) {
494 help_overlay_set_state(SIM_ROOM_OVERLAY, 1);
497 help_overlay_set_state(SIM_ROOM_OVERLAY, 0);
501 case GS_STATE_TECH_MENU: {
502 if ( !help_overlay_active(TECH_ROOM_OVERLAY) ) {
503 help_overlay_set_state(TECH_ROOM_OVERLAY, 1);
506 help_overlay_set_state(TECH_ROOM_OVERLAY, 0);
511 case GS_STATE_CMD_BRIEF:
512 if ( !help_overlay_active(CMD_BRIEF_OVERLAY) ) {
513 help_overlay_set_state(CMD_BRIEF_OVERLAY, 1);
516 help_overlay_set_state(CMD_BRIEF_OVERLAY, 0);
521 nprintf(("Warning","WARNING ==> There is no context help available for state %s\n", GS_state_text[Source_game_state-1]));
528 // Called once at the beginning of the game to load help bitmaps & data
529 void help_overlay_init()
532 // load right_bracket bitmap
533 help_right_bracket_bitmap = bm_load("right_bracket");
534 if(help_right_bracket_bitmap < 0){
535 // we failed to load the bitmap - this is very bad
539 // load left_bracket bitmap
540 help_left_bracket_bitmap = bm_load("left_bracket");
541 if(help_left_bracket_bitmap < 0){
542 // we failed to load the bitmap - this is very bad
552 // parses help.tbl and populates help_overlaylist[]
556 int overlay_id, currcount;
557 char buf[HELP_MAX_STRING_LENGTH + 1];
564 read_file_text(HELP_OVERLAY_FILENAME);
566 // for each overlay...
567 for (overlay_id=0; overlay_id<MAX_HELP_OVERLAYS; overlay_id++) {
570 skip_to_string(help_overlay_section_names[overlay_id]);
572 // clear out counters in the overlay struct
573 help_overlaylist[overlay_id].plinecount = 0;
574 help_overlaylist[overlay_id].textcount = 0;
575 help_overlaylist[overlay_id].rbracketcount = 0;
576 help_overlaylist[overlay_id].lbracketcount = 0;
578 // read in all elements for this overlay
579 while (!(check_for_string("$end"))) {
581 if (optional_string("+pline")) {
583 currcount = help_overlaylist[overlay_id].plinecount;
584 int a, b; // temp vars to read in int before cast to float;
586 if (currcount < HELP_MAX_ITEM) {
587 // read number of pline vertices
588 stuff_int(&help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount); // note that it is read into GR_640
589 // help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtxcount = help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount; // set equal to 1024 version vertex count to prevent bugs
590 SDL_assert(help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount <= HELP_MAX_PLINE_VERTICES);
591 // get 640x480 vertex coordinates
592 for (i=0; i<help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount; i++) {
595 help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.x = (float)a;
596 help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.y = (float)b;
597 help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.z = 0.0f;
598 help_overlaylist[overlay_id].plinelist[GR_640][currcount].pvtx[i] = &help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i];
600 // get 1024x768 vertex coordinates
601 for (i=0; i<help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount; i++) {
604 help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.x = (float)a;
605 help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.y = (float)b;
606 help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.z = 0.0f;
607 help_overlaylist[overlay_id].plinelist[GR_1024][currcount].pvtx[i] = &help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i];
611 //mprintf(("Found pline - start location (%f,%f), end location (%f,%f)\n", help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].y, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].y));
612 help_overlaylist[overlay_id].plinecount++;
614 } else if (optional_string("+text")) {
616 currcount = help_overlaylist[overlay_id].textcount;
618 if (currcount < HELP_MAX_ITEM) {
619 // get 640x480 coordinates
620 stuff_int(&(help_overlaylist[overlay_id].textlist[GR_640][currcount].x_coord));
621 stuff_int(&(help_overlaylist[overlay_id].textlist[GR_640][currcount].y_coord));
622 // get 1024x768 coordinates
623 stuff_int(&(help_overlaylist[overlay_id].textlist[GR_1024][currcount].x_coord));
624 stuff_int(&(help_overlaylist[overlay_id].textlist[GR_1024][currcount].y_coord));
626 // get string (always use the GR_640 one)
627 stuff_string(buf, F_MESSAGE, NULL);
628 help_overlaylist[overlay_id].textlist[GR_640][currcount].string = strdup(buf);
630 //mprintf(("Found text %d on overlay %d - location (%d,%d) @ 640x480 :: location (%d,%d) @ 1024x768\n", currcount, overlay_id, help_overlaylist[overlay_id].textlist[GR_640][currcount].x_coord, help_overlaylist[overlay_id].textlist[GR_640][currcount].y_coord, help_overlaylist[overlay_id].textlist[GR_1024][currcount].x_coord, help_overlaylist[overlay_id].textlist[GR_1024][currcount].x_coord));
631 help_overlaylist[overlay_id].textcount++;
634 } else if (optional_string("+right_bracket")) {
636 currcount = help_overlaylist[overlay_id].rbracketcount;
638 if (currcount < HELP_MAX_ITEM) {
639 // get 640x480 coordinates
640 stuff_int(&(help_overlaylist[overlay_id].rbracketlist[GR_640][currcount].x_coord));
641 stuff_int(&(help_overlaylist[overlay_id].rbracketlist[GR_640][currcount].y_coord));
642 // get 1024x768 coordinates
643 stuff_int(&(help_overlaylist[overlay_id].rbracketlist[GR_1024][currcount].x_coord));
644 stuff_int(&(help_overlaylist[overlay_id].rbracketlist[GR_1024][currcount].y_coord));
646 //mprintf(("Found rbracket %d on overlay %d - location (%d,%d) @ 640x480 :: location (%d,%d) @ 1024x768\n", currcount, overlay_id, help_overlaylist[overlay_id].rbracketlist[GR_640][currcount].x_coord, help_overlaylist[overlay_id].rbracketlist[GR_640][currcount].y_coord, help_overlaylist[overlay_id].rbracketlist[GR_1024][currcount].x_coord, help_overlaylist[overlay_id].rbracketlist[GR_1024][currcount].y_coord));
647 help_overlaylist[overlay_id].rbracketcount++;
650 } else if (optional_string("+left_bracket")) {
652 currcount = help_overlaylist[overlay_id].lbracketcount;
654 if (currcount < HELP_MAX_ITEM) {
655 // get 640x480 coordinates
656 stuff_int(&(help_overlaylist[overlay_id].lbracketlist[GR_640][currcount].x_coord));
657 stuff_int(&(help_overlaylist[overlay_id].lbracketlist[GR_640][currcount].y_coord));
658 // get 1024x768 coordinates
659 stuff_int(&(help_overlaylist[overlay_id].lbracketlist[GR_1024][currcount].x_coord));
660 stuff_int(&(help_overlaylist[overlay_id].lbracketlist[GR_1024][currcount].y_coord));
662 //mprintf(("Found lbracket %d on overlay %d - location (%d,%d) @ 640x480 :: location (%d,%d) @ 1024x768\n", currcount, overlay_id, help_overlaylist[overlay_id].lbracketlist[GR_640][currcount].x_coord, help_overlaylist[overlay_id].lbracketlist[GR_640][currcount].y_coord, help_overlaylist[overlay_id].lbracketlist[GR_1024][currcount].x_coord, help_overlaylist[overlay_id].lbracketlist[GR_1024][currcount].y_coord));
663 help_overlaylist[overlay_id].lbracketcount++;
667 // help.tbl is corrupt
674 } catch (parse_error_t rval) {
675 Error(LOCATION, "Unable to parse %s! Code = %i.\n", HELP_OVERLAY_FILENAME, (int)rval);
678 // close localization
685 // draw overlay on the screen
686 void help_overlay_blit(int overlay_id)
689 SDL_assert(overlay_id >= 0 && overlay_id < MAX_HELP_OVERLAYS);
691 Overlay = bm_load(Help_overlays[overlay_id]);
697 gr_set_bitmap(Overlay, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 1.0f, -1, -1);
701 int idx, width, height;
702 int plinecount = help_overlaylist[overlay_id].plinecount;
703 int textcount = help_overlaylist[overlay_id].textcount;
704 int rbracketcount = help_overlaylist[overlay_id].rbracketcount;
705 int lbracketcount = help_overlaylist[overlay_id].lbracketcount;
707 SDL_assert(overlay_id >= 0 && overlay_id < MAX_HELP_OVERLAYS);
709 // this draws each line of help text with white on black text (use the GR_640 index for the string)
710 for (idx = 0; idx < textcount; idx++) {
711 gr_set_color_fast(&Color_black);
712 gr_get_string_size(&width, &height, help_overlaylist[overlay_id].textlist[GR_640][idx].string, strlen(help_overlaylist[overlay_id].textlist[GR_640][idx].string));
713 gr_rect(help_overlaylist[overlay_id].textlist[gr_screen.res][idx].x_coord-2*HELP_PADDING, help_overlaylist[overlay_id].textlist[gr_screen.res][idx].y_coord-3*HELP_PADDING, width+4*HELP_PADDING, height+4*HELP_PADDING);
714 gr_set_color_fast(&Color_bright_white);
715 gr_printf(help_overlaylist[overlay_id].textlist[gr_screen.res][idx].x_coord, help_overlaylist[overlay_id].textlist[gr_screen.res][idx].y_coord, help_overlaylist[overlay_id].textlist[GR_640][idx].string);
718 // this draws each right bracket
719 for (idx = 0; idx < rbracketcount; idx++) {
720 gr_set_bitmap(help_right_bracket_bitmap, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 1.0f, -1, -1);
721 gr_bitmap(help_overlaylist[overlay_id].rbracketlist[gr_screen.res][idx].x_coord, help_overlaylist[overlay_id].rbracketlist[gr_screen.res][idx].y_coord);
724 // this draws each left bracket
725 for (idx = 0; idx < lbracketcount; idx++) {
726 gr_set_bitmap(help_left_bracket_bitmap, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, 1.0f, -1, -1);
727 gr_bitmap(help_overlaylist[overlay_id].lbracketlist[gr_screen.res][idx].x_coord, help_overlaylist[overlay_id].lbracketlist[gr_screen.res][idx].y_coord);
730 // this draws each 2d line for the help screen
731 //gr_set_color_fast(&Color_yellow);
732 gr_set_color(255, 255, 0);
733 for (idx = 0; idx<plinecount; idx++) {
734 gr_pline_special(help_overlaylist[overlay_id].plinelist[gr_screen.res][idx].pvtx , help_overlaylist[overlay_id].plinelist[GR_640][idx].vtxcount, HELP_PLINE_THICKNESS);
740 // --------------------------------------------------
742 // --------------------------------------------------
744 DCF(help_reload, "Reloads help overlay data from help.tbl")
751 dc_printf( "Usage: sample\nCrashes your machine.\n" );
755 dc_printf( "Yes, my master." );
759 int h_textnum=0, h_amt=0, h_vtx = 0;
761 void nudgetext_x(int textnum, int amount)
763 help_overlaylist[current_helpid].textlist[gr_screen.res][textnum].x_coord += amount;
765 void nudgetext_y(int textnum, int amount)
767 help_overlaylist[current_helpid].textlist[gr_screen.res][textnum].y_coord += amount;
769 void nudgepline_x(int plinenum, int plinevert, int amount)
771 help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].xyz.x += amount;
773 void nudgepline_y(int plinenum, int plinevert, int amount)
775 help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].xyz.y += amount;
777 void nudgerbracket_x(int num, int amount)
779 help_overlaylist[current_helpid].rbracketlist[gr_screen.res][num].x_coord += amount;
781 void nudgerbracket_y(int num, int amount)
783 help_overlaylist[current_helpid].rbracketlist[gr_screen.res][num].y_coord += amount;
785 void nudgelbracket_x(int num, int amount)
787 help_overlaylist[current_helpid].lbracketlist[gr_screen.res][num].x_coord += amount;
789 void nudgelbracket_y(int num, int amount)
791 help_overlaylist[current_helpid].lbracketlist[gr_screen.res][num].y_coord += amount;
793 void showtextpos(int textnum)
795 dc_printf("text %d is now located at (%d, %d)", textnum, help_overlaylist[current_helpid].textlist[gr_screen.res][textnum].x_coord, help_overlaylist[current_helpid].textlist[gr_screen.res][textnum].y_coord );
797 void showrbracketpos(int num)
799 dc_printf("rbracket %d is now located at (%d, %d)", num, help_overlaylist[current_helpid].rbracketlist[gr_screen.res][num].x_coord, help_overlaylist[current_helpid].rbracketlist[gr_screen.res][num].y_coord );
801 void showlbracketpos(int num)
803 dc_printf("lbracket %d on overlay %d is now located at (%d, %d)", num, current_helpid, help_overlaylist[current_helpid].lbracketlist[gr_screen.res][num].x_coord, help_overlaylist[current_helpid].lbracketlist[gr_screen.res][num].y_coord );
805 void showplinepos(int plinenum)
808 dc_printf("pline %d on overlay %d vertices are now ", plinenum, current_helpid, help_overlaylist[current_helpid].textlist[gr_screen.res][plinenum].y_coord );
809 for (i=0; i<help_overlaylist[current_helpid].plinelist[GR_640][plinenum].vtxcount; i++)
811 dc_printf("(%3.0f %3.0f) ", help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].xyz.x, help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].xyz.y);
815 DCF(help_nudgetext_x, "Use to visually position overlay text.")
819 if(Dc_arg_type & ARG_INT){
820 h_textnum = Dc_arg_int;
823 if(Dc_arg_type & ARG_INT){
826 nudgetext_x(h_textnum, h_amt);
830 dc_printf( "Usage: sample\nCrashes your machine.\n" );
834 showtextpos(h_textnum);
838 DCF(help_nudgetext_y, "Use to visually position overlay text.")
842 if(Dc_arg_type & ARG_INT){
843 h_textnum = Dc_arg_int;
846 if(Dc_arg_type & ARG_INT){
849 nudgetext_y(h_textnum, h_amt);
853 dc_printf( "Usage: sample\nCrashes your machine.\n" );
857 showtextpos(h_textnum);
861 DCF(help_nudgepline_x, "Use to visually position overlay polylines.")
865 if(Dc_arg_type & ARG_INT){
866 h_textnum = Dc_arg_int;
869 if(Dc_arg_type & ARG_INT){
873 if(Dc_arg_type & ARG_INT){
876 nudgepline_x(h_textnum, h_vtx, h_amt);
880 dc_printf( "Usage: help_nudgepline [pline_number] [vertex_number] [distance]\n" );
884 showplinepos(h_textnum);
889 DCF(help_nudgepline_y, "Use to visually position overlay polylines.")
893 if(Dc_arg_type & ARG_INT){
894 h_textnum = Dc_arg_int;
897 if(Dc_arg_type & ARG_INT){
901 if(Dc_arg_type & ARG_INT){
904 nudgepline_y(h_textnum, h_vtx, h_amt);
908 dc_printf( "Usage: help_nudgepline [pline_number] [vertex_number] [distance]\n" );
912 showplinepos(h_textnum);
917 DCF(help_nudgerbracket_x, "Use to visually position overlay right bracket.")
921 if(Dc_arg_type & ARG_INT){
922 h_textnum = Dc_arg_int;
925 if(Dc_arg_type & ARG_INT){
928 nudgerbracket_x(h_textnum, h_amt);
932 dc_printf( "Usage: help_nudgerbracket_x [num] [amount]\n" );
936 showrbracketpos(h_textnum);
940 DCF(help_nudgerbracket_y, "Use to visually position overlay right bracket.")
944 if(Dc_arg_type & ARG_INT){
945 h_textnum = Dc_arg_int;
948 if(Dc_arg_type & ARG_INT){
951 nudgerbracket_y(h_textnum, h_amt);
955 dc_printf( "Usage: help_nudgerbracket_y [num] [amount]\n" );
959 showrbracketpos(h_textnum);
966 DCF(help_nudgelbracket_x, "Use to visually position overlay left bracket.")
970 if(Dc_arg_type & ARG_INT){
971 h_textnum = Dc_arg_int;
974 if(Dc_arg_type & ARG_INT){
977 nudgelbracket_x(h_textnum, h_amt);
981 dc_printf( "Usage: help_nudgelbracket_x [num] [amount]\n" );
985 showlbracketpos(h_textnum);
989 DCF(help_nudgelbracket_y, "Use to visually position overlay left bracket.")
993 if(Dc_arg_type & ARG_INT){
994 h_textnum = Dc_arg_int;
997 if(Dc_arg_type & ARG_INT){
1000 nudgelbracket_y(h_textnum, h_amt);
1004 dc_printf( "Usage: help_nudgelbracket_y [num] [amount]\n" );
1008 showlbracketpos(h_textnum);