remove ObjType, ObjId, ObjStrength and OL_ constants; use "object" instead of "robot...
authorChris Taylor <chris@icculus.org>
Thu, 31 Mar 2005 09:38:53 +0000 (09:38 +0000)
committerChris Taylor <chris@icculus.org>
Thu, 31 Mar 2005 09:38:53 +0000 (09:38 +0000)
ChangeLog
main/bm.c
main/bm.h
main/bmread.c
main/editor/editor.h
main/editor/eglobal.c
main/editor/eobject.c
main/editor/medrobot.c
main/editor/objpage.c
main/editor/objpage.h

index d788056..7d26d2a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-03-31  Chris Taylor  <chris@icculus.org>
+
+       * main/bm.c, main/bm.h, main/bmread.c, main/editor/editor.h,
+       main/editor/eglobal.c, main/editor/eobject.c,
+       main/editor/medrobot.c, main/editor/objpage.c,
+       main/editor/objpage.h: remove ObjType, ObjId, ObjStrength and
+       OL_ constants; use "object" instead of "robot" in some places;
+       draw and place reactors with correct modelnum
+
 2005-03-29  Bradley Bell  <btb@icculus.org>
 
        * mem/mem.c: remove obsolete malloc.h
 2005-03-29  Bradley Bell  <btb@icculus.org>
 
        * mem/mem.c: remove obsolete malloc.h
index 2818160..8517eb6 100644 (file)
--- a/main/bm.c
+++ b/main/bm.c
@@ -1,4 +1,4 @@
-/* $Id: bm.c,v 1.48 2005-03-16 23:06:14 btb Exp $ */
+/* $Id: bm.c,v 1.49 2005-03-31 09:38:53 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -62,10 +62,7 @@ ubyte Sounds[MAX_SOUNDS];
 ubyte AltSounds[MAX_SOUNDS];
 
 #ifdef EDITOR
 ubyte AltSounds[MAX_SOUNDS];
 
 #ifdef EDITOR
-int Num_total_object_types;
-sbyte ObjType[MAX_OBJTYPE];
-sbyte ObjId[MAX_OBJTYPE];
-fix    ObjStrength[MAX_OBJTYPE];
+int Num_object_subtypes = 1;
 #endif
 
 //for each model, a model number for dying & dead variants, or -1 if none
 #endif
 
 //for each model, a model number for dying & dead variants, or -1 if none
index 9801aba..3b76705 100644 (file)
--- a/main/bm.h
+++ b/main/bm.h
@@ -1,4 +1,4 @@
-/* $Id: bm.h,v 1.14 2005-03-16 23:06:14 btb Exp $ */
+/* $Id: bm.h,v 1.15 2005-03-31 09:38:53 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -77,21 +77,7 @@ void bm_close();
 // Initializes the Texture[] array of bmd_bitmap structures.
 void init_textures();
 
 // Initializes the Texture[] array of bmd_bitmap structures.
 void init_textures();
 
-#define OL_ROBOT            1
-#define OL_HOSTAGE          2
-#define OL_POWERUP          3
-#define OL_CONTROL_CENTER   4
-#define OL_PLAYER           5
-#define OL_CLUTTER          6   //some sort of misc object
-#define OL_EXIT             7   //the exit model for external scenes
-#define OL_WEAPON           8   //a weapon that can be placed
-
-#define MAX_OBJTYPE         140
-
-extern int  Num_total_object_types;     // Total number of object types, including robots, hostages, powerups, control centers, faces
-extern sbyte ObjType[MAX_OBJTYPE];      // Type of an object, such as Robot, eg if ObjType[11] == OL_ROBOT, then object #11 is a robot
-extern sbyte ObjId[MAX_OBJTYPE];        // ID of a robot, within its class, eg if ObjType[11] == 3, then object #11 is the third robot
-extern fix  ObjStrength[MAX_OBJTYPE];   // initial strength of each object
+extern int  Num_object_subtypes;     // Number of possible IDs for the current type of object to be placed
 
 #define MAX_OBJ_BITMAPS     610
 
 
 #define MAX_OBJ_BITMAPS     610
 
index 0fc1672..7d2d778 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bmread.c,v 1.14 2005-02-26 07:04:47 chris Exp $ */
+/* $Id: bmread.c,v 1.15 2005-03-31 09:38:53 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -429,10 +429,6 @@ int bm_init_use_tbl()
 
        init_polygon_models();
 
 
        init_polygon_models();
 
-       ObjType[0] = OL_PLAYER;
-       ObjId[0] = 0;
-       Num_total_object_types = 1;
-
        for (i=0; i<MAX_SOUNDS; i++ )   {
                Sounds[i] = 255;
                AltSounds[i] = 255;
        for (i=0; i<MAX_SOUNDS; i++ )   {
                Sounds[i] = 255;
                AltSounds[i] = 255;
@@ -1266,8 +1262,6 @@ void bm_read_robot()
                Robot_info[N_robot_types].model_num = -1;
                N_robot_types++;
                Assert(N_robot_types < MAX_ROBOT_TYPES);
                Robot_info[N_robot_types].model_num = -1;
                N_robot_types++;
                Assert(N_robot_types < MAX_ROBOT_TYPES);
-               Num_total_object_types++;
-               Assert(Num_total_object_types < MAX_OBJTYPE);
                clear_to_end_of_line();
                return;
        }
                clear_to_end_of_line();
                return;
        }
@@ -1427,9 +1421,6 @@ void bm_read_robot()
                Int3();
        }
 
                Int3();
        }
 
-       ObjType[Num_total_object_types] = OL_ROBOT;
-       ObjId[Num_total_object_types] = N_robot_types;
-
        Robot_info[N_robot_types].exp1_vclip_num = exp1_vclip_num;
        Robot_info[N_robot_types].exp2_vclip_num = exp2_vclip_num;
        Robot_info[N_robot_types].exp1_sound_num = exp1_sound_num;
        Robot_info[N_robot_types].exp1_vclip_num = exp1_vclip_num;
        Robot_info[N_robot_types].exp2_vclip_num = exp2_vclip_num;
        Robot_info[N_robot_types].exp1_sound_num = exp1_sound_num;
@@ -1476,10 +1467,8 @@ void bm_read_robot()
        strcpy(Robot_names[N_robot_types], name);
 
        N_robot_types++;
        strcpy(Robot_names[N_robot_types], name);
 
        N_robot_types++;
-       Num_total_object_types++;
 
        Assert(N_robot_types < MAX_ROBOT_TYPES);
 
        Assert(N_robot_types < MAX_ROBOT_TYPES);
-       Assert(Num_total_object_types < MAX_OBJTYPE);
 
        bm_flag = BM_NONE;
 }
 
        bm_flag = BM_NONE;
 }
@@ -1514,8 +1503,6 @@ void bm_read_reactor()
        arg = strtok( NULL, space );
        first_bitmap_num = N_ObjBitmapPtrs;
 
        arg = strtok( NULL, space );
        first_bitmap_num = N_ObjBitmapPtrs;
 
-       type = OL_CONTROL_CENTER;
-
        while (arg!=NULL)       {
 
                equal_ptr = strchr( arg, '=' );
        while (arg!=NULL)       {
 
                equal_ptr = strchr( arg, '=' );
@@ -1526,13 +1513,6 @@ void bm_read_reactor()
 
                        // if we have john=cool, arg is 'john' and equal_ptr is 'cool'
 
 
                        // if we have john=cool, arg is 'john' and equal_ptr is 'cool'
 
-                       //@@if (!stricmp(arg,"type")) {
-                       //@@    if (!stricmp(equal_ptr,"controlcen"))
-                       //@@            type = OL_CONTROL_CENTER;
-                       //@@    else if (!stricmp(equal_ptr,"clutter"))
-                       //@@            type = OL_CLUTTER;
-                       //@@}
-
                        if (!stricmp( arg, "exp_vclip" ))       {
                                explosion_vclip_num = atoi(equal_ptr);
                        } else if (!stricmp( arg, "dead_pof" )) {
                        if (!stricmp( arg, "exp_vclip" ))       {
                                explosion_vclip_num = atoi(equal_ptr);
                        } else if (!stricmp( arg, "dead_pof" )) {
@@ -1576,14 +1556,6 @@ void bm_read_reactor()
        Reactors[Num_reactors].model_num = model_num;
        Reactors[Num_reactors].n_guns = read_model_guns(model_name,Reactors[Num_reactors].gun_points,Reactors[Num_reactors].gun_dirs,NULL);
 
        Reactors[Num_reactors].model_num = model_num;
        Reactors[Num_reactors].n_guns = read_model_guns(model_name,Reactors[Num_reactors].gun_points,Reactors[Num_reactors].gun_dirs,NULL);
 
-       ObjType[Num_total_object_types] = type;
-       ObjId[Num_total_object_types] = Num_reactors;
-       ObjStrength[Num_total_object_types] = strength;
-       
-       //printf( "Object type %d is a control center\n", Num_total_object_types );
-       Num_total_object_types++;
-       Assert(Num_total_object_types < MAX_OBJTYPE);
-
        Num_reactors++;
 }
 
        Num_reactors++;
 }
 
@@ -1675,14 +1647,6 @@ void bm_read_exitmodel()
        else
                Dead_modelnums[model_num] = -1;
 
        else
                Dead_modelnums[model_num] = -1;
 
-//@@   ObjType[Num_total_object_types] = type;
-//@@   ObjId[Num_total_object_types] = model_num;
-//@@   ObjStrength[Num_total_object_types] = strength;
-//@@   
-//@@   //printf( "Object type %d is a control center\n", Num_total_object_types );
-//@@   Num_total_object_types++;
-//@@   Assert(Num_total_object_types < MAX_OBJTYPE);
-
        exit_modelnum = model_num;
        destroyed_exit_modelnum = Dead_modelnums[model_num];
 
        exit_modelnum = model_num;
        destroyed_exit_modelnum = Dead_modelnums[model_num];
 
@@ -2104,11 +2068,6 @@ void bm_read_weapon(int unused_flag)
                        } else if (!stricmp(arg, "placable" )) {
                                if (atoi(equal_ptr)) {
                                        Weapon_info[n].flags |= WIF_PLACABLE;
                        } else if (!stricmp(arg, "placable" )) {
                                if (atoi(equal_ptr)) {
                                        Weapon_info[n].flags |= WIF_PLACABLE;
-
-                                       Assert(Num_total_object_types < MAX_OBJTYPE);
-                                       ObjType[Num_total_object_types] = OL_WEAPON;
-                                       ObjId[Num_total_object_types] = n;
-                                       Num_total_object_types++;
                                }
                        } else {
                                Int3();
                                }
                        } else {
                                Int3();
@@ -2217,13 +2176,6 @@ void bm_read_powerup(int unused_flag)
                }
                arg = strtok( NULL, space );
        }
                }
                arg = strtok( NULL, space );
        }
-
-       ObjType[Num_total_object_types] = OL_POWERUP;
-       ObjId[Num_total_object_types] = n;
-       //printf( "Object type %d is a powerup\n", Num_total_object_types );
-       Num_total_object_types++;
-       Assert(Num_total_object_types < MAX_OBJTYPE);
-
 }
 
 void bm_read_hostage()
 }
 
 void bm_read_hostage()
@@ -2260,13 +2212,6 @@ void bm_read_hostage()
                }
                arg = strtok( NULL, space );
        }
                }
                arg = strtok( NULL, space );
        }
-
-       ObjType[Num_total_object_types] = OL_HOSTAGE;
-       ObjId[Num_total_object_types] = n;
-       //printf( "Object type %d is a hostage\n", Num_total_object_types );
-       Num_total_object_types++;
-       Assert(Num_total_object_types < MAX_OBJTYPE);
-
 }
 
 //these values are the number of each item in the release of d2
 }
 
 //these values are the number of each item in the release of d2
@@ -2381,13 +2326,6 @@ fprintf(tfile,"player_ship size = %d\n",sizeof(player_ship));
 
 fprintf(tfile,"Num_cockpits = %d, cockpit_bitmaps array = %d\n",Num_cockpits,sizeof(bitmap_index)*Num_cockpits);
 
 
 fprintf(tfile,"Num_cockpits = %d, cockpit_bitmaps array = %d\n",Num_cockpits,sizeof(bitmap_index)*Num_cockpits);
 
-//@@   fwrite( &Num_total_object_types, sizeof(int), 1, fp );
-//@@   fwrite( ObjType, sizeof(sbyte), Num_total_object_types, fp );
-//@@   fwrite( ObjId, sizeof(sbyte), Num_total_object_types, fp );
-//@@   fwrite( ObjStrength, sizeof(fix), Num_total_object_types, fp );
-
-fprintf(tfile,"Num_total_object_types = %d, ObjType array = %d, ObjId array = %d, ObjStrength array = %d\n",Num_total_object_types,Num_total_object_types,Num_total_object_types,sizeof(fix)*Num_total_object_types);
-
        fwrite( &First_multi_bitmap_num, sizeof(int), 1, fp );
 
        fwrite( &Num_reactors, sizeof(Num_reactors), 1, fp );
        fwrite( &First_multi_bitmap_num, sizeof(int), 1, fp );
 
        fwrite( &Num_reactors, sizeof(Num_reactors), 1, fp );
index 26b0c6a..fe59f09 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: editor.h,v 1.7 2005-01-25 20:46:55 schaffner Exp $ */
+/* $Id: editor.h,v 1.8 2005-03-31 09:38:53 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -601,8 +601,9 @@ int rotate_segment_new(vms_angvec *pbh);
 int alloc_vert();
 void free_vert(int vert_num);
 
 int alloc_vert();
 void free_vert(int vert_num);
 
-// The current robot type declared in eglobal.c
-extern int Cur_robot_type;
+// The current object type and id declared in eglobal.c
+extern short Cur_object_type;
+extern short Cur_object_id;
 
 //     From med.c
 extern int DisplayCurrentRobotType(void);
 
 //     From med.c
 extern int DisplayCurrentRobotType(void);
@@ -639,9 +640,6 @@ extern void med_point_2_vec(grs_canvas *canv,vms_vector *v,short sx,short sy);
 //shutdown ui on the editor screen
 void close_editor_screen(void);
 
 //shutdown ui on the editor screen
 void close_editor_screen(void);
 
-//     From eobject.c
-extern int place_object(segment *segp, vms_vector *object_pos, int object_type);
-
 // from ksegsize.c
 extern void med_extract_up_vector_from_segment_side(segment *sp, int sidenum, vms_vector *vp);
 extern void med_extract_right_vector_from_segment_side(segment *sp, int sidenum, vms_vector *vp);
 // from ksegsize.c
 extern void med_extract_up_vector_from_segment_side(segment *sp, int sidenum, vms_vector *vp);
 extern void med_extract_right_vector_from_segment_side(segment *sp, int sidenum, vms_vector *vp);
index f9401c9..466a33c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: eglobal.c,v 1.4 2005-01-25 21:44:24 schaffner Exp $ */
+/* $Id: eglobal.c,v 1.5 2005-03-31 09:38:53 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -19,7 +19,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  */
 
 #ifdef RCS
  */
 
 #ifdef RCS
