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.5 2003/05/25 02:30:42 taylor
21 * Revision 1.4 2002/06/17 06:33:09 relnev
22 * ryan's struct patch for gcc 2.95
24 * Revision 1.3 2002/06/09 04:41:17 relnev
25 * added copyright header
27 * Revision 1.2 2002/05/07 03:16:44 theoddone33
28 * The Great Newline Fix
30 * Revision 1.1.1.1 2002/05/03 03:28:09 root
34 * 16 8/22/99 4:22p Jefff
35 * removed 2nd tech room overlay stuff
37 * 15 8/09/99 5:54p Jefff
38 * tech room overlay changes
40 * 14 7/27/99 7:18p Jefff
41 * fixed a debug function for adjsuting overlays in-game
43 * 13 7/20/99 1:49p Dave
44 * Peter Drake build. Fixed some release build warnings.
46 * 12 7/16/99 10:07a Jefff
47 * Removed legacy bitmap overlay code
49 * 11 7/16/99 10:04a Jefff
51 * 10 7/15/99 9:20a Andsager
52 * FS2_DEMO initial checkin
54 * 9 7/11/99 6:40p Jefff
56 * 8 7/08/99 6:25p Jefff
57 * got new help system working
59 * 7 6/03/99 10:15p Dave
60 * Put in temporary main hall screen.
62 * 6 3/25/99 8:32p Neilk
63 * temporary barracks help removal
65 * 5 2/15/99 9:37a Dave
66 * Removed infinite loop from context help parse code.
68 * 4 2/11/99 4:05p Neilk
71 * 3 1/29/99 2:37p Neilk
72 * foundation for a new help system
74 * 2 10/07/98 10:52a Dave
77 * 1 10/07/98 10:48a Dave
79 * 92 5/06/98 11:49p Lawrance
80 * Add help overlay for command brief
82 * 91 5/05/98 1:49a Lawrance
83 * Add in missing help overlays
85 * 90 4/25/98 2:00p Dave
86 * Installed a bunch of multiplayer context help screens. Reworked ingame
87 * join ship select screen. Fix places where network timestamps get hosed.
89 * 89 4/20/98 12:03a Lawrance
90 * make gray help shader lighter
92 * 88 4/11/98 7:59p Lawrance
93 * Add support for help overlays
95 * 87 3/12/98 5:36p John
96 * Took out any unused shaders. Made shader code take rgbc instead of
97 * matrix and vector since noone used it like a matrix and it would have
98 * been impossible to do in hardware. Made Glide implement a basic
99 * shader for online help.
101 * 86 3/09/98 9:55p Lawrance
102 * split off gameplay help, rip out obsolete code
104 * 85 3/05/98 11:15p Hoffoss
105 * Changed non-game key checking to use game_check_key() instead of
108 * 84 2/28/98 9:47p Lawrance
109 * Fix couple of typos
111 * 83 2/28/98 7:02p Lawrance
112 * overhaul on-line help
118 #include "contexthelp.h"
119 #include "gamesequence.h"
120 #include "freespace.h"
121 #include "mainhallmenu.h"
128 #include "controlsconfig.h"
129 #include "techmenu.h"
131 #include "localize.h"
132 #include "alphacolors.h"
135 ////////////////////////////////////////////////////////////////////
136 // private function prototypes / structs
137 ////////////////////////////////////////////////////////////////////
138 void parse_helptbl();
139 void help_overlay_blit(int overlay_id);
140 void help_overlay_init();
144 int x_begin, y_begin, x_end, y_end;
148 vector vtx[HELP_MAX_PLINE_VERTICES];
149 vector *pvtx[HELP_MAX_PLINE_VERTICES];
154 int x_coord, y_coord;
159 int x_coord, y_coord;
163 int x_coord, y_coord;
164 } help_right_bracket;
167 help_pline plinelist[GR_NUM_RESOLUTIONS][HELP_MAX_ITEM];
168 help_text textlist[GR_NUM_RESOLUTIONS][HELP_MAX_ITEM];
169 help_left_bracket lbracketlist[GR_NUM_RESOLUTIONS][HELP_MAX_ITEM];
170 help_right_bracket rbracketlist[GR_NUM_RESOLUTIONS][HELP_MAX_ITEM];
178 char *Help_overlays[MAX_HELP_OVERLAYS] = {
185 "Briefing_Help_Overlay_Demo",
186 "main_help_overlay_demo",
194 "main_help_overlay2",
203 // new help.tbl file way
204 char *help_overlay_section_names[MAX_HELP_OVERLAYS] = {
205 "$ship", // ship_help
206 "$weapon", // weapon_help
207 "$briefing", // briefing
208 "$main", // main help overlay
209 "$barracks", // barracks
210 "$control", // control help
211 "$debrief", // debrief help
212 "$multicreate", // multicreate help
213 "$multistart", // multistart help
214 "$multijoin", // multijoin help
215 "$main2", // main help overlay2
216 "$hotkey", // hotkey help
217 "$campaign", // campaign help
218 "$simulator", // simulator help
219 "$tech", // tech help
220 "$command" // command help
223 ////////////////////////////////////////////////////////////////////
225 ////////////////////////////////////////////////////////////////////
228 ////////////////////////////////////////////////////////////////////
230 ////////////////////////////////////////////////////////////////////
232 static int help_left_bracket_bitmap;
233 static int help_right_bracket_bitmap;
235 static help_overlay help_overlaylist[MAX_HELP_OVERLAYS];
237 static int current_helpid = -1; // the currently active overlay_id, only really used for the debug console funxions
238 int Help_overlay_flags;
239 static int Source_game_state; // state from where F1 was pressed
242 static int Overlay = -1;
245 ////////////////////////////////////////////////////////////////////
247 ////////////////////////////////////////////////////////////////////
250 // query whether a help overlay is active (ie being displayed)
251 int help_overlay_active(int overlay_id)
253 Assert(overlay_id >= 0 && overlay_id < MAX_HELP_OVERLAYS);
254 return Help_overlay_flags & (1<<overlay_id);
257 // stop displaying a help overlay
258 void help_overlay_set_state(int overlay_id, int state)
260 Assert(overlay_id >= 0 && overlay_id < MAX_HELP_OVERLAYS);
263 Help_overlay_flags |= (1<<overlay_id);
264 current_helpid = overlay_id;
266 Help_overlay_flags &= ~(1<<overlay_id);
267 //current_helpid = -1;
272 // load in the bitmap for a help overlay
273 // FIXME - leftover from the old bitmap overlay days - prune this out sometime
274 void help_overlay_load(int overlay_id)
279 // unload a bitmap of a help overlay
280 // FIXME - leftover from the old bitmap overlay days - prune this out sometime
281 void help_overlay_unload(int overlay_id)
292 // maybe blit a bitmap of a help overlay to the screen
293 void help_overlay_maybe_blit(int overlay_id)
295 Assert(overlay_id >= 0 && overlay_id < MAX_HELP_OVERLAYS);
297 if ( Help_overlay_flags & (1<<overlay_id) ) {
298 context_help_grey_screen();
299 help_overlay_blit(overlay_id);
303 // reset the flags for the help overlays
304 void help_overlay_reset_all()
306 Help_overlay_flags = 0;
309 // Set up Grey_shader, which is used game-wide to grey out background when using help overlays
310 void create_grey_shader()
316 // The c matrix brightens everything a bit.
320 gr_create_shader( &Grey_shader, tmp, tmp, tmp, c );
323 // called at game startup to init all help related data
324 void context_help_init()
326 create_grey_shader();
327 help_overlay_reset_all();
331 void context_help_grey_screen()
333 gr_set_shader(&Grey_shader);
334 gr_shade(0,0,gr_screen.clip_width, gr_screen.clip_height);
337 // launch_context_help() will switch to a context sensitive help state
338 void launch_context_help()
340 // look at the state the game was in when F1 was pressed
341 Source_game_state = gameseq_get_state();
343 switch (Source_game_state) {
345 case GS_STATE_MAIN_MENU:
346 #if !defined(PRESS_TOUR_BUILD) && !defined(PD_BUILD)
348 main_hall_num = (main_hall_id() == 0) ? MH_OVERLAY : MH2_OVERLAY;
349 if ( !help_overlay_active(main_hall_num) ) {
350 help_overlay_set_state(main_hall_num, 1);
353 help_overlay_set_state(main_hall_num, 0);
358 case GS_STATE_GAME_PLAY:
359 case GS_STATE_GAME_PAUSED:
360 case GS_STATE_TRAINING_PAUSED:
361 gameseq_post_event(GS_EVENT_GAMEPLAY_HELP);
364 case GS_STATE_BRIEFING:
365 if ( !help_overlay_active(BR_OVERLAY) ) {
366 help_overlay_set_state(BR_OVERLAY, 1);
369 help_overlay_set_state(BR_OVERLAY, 0);
373 case GS_STATE_SHIP_SELECT:
374 if ( !help_overlay_active(SS_OVERLAY) ) {
375 help_overlay_set_state(SS_OVERLAY, 1);
378 help_overlay_set_state(SS_OVERLAY, 0);
382 case GS_STATE_WEAPON_SELECT:
383 if ( !help_overlay_active(WL_OVERLAY) ) {
384 help_overlay_set_state(WL_OVERLAY, 1);
387 help_overlay_set_state(WL_OVERLAY, 0);
391 case GS_STATE_BARRACKS_MENU:
392 if ( !help_overlay_active(BARRACKS_OVERLAY) ) {
393 help_overlay_set_state(BARRACKS_OVERLAY, 1);
396 help_overlay_set_state(BARRACKS_OVERLAY, 0);
400 case GS_STATE_CONTROL_CONFIG:
401 if ( !help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
402 help_overlay_set_state(CONTROL_CONFIG_OVERLAY, 1);
405 help_overlay_set_state(CONTROL_CONFIG_OVERLAY, 0);
409 case GS_STATE_DEBRIEF:
410 if ( !help_overlay_active(DEBRIEFING_OVERLAY) ) {
411 help_overlay_set_state(DEBRIEFING_OVERLAY, 1);
414 help_overlay_set_state(DEBRIEFING_OVERLAY, 0);
418 case GS_STATE_MULTI_HOST_SETUP:
419 if ( !help_overlay_active(MULTI_CREATE_OVERLAY) ) {
420 help_overlay_set_state(MULTI_CREATE_OVERLAY, 1);
423 help_overlay_set_state(MULTI_CREATE_OVERLAY, 0);
427 case GS_STATE_MULTI_START_GAME:
428 if ( !help_overlay_active(MULTI_START_OVERLAY) ) {
429 help_overlay_set_state(MULTI_START_OVERLAY, 1);
432 help_overlay_set_state(MULTI_START_OVERLAY, 0);
436 case GS_STATE_MULTI_JOIN_GAME:
437 if ( !help_overlay_active(MULTI_JOIN_OVERLAY) ) {
438 help_overlay_set_state(MULTI_JOIN_OVERLAY, 1);
441 help_overlay_set_state(MULTI_JOIN_OVERLAY, 0);
445 case GS_STATE_HOTKEY_SCREEN:
446 if ( !help_overlay_active(HOTKEY_OVERLAY) ) {
447 help_overlay_set_state(HOTKEY_OVERLAY, 1);
450 help_overlay_set_state(HOTKEY_OVERLAY, 0);
454 case GS_STATE_CAMPAIGN_ROOM:
455 if ( !help_overlay_active(CAMPAIGN_ROOM_OVERLAY) ) {
456 help_overlay_set_state(CAMPAIGN_ROOM_OVERLAY, 1);
459 help_overlay_set_state(CAMPAIGN_ROOM_OVERLAY, 0);
463 case GS_STATE_SIMULATOR_ROOM:
464 if ( !help_overlay_active(SIM_ROOM_OVERLAY) ) {
465 help_overlay_set_state(SIM_ROOM_OVERLAY, 1);
468 help_overlay_set_state(SIM_ROOM_OVERLAY, 0);
472 case GS_STATE_TECH_MENU: {
473 if ( !help_overlay_active(TECH_ROOM_OVERLAY) ) {
474 help_overlay_set_state(TECH_ROOM_OVERLAY, 1);
477 help_overlay_set_state(TECH_ROOM_OVERLAY, 0);
482 case GS_STATE_CMD_BRIEF:
483 if ( !help_overlay_active(CMD_BRIEF_OVERLAY) ) {
484 help_overlay_set_state(CMD_BRIEF_OVERLAY, 1);
487 help_overlay_set_state(CMD_BRIEF_OVERLAY, 0);
492 nprintf(("Warning","WARNING ==> There is no context help available for state %s\n", GS_state_text[Source_game_state-1]));
499 // Called once at the beginning of the game to load help bitmaps & data
500 void help_overlay_init()
503 // load right_bracket bitmap
504 help_right_bracket_bitmap = bm_load("right_bracket");
505 if(help_right_bracket_bitmap < 0){
506 // we failed to load the bitmap - this is very bad
510 // load left_bracket bitmap
511 help_left_bracket_bitmap = bm_load("left_bracket");
512 if(help_left_bracket_bitmap < 0){
513 // we failed to load the bitmap - this is very bad
523 // parses help.tbl and populates help_overlaylist[]
527 int overlay_id, currcount;
528 char buf[HELP_MAX_STRING_LENGTH + 1];
534 read_file_text(HELP_OVERLAY_FILENAME);
536 // for each overlay...
537 for (overlay_id=0; overlay_id<MAX_HELP_OVERLAYS; overlay_id++) {
540 skip_to_string(help_overlay_section_names[overlay_id]);
542 // clear out counters in the overlay struct
543 help_overlaylist[overlay_id].plinecount = 0;
544 help_overlaylist[overlay_id].textcount = 0;
545 help_overlaylist[overlay_id].rbracketcount = 0;
546 help_overlaylist[overlay_id].lbracketcount = 0;
548 // read in all elements for this overlay
549 while (!(check_for_string("$end"))) {
551 if (optional_string("+pline")) {
553 currcount = help_overlaylist[overlay_id].plinecount;
554 int a, b; // temp vars to read in int before cast to float;
556 if (currcount < HELP_MAX_ITEM) {
557 // read number of pline vertices
558 stuff_int(&help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount); // note that it is read into GR_640
559 // 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
560 Assert(help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount <= HELP_MAX_PLINE_VERTICES);
561 // get 640x480 vertex coordinates
562 for (i=0; i<help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount; i++) {
565 help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.x = (float)a;
566 help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.y = (float)b;
567 help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.z = 0.0f;
568 help_overlaylist[overlay_id].plinelist[GR_640][currcount].pvtx[i] = &help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i];
570 // get 1024x768 vertex coordinates
571 for (i=0; i<help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount; i++) {
574 help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.x = (float)a;
575 help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.y = (float)b;
576 help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.z = 0.0f;
577 help_overlaylist[overlay_id].plinelist[GR_1024][currcount].pvtx[i] = &help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i];
581 //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));
582 help_overlaylist[overlay_id].plinecount++;
584 } else if (optional_string("+text")) {
586 currcount = help_overlaylist[overlay_id].textcount;
588 if (currcount < HELP_MAX_ITEM) {
589 // get 640x480 coordinates
590 stuff_int(&(help_overlaylist[overlay_id].textlist[GR_640][currcount].x_coord));
591 stuff_int(&(help_overlaylist[overlay_id].textlist[GR_640][currcount].y_coord));
592 // get 1024x768 coordinates
593 stuff_int(&(help_overlaylist[overlay_id].textlist[GR_1024][currcount].x_coord));
594 stuff_int(&(help_overlaylist[overlay_id].textlist[GR_1024][currcount].y_coord));
596 // get string (always use the GR_640 one)
597 stuff_string(buf, F_MESSAGE, NULL);
598 help_overlaylist[overlay_id].textlist[GR_640][currcount].string = strdup(buf);
600 //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));
601 help_overlaylist[overlay_id].textcount++;
604 } else if (optional_string("+right_bracket")) {
606 currcount = help_overlaylist[overlay_id].rbracketcount;
608 if (currcount < HELP_MAX_ITEM) {
609 // get 640x480 coordinates
610 stuff_int(&(help_overlaylist[overlay_id].rbracketlist[GR_640][currcount].x_coord));
611 stuff_int(&(help_overlaylist[overlay_id].rbracketlist[GR_640][currcount].y_coord));
612 // get 1024x768 coordinates
613 stuff_int(&(help_overlaylist[overlay_id].rbracketlist[GR_1024][currcount].x_coord));
614 stuff_int(&(help_overlaylist[overlay_id].rbracketlist[GR_1024][currcount].y_coord));
616 //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));
617 help_overlaylist[overlay_id].rbracketcount++;
620 } else if (optional_string("+left_bracket")) {
622 currcount = help_overlaylist[overlay_id].lbracketcount;
624 if (currcount < HELP_MAX_ITEM) {
625 // get 640x480 coordinates
626 stuff_int(&(help_overlaylist[overlay_id].lbracketlist[GR_640][currcount].x_coord));
627 stuff_int(&(help_overlaylist[overlay_id].lbracketlist[GR_640][currcount].y_coord));
628 // get 1024x768 coordinates
629 stuff_int(&(help_overlaylist[overlay_id].lbracketlist[GR_1024][currcount].x_coord));
630 stuff_int(&(help_overlaylist[overlay_id].lbracketlist[GR_1024][currcount].y_coord));
632 //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));
633 help_overlaylist[overlay_id].lbracketcount++;
637 // help.tbl is corrupt
645 // close localization
652 // draw overlay on the screen
653 void help_overlay_blit(int overlay_id)
656 Overlay = bm_load(Help_overlays[overlay_id]);
662 gr_set_bitmap(Overlay);
666 int idx, width, height;
667 int plinecount = help_overlaylist[overlay_id].plinecount;
668 int textcount = help_overlaylist[overlay_id].textcount;
669 int rbracketcount = help_overlaylist[overlay_id].rbracketcount;
670 int lbracketcount = help_overlaylist[overlay_id].lbracketcount;
672 Assert(overlay_id >= 0 && overlay_id < MAX_HELP_OVERLAYS);
674 // this draws each line of help text with white on black text (use the GR_640 index for the string)
675 for (idx = 0; idx < textcount; idx++) {
676 gr_set_color_fast(&Color_black);
677 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));
678 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);
679 gr_set_color_fast(&Color_bright_white);
680 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);
683 // this draws each right bracket
684 for (idx = 0; idx < rbracketcount; idx++) {
685 gr_set_bitmap(help_right_bracket_bitmap);
686 gr_bitmap(help_overlaylist[overlay_id].rbracketlist[gr_screen.res][idx].x_coord, help_overlaylist[overlay_id].rbracketlist[gr_screen.res][idx].y_coord);
689 // this draws each left bracket
690 for (idx = 0; idx < lbracketcount; idx++) {
691 gr_set_bitmap(help_left_bracket_bitmap);
692 gr_bitmap(help_overlaylist[overlay_id].lbracketlist[gr_screen.res][idx].x_coord, help_overlaylist[overlay_id].lbracketlist[gr_screen.res][idx].y_coord);
695 // this draws each 2d line for the help screen
696 //gr_set_color_fast(&Color_yellow);
697 gr_set_color(255, 255, 0);
698 for (idx = 0; idx<plinecount; idx++) {
699 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);
705 // --------------------------------------------------
707 // --------------------------------------------------
709 DCF(help_reload, "Reloads help overlay data from help.tbl")
716 dc_printf( "Usage: sample\nCrashes your machine.\n" );
720 dc_printf( "Yes, my master." );
724 int h_textnum=0, h_amt=0, h_vtx = 0;
726 void nudgetext_x(int textnum, int amount)
728 help_overlaylist[current_helpid].textlist[gr_screen.res][textnum].x_coord += amount;
730 void nudgetext_y(int textnum, int amount)
732 help_overlaylist[current_helpid].textlist[gr_screen.res][textnum].y_coord += amount;
734 void nudgepline_x(int plinenum, int plinevert, int amount)
736 help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].xyz.x += amount;
738 void nudgepline_y(int plinenum, int plinevert, int amount)
740 help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].xyz.y += amount;
742 void nudgerbracket_x(int num, int amount)
744 help_overlaylist[current_helpid].rbracketlist[gr_screen.res][num].x_coord += amount;
746 void nudgerbracket_y(int num, int amount)
748 help_overlaylist[current_helpid].rbracketlist[gr_screen.res][num].y_coord += amount;
750 void nudgelbracket_x(int num, int amount)
752 help_overlaylist[current_helpid].lbracketlist[gr_screen.res][num].x_coord += amount;
754 void nudgelbracket_y(int num, int amount)
756 help_overlaylist[current_helpid].lbracketlist[gr_screen.res][num].y_coord += amount;
758 void showtextpos(int textnum)
760 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 );
762 void showrbracketpos(int num)
764 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 );
766 void showlbracketpos(int num)
768 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 );
770 void showplinepos(int plinenum)
773 dc_printf("pline %d on overlay %d vertices are now ", plinenum, current_helpid, help_overlaylist[current_helpid].textlist[gr_screen.res][plinenum].y_coord );
774 for (i=0; i<help_overlaylist[current_helpid].plinelist[GR_640][plinenum].vtxcount; i++)
776 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);
780 DCF(help_nudgetext_x, "Use to visually position overlay text.")
784 if(Dc_arg_type & ARG_INT){
785 h_textnum = Dc_arg_int;
788 if(Dc_arg_type & ARG_INT){
791 nudgetext_x(h_textnum, h_amt);
795 dc_printf( "Usage: sample\nCrashes your machine.\n" );
799 showtextpos(h_textnum);
803 DCF(help_nudgetext_y, "Use to visually position overlay text.")
807 if(Dc_arg_type & ARG_INT){
808 h_textnum = Dc_arg_int;
811 if(Dc_arg_type & ARG_INT){
814 nudgetext_y(h_textnum, h_amt);
818 dc_printf( "Usage: sample\nCrashes your machine.\n" );
822 showtextpos(h_textnum);
826 DCF(help_nudgepline_x, "Use to visually position overlay polylines.")
830 if(Dc_arg_type & ARG_INT){
831 h_textnum = Dc_arg_int;
834 if(Dc_arg_type & ARG_INT){
838 if(Dc_arg_type & ARG_INT){
841 nudgepline_x(h_textnum, h_vtx, h_amt);
845 dc_printf( "Usage: help_nudgepline [pline_number] [vertex_number] [distance]\n" );
849 showplinepos(h_textnum);
854 DCF(help_nudgepline_y, "Use to visually position overlay polylines.")
858 if(Dc_arg_type & ARG_INT){
859 h_textnum = Dc_arg_int;
862 if(Dc_arg_type & ARG_INT){
866 if(Dc_arg_type & ARG_INT){
869 nudgepline_y(h_textnum, h_vtx, h_amt);
873 dc_printf( "Usage: help_nudgepline [pline_number] [vertex_number] [distance]\n" );
877 showplinepos(h_textnum);
882 DCF(help_nudgerbracket_x, "Use to visually position overlay right bracket.")
886 if(Dc_arg_type & ARG_INT){
887 h_textnum = Dc_arg_int;
890 if(Dc_arg_type & ARG_INT){
893 nudgerbracket_x(h_textnum, h_amt);
897 dc_printf( "Usage: help_nudgerbracket_x [num] [amount]\n" );
901 showrbracketpos(h_textnum);
905 DCF(help_nudgerbracket_y, "Use to visually position overlay right bracket.")
909 if(Dc_arg_type & ARG_INT){
910 h_textnum = Dc_arg_int;
913 if(Dc_arg_type & ARG_INT){
916 nudgerbracket_y(h_textnum, h_amt);
920 dc_printf( "Usage: help_nudgerbracket_y [num] [amount]\n" );
924 showrbracketpos(h_textnum);
931 DCF(help_nudgelbracket_x, "Use to visually position overlay left bracket.")
935 if(Dc_arg_type & ARG_INT){
936 h_textnum = Dc_arg_int;
939 if(Dc_arg_type & ARG_INT){
942 nudgelbracket_x(h_textnum, h_amt);
946 dc_printf( "Usage: help_nudgelbracket_x [num] [amount]\n" );
950 showlbracketpos(h_textnum);
954 DCF(help_nudgelbracket_y, "Use to visually position overlay left bracket.")
958 if(Dc_arg_type & ARG_INT){
959 h_textnum = Dc_arg_int;
962 if(Dc_arg_type & ARG_INT){
965 nudgelbracket_y(h_textnum, h_amt);
969 dc_printf( "Usage: help_nudgelbracket_y [num] [amount]\n" );
973 showlbracketpos(h_textnum);