home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1992-1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #include "Help.h"
- #include <gl/gl.h>
- #include <gl/device.h>
- #include <fmclient.h>
-
- #define TITLE_COL 0xFFFFFF
- #define TEXT_COL 0xFF00
-
- static void draw_string(fmfonthandle font, char *s);
- static float xpos, ypos;
-
- // draws the string at the current xpos and ypos
- // then updates ypos downward by a reasonable
- // amount.
- static void draw_string(fmfonthandle font, char *s)
- {
- fmfontinfo font_info;
- fmgetfontinfo(font, &font_info);
-
- long pixels_high = font_info.height;
-
- cmov2(xpos,ypos);
- fmsetfont(font);
- fmprstr(s);
-
- ypos -= 1.4*pixels_high;
- }
-
- // draws help given window area in pixels
- void draw_help(long width, long height)
- {
- fmfonthandle font1, title, text;
- float tmp, tmp2;
-
- font1 = fmfindfont("Hlv");
- title = fmscalefont(font1, (float)width/70.0);
- text = fmscalefont(font1, (float)width/80.0);
-
- cpack(0);
- clear();
-
- ortho2(0,width,0,height);
-
- float top = height - height/15;
- float col1 = width/20;
- float col2 = width/3 + width/30;
- float col3 = 2*width/3 + 2*width/20;
-
- xpos = col1;
- ypos = top;
-
- cpack(TITLE_COL);
- draw_string(title,"Welcome to Backseat Driver");
- draw_string(text,"");
-
- cpack(TITLE_COL);
- draw_string(title,"Car Controls");
- cpack(TEXT_COL);
- tmp = ypos;
- draw_string(text,"Left-Right");
- draw_string(text," Mouse Motion");
- draw_string(text,"");
- draw_string(text,"Right Mouse");
- draw_string(text,"Middle Mouse");
- draw_string(text,"");
- draw_string(text,"A");
- draw_string(text,"Z");
- draw_string(text," or use");
- draw_string(text,"1-2-3-4-5-N");
- draw_string(text,"");
- draw_string(text,"I");
- tmp2 = ypos;
-
- ypos = tmp;
- xpos = col1 + width/8;
- draw_string(text,"Steering");
- draw_string(text,"");
- draw_string(text,"");
- draw_string(text,"Gas");
- draw_string(text,"Brakes");
- draw_string(text,"");
- draw_string(text,"Upshift");
- draw_string(text,"Downshift");
- draw_string(text,"");
- draw_string(text,"");
- draw_string(text,"");
- draw_string(text,"Ignition");
-
- xpos = col1;
- ypos = tmp2;
- cpack(TITLE_COL);
- draw_string(text,"");
- draw_string(title,"Program Controls");
- cpack(TEXT_COL);
- tmp = ypos;
- draw_string(text,"Esc");
- draw_string(text,"R");
- draw_string(text,"");
- draw_string(text,"V");
- draw_string(text,"G");
- draw_string(text,"S");
- draw_string(text,"D");
-
- ypos = tmp;
- xpos = col1 + width/16;
- draw_string(text,"Exit");
- draw_string(text,"Reset Everything");
- draw_string(text,"");
- draw_string(text,"Toggle Driver/Helicopter View");
- draw_string(text,"Toggle Fog (if available)");
- draw_string(text,"Toggle Sound (if available)");
- draw_string(text,"Toggle Draw Style");
-
- xpos = col2;
- ypos = top;
- cpack(TITLE_COL);
- draw_string(title,"Helpful Hints");
- cpack(TEXT_COL);
- draw_string(text,"To start the engine, hold the gas and ignition");
- draw_string(text,"simultaneously. Be sure you are in neutral.");
- draw_string(text,"");
- draw_string(text,"Beating your best lap time gives you more gas.");
- draw_string(text,"");
- draw_string(text,"Running without sound (using the S key");
- draw_string(text,"or the -quiet option) will simultaneously");
- draw_string(text,"increase graphics frame rate and please your");
- draw_string(text,"office-mates.");
- draw_string(text,"");
- draw_string(text,"Running other CPU intensive programs");
- draw_string(text,"may degrade the graphics frame rate and cause");
- draw_string(text,"audio 'skipping.' Be sure to kill unwanted");
- draw_string(text,"programs before running Backseat Driver.");
- draw_string(text,"");
- draw_string(text,"Driving way off the road or turning");
- draw_string(text,"around and driving in the opposite direction");
- draw_string(text,"will cause the display to become confused.");
- draw_string(text,"This is a bug in Backseat Driver and will be");
- draw_string(text,"fixed in a future release.");
- draw_string(text,"");
- draw_string(text,"Always drive defensively, wear your seatbelt,");
- draw_string(text,"and never, ever drink and drive.");
-
- xpos = col3;
- ypos = top;
- cpack(TITLE_COL);
- draw_string(title,"Author");
- cpack(TEXT_COL);
- draw_string(text,"Howard Look");
- draw_string(text,"howardl @ sgi.com");
-
- cpack(TITLE_COL);
- draw_string(text,"");
- draw_string(title,"Tons of Help from");
- cpack(TEXT_COL);
- draw_string(text,"Alain Dumesney");
- draw_string(text,"Bill Torzewski");
- draw_string(text,"Dave Ligon");
- draw_string(text,"Gary Tarolli");
- draw_string(text,"Gavin Bell");
- draw_string(text,"Gerald Anderson");
- draw_string(text,"Gints Klimanis");
- draw_string(text,"Jill Huchital");
- draw_string(text,"John Giannandrea");
- draw_string(text,"John Wilkinson");
- draw_string(text,"Mason Woo");
- draw_string(text,"Melissa Anderson");
- draw_string(text,"Micah Altman");
- draw_string(text,"Michael Toy");
- draw_string(text,"Nick Thompson");
- draw_string(text,"Paul Haeberli");
- draw_string(text,"Paul Strauss");
- draw_string(text,"Peter Broadwell");
- draw_string(text,"Rikk Carey");
- draw_string(text,"Rick Pasetto");
- draw_string(text,"Rob Mace");
- draw_string(text,"Vic Alessi");
- }
-
-