-static char rcsid[] = "$Id: eglobal.c,v 1.4 2005-01-25 21:44:24 schaffner Exp $";
+static char rcsid[] = "$Id: eglobal.c,v 1.5 2005-03-31 09:38:53 chris Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -92,8 +92,9 @@ int   Num_tilings = 1;                                        // Number of tilings per wall
 
 short Cur_object_index = -1;
 
 
 short Cur_object_index = -1;
 
-// The current robot type
-int Cur_robot_type = 0;
+// The current object type and id
+short Cur_object_type = 4;     // OBJ_PLAYER
+short Cur_object_id = 0;
 
 //     !0 if a degenerate segment has been found.
 int    Degenerate_segment_found=0;
 
 //     !0 if a degenerate segment has been found.
 int    Degenerate_segment_found=0;
index 80e8770..a62ce19 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: eobject.c,v 1.5 2005-01-24 21:33:28 schaffner Exp $ */
+/* $Id: eobject.c,v 1.6 2005-03-31 09:38:53 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -19,7 +19,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  */
 
 #ifdef RCS
  */
 
 #ifdef RCS
-static char rcsid[] = "$Id: eobject.c,v 1.5 2005-01-24 21:33:28 schaffner Exp $";
+static char rcsid[] = "$Id: eobject.c,v 1.6 2005-03-31 09:38:53 chris Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -55,6 +55,7 @@ static char rcsid[] = "$Id: eobject.c,v 1.5 2005-01-24 21:33:28 schaffner Exp $"
 #include "medrobot.h"
 #include "player.h"
 #include "gameseg.h"
 #include "medrobot.h"
 #include "player.h"
 #include "gameseg.h"
+#include "cntrlcen.h"
 
 #define        OBJ_SCALE               (F1_0/2)
 #define        OBJ_DEL_SIZE    (F1_0/2)
 
 #define        OBJ_SCALE               (F1_0/2)
 #define        OBJ_DEL_SIZE    (F1_0/2)
@@ -118,7 +119,7 @@ int get_next_object(segment *seg,int id)
 //@@}
 
 //     ------------------------------------------------------------------------------------
 //@@}
 
 //     ------------------------------------------------------------------------------------
-int place_object(segment *segp, vms_vector *object_pos, int object_type)
+int place_object(segment *segp, vms_vector *object_pos, short object_type, short object_id)
 {
         short objnum=0;
        object *obj;
 {
         short objnum=0;
        object *obj;
@@ -126,9 +127,10 @@ int place_object(segment *segp, vms_vector *object_pos, int object_type)
 
        med_extract_matrix_from_segment(segp,&seg_matrix);
 
 
        med_extract_matrix_from_segment(segp,&seg_matrix);
 
-       switch(ObjType[object_type]) {
+       switch (object_type)
+       {
 
 
-               case OL_HOSTAGE:
+               case OBJ_HOSTAGE:
 
                        objnum = obj_create(OBJ_HOSTAGE, -1, 
                                        segp-Segments,object_pos,&seg_matrix,HOSTAGE_SIZE,
 
                        objnum = obj_create(OBJ_HOSTAGE, -1, 
                                        segp-Segments,object_pos,&seg_matrix,HOSTAGE_SIZE,
@@ -144,17 +146,17 @@ int place_object(segment *segp, vms_vector *object_pos, int object_type)
                
                        obj->control_type = CT_POWERUP;
                        
                
                        obj->control_type = CT_POWERUP;
                        
-                       obj->rtype.vclip_info.vclip_num = Hostage_vclip_num[ObjId[object_type]];
+                       obj->rtype.vclip_info.vclip_num = Hostage_vclip_num[object_id];
                        obj->rtype.vclip_info.frametime = Vclip[obj->rtype.vclip_info.vclip_num].frame_time;
                        obj->rtype.vclip_info.framenum = 0;
 
                        break;
 
                        obj->rtype.vclip_info.frametime = Vclip[obj->rtype.vclip_info.vclip_num].frame_time;
                        obj->rtype.vclip_info.framenum = 0;
 
                        break;
 
-               case OL_ROBOT:
+               case OBJ_ROBOT:
 
 
-                       objnum = obj_create(OBJ_ROBOT,ObjId[object_type],segp-Segments,object_pos,
-                               &seg_matrix,Polygon_models[Robot_info[ObjId[object_type]].model_num].rad,
-                               CT_AI,MT_PHYSICS,RT_POLYOBJ);
+                       objnum = obj_create(OBJ_ROBOT, object_id, segp - Segments, object_pos,
+                               &seg_matrix, Polygon_models[Robot_info[object_id].model_num].rad,
+                               CT_AI, MT_PHYSICS, RT_POLYOBJ);
 
                        if ( objnum < 0 )
                                return 0;
 
                        if ( objnum < 0 )
                                return 0;
@@ -188,11 +190,11 @@ int place_object(segment *segp, vms_vector *object_pos, int object_type)
                        }
                        break;
 
                        }
                        break;
 
-               case OL_POWERUP:
+               case OBJ_POWERUP:
 
 
-                       objnum = obj_create(OBJ_POWERUP,ObjId[object_type],
-                                       segp-Segments,object_pos,&seg_matrix,Powerup_info[ObjId[object_type]].size,
-                                       CT_POWERUP,MT_NONE,RT_POWERUP);
+                       objnum = obj_create(OBJ_POWERUP, object_id,
+                                       segp - Segments, object_pos, &seg_matrix, Powerup_info[object_id].size,
+                                       CT_POWERUP, MT_NONE, RT_POWERUP);
 
                        if ( objnum < 0 )
                                return 0;
 
                        if ( objnum < 0 )
                                return 0;
@@ -212,43 +214,29 @@ int place_object(segment *segp, vms_vector *object_pos, int object_type)
 
                        break;
 
 
                        break;
 
-               case OL_CLUTTER:
-               case OL_CONTROL_CENTER: 
+               case OBJ_CNTRLCEN: 
                {
                {
-                       int obj_type,control_type;
-
-                       if (ObjType[object_type]==OL_CONTROL_CENTER) {
-                               obj_type = OBJ_CNTRLCEN;
-                               control_type = CT_CNTRLCEN;
-                       }
-                       else {
-                               obj_type = OBJ_CLUTTER;
-                               control_type = CT_NONE;
-                       }
-
-                       objnum = obj_create(obj_type,object_type,segp-Segments,object_pos,
-                                       &seg_matrix,Polygon_models[ObjId[object_type]].rad,
-                                       control_type,MT_NONE,RT_POLYOBJ);
+                       objnum = obj_create(OBJ_CNTRLCEN, object_id, segp - Segments, object_pos,
+                                       &seg_matrix, Polygon_models[object_id].rad,
+                                       CT_CNTRLCEN, MT_NONE, RT_POLYOBJ);
 
                        if ( objnum < 0 )
                                return 0;
 
                        obj = &Objects[objnum];
 
 
                        if ( objnum < 0 )
                                return 0;
 
                        obj = &Objects[objnum];
 
-                       obj->shields = ObjStrength[object_type];
-
                        //Set polygon-object-specific data 
                        //Set polygon-object-specific data 
-                       obj->shields = ObjStrength[object_type];
-                       obj->rtype.pobj_info.model_num = ObjId[object_type];
+                       obj->shields = 0;       // stored in Reactor_strength or calculated
+                       obj->rtype.pobj_info.model_num = Reactors[object_id].model_num;
                        obj->rtype.pobj_info.subobj_flags = 0;
 
                        break;
                }
 
                        obj->rtype.pobj_info.subobj_flags = 0;
 
                        break;
                }
 
-               case OL_PLAYER: {
-                       objnum = obj_create(OBJ_PLAYER,ObjId[object_type],segp-Segments,object_pos,
-                               &seg_matrix,Polygon_models[Player_ship->model_num].rad,
-                               CT_NONE,MT_PHYSICS,RT_POLYOBJ);
+               case OBJ_PLAYER:        {
+                       objnum = obj_create(OBJ_PLAYER, object_id, segp - Segments, object_pos,
+                               &seg_matrix, Polygon_models[Player_ship->model_num].rad,
+                               CT_NONE, MT_PHYSICS, RT_POLYOBJ);
 
                        if ( objnum < 0 )
                                return 0;
 
                        if ( objnum < 0 )
                                return 0;
@@ -325,7 +313,8 @@ int ObjectPlaceObject(void)
        vms_vector      cur_object_loc;
 
 #ifdef SHAREWARE
        vms_vector      cur_object_loc;
 
 #ifdef SHAREWARE
-       if (ObjType[Cur_robot_type] == OL_PLAYER) {
+       if (Cur_object_type == OBJ_PLAYER)
+       {
                int num_players = compute_num_players();
                Assert(num_players <= MAX_PLAYERS);
                if (num_players == MAX_PLAYERS) {
                int num_players = compute_num_players();
                Assert(num_players <= MAX_PLAYERS);
                if (num_players == MAX_PLAYERS) {
@@ -336,7 +325,8 @@ int ObjectPlaceObject(void)
 #endif
 
 #ifndef SHAREWARE
 #endif
 
 #ifndef SHAREWARE
-       if (ObjType[Cur_robot_type] == OL_PLAYER) {
+       if (Cur_object_type == OBJ_PLAYER)
+       {
                int num_players = compute_num_players();
                Assert(num_players <= MAX_MULTI_PLAYERS);
                if (num_players > MAX_PLAYERS)
                int num_players = compute_num_players();
                Assert(num_players <= MAX_MULTI_PLAYERS);
                if (num_players > MAX_PLAYERS)
@@ -352,7 +342,7 @@ int ObjectPlaceObject(void)
        compute_segment_center(&cur_object_loc, Cursegp);
 
        old_cur_object_index = Cur_object_index;
        compute_segment_center(&cur_object_loc, Cursegp);
 
        old_cur_object_index = Cur_object_index;
-       rval = place_object(Cursegp, &cur_object_loc, Cur_robot_type);
+       rval = place_object(Cursegp, &cur_object_loc, Cur_object_type, Cur_object_id);
 
        if (old_cur_object_index != Cur_object_index)
                Objects[Cur_object_index].rtype.pobj_info.tmap_override = -1;
 
        if (old_cur_object_index != Cur_object_index)
                Objects[Cur_object_index].rtype.pobj_info.tmap_override = -1;
@@ -372,7 +362,7 @@ int ObjectPlaceObjectTmap(void)
        compute_segment_center(&cur_object_loc, Cursegp);
 
        old_cur_object_index = Cur_object_index;
        compute_segment_center(&cur_object_loc, Cursegp);
 
        old_cur_object_index = Cur_object_index;
-       rval = place_object(Cursegp, &cur_object_loc, Cur_robot_type);
+       rval = place_object(Cursegp, &cur_object_loc, Cur_object_type, Cur_object_id);
 
        if ((Cur_object_index != old_cur_object_index) && (Objects[Cur_object_index].render_type == RT_POLYOBJ))
                Objects[Cur_object_index].rtype.pobj_info.tmap_override = CurrentTexture;
 
        if ((Cur_object_index != old_cur_object_index) && (Objects[Cur_object_index].render_type == RT_POLYOBJ))
                Objects[Cur_object_index].rtype.pobj_info.tmap_override = CurrentTexture;
index 09e2cd7..19856f1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: medrobot.c,v 1.5 2005-01-24 22:26:06 schaffner Exp $ */
+/* $Id: medrobot.c,v 1.6 2005-03-31 09:38:53 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -19,7 +19,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  */
 
 #ifdef RCS
  */
 
 #ifdef RCS
-static char rcsid[] = "$Id: medrobot.c,v 1.5 2005-01-24 22:26:06 schaffner Exp $";
+static char rcsid[] = "$Id: medrobot.c,v 1.6 2005-03-31 09:38:53 chris Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -79,38 +79,6 @@ static int old_object;
 static fix Time;
 static vms_angvec angles={0,0,0}, goody_angles={0,0,0};
 
 static fix Time;
 static vms_angvec angles={0,0,0}, goody_angles={0,0,0};
 
-//-------------------------------------------------------------------------
-// Given a pointer to an object, returns a number that cooresponds to the
-// object id as used in the objpage stuff.
-//-------------------------------------------------------------------------
-int get_object_id( object * obj )
-{
-       int i;
-       int goal_type;
-
-       switch( obj->type )     {
-       case OBJ_PLAYER: goal_type=OL_PLAYER; break;
-       case OBJ_ROBOT: goal_type=OL_ROBOT; break;
-       case OBJ_POWERUP: goal_type=OL_POWERUP; break;
-       case OBJ_CNTRLCEN: goal_type=OL_CONTROL_CENTER; break;
-       case OBJ_HOSTAGE: goal_type=OL_HOSTAGE; break;
-       case OBJ_CLUTTER: goal_type=OL_CLUTTER; break;
-       default:
-               Int3(); // Invalid object type
-               return -1;
-       }
-
-       // Find first object with the same type as this
-       // one and then add the object id to that to find
-       // the offset into the list.
-
-       for (i=0; i< Num_total_object_types; i++ )      {
-               if ( ObjType[i]==goal_type)
-                       return obj->id + i;
-       }
-       return -1;
-}
-
 void call_init_ai_object(object *objp, int behavior)
 {
        int     hide_segment;
 void call_init_ai_object(object *objp, int behavior)
 {
        int     hide_segment;
@@ -166,7 +134,7 @@ int RobotNextType()
                        obj->shields = Robot_info[obj->id].strength;
                        call_init_ai_object(obj, AIB_NORMAL);
 
                        obj->shields = Robot_info[obj->id].strength;
                        call_init_ai_object(obj, AIB_NORMAL);
 
-                       Cur_robot_type = obj->id;
+                       Cur_object_id = obj->id;
                }
        }
        Update_flags |= UF_WORLD_CHANGED;
                }
        }
        Update_flags |= UF_WORLD_CHANGED;
@@ -195,7 +163,7 @@ int RobotPrevType()
                        obj->shields = Robot_info[obj->id].strength;
                        call_init_ai_object(obj, AIB_NORMAL);
 
                        obj->shields = Robot_info[obj->id].strength;
                        call_init_ai_object(obj, AIB_NORMAL);
 
-                       Cur_robot_type = obj->id;
+                       Cur_object_id = obj->id;
                }
        }
        Update_flags |= UF_WORLD_CHANGED;
                }
        }
        Update_flags |= UF_WORLD_CHANGED;
@@ -472,10 +440,11 @@ int LocalObjectPlaceObject(void)
 
        Cur_goody_count = 0;
 
 
        Cur_goody_count = 0;
 
-       while (ObjType[Cur_robot_type] != OL_ROBOT) { // && (ObjType[Cur_robot_type] != OL_POWERUP)) {
-               Cur_robot_type++;
-               if (Cur_robot_type >= N_robot_types)
-                       Cur_robot_type = 0;
+       if (Cur_object_type != OBJ_ROBOT)
+       {
+               Cur_object_type = OBJ_ROBOT;
+               Cur_object_id = 3;      // class 1 drone
+               Num_object_subtypes = N_robot_types;
        }
 
        rval = ObjectPlaceObject();
        }
 
        rval = ObjectPlaceObject();
@@ -642,11 +611,11 @@ void do_robot_window()
        // Redraw the object in the little 64x64 box
        //------------------------------------------------------------
        if (Cur_object_index > -1 )     {
        // Redraw the object in the little 64x64 box
        //------------------------------------------------------------
        if (Cur_object_index > -1 )     {
-               int id;
+               object *obj = &Objects[Cur_object_index];
+
                gr_set_current_canvas( RobotViewBox->canvas );
                gr_set_current_canvas( RobotViewBox->canvas );
-               id = get_object_id(&Objects[Cur_object_index]);
-               if ( id > -1 )  
-                       draw_robot_picture(id, &angles, -1 );
+               if ( obj->id > -1 )     
+                       draw_object_picture(obj->id, &angles, obj->type );
                else
                        gr_clear_canvas( CGREY );
                angles.h += fixmul(0x1000, DeltaTime );
                else
                        gr_clear_canvas( CGREY );
                angles.h += fixmul(0x1000, DeltaTime );
@@ -662,21 +631,10 @@ void do_robot_window()
        // Redraw the contained object in the other little box
        //------------------------------------------------------------
        if ((Cur_object_index > -1 ) && (Cur_goody_count > 0))  {
        // Redraw the contained object in the other little box
        //------------------------------------------------------------
        if ((Cur_object_index > -1 ) && (Cur_goody_count > 0))  {
-               int id;
-
                gr_set_current_canvas( ContainsViewBox->canvas );
                gr_set_current_canvas( ContainsViewBox->canvas );
-               id = Cur_goody_id;
-               if ( id > -1 )   {
-                        int ol_type=0;
-                       if (Cur_goody_type == OBJ_ROBOT)
-                               ol_type = OL_ROBOT;
-                       else if (Cur_goody_type == OBJ_POWERUP)
-                               ol_type = OL_POWERUP;
-                       else
-                               Int3(); //      Error?  Unknown goody type!
-
-                       draw_robot_picture(id, &goody_angles, ol_type );
-               } else
+               if ( Cur_goody_id > -1 )
+                       draw_object_picture(Cur_goody_id, &goody_angles, Cur_goody_type);
+               else
                        gr_clear_canvas( CGREY );
                goody_angles.h += fixmul(0x1000, DeltaTime );
        } else {
                        gr_clear_canvas( CGREY );
                goody_angles.h += fixmul(0x1000, DeltaTime );
        } else {
index 932ff81..1d4804c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: objpage.c,v 1.3 2004-12-19 15:21:11 btb Exp $ */
+/* $Id: objpage.c,v 1.4 2005-03-31 09:38:53 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -19,7 +19,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  */
 
 #ifdef RCS
  */
 
 #ifdef RCS
-static char rcsid[] = "$Id: objpage.c,v 1.3 2004-12-19 15:21:11 btb Exp $";
+static char rcsid[] = "$Id: objpage.c,v 1.4 2005-03-31 09:38:53 chris Exp $";
 #endif
 
 // Num_robot_types -->  N_polygon_models
 #endif
 
 // Num_robot_types -->  N_polygon_models
@@ -47,7 +47,7 @@ static char rcsid[] = "$Id: objpage.c,v 1.3 2004-12-19 15:21:11 btb Exp $";
 #include "bm.h"
 #include "player.h"
 #include "piggy.h"
 #include "bm.h"
 #include "player.h"
 #include "piggy.h"
-
+#include "cntrlcen.h"
 
 #define OBJS_PER_PAGE 8
 
 
 #define OBJS_PER_PAGE 8
 
@@ -98,43 +98,37 @@ extern int polyobj_lighting;
 
 
 //canvas set
 
 
 //canvas set
-//     Type is optional.  If you pass -1, type is determined, else type is used, and id is not xlated through ObjId.
-void draw_robot_picture(int id, vms_angvec *orient_angles, int type)
+void draw_object_picture(int id, vms_angvec *orient_angles, int type)
 {
 
 {
 
-       if (id >= Num_total_object_types)
+       if (id >= Num_object_subtypes)
                return;
 
                return;
 
-       if ( type == -1 )       {
-               type = ObjType[id];             // Find the object type, given an object id.
-               id = ObjId[id]; // Translate to sub-id.
-       }
-
        switch (type) {
 
        switch (type) {
 
-               case OL_HOSTAGE:
+               case OBJ_HOSTAGE:
                        PIGGY_PAGE_IN(Vclip[Hostage_vclip_num[id]].frames[0]);
                        gr_bitmap(0,0,&GameBitmaps[Vclip[Hostage_vclip_num[id]].frames[0].index]);
                        break;
 
                        PIGGY_PAGE_IN(Vclip[Hostage_vclip_num[id]].frames[0]);
                        gr_bitmap(0,0,&GameBitmaps[Vclip[Hostage_vclip_num[id]].frames[0].index]);
                        break;
 
-               case OL_POWERUP:
+               case OBJ_POWERUP:
                        if ( Powerup_info[id].vclip_num > -1 )  {
                                PIGGY_PAGE_IN(Vclip[Powerup_info[id].vclip_num].frames[0]);
                                gr_bitmap(0,0,&GameBitmaps[Vclip[Powerup_info[id].vclip_num].frames[0].index]);
                        }
                        break;
 
                        if ( Powerup_info[id].vclip_num > -1 )  {
                                PIGGY_PAGE_IN(Vclip[Powerup_info[id].vclip_num].frames[0]);
                                gr_bitmap(0,0,&GameBitmaps[Vclip[Powerup_info[id].vclip_num].frames[0].index]);
                        }
                        break;
 
-               case OL_PLAYER:
+               case OBJ_PLAYER:
                        draw_model_picture(Player_ship->model_num,orient_angles);               // Draw a poly model below
                        break;
 
                        draw_model_picture(Player_ship->model_num,orient_angles);               // Draw a poly model below
                        break;
 
-               case OL_ROBOT:
+               case OBJ_ROBOT:
                        draw_model_picture(Robot_info[id].model_num,orient_angles);     // Draw a poly model below
                        break;
 
                        draw_model_picture(Robot_info[id].model_num,orient_angles);     // Draw a poly model below
                        break;
 
-               case OL_CONTROL_CENTER:
-               case OL_CLUTTER:
-                       draw_model_picture(id,orient_angles);
+               case OBJ_CNTRLCEN:
+               case OBJ_CLUTTER:
+                       draw_model_picture(Reactors[id].model_num, orient_angles);
                        break;
                default:
                        //Int3();       // Invalid type!!!
                        break;
                default:
                        //Int3();       // Invalid type!!!
@@ -149,7 +143,7 @@ void redraw_current_object()
 
        cc = grd_curcanv;
        gr_set_current_canvas(ObjCurrent->canvas);
 
        cc = grd_curcanv;
        gr_set_current_canvas(ObjCurrent->canvas);
-       draw_robot_picture(Cur_robot_type,&objpage_view_orient, -1);
+       draw_object_picture(Cur_object_id, &objpage_view_orient, Cur_object_type);
        gr_set_current_canvas(cc);
 }
 
        gr_set_current_canvas(cc);
 }
 
@@ -157,7 +151,7 @@ void gr_label_box( int i)
 {
 
        gr_clear_canvas(BM_XRGB(0,0,0));
 {
 
        gr_clear_canvas(BM_XRGB(0,0,0));
-       draw_robot_picture(i,&objpage_view_orient, -1);
+       draw_object_picture(i, &objpage_view_orient, Cur_object_type);
 
 //     char s[20];
 //     sprintf( s, " %d ", i );
 
 //     char s[20];
 //     sprintf( s, " %d ", i );
@@ -173,7 +167,7 @@ int objpage_goto_first()
        ObjectPage=0;
        for (i=0;  i<OBJS_PER_PAGE; i++ ) {
                gr_set_current_canvas(ObjBox[i]->canvas);
        ObjectPage=0;
        for (i=0;  i<OBJS_PER_PAGE; i++ ) {
                gr_set_current_canvas(ObjBox[i]->canvas);
-               if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types ) {
+               if (i+ObjectPage*OBJS_PER_PAGE < Num_object_subtypes ) {
                        //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                        gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
                } else
                        //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                        gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
                } else
@@ -187,11 +181,11 @@ int objpage_goto_last()
 {
        int i;
 
 {
        int i;
 
-       ObjectPage=(Num_total_object_types)/OBJS_PER_PAGE;
+       ObjectPage=(Num_object_subtypes)/OBJS_PER_PAGE;
        for (i=0;  i<OBJS_PER_PAGE; i++ )
        {
                gr_set_current_canvas(ObjBox[i]->canvas);
        for (i=0;  i<OBJS_PER_PAGE; i++ )
        {
                gr_set_current_canvas(ObjBox[i]->canvas);
-               if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types )
+               if (i+ObjectPage*OBJS_PER_PAGE < Num_object_subtypes )
                {
                        //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                        gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
                {
                        //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                        gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
@@ -210,7 +204,7 @@ static int objpage_goto_prev()
                for (i=0;  i<OBJS_PER_PAGE; i++ )
                {
                        gr_set_current_canvas(ObjBox[i]->canvas);
                for (i=0;  i<OBJS_PER_PAGE; i++ )
                {
                        gr_set_current_canvas(ObjBox[i]->canvas);
-                       if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types)
+                       if (i+ObjectPage*OBJS_PER_PAGE < Num_object_subtypes)
                        {
                                //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                                gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
                        {
                                //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                                gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
@@ -225,12 +219,12 @@ static int objpage_goto_prev()
 static int objpage_goto_next()
 {
        int i;
 static int objpage_goto_next()
 {
        int i;
-       if ((ObjectPage+1)*OBJS_PER_PAGE < Num_total_object_types) {
+       if ((ObjectPage+1)*OBJS_PER_PAGE < Num_object_subtypes) {
                ObjectPage++;
                for (i=0;  i<OBJS_PER_PAGE; i++ )
                {
                        gr_set_current_canvas(ObjBox[i]->canvas);
                ObjectPage++;
                for (i=0;  i<OBJS_PER_PAGE; i++ )
                {
                        gr_set_current_canvas(ObjBox[i]->canvas);
-                       if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types)
+                       if (i+ObjectPage*OBJS_PER_PAGE < Num_object_subtypes)
                        {
                                //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                                gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
                        {
                                //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                                gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
@@ -246,15 +240,15 @@ int objpage_grab_current(int n)
 {
        int i;
 
 {
        int i;
 
-       if ( (n<0) || ( n>= Num_total_object_types) ) return 0;
+       if ((n < 0) || (n >= Num_object_subtypes)) return 0;
        
        ObjectPage = n / OBJS_PER_PAGE;
        
        
        ObjectPage = n / OBJS_PER_PAGE;
        
-       if (ObjectPage*OBJS_PER_PAGE < Num_total_object_types) {
+       if (ObjectPage*OBJS_PER_PAGE < Num_object_subtypes) {
                for (i=0;  i<OBJS_PER_PAGE; i++ )
                {
                        gr_set_current_canvas(ObjBox[i]->canvas);
                for (i=0;  i<OBJS_PER_PAGE; i++ )
                {
                        gr_set_current_canvas(ObjBox[i]->canvas);
-                       if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types)
+                       if (i + ObjectPage*OBJS_PER_PAGE < Num_object_subtypes)
                        {
                                //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                                gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
                        {
                                //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                                gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
@@ -264,10 +258,10 @@ int objpage_grab_current(int n)
                }
        }
 
                }
        }
 
-       Cur_robot_type = n;
+       Cur_object_id = n;
        gr_set_current_canvas(ObjCurrent->canvas);
        //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ Cur_robot_type ] ] );
        gr_set_current_canvas(ObjCurrent->canvas);
        //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ Cur_robot_type ] ] );
-       gr_label_box(Cur_robot_type);
+       gr_label_box(Cur_object_id);
 
        //objpage_display_name( Texture[Cur_robot_type]->filename );
        
 
        //objpage_display_name( Texture[Cur_robot_type]->filename );
        
@@ -276,12 +270,37 @@ int objpage_grab_current(int n)
 
 int objpage_goto_next_object()
 {
 
 int objpage_goto_next_object()
 {
-       int n;
+       // there should be a pop-up menu for this
+       switch (Cur_object_type)
+       {
+               case OBJ_ROBOT:
+                       Cur_object_type = OBJ_HOSTAGE;
+                       Num_object_subtypes = 1;
+                       break;
+
+               case OBJ_HOSTAGE:
+                       Cur_object_type = OBJ_PLAYER;
+                       Num_object_subtypes = 1;        // can have anarchy/coop, but this is handled automatically
+                       break;
 
 
-       n = Cur_robot_type++;
-       if (n >= Num_total_object_types) n = 0;
+               case OBJ_PLAYER:
+                       Cur_object_type = OBJ_POWERUP;
+                       Num_object_subtypes = N_powerup_types;
+                       break;
+
+               case OBJ_POWERUP:
+                       Cur_object_type = OBJ_CNTRLCEN;
+                       Num_object_subtypes = Num_reactors;
+                       break;
+
+               case OBJ_CNTRLCEN:
+               default:
+                       Cur_object_type = OBJ_ROBOT;
+                       Num_object_subtypes = N_robot_types;
+                       break;
+       }
 
 
-       objpage_grab_current(n);
+       objpage_grab_current(0);
 
        return 1;
 
 
        return 1;
 
@@ -400,7 +419,7 @@ void objpage_init( UI_WINDOW *win )
        for (i=0;  i<OBJS_PER_PAGE; i++ )
        {
                gr_set_current_canvas(ObjBox[i]->canvas);
        for (i=0;  i<OBJS_PER_PAGE; i++ )
        {
                gr_set_current_canvas(ObjBox[i]->canvas);
-               if (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types)
+               if (i+ObjectPage*OBJS_PER_PAGE < Num_object_subtypes)
                {
                                //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                                gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
                {
                                //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ i+ObjectPage*OBJS_PER_PAGE ] ] );
                                gr_label_box(i+ObjectPage*OBJS_PER_PAGE );
@@ -413,7 +432,7 @@ void objpage_init( UI_WINDOW *win )
 //     Cur_robot_type = ObjectPage*OBJS_PER_PAGE;
        gr_set_current_canvas(ObjCurrent->canvas);
        //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ Cur_robot_type ] ] );
 //     Cur_robot_type = ObjectPage*OBJS_PER_PAGE;
        gr_set_current_canvas(ObjCurrent->canvas);
        //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ Cur_robot_type ] ] );
-       gr_label_box(Cur_robot_type);
+       gr_label_box(Cur_object_id);
 
        //ObjnameCanvas = gr_create_sub_canvas(&grd_curscreen->sc_canvas, OBJCURBOX_X , OBJCURBOX_Y + OBJBOX_H + 10, 100, 20);
        //gr_set_current_canvas( ObjnameCanvas );
 
        //ObjnameCanvas = gr_create_sub_canvas(&grd_curscreen->sc_canvas, OBJCURBOX_X , OBJCURBOX_Y + OBJBOX_H + 10, 100, 20);
        //gr_set_current_canvas( ObjnameCanvas );
@@ -437,12 +456,12 @@ void objpage_do()
 
        for (i=0; i<OBJS_PER_PAGE; i++ )
        {
 
        for (i=0; i<OBJS_PER_PAGE; i++ )
        {
-               if (ObjBox[i]->b1_clicked && (i+ObjectPage*OBJS_PER_PAGE < Num_total_object_types))
+               if (ObjBox[i]->b1_clicked && (i+ObjectPage*OBJS_PER_PAGE < Num_object_subtypes))
                {
                {
-                       Cur_robot_type = i+ObjectPage*OBJS_PER_PAGE;
+                       Cur_object_id = i+ObjectPage*OBJS_PER_PAGE;
                        gr_set_current_canvas(ObjCurrent->canvas);
                        //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ Cur_robot_type ] ] );
                        gr_set_current_canvas(ObjCurrent->canvas);
                        //gr_ubitmap(0,0, robot_bms[robot_bm_nums[ Cur_robot_type ] ] );
-                       gr_label_box(Cur_robot_type);
+                       gr_label_box(Cur_object_id);
                        //objpage_display_name( Texture[Cur_robot_type]->filename );
                }
        }
                        //objpage_display_name( Texture[Cur_robot_type]->filename );
                }
        }
index 7c26b70..eaabff5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: objpage.h,v 1.2 2004-12-19 14:52:48 btb Exp $ */
+/* $Id: objpage.h,v 1.3 2005-03-31 09:38:53 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -30,6 +30,6 @@ void objpage_init( UI_WINDOW *win );
 void objpage_close();
 void objpage_do();
 
 void objpage_close();
 void objpage_do();
 
-extern void draw_robot_picture(int id, vms_angvec *orient_angles, int type);
+extern void draw_object_picture(int id, vms_angvec *orient_angles, int type);
 
 #endif
 
 #endif