home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / editor / objpage.c < prev    next >
Text File  |  1998-06-08  |  16KB  |  576 lines

  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  12. */
  13. /*
  14.  * $Source: f:/miner/source/main/editor/rcs/objpage.c $
  15.  * $Revision: 2.0 $
  16.  * $Author: john $
  17.  * $Date: 1995/02/27 11:34:43 $
  18.  * 
  19.  * object selection stuff.
  20.  * 
  21.  * $Log: objpage.c $
  22.  * Revision 2.0  1995/02/27  11:34:43  john
  23.  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
  24.  * for bitmaps.tbl.
  25.  * 
  26.  * Revision 1.37  1995/01/14  19:17:55  john
  27.  * First version of object paging.
  28.  * 
  29.  * Revision 1.36  1995/01/05  16:20:13  mike
  30.  * bah, remove the int3.
  31.  * 
  32.  * Revision 1.35  1995/01/05  12:47:13  mike
  33.  * Move code about to prevent compiler warning.
  34.  * 
  35.  * Revision 1.34  1994/11/18  15:23:55  john
  36.  * Made so the int3 for drawing an invalib object just returns.
  37.  * 
  38.  * Revision 1.33  1994/11/02  16:19:18  matt
  39.  * Moved draw_model_picture() out of editor, and cleaned up code
  40.  * 
  41.  * Revision 1.32  1994/10/23  02:11:18  matt
  42.  * Got rid of obsolete hostage_info stuff
  43.  * 
  44.  * Revision 1.31  1994/09/09  14:41:35  matt
  45.  * New parms for draw_polygon_model()
  46.  * 
  47.  * Revision 1.30  1994/08/29  19:26:53  matt
  48.  * Fixed botches change from yesterday
  49.  * 
  50.  * Revision 1.29  1994/08/28  23:40:35  matt
  51.  * 
  52.  * 
  53.  * Revision 1.28  1994/08/14  23:15:32  matt
  54.  * Added animating bitmap hostages, and cleaned up vclips a bit
  55.  * 
  56.  * Revision 1.27  1994/08/13  14:59:02  matt
  57.  * Finished adding support for miscellaneous objects
  58.  * 
  59.  * Revision 1.26  1994/08/09  16:06:15  john
  60.  * Added the ability to place players.  Made old
  61.  * Player variable be ConsoleObject.
  62.  * 
  63.  * Revision 1.25  1994/07/28  16:59:23  mike
  64.  * objects containing objects.
  65.  * 
  66.  * Revision 1.24  1994/06/08  18:17:25  john
  67.  * Changed the way object types and id's work for hostages
  68.  * and powerups.
  69.  * 
  70.  * Revision 1.23  1994/06/07  16:52:30  matt
  71.  * Made object lighting work correctly; changed name of Ambient_light to
  72.  * Dynamic_light; cleaned up polygobj object rendering a little.
  73.  * 
  74.  * Revision 1.22  1994/05/31  18:42:07  matt
  75.  * Made robot photos unlighted
  76.  * 
  77.  * Revision 1.21  1994/05/26  21:09:34  matt
  78.  * Moved robot stuff out of polygon model and into robot_info struct
  79.  * Made new file, robot.c, to deal with robots
  80.  * 
  81.  * Revision 1.20  1994/05/19  12:10:11  matt
  82.  * Use new vecmat macros and globals
  83.  * 
  84.  * Revision 1.19  1994/05/17  14:45:27  mike
  85.  * Get object type and id from ObjType and ObjId.
  86.  * 
  87.  * Revision 1.18  1994/05/17  12:03:36  mike
  88.  * Deal with little known fact that polygon object != robot.
  89.  * 
  90.  * Revision 1.17  1994/04/29  09:16:56  matt
  91.  * Added support for multiple-piece explosions
  92.  * 
  93.  * Revision 1.16  1994/04/18  14:15:00  john
  94.  * Initial version of robot dialog box.
  95.  * 
  96.  * Revision 1.15  1994/04/11  12:01:36  yuan
  97.  * Fixed resetting to first object on page annoyance.
  98.  * 
  99.  * Revision 1.14  1994/04/01  14:35:50  yuan
  100.  * Removed debug "id %d\n" for placing objects
  101.  * 
  102.  * Revision 1.13  1994/04/01  11:17:04  yuan
  103.  * Added objects to objpage. Added buttons for easier tmap scrolling.
  104.  * Objects are selected fully from objpage and add object menu or pad.
  105.  * 
  106.  * Revision 1.12  1994/03/25  18:42:26  matt
  107.  * Adjusted constant to make robot pictures more correct size
  108.  * 
  109.  * Revision 1.11  1994/03/25  16:57:17  matt
  110.  * New parm to draw_polygon_object(), and draw object "snapshots" in
  111.  * correct size (although this probably doesn't work yet).
  112.  * 
  113.  * Revision 1.10  1994/03/25  14:23:01  matt
  114.  * Disabled lighting when taking "snapshots" of robots
  115.  * 
  116.  * Revision 1.9  1994/03/17  10:47:24  john
  117.  * Corrected all kinds of problems associated with N_polygon_objects.
  118.  * 
  119.  * Revision 1.8  1994/03/16  11:07:31  john
  120.  * Made zoom work a bit better.
  121.  * 
  122.  * Revision 1.7  1994/03/16  10:50:32  john
  123.  * fixed warning with constant length.
  124.  * 
  125.  * Revision 1.6  1994/03/16  10:43:18  john
  126.  * Added controls to rotate/zoom object.
  127.  * 
  128.  * Revision 1.5  1994/03/15  22:23:24  matt
  129.  * Render little bitmap pictures of robots for display on editor page
  130.  * 
  131.  * Revision 1.4  1994/02/01  11:27:14  john
  132.  * Hacked in 8 object types for demo.
  133.  * 
  134.  * Revision 1.3  1994/01/26  16:42:19  john
  135.  * Display numbers instead of bitmaps... made 
  136.  * Num_robot_types or whatever be set to 4
  137.  * in init_object_page... this is a hack!!!
  138.  * 
  139.  * Revision 1.2  1993/12/16  17:26:24  john
  140.  * Moved texture and object selection to texpage and objpage
  141.  * 
  142.  * Revision 1.1  1993/12/16  16:12:57  john
  143.  * Initial revision
  144.  * 
  145.  * 
  146.  */
  147.  
  148.  
  149.  
  150. #pragma off (unreferenced)
  151. static char rcsid[] = "$Id: objpage.c 2.0 1995/02/27 11:34:43 john Exp $";
  152. #pragma on (unreferenced)
  153.  
  154. // Num_robot_types -->  N_polygon_models
  155. // Cur_robot_type --> Cur_robot_type
  156. // Texture[Cur_robot_type]->bitmap  ---> robot_bms[robot_bm_nums[ Cur_robot_type ] ] 
  157.  
  158. #include <stdlib.h>
  159. #include <stdio.h>
  160.  
  161.  
  162. #include "inferno.h"
  163. #include "screens.h"            // For GAME_SCREEN?????
  164. #include "editor.h"            // For TMAP_CURBOX??????
  165. #include "gr.h"                // For canves, font stuff
  166. #include "ui.h"                // For UI_GADGET stuff
  167. #include "object.h"            // For robot_bms
  168. #include "mono.h"                // For debugging
  169. #include "error.h"
  170.  
  171. #include "objpage.h"
  172. #include "bm.h"
  173. #include "player.h"
  174. #include "piggy.h"
  175.  
  176.  
  177. #define OBJS_PER_PAGE 8
  178.  
  179. static UI_GADGET_USERBOX * ObjBox[OBJS_PER_PAGE];
  180. static UI_GADGET_USERBOX * ObjCurrent;
  181.  
  182. static int ObjectPage = 0;
  183.  
  184. //static char Description[8][20] = { "Pig", "Star", "Little\nJosh", "Big\nJosh", "Flying\nPig", "Flying\nStar", 
  185. //"Little\nFlying\nJosh", "Big\nFlying\nJosh" };
  186.  
  187. //static grs_canvas * ObjnameCanvas;
  188. //static char object_filename[13];
  189.  
  190. //static void objpage_print_name( char name[13] ) {
  191. //     short w,h,aw;
  192. //
  193. //    gr_set_current_canvas( ObjnameCanvas );
  194. //    gr_get_string_size( name, &w, &h, &aw );
  195. //    gr_string( 0, 0, name );              
  196. //     //gr_set_fontcolor( CBLACK, CWHITE );
  197. //}
  198.  
  199. //static void objpage_display_name( char *format, ... ) {
  200. //    va_list ap;
  201. //
  202. //    va_start(ap, format);
  203. //   vsprintf(object_filename, format, ap);
  204. //    va_end(ap);
  205. //
  206. //   objpage_print_name(object_filename);
  207. //        
  208. //}
  209.  
  210. #include "vecmat.h"
  211. #include "3d.h"
  212. #include "polyobj.h"
  213. #include "texmap.h"
  214.  
  215. #include "hostage.h"
  216. #include "powerup.h"
  217.  
  218. vms_angvec objpage_view_orient;
  219. fix objpage_view_dist;
  220.  
  221. //this is bad to have the extern, but this snapshot stuff is special
  222. extern int polyobj_lighting;
  223.  
  224.  
  225. //canvas set
  226. //    Type is optional.  If you pass -1, type is determined, else type is used, and id is not xlated through ObjId.
  227. draw_robot_picture(int id, vms_angvec *orient_angles, int type)
  228. {
  229.  
  230.     if (id >= Num_total_object_types)
  231.         return;
  232.  
  233.     if ( type == -1 )    {
  234.         type = ObjType[id];        // Find the object type, given an object id.
  235.         id = ObjId[id];    // Translate to sub-id.
  236.     }
  237.  
  238.     switch (type) {
  239.  
  240.         case OL_HOSTAGE:
  241.             PIGGY_PAGE_IN(Vclip[Hostage_vclip_num[id]].frames[0]);
  242.             gr_bitmap(0,0,&GameBitmaps[Vclip[Hostage_vclip_num[id]].frames[0].index]);
  243.             break;
  244.  
  245.         case OL_POWERUP:
  246.             if ( Powerup_info[id].vclip_num > -1 )    {
  247.                 PIGGY_PAGE_IN(Vclip[Powerup_info[id].vclip_num].frames[0]);
  248.                 gr_bitmap(0,0,&GameBitmaps[Vclip[Powerup_info[id].vclip_num].frames[0].index]);
  249.             }
  250.             break;
  251.  
  252.         case OL_PLAYER:
  253.             draw_model_picture(Player_ship->model_num,orient_angles);        // Draw a poly model below
  254.             break;
  255.  
  256.         case OL_ROBOT:
  257.             draw_model_picture(Robot_info[id].model_num,orient_angles);    // Draw a poly model below
  258.             break;
  259.  
  260.         case OL_CONTROL_CENTER:
  261.         case OL_CLUTTER:
  262.             draw_model_picture(id,orient_angles);
  263.             break;
  264.         default:
  265.             //Int3();    // Invalid type!!!
  266.             return;
  267.     }
  268.  
  269. }
  270.  
  271. void redraw_current_object()
  272. {
  273.     grs_canvas * cc;
  274.  
  275.     cc = grd_curcanv;
  276.     gr_set_current_canvas(ObjCurrent->canvas);
  277.     draw_robot_picture(Cur_robot_type,&objpage_view_orient, -1);
  278.     gr_set_current_canvas(cc);
  279. }
  280.  
  281. void gr_label_box( int i)
  282. {
  283.  
  284.     gr_clear_canvas(BM_XRGB(0,0,0));
  285.     draw_robot_picture(i,&objpage_view_orient, -1);
  286.  
  287. //    char s[20];
  288. //    sprintf( s, " %d ", i );
  289. //    gr_clear_canvas( BM_XRGB(0,15,0) );
  290. //    gr_set_fontcolor( CWHITE, BM_XRGB(0,15,0) );
  291. //    ui_string_centered(  grd_curcanv->cv_bitmap.bm_w/2, grd_curcanv->cv_bitmap.bm_h/2, Description[i] );
  292. }
  293.  
  294. int objpage_goto_first()
  295. {
  296.     int i;
  297.  
  298.     ObjectPage=0;
  299.     for (i=0;  i<OBJS_PER_PAGE; i++ ) {
  300.         gr_set_current_canvas(ObjBox[i]->canvas);
  301.         if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types ) {
  302.             //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
  303.             gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
  304.         } else
  305.             gr_clear_canvas( CGREY );
  306.     }
  307.  
  308.     return 1;
  309. }
  310.  
  311. int objpage_goto_last()
  312. {
  313.     int i;
  314.  
  315.     ObjectPage=(Num_total_object_types)/OBJS_PER_PAGE;
  316.     for (i=0;  i<OBJS_PER_PAGE; i++ )
  317.     {
  318.         gr_set_current_canvas(ObjBox[i]->canvas);
  319.         if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types )
  320.         {
  321.             //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
  322.             gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
  323.         } else {
  324.             gr_clear_canvas( CGREY );
  325.         }
  326.     }
  327.     return 1;
  328. }
  329.  
  330. static int objpage_goto_prev()
  331. {
  332.     int i;
  333.     if (ObjectPage > 0) {
  334.         ObjectPage--;
  335.         for (i=0;  i<OBJS_PER_PAGE; i++ )
  336.         {
  337.             gr_set_current_canvas(ObjBox[i]->canvas);
  338.             if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types)
  339.             {
  340.                 //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
  341.                 gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
  342.             } else {
  343.                 gr_clear_canvas( CGREY );
  344.             }
  345.         }
  346.     }
  347.     return 1;
  348. }
  349.  
  350. static int objpage_goto_next()
  351. {
  352.     int i;
  353.     if ((ObjectPage+1)*OBJS_PER_PAGE < Num_total_object_types) {
  354.         ObjectPage++;
  355.         for (i=0;  i<OBJS_PER_PAGE; i++ )
  356.         {
  357.             gr_set_current_canvas(ObjBox[i]->canvas);
  358.             if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types)
  359.             {
  360.                 //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
  361.                 gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
  362.             } else {
  363.                 gr_clear_canvas( CGREY );
  364.             }
  365.         }
  366.     }
  367.     return 1;
  368. }
  369.  
  370. int objpage_grab_current(int n)
  371. {
  372.     int i;
  373.  
  374.     if ( (n<0) || ( n>= Num_total_object_types) ) return 0;
  375.     
  376.     ObjectPage = n / OBJS_PER_PAGE;
  377.     
  378.     if (ObjectPage*OBJS_PER_PAGE < Num_total_object_types) {
  379.         for (i=0;  i<OBJS_PER_PAGE; i++ )
  380.         {
  381.             gr_set_current_canvas(ObjBox[i]->canvas);
  382.             if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types)
  383.             {
  384.                 //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
  385.                 gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
  386.             } else {
  387.                 gr_clear_canvas( CGREY );
  388.             }
  389.         }
  390.     }
  391.  
  392.     Cur_robot_type = n;
  393.     gr_set_current_canvas(ObjCurrent->canvas);
  394.     //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ Cur_robot_type ] ] );
  395.     gr_label_box(Cur_robot_type);
  396.  
  397.     //objpage_display_name( Texture[Cur_robot_type]->filename );
  398.     
  399.     return 1;
  400. }
  401.  
  402. int objpage_goto_next_object()
  403. {
  404.     int n;
  405.  
  406.     n = Cur_robot_type++;
  407.      if (n >= Num_total_object_types) n = 0;
  408.  
  409.     objpage_grab_current(n);
  410.  
  411.     return 1;
  412.  
  413. }
  414.  
  415. #define OBJBOX_X    (TMAPBOX_X)    //location of first one
  416. #define OBJBOX_Y    (OBJCURBOX_Y - 24 )
  417. #define OBJBOX_W    64
  418. #define OBJBOX_H    64
  419.  
  420. #define DELTA_ANG 0x800
  421.  
  422. int objpage_increase_pitch()
  423. {
  424.     objpage_view_orient.p += DELTA_ANG;
  425.     redraw_current_object();
  426.     return 1;
  427. }
  428.  
  429. int objpage_decrease_pitch()
  430. {
  431.     objpage_view_orient.p -= DELTA_ANG;
  432.     redraw_current_object();
  433.     return 1;
  434. }
  435.  
  436. int objpage_increase_heading()
  437. {
  438.     objpage_view_orient.h += DELTA_ANG;
  439.     redraw_current_object();
  440.     return 1;
  441. }
  442.  
  443. int objpage_decrease_heading()
  444. {
  445.     objpage_view_orient.h -= DELTA_ANG;
  446.     redraw_current_object();
  447.     return 1;
  448. }
  449.  
  450. int objpage_increase_bank()
  451. {
  452.     objpage_view_orient.b += DELTA_ANG;
  453.     redraw_current_object();
  454.     return 1;
  455. }
  456.  
  457. int objpage_decrease_bank()
  458. {
  459.     objpage_view_orient.b -= DELTA_ANG;
  460.     redraw_current_object();
  461.     return 1;
  462. }
  463.  
  464. int objpage_increase_z()
  465. {
  466.     objpage_view_dist -= 0x8000;
  467.     redraw_current_object();
  468.     return 1;
  469. }
  470.  
  471. int objpage_decrease_z()
  472. {
  473.     objpage_view_dist += 0x8000;
  474.     redraw_current_object();
  475.     return 1;
  476. }
  477.  
  478. int objpage_reset_orient()
  479. {
  480.     objpage_view_orient.p = 0;
  481.     objpage_view_orient.b = 0;
  482.     objpage_view_orient.h = -0x8000;
  483.     //objpage_view_dist = DEFAULT_VIEW_DIST;
  484.     redraw_current_object();
  485.     return 1;
  486. }
  487.  
  488.  
  489. // INIT TEXTURE STUFF
  490.  
  491. void objpage_init( UI_WINDOW *win )
  492. {
  493.     int i;
  494.  
  495.     //Num_total_object_types = N_polygon_models + N_hostage_types + N_powerup_types;
  496.     //Assert (N_polygon_models < MAX_POLYGON_MODELS);
  497.     //Assert (Num_total_object_types < MAX_OBJTYPE );
  498.     //Assert (N_hostage_types < MAX_HOSTAGE_TYPES ); 
  499.     //Assert (N_powerup_types < MAX_POWERUP_TYPES );
  500.     // Assert (N_robot_types < MAX_ROBOTS);
  501.  
  502.     ui_add_gadget_button( win, OBJCURBOX_X + 00, OBJCURBOX_Y - 27, 30, 20, "<<", objpage_goto_prev );
  503.     ui_add_gadget_button( win, OBJCURBOX_X + 32, OBJCURBOX_Y - 27, 30, 20, ">>", objpage_goto_next );
  504.  
  505.     ui_add_gadget_button( win, OBJCURBOX_X + 00, OBJCURBOX_Y - 54, 30, 20, "B", objpage_goto_first );
  506.     ui_add_gadget_button( win, OBJCURBOX_X + 32, OBJCURBOX_Y - 54, 30, 20, "E", objpage_goto_last );
  507.  
  508.     ui_add_gadget_button( win, OBJCURBOX_X + 25, OBJCURBOX_Y + 62, 22, 13, "P-", objpage_decrease_pitch );
  509.     ui_add_gadget_button( win, OBJCURBOX_X + 25, OBJCURBOX_Y + 90, 22, 13, "P+", objpage_increase_pitch );
  510.     ui_add_gadget_button( win, OBJCURBOX_X + 00, OBJCURBOX_Y + 90, 22, 13, "B-", objpage_decrease_bank );
  511.     ui_add_gadget_button( win, OBJCURBOX_X + 50, OBJCURBOX_Y + 90, 22, 13, "B+", objpage_increase_bank );
  512.     ui_add_gadget_button( win, OBJCURBOX_X + 00, OBJCURBOX_Y + 76, 22, 13, "H-", objpage_decrease_heading );
  513.     ui_add_gadget_button( win, OBJCURBOX_X + 50, OBJCURBOX_Y + 76, 22, 13, "H+", objpage_increase_heading );
  514.     ui_add_gadget_button( win, OBJCURBOX_X + 00, OBJCURBOX_Y + 62, 22, 13, "Z+", objpage_increase_z );
  515.     ui_add_gadget_button( win, OBJCURBOX_X + 50, OBJCURBOX_Y + 62, 22, 13, "Z-", objpage_decrease_z );
  516.     ui_add_gadget_button( win, OBJCURBOX_X + 25, OBJCURBOX_Y + 76, 22, 13, "R", objpage_reset_orient );
  517.  
  518.     for (i=0;i<OBJS_PER_PAGE;i++)
  519.         ObjBox[i] = ui_add_gadget_userbox( win, OBJBOX_X + (i/2)*(2+OBJBOX_W), OBJBOX_Y + (i%2)*(2+OBJBOX_H), OBJBOX_W, OBJBOX_H);
  520.  
  521.     ObjCurrent = ui_add_gadget_userbox( win, OBJCURBOX_X, OBJCURBOX_Y-5, 64, 64 );
  522.  
  523.     objpage_reset_orient();
  524.  
  525.     for (i=0;  i<OBJS_PER_PAGE; i++ )
  526.     {
  527.         gr_set_current_canvas(ObjBox[i]->canvas);
  528.         if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types)
  529.         {
  530.                 //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
  531.                 gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
  532.         } else {
  533.             gr_clear_canvas( CGREY );
  534.         }
  535.     }
  536.  
  537. // Don't reset robot_type when we return to editor.
  538. //    Cur_robot_type = ObjectPage*OBJS_PER_PAGE;
  539.     gr_set_current_canvas(ObjCurrent->canvas);
  540.     //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ Cur_robot_type ] ] );
  541.     gr_label_box(Cur_robot_type);
  542.  
  543.     //ObjnameCanvas = gr_create_sub_canvas(&grd_curscreen->sc_canvas, OBJCURBOX_X , OBJCURBOX_Y + OBJBOX_H + 10, 100, 20);
  544.     //gr_set_current_canvas( ObjnameCanvas );
  545.     //gr_set_curfont( ui_small_font ); 
  546.    //gr_set_fontcolor( CBLACK, CWHITE );
  547.     //objpage_display_name( Texture[Cur_robot_type]->filename );
  548.  
  549. }
  550.  
  551. void objpage_close()
  552. {
  553.     //gr_free_sub_canvas(ObjnameCanvas);
  554. }
  555.  
  556.  
  557. // DO TEXTURE STUFF
  558.  
  559. void objpage_do()
  560. {
  561.     int i;
  562.  
  563.     for (i=0; i<OBJS_PER_PAGE; i++ )
  564.     {
  565.         if (ObjBox[i]->b1_clicked && (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types))
  566.         {
  567.             Cur_robot_type = i+ObjectPage*OBJS_PER_PAGE;
  568.             gr_set_current_canvas(ObjCurrent->canvas);
  569.             //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ Cur_robot_type ] ] );
  570.             gr_label_box(Cur_robot_type);
  571.             //objpage_display_name( Texture[Cur_robot_type]->filename );
  572.         }
  573.     }
  574. }
  575. 
  576.