changed args_find to FindArg
authorBradley Bell <btb@icculus.org>
Wed, 24 Jan 2001 04:29:48 +0000 (04:29 +0000)
committerBradley Bell <btb@icculus.org>
Wed, 24 Jan 2001 04:29:48 +0000 (04:29 +0000)
27 files changed:
arch/dos/init.c
arch/dos/joyc.c
arch/dos_init.c
arch/linux/init.c
arch/linux/ipx_udp.c
arch/linux/linuxnet.c
arch/linux_init.c
arch/linux_ipx_udp.c
arch/linux_net.c
arch/sdl/init.c
arch/sdl_init.c
include/args.h
input/dos_joyc.c
input/svgalib_init.c
main/config.c
main/hud.c
main/menu.c
main/multi.c
main/network.c
main/piggy.c
main/polyobj.c
main/slew.c
main/songs.c
misc/args.c
sound/sdl_cdrom.c
video/ogl_gr.c
video/sdl_gr.c

index 3f74ec4..27217a0 100644 (file)
@@ -294,13 +294,13 @@ void arch_init_start() {
 }
 
 void arch_init() {
-        if ( !args_find( "-nodoscheck" ))
+        if ( !FindArg( "-nodoscheck" ))
                 check_dos_version();
         
-        if ( !args_find( "-nofilecheck" ))
+        if ( !FindArg( "-nofilecheck" ))
                 dos_check_file_handles(5);
 
-        if ( !args_find( "-nomemcheck" ))
+        if ( !FindArg( "-nomemcheck" ))
                 check_memory();
 
        #ifndef NDEBUG
@@ -322,35 +322,35 @@ void arch_init() {
 
         con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_3);
         key_init();
-        if (!args_find( "-nomouse" ))     {
+        if (!FindArg( "-nomouse" ))     {
                 con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_4);
-                if (args_find( "-nocyberman" ))
+                if (FindArg( "-nocyberman" ))
                         mouse_init(0);
                 else
                         mouse_init(1);
         } else {
                 con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_5);
         }
-        if (!args_find( "-nojoystick" ))  {
+        if (!FindArg( "-nojoystick" ))  {
                 con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_6);
                 joy_init();
-                if ( args_find( "-joyslow" ))     {
+                if ( FindArg( "-joyslow" ))     {
                         con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_7);
                         joy_set_slow_reading(JOY_SLOW_READINGS);
                 }
-                if ( args_find( "-joypolled" ))   {
+                if ( FindArg( "-joypolled" ))   {
                         con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_8);
                         joy_set_slow_reading(JOY_POLLED_READINGS);
                 }
-                if ( args_find( "-joybios" ))     {
+                if ( FindArg( "-joybios" ))     {
                         con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_9);
                         joy_set_slow_reading(JOY_BIOS_READINGS);
                 }
-                if ( args_find( "-joynice" ))     {
+                if ( FindArg( "-joynice" ))     {
                         con_printf(CON_VERBOSE, "\n%s", "Using nice joystick poller..." );
                         joy_set_slow_reading(JOY_FRIENDLY_READINGS);
                 }
-                if ( args_find( "-gameport" ))    {
+                if ( FindArg( "-gameport" ))    {
                         if ( init_gameport() )  {                       
                                 joy_set_slow_reading(JOY_BIOS_READINGS);
                         } else {
index 410e7a3..d17fb78 100644 (file)
@@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 */
 /*
  * $Source: /cvs/cvsroot/d2x/arch/dos/joyc.c,v $
- * $Revision: 1.1.1.2 $
+ * $Revision: 1.2 $
  * $Author: bradleyb $
- * $Date: 2001-01-19 03:33:52 $
+ * $Date: 2001-01-24 04:29:45 $
  * 
  * Routines for joystick reading.
  * 
  * $Log: not supported by cvs2svn $
+ * Revision 1.1.1.2  2001/01/19 03:33:52  bradleyb
+ * Import of d2x-0.0.9-pre1
+ *
  * Revision 1.1.1.1  1999/06/14 21:58:26  donut
  * Import of d1x 1.37 source.
  *
@@ -443,9 +446,9 @@ int joy_init()
        int i;
        int temp_axis[4];
 
-//        if(args_find("-joy209"))
+//        if(FindArg("-joy209"))
 //         use_alt_joyport=1;
-        if(args_find("-joy209"))
+        if(FindArg("-joy209"))
          JOY_PORT = 521;  //209h;
          
        joy_flush();
index 2143a5b..d8f1644 100644 (file)
@@ -295,13 +295,13 @@ void arch_init_start() {
 }
 
 void arch_init() {
-        if ( !args_find( "-nodoscheck" ))
+        if ( !FindArg( "-nodoscheck" ))
                 check_dos_version();
         
-        if ( !args_find( "-nofilecheck" ))
+        if ( !FindArg( "-nofilecheck" ))
                 dos_check_file_handles(5);
 
-        if ( !args_find( "-nomemcheck" ))
+        if ( !FindArg( "-nomemcheck" ))
                 check_memory();
 
        #ifndef NDEBUG
@@ -323,35 +323,35 @@ void arch_init() {
 
         con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_3);
         key_init();
-        if (!args_find( "-nomouse" ))     {
+        if (!FindArg( "-nomouse" ))     {
                 con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_4);
-                if (args_find( "-nocyberman" ))
+                if (FindArg( "-nocyberman" ))
                         mouse_init(0);
                 else
                         mouse_init(1);
         } else {
                 con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_5);
         }
-        if (!args_find( "-nojoystick" ))  {
+        if (!FindArg( "-nojoystick" ))  {
                 con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_6);
                 joy_init();
-                if ( args_find( "-joyslow" ))     {
+                if ( FindArg( "-joyslow" ))     {
                         con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_7);
                         joy_set_slow_reading(JOY_SLOW_READINGS);
                 }
-                if ( args_find( "-joypolled" ))   {
+                if ( FindArg( "-joypolled" ))   {
                         con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_8);
                         joy_set_slow_reading(JOY_POLLED_READINGS);
                 }
-                if ( args_find( "-joybios" ))     {
+                if ( FindArg( "-joybios" ))     {
                         con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_9);
                         joy_set_slow_reading(JOY_BIOS_READINGS);
                 }
-                if ( args_find( "-joynice" ))     {
+                if ( FindArg( "-joynice" ))     {
                         con_printf(CON_VERBOSE, "\n%s", "Using nice joystick poller..." );
                         joy_set_slow_reading(JOY_FRIENDLY_READINGS);
                 }
-                if ( args_find( "-gameport" ))    {
+                if ( FindArg( "-gameport" ))    {
                         if ( init_gameport() )  {                       
                                 joy_set_slow_reading(JOY_BIOS_READINGS);
                         } else {
index 41330ae..bdd9122 100644 (file)
@@ -30,7 +30,7 @@ void arch_init()
 #ifdef __SVGALIB__
        arch_svgalib_init();
 #endif
-       if (!args_find( "-nojoystick" ))  {
+       if (!FindArg( "-nojoystick" ))  {
                con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_6);
                joy_init();
        }
@@ -38,7 +38,7 @@ void arch_init()
 #ifdef NETWORK
        //end addition -MM
 //added on 10/19/98 by Victor Rachels to add serial support (from DPH)
-    if(!(args_find("-noserial")))
+    if(!(FindArg("-noserial")))
      com_init();
 //end this section addition - Victor 
        //added 06/09/99 Matt Mueller - fix nonetwork compile
index 48a1125..bef92c3 100644 (file)
@@ -340,7 +340,7 @@ char *s,*s2,*ns;
        if (!have_empty_address())
                return 0;
 
-       if (!((i=args_find("-udp")) && (s=Args[i+1]) && (*s=='=' || *s=='+' || *s=='@'))) s=NULL;
+       if (!((i=FindArg("-udp")) && (s=Args[i+1]) && (*s=='=' || *s=='+' || *s=='@'))) s=NULL;
 
        if (gethostname(buf,sizeof(buf))) FAIL("Error getting my hostname");
        if (!(queryhost(buf))) FAIL("Querying my own hostname \"%s\"",buf);
index e96f724..36a13ff 100644 (file)
@@ -98,11 +98,11 @@ int ipx_init( int socket_number, int show_address )
        int i;
        
 /* DPH: killed kali for now 
-       if (args_find("-kali")) {
+       if (FindArg("-kali")) {
                printf("Using Kali for network games\n");
                driver = &ipx_kali;
 //added on 12/20/98 by Jan Kratochvil for direct TCP/IP games
-        } else*/ if (args_find("-udp")) {
+        } else*/ if (FindArg("-udp")) {
                 printf("Using native TCP/IP (UDP) for network games\n");
                 driver = &ipx_udp;
 //end this section addition - JK
@@ -110,7 +110,7 @@ int ipx_init( int socket_number, int show_address )
                printf("Using real IPX for network games\n");
                driver = &ipx_bsd;
        }
-       if ((i = args_find("-ipxnetwork")) && Args[i + 1]) {
+       if ((i = FindArg("-ipxnetwork")) && Args[i + 1]) {
                unsigned long n = strtol(Args[i + 1], NULL, 16);
                ipx_MyAddress[0] = n >> 24; ipx_MyAddress[1] = (n >> 16) & 255;
                ipx_MyAddress[2] = (n >> 8) & 255; ipx_MyAddress[3] = n & 255;
index 95260eb..55f7879 100644 (file)
@@ -30,7 +30,7 @@ void arch_init()
 #ifdef SVGALIB_INPUT
        arch_svgalib_init();
 #endif
-       if (!args_find( "-nojoystick" ))  {
+       if (!FindArg( "-nojoystick" ))  {
                con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_6);
                joy_init();
        }
@@ -38,7 +38,7 @@ void arch_init()
 #ifdef NETWORK
        //end addition -MM
 //added on 10/19/98 by Victor Rachels to add serial support (from DPH)
-    if(!(args_find("-noserial")))
+    if(!(FindArg("-noserial")))
      com_init();
 //end this section addition - Victor 
        //added 06/09/99 Matt Mueller - fix nonetwork compile
index 48a1125..bef92c3 100644 (file)
@@ -340,7 +340,7 @@ char *s,*s2,*ns;
        if (!have_empty_address())
                return 0;
 
-       if (!((i=args_find("-udp")) && (s=Args[i+1]) && (*s=='=' || *s=='+' || *s=='@'))) s=NULL;
+       if (!((i=FindArg("-udp")) && (s=Args[i+1]) && (*s=='=' || *s=='+' || *s=='@'))) s=NULL;
 
        if (gethostname(buf,sizeof(buf))) FAIL("Error getting my hostname");
        if (!(queryhost(buf))) FAIL("Querying my own hostname \"%s\"",buf);
index e96f724..36a13ff 100644 (file)
@@ -98,11 +98,11 @@ int ipx_init( int socket_number, int show_address )
        int i;
        
 /* DPH: killed kali for now 
-       if (args_find("-kali")) {
+       if (FindArg("-kali")) {
                printf("Using Kali for network games\n");
                driver = &ipx_kali;
 //added on 12/20/98 by Jan Kratochvil for direct TCP/IP games
-        } else*/ if (args_find("-udp")) {
+        } else*/ if (FindArg("-udp")) {
                 printf("Using native TCP/IP (UDP) for network games\n");
                 driver = &ipx_udp;
 //end this section addition - JK
@@ -110,7 +110,7 @@ int ipx_init( int socket_number, int show_address )
                printf("Using real IPX for network games\n");
                driver = &ipx_bsd;
        }
-       if ((i = args_find("-ipxnetwork")) && Args[i + 1]) {
+       if ((i = FindArg("-ipxnetwork")) && Args[i + 1]) {
                unsigned long n = strtol(Args[i + 1], NULL, 16);
                ipx_MyAddress[0] = n >> 24; ipx_MyAddress[1] = (n >> 16) & 255;
                ipx_MyAddress[2] = (n >> 8) & 255; ipx_MyAddress[3] = n & 255;
index 361d24e..29d33bf 100644 (file)
@@ -20,10 +20,10 @@ void arch_sdl_init()
  // Initialise the library
 //edited on 01/03/99 by Matt Mueller - if we use SDL_INIT_EVERYTHING, cdrom is initialized even if -nocdaudio is used
 #ifdef SDL_INPUT
- if (!args_find("-nomouse"))
+ if (!FindArg("-nomouse"))
    d_mouse_init();
 #endif
- if (!args_find("-nosound"))
+ if (!FindArg("-nosound"))
    digi_init();
  atexit(sdl_close);
 }
index 8951cd5..9ba42ae 100644 (file)
@@ -22,10 +22,10 @@ void arch_sdl_init()
  // Initialise the library
 //edited on 01/03/99 by Matt Mueller - if we use SDL_INIT_EVERYTHING, cdrom is initialized even if -nocdaudio is used
 #ifdef SDL_INPUT
- if (!args_find("-nomouse"))
+ if (!FindArg("-nomouse"))
    d_mouse_init();
 #endif
- if (!args_find("-nosound"))
+ if (!FindArg("-nosound"))
    digi_init();
  atexit(sdl_close);
 }
index 19c2730..307c8fd 100644 (file)
@@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 */
 /*
  * $Source: /cvs/cvsroot/d2x/include/args.h,v $
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
  * $Author: bradleyb $
- * $Date: 2001-01-19 03:30:16 $
+ * $Date: 2001-01-24 04:29:45 $
  * 
  * Prototypes for accessing arguments.
  * 
  * $Log: not supported by cvs2svn $
+ * Revision 1.1.1.1  2001/01/19 03:30:16  bradleyb
+ * Import of d2x-0.0.8
+ *
  * Revision 1.1.1.1  1999/06/14 22:02:08  donut
  * Import of d1x 1.37 source.
  *
@@ -49,7 +52,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 
 extern int Num_args;                                           
 extern char * Args[];                                          
-extern int args_find( char * s );
+extern int FindArg( char * s );
 extern void args_init( int argc, char **argv );
 
 #endif
index 870f291..ab1526b 100644 (file)
@@ -299,9 +299,9 @@ int joy_init()
        int i;
        int temp_axis[4];
 
-//        if(args_find("-joy209"))
+//        if(FindArg("-joy209"))
 //         use_alt_joyport=1;
-        if(args_find("-joy209"))
+        if(FindArg("-joy209"))
          JOY_PORT = 521;  //209h;
          
        joy_flush();
index efd4c27..88b77b4 100644 (file)
@@ -10,7 +10,7 @@ extern void d_mouse_init();
 
 void arch_svgalib_init()
 {
- if (!args_find("-nomouse"))
+ if (!FindArg("-nomouse"))
        d_mouse_init();
 }
 
index e4c05a4..5e2dd00 100644 (file)
@@ -46,7 +46,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 
 
 #ifdef RCS
-static char rcsid[] = "$Id: config.c,v 1.1.1.2 2001-01-19 03:33:47 bradleyb Exp $";
+static char rcsid[] = "$Id: config.c,v 1.2 2001-01-24 04:29:45 bradleyb Exp $";
 #endif
 
 ubyte Config_digi_volume = 8;
@@ -339,7 +339,7 @@ int ReadConfigFile()
        joy_set_cal_vals(joy_axis_min, joy_axis_center, joy_axis_max);
 #endif
 
-       i = args_find( "-volume" );
+       i = FindArg( "-volume" );
        
        if ( i > 0 )    {
                i = atoi( Args[i+1] );
@@ -370,7 +370,7 @@ int ReadConfigFile()
        Config_digi_dma = digi_driver_dma;*/
 
 #if !defined WINDOWS && !defined __ENV_LINUX__ && !defined __ENV_DJGPP__
-       if (digi_driver_board_16 > 0 && !args_find("-no16bit") && digi_driver_board_16 != _GUS_16_ST) {
+       if (digi_driver_board_16 > 0 && !FindArg("-no16bit") && digi_driver_board_16 != _GUS_16_ST) {
                digi_driver_board = digi_driver_board_16;
                digi_driver_dma = digi_driver_dma_16;
        }
@@ -474,7 +474,7 @@ int WriteConfigFile()
        fputs(str, infile);*/
        sprintf (str, "%s=%d\n", midi_volume_str, Config_midi_volume);
        fputs(str, infile);
-       sprintf (str, "%s=%d\n", redbook_enabled_str, args_find("-noredbook")?save_redbook_enabled:Redbook_enabled);
+       sprintf (str, "%s=%d\n", redbook_enabled_str, FindArg("-noredbook")?save_redbook_enabled:Redbook_enabled);
        fputs(str, infile);
        sprintf (str, "%s=%d\n", redbook_volume_str, Config_redbook_volume);
        fputs(str, infile);
@@ -576,7 +576,7 @@ int WriteConfigFile()
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: config.c,v 1.1.1.2 2001-01-19 03:33:47 bradleyb Exp $";
+static char rcsid[] = "$Id: config.c,v 1.2 2001-01-24 04:29:45 bradleyb Exp $";
 #endif
 
 #define MAX_CTB_LEN    512
index 2e24d18..0874dec 100644 (file)
@@ -349,11 +349,11 @@ int HUD_init_message(char * format, ... )
 
        // Added by Leighton 
    
-   if ((Game_mode & GM_MULTI) && args_find("-noredundancy"))
+   if ((Game_mode & GM_MULTI) && FindArg("-noredundancy"))
         if (!strnicmp ("You already",message,11))
                return 0;
 
-   if ((Game_mode & GM_MULTI) && args_find("-PlayerMessages") && PlayerMessage==0)
+   if ((Game_mode & GM_MULTI) && FindArg("-PlayerMessages") && PlayerMessage==0)
                return 0;
   
        if (HUD_nmessages > 0)  {
index b47f30f..cda2f94 100644 (file)
@@ -788,7 +788,7 @@ void set_display_mode(int mode)
                return;                                                         //...don't change
 
        #if !defined(MACINTOSH) && !defined(WINDOWS)
-       if (mode >= 5 && !args_find("-superhires"))
+       if (mode >= 5 && !FindArg("-superhires"))
                mode = 4;
        #endif
 
@@ -932,7 +932,7 @@ void do_screen_res_menu()
        m[5].type=NM_TYPE_RADIO; m[5].value=0; m[5].group=0; m[5].text=" 640x480";
        m[6].type=NM_TYPE_RADIO; m[6].value=0; m[6].group=0; m[6].text=" 800x600";
        n_items = 7;
-       if (args_find("-superhires")) {
+       if (FindArg("-superhires")) {
                m[7].type=NM_TYPE_RADIO; m[7].value=0; m[7].group=0; m[7].text=" 1024x768";
                m[8].type=NM_TYPE_RADIO; m[8].value=0; m[8].group=0; m[8].text=" 1280x1024";
                n_items += 2;
@@ -1277,7 +1277,7 @@ void sound_menuset(int nitems, newmenu_item * items, int *last_key, int citem )
 
        if (items[4].value != (Redbook_playing!=0)) {
 
-               if (items[4].value && args_find("-noredbook")) {
+               if (items[4].value && FindArg("-noredbook")) {
                        nm_messagebox (TXT_SORRY,1,TXT_OK,"Redbook audio has been disabled\non the command line");
                        items[4].value = 0;
                        items[4].redraw = 1;
index 3d203cf..c15aa35 100644 (file)
@@ -4946,7 +4946,7 @@ void multi_add_lifetime_kills ()
   if (oldrank!=GetMyNetRanking())
    {
         multi_send_ranking();
-    if (!args_find("-norankings"))
+    if (!FindArg("-norankings"))
          {
                 HUD_init_message ("You have been promoted to %s!",RankStrings[GetMyNetRanking()]);
         digi_play_sample (SOUND_BUDDY_MET_GOAL,F1_0*2);
@@ -4975,7 +4975,7 @@ void multi_add_lifetime_killed ()
          multi_send_ranking();
          NetPlayers.players[Player_num].rank=GetMyNetRanking();
          
-     if (!args_find("-norankings"))    
+     if (!FindArg("-norankings"))      
                  HUD_init_message ("You have been demoted to %s!",RankStrings[GetMyNetRanking()]);
   
        }       
@@ -5007,7 +5007,7 @@ void multi_do_ranking (char *buf)
 
   NetPlayers.players[(int)pnum].rank=rank;
 
-  if (!args_find("-norankings"))
+  if (!FindArg("-norankings"))
          HUD_init_message ("%s has been %s to %s!",Players[(int)pnum].callsign,rankstr,RankStrings[(int)rank]);
  }
 void multi_send_modem_ping ()
index 8e1f38a..1d04783 100644 (file)
@@ -12,7 +12,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 */
 
 #ifdef RCS
-static char rcsid[] = "$Id: network.c,v 1.2 2001-01-20 13:49:16 bradleyb Exp $";
+static char rcsid[] = "$Id: network.c,v 1.3 2001-01-24 04:29:45 bradleyb Exp $";
 #endif
 
 #include <conf.h>
@@ -408,7 +408,7 @@ network_init(void)
 
        Netgame.PacketsPerSec=10;
 
-   if ((t=args_find("-packets")))
+   if ((t=FindArg("-packets")))
     {
      Netgame.PacketsPerSec=atoi(Args[t+1]);
      if (Netgame.PacketsPerSec<1)
@@ -417,7 +417,7 @@ network_init(void)
       Netgame.PacketsPerSec=20;
      mprintf ((0,"Will send %d packets per second",Netgame.PacketsPerSec));
     }
-   if (args_find("-shortpackets"))
+   if (FindArg("-shortpackets"))
     {
      Netgame.ShortPackets=1;
      mprintf ((0,"Will send short packets.\n"));
@@ -815,7 +815,7 @@ network_new_player(sequence_packet *their)
 
    ClipRank (&their->player.rank);
    
-   if (args_find("-norankings"))
+   if (FindArg("-norankings"))
          HUD_init_message("'%s' %s\n",their->player.callsign, TXT_JOINING);
    else   
      HUD_init_message("%s'%s' %s\n",RankStrings[their->player.rank],their->player.callsign, TXT_JOINING);
@@ -841,7 +841,7 @@ void network_welcome_player(sequence_packet *their)
 
    WaitForRefuseAnswer=0;
 
-       if (args_find("-NoMatrixCheat"))
+       if (FindArg("-NoMatrixCheat"))
        {
                if (their->player.version_minor & (0x0F<3))
                {
@@ -1009,7 +1009,7 @@ void network_welcome_player(sequence_packet *their)
 
                digi_play_sample(SOUND_HUD_MESSAGE, F1_0);
                
-               if (args_find("-norankings"))
+               if (FindArg("-norankings"))
                        HUD_init_message("'%s' %s", Players[player_num].callsign, TXT_REJOIN);
                else
                        HUD_init_message("%s'%s' %s", RankStrings[NetPlayers.players[player_num].rank],Players[player_num].callsign, TXT_REJOIN);
@@ -2917,7 +2917,7 @@ void network_start_poll( int nitems, newmenu_item * menus, int * key, int citem
                digi_play_sample (SOUND_HUD_MESSAGE,F1_0);
 
       mprintf ((0,"More players are printed!"));
-               if (args_find("-norankings"))
+               if (FindArg("-norankings"))
              sprintf( menus[N_players-1].text, "%d. %-20s", N_players,NetPlayers.players[N_players-1].callsign );
                else
              sprintf( menus[N_players-1].text, "%d. %s%-20s", N_players, RankStrings[NetPlayers.players[N_players-1].rank],NetPlayers.players[N_players-1].callsign );
@@ -2937,7 +2937,7 @@ void network_start_poll( int nitems, newmenu_item * menus, int * key, int citem
                for (i=0; i<N_players; i++ )    
                {
         
-        if (args_find("-norankings"))  
+        if (FindArg("-norankings"))    
                 sprintf( menus[i].text, "%d. %-20s", i+1, NetPlayers.players[i].callsign );
         else
                 sprintf( menus[i].text, "%d. %s%-20s", i+1, RankStrings[NetPlayers.players[i].rank],NetPlayers.players[i].callsign );
@@ -3077,7 +3077,7 @@ int network_get_game_params( char * game_name, int *mode, int *game_flags, int *
        if (new_mission_num < 0)
                return -1;
 
-   if (!(args_find ("-packets") && args_find ("-shortpackets")))
+   if (!(FindArg ("-packets") && FindArg ("-shortpackets")))
           if (!network_choose_connect ())
                        return -1;
 
@@ -3618,7 +3618,7 @@ network_select_players(void)
 
        m[0].value = 1;                         // Assume server will play...
 
-   if (args_find("-norankings"))
+   if (FindArg("-norankings"))
                sprintf( text[0], "%d. %-20s", 1, Players[Player_num].callsign );
        else
                sprintf( text[0], "%d. %s%-20s", 1, RankStrings[NetPlayers.players[Player_num].rank],Players[Player_num].callsign );
@@ -5448,7 +5448,7 @@ void network_read_pdata_packet(frame_info *pd )
                
                ClipRank (&NetPlayers.players[TheirPlayernum].rank);
 
-               if (args_find("-norankings"))      
+               if (FindArg("-norankings"))      
                        HUD_init_message( "'%s' %s", Players[TheirPlayernum].callsign, TXT_REJOIN );
                else
                        HUD_init_message( "%s'%s' %s", RankStrings[NetPlayers.players[TheirPlayernum].rank],Players[TheirPlayernum].callsign, TXT_REJOIN );
@@ -5608,7 +5608,7 @@ void network_read_pdata_short_packet(short_frame_info *pd )
                digi_play_sample( SOUND_HUD_MESSAGE, F1_0);
                ClipRank (&NetPlayers.players[TheirPlayernum].rank);
                
-               if (args_find("-norankings"))
+               if (FindArg("-norankings"))
                        HUD_init_message( "'%s' %s", Players[TheirPlayernum].callsign, TXT_REJOIN );
                else
                        HUD_init_message( "%s'%s' %s", RankStrings[NetPlayers.players[TheirPlayernum].rank],Players[TheirPlayernum].callsign, TXT_REJOIN );
@@ -6004,7 +6004,7 @@ void DoRefuseStuff (sequence_packet *their)
                 {
        
                                        
-      if (!args_find("-norankings"))
+      if (!FindArg("-norankings"))
              HUD_init_message ("%s %s wants to join",RankStrings[their->player.rank],their->player.callsign);
        #ifndef MACINTOSH
                HUD_init_message ("%s joining. Alt-1 assigns to team %s. Alt-2 to team %s",their->player.callsign,Netgame.team_name[0],Netgame.team_name[1]);
@@ -6407,7 +6407,7 @@ void network_process_names_return (char *data)
 
          for (t=0;t<CALLSIGN_LEN+1;t++)
                 temp[t]=data[count++];   
-     if (args_find("-norankings"))     
+     if (FindArg("-norankings"))       
             sprintf (mtext[num],"%s",temp);
          else
             sprintf (mtext[num],"%s%s",RankStrings[l],temp);
index 21ea039..f883931 100644 (file)
@@ -13,7 +13,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 
 
 #ifdef RCS
-static char rcsid[] = "$Id: piggy.c,v 1.2 2001-01-20 13:49:17 bradleyb Exp $";
+static char rcsid[] = "$Id: piggy.c,v 1.3 2001-01-24 04:29:48 bradleyb Exp $";
 #endif
 
 #include <conf.h>
@@ -181,7 +181,7 @@ bitmap_index piggy_register_bitmap( grs_bitmap * bmp, char * name, int in_file )
 
        if (!in_file)   {
 #ifdef EDITOR
-               if ( args_find("-macdata") )
+               if ( FindArg("-macdata") )
                        swap_0_255( bmp );
 #endif
                if ( !BigPig )  gr_bitmap_rle_compress( bmp );
@@ -851,7 +851,7 @@ void piggy_new_pigfile(char *pigname)
                                        bm[fnum]->avg_color = compute_average_pixel(bm[fnum]);
 
 #ifdef EDITOR
-                                       if ( args_find("-macdata") )
+                                       if ( FindArg("-macdata") )
                                                swap_0_255( bm[fnum] );
 #endif
                                        if ( !BigPig ) gr_bitmap_rle_compress( bm[fnum] );
@@ -904,7 +904,7 @@ void piggy_new_pigfile(char *pigname)
                                new->avg_color = compute_average_pixel(new);
                        
 #ifdef EDITOR
-                                       if ( args_find("-macdata") )
+                                       if ( FindArg("-macdata") )
                                                swap_0_255( new );
 #endif
                                if ( !BigPig )  gr_bitmap_rle_compress( new );
@@ -1131,13 +1131,13 @@ int piggy_init(void)
                GameBitmapOffset[0] = 0;
        }
 
-       if ( args_find( "-bigpig" ))
+       if ( FindArg( "-bigpig" ))
                BigPig = 1;
 
-       if ( args_find( "-lowmem" ))
+       if ( FindArg( "-lowmem" ))
                piggy_low_memory = 1;
 
-       if ( args_find( "-nolowmem" ))
+       if ( FindArg( "-nolowmem" ))
                piggy_low_memory = 0;
 
        if (piggy_low_memory)
index f84e8ab..26cc293 100644 (file)
@@ -13,7 +13,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 
 
 #ifdef RCS
-static char rcsid[] = "$Id: polyobj.c,v 1.2 2001-01-20 13:49:17 bradleyb Exp $";
+static char rcsid[] = "$Id: polyobj.c,v 1.3 2001-01-24 04:29:48 bradleyb Exp $";
 #endif
 
 #include <conf.h>
@@ -203,7 +203,7 @@ polymodel *read_model_file(polymodel *pm,char *filename,robot_info *r)
        if (version < PM_COMPATIBLE_VERSION || version > PM_OBJFILE_VERSION)
                Error("Bad version (%d) in model file <%s>",version,filename);
 
-       if ( args_find( "-bspgen" )) 
+       if ( FindArg( "-bspgen" )) 
                printf( "bspgen -c1" );
 
        while (new_pof_read_int(id,model_buf) == 1) {
@@ -227,7 +227,7 @@ polymodel *read_model_file(polymodel *pm,char *filename,robot_info *r)
                                pof_read_vecs(&pmmin,1,model_buf);
                                pof_read_vecs(&pmmax,1,model_buf);
 
-                               if ( args_find( "-bspgen" ))    {
+                               if ( FindArg( "-bspgen" ))      {
                                        vms_vector v;
                                        fix l;
                                
@@ -372,7 +372,7 @@ polymodel *read_model_file(polymodel *pm,char *filename,robot_info *r)
 //     for (i=0;i<pm->n_models;i++)
 //             pm->submodel_ptrs[i] += (int) pm->model_data;
 
-       if ( args_find( "-bspgen" )) {
+       if ( FindArg( "-bspgen" )) {
                char *p = strchr( filename, '.' );
                *p = 0;
 
index bf72516..e6eafe1 100644 (file)
@@ -12,7 +12,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 */
 
 #ifdef RCS
-static char rcsid[] = "$Id: slew.c,v 1.1.1.1 2001-01-19 03:30:01 bradleyb Exp $";
+static char rcsid[] = "$Id: slew.c,v 1.2 2001-01-24 04:29:48 bradleyb Exp $";
 #endif
 
 #include <conf.h>
@@ -89,7 +89,7 @@ int do_slew_movement(object *obj, int check_keys, int check_joy )
 
        if (check_keys) {
                if (Function_mode == FMODE_EDITOR) {
-                       if (args_find("-jasen"))
+                       if (FindArg("-jasen"))
                                obj->mtype.phys_info.velocity.x += VEL_SPEED * (key_down_time(KEY_PAD3) - key_down_time(KEY_PAD1));
                        else
                                obj->mtype.phys_info.velocity.x += VEL_SPEED * (key_down_time(KEY_PAD9) - key_down_time(KEY_PAD7));
@@ -97,7 +97,7 @@ int do_slew_movement(object *obj, int check_keys, int check_joy )
                        obj->mtype.phys_info.velocity.z += VEL_SPEED * (key_down_time(KEY_PAD8) - key_down_time(KEY_PAD2));
 
                        rotang.p = (key_down_time(KEY_LBRACKET) - key_down_time(KEY_RBRACKET))/ROT_SPEED ;
-                       if (args_find("-jasen"))
+                       if (FindArg("-jasen"))
                                rotang.b  = (key_down_time(KEY_PAD7) - key_down_time(KEY_PAD9))/ROT_SPEED;
                        else
                                rotang.b  = (key_down_time(KEY_PAD1) - key_down_time(KEY_PAD3))/ROT_SPEED;
index 2884251..be9da25 100644 (file)
@@ -77,7 +77,7 @@ void songs_init()
 
 
        #if !defined(MACINTOSH) && !defined(WINDOWS)    // don't crank it if on a macintosh!!!!!
-               if (!args_find("-nomixer"))
+               if (!FindArg("-nomixer"))
                        CD_blast_mixer();   // Crank it!
        #endif
 
@@ -114,7 +114,7 @@ void songs_init()
 
        //      RBA Hook
        #if !defined(SHAREWARE) || ( defined(SHAREWARE) && defined(APPLE_DEMO) )
-               if (args_find("-noredbook"))
+               if (FindArg("-noredbook"))
                {
                        Redbook_enabled = 0;
                }
@@ -201,7 +201,7 @@ int play_redbook_track(int tracknum,int keep_playing)
 {
        Redbook_playing = 0;
 
-       if (!RBAEnabled() && Redbook_enabled && !args_find("-noredbook"))
+       if (!RBAEnabled() && Redbook_enabled && !FindArg("-noredbook"))
                reinit_redbook();
 
        if (force_rb_register) {
@@ -302,7 +302,7 @@ void songs_play_level_song( int levelnum )
 
        songnum = (levelnum>0)?(levelnum-1):(-levelnum);
        
-       if (!RBAEnabled() && Redbook_enabled && !args_find("-noredbook"))
+       if (!RBAEnabled() && Redbook_enabled && !FindArg("-noredbook"))
                reinit_redbook();
 
        if (force_rb_register) {
index 275403f..55e1ca7 100644 (file)
@@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 */
 /*
  * $Source: /cvs/cvsroot/d2x/misc/args.c,v $
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
  * $Author: bradleyb $
- * $Date: 2001-01-19 03:30:14 $
+ * $Date: 2001-01-24 04:29:48 $
  * 
  * Functions for accessing arguments.
  * 
  * $Log: not supported by cvs2svn $
+ * Revision 1.1.1.1  2001/01/19 03:30:14  bradleyb
+ * Import of d2x-0.0.8
+ *
  * Revision 1.3  1999/08/05 22:53:41  sekmu
  *
  * D3D patch(es) from ADB
@@ -66,7 +69,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 
 
 #ifdef RCS
-static char rcsid[] = "$Id: args.c,v 1.1.1.1 2001-01-19 03:30:14 bradleyb Exp $";
+static char rcsid[] = "$Id: args.c,v 1.2 2001-01-24 04:29:48 bradleyb Exp $";
 #endif
 
 #include <conf.h>
@@ -82,7 +85,7 @@ static char rcsid[] = "$Id: args.c,v 1.1.1.1 2001-01-19 03:30:14 bradleyb Exp $"
 int Num_args=0;
 char * Args[100];
 
-int args_find( char * s )      {
+int FindArg( char * s )        {
        int i;
 
        for (i=0; i<Num_args; i++ )
@@ -122,7 +125,7 @@ void args_init( int argc,char **argv )
      if ( Args[i][0] == '-' )
       strlwr( Args[i]  );             // Convert all args to lowercase
     }
-  if((i=args_find("-ini")))
+  if((i=FindArg("-ini")))
    f=fopen(Args[i+1],"rt");
   else
    f=fopen("d1x.ini","rt");
index 7f09930..e8d8073 100644 (file)
@@ -26,7 +26,7 @@ void RBAExit()
 void RBAInit()
 {
        if (initialised) return;
-       if (args_find("-nocdrom")) return; 
+       if (FindArg("-nocdrom")) return; 
 
        if (SDL_Init(SDL_INIT_CDROM) < 0)
        {
index 8277aed..9ed996a 100644 (file)
@@ -135,16 +135,16 @@ void ogl_get_verinfo(void){
        }
 
        //allow overriding of stuff.
-       if ((t=args_find("-gl_intensity4_ok"))){
+       if ((t=FindArg("-gl_intensity4_ok"))){
                ogl_intensity4_ok=atoi(Args[t+1]);
        }
-       if ((t=args_find("-gl_luminance4_alpha4_ok"))){
+       if ((t=FindArg("-gl_luminance4_alpha4_ok"))){
                ogl_luminance4_alpha4_ok=atoi(Args[t+1]);
        }
-       if ((t=args_find("-gl_rgba2_ok"))){
+       if ((t=FindArg("-gl_rgba2_ok"))){
                ogl_rgba2_ok=atoi(Args[t+1]);
        }
-       if ((t=args_find("-gl_readpixels_ok"))){
+       if ((t=FindArg("-gl_readpixels_ok"))){
                ogl_readpixels_ok=atoi(Args[t+1]);
        }
 
@@ -240,7 +240,7 @@ int ogl_init_load_library(void)
        int retcode=0;
        if (!ogl_rt_loaded){
                int t;
-               if ((t=args_find("-gl_library")))
+               if ((t=FindArg("-gl_library")))
                        OglLibPath=Args[t+1];
 
                retcode = OpenGL_LoadLibrary(true);
@@ -275,48 +275,48 @@ int gr_init()
 #endif
 
 #ifdef GR_SUPPORTS_FULLSCREEN_TOGGLE
-       if (args_find("-gl_voodoo")){
+       if (FindArg("-gl_voodoo")){
                ogl_voodoohack=1;
                gr_toggle_fullscreen();
        }
-       if (args_find("-fullscreen"))
+       if (FindArg("-fullscreen"))
                gr_toggle_fullscreen();
 #endif
-       if ((glt=args_find("-gl_alttexmerge")))
+       if ((glt=FindArg("-gl_alttexmerge")))
                ogl_alttexmerge=1;
-       if ((t=args_find("-gl_stdtexmerge")))
+       if ((t=FindArg("-gl_stdtexmerge")))
                if (t>=glt)//allow overriding of earlier args
                        ogl_alttexmerge=0;
                        
-       if ((glt=args_find("-gl_16bittextures")))
+       if ((glt=FindArg("-gl_16bittextures")))
                ogl_rgba_format=GL_RGB5_A1;
 
-       if ((glt=args_find("-gl_mipmap"))){
+       if ((glt=FindArg("-gl_mipmap"))){
                GL_texmagfilt=GL_LINEAR;
                GL_texminfilt=GL_LINEAR_MIPMAP_NEAREST;
        }
-       if ((t=args_find("-gl_simple"))){
+       if ((t=FindArg("-gl_simple"))){
                if (t>=glt){//allow overriding of earlier args
                        glt=t;
                        GL_texmagfilt=GL_NEAREST;
                        GL_texminfilt=GL_NEAREST;
                }
        }
-       if ((t=args_find("-gl_texmagfilt")) || (t=args_find("-gl_texmagfilter"))){
+       if ((t=FindArg("-gl_texmagfilt")) || (t=FindArg("-gl_texmagfilter"))){
                if (t>=glt)//allow overriding of earlier args
                        GL_texmagfilt=ogl_atotexfilti(Args[t+1],0);
        }
-       if ((t=args_find("-gl_texminfilt")) || (t=args_find("-gl_texminfilter"))){
+       if ((t=FindArg("-gl_texminfilt")) || (t=FindArg("-gl_texminfilter"))){
                if (t>=glt)//allow overriding of earlier args
                        GL_texminfilt=ogl_atotexfilti(Args[t+1],1);
        }
        GL_needmipmaps=ogl_testneedmipmaps(GL_texminfilt);
        mprintf((0,"gr_init: texmagfilt:%x texminfilt:%x needmipmaps=%i\n",GL_texmagfilt,GL_texminfilt,GL_needmipmaps));
        
-       if ((t=args_find("-gl_vidmem"))){
+       if ((t=FindArg("-gl_vidmem"))){
                ogl_mem_target=atoi(Args[t+1])*1024*1024;
        }
-       if ((t=args_find("-gl_reticle"))){
+       if ((t=FindArg("-gl_reticle"))){
                gl_reticle=atoi(Args[t+1]);
        }
        //printf("ogl_mem_target=%i\n",ogl_mem_target);
index 5546ec7..b31538f 100644 (file)
@@ -163,14 +163,14 @@ int gr_init(void)
        memset( grd_curscreen, 0, sizeof(grs_screen));
 
 //added 10/05/98 by Matt Mueller - make fullscreen mode optional
-       if (args_find("-fullscreen"))
+       if (FindArg("-fullscreen"))
             sdl_video_flags|=SDL_FULLSCREEN;
 //end addition -MM
        //added 05/19/99 Matt Mueller - make HW surface optional
-       if (args_find("-hwsurface"))
+       if (FindArg("-hwsurface"))
             sdl_video_flags|=SDL_HWSURFACE;
        //end addition -MM
-       if (args_find("-nosdlvidmodecheck"))
+       if (FindArg("-nosdlvidmodecheck"))
                checkvidmodeok=0;
        
        // Set the mode.