From a973da943260171a9fd019cd3ab599361812e75f Mon Sep 17 00:00:00 2001 From: zicodxx Date: Fri, 1 Jul 2011 01:00:59 +0200 Subject: [PATCH] Made formatting for help text more consistent and prettier; Somewhat changed the code for help text so we can use variables in the help text. For example: If we change MAXIMUM_FPS, it will automatically be displayed in the help text without manual editing needed --- CHANGELOG.txt | 4 ++ d2x.ini | 88 +++++++++++++++++++-------------------- main/inferno.c | 111 ++++++++++++++++++++++++++----------------------- main/net_udp.h | 5 +++ misc/args.c | 13 ++++-- 5 files changed, 122 insertions(+), 99 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 293a367a3..4088ea783 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D2X-Rebirth Changelog +20110701 +-------- +d2x.ini, main/inferno.c, main/net_udp.h, misc/args.c: Made formatting for help text more consistent and prettier; Somewhat changed the code for help text so we can use variables in the help text. For example: If we change MAXIMUM_FPS, it will automatically be displayed in the help text without manual editing needed + 20110630 -------- editor/group.c, editor/ksegsize.c, editor/meddraw.c, editor/segment.c, editor/seguvs.c, include/editor/editor.h, main/automap.c, main/fireball.c, main/gamecntl.c, main/gameseg.c, main/gameseg.h, main/lighting.c, main/render.c, main/render.h, main/segment.h: changed variables and pointer carrying vertex indexes from short to int to handle levels with over 900 segments properly diff --git a/d2x.ini b/d2x.ini index 04e9947ee..aba4848b8 100644 --- a/d2x.ini +++ b/d2x.ini @@ -1,61 +1,61 @@ System Options: -;-nonicefps Don't free CPU-cycles -;-maxfps Set maximum framerate (1-200) -;-hogdir set shared data directory to -;-nohogdir don't try to use shared data directory -;-use_players_dir put player files and saved games in Players subdirectory -;-lowmem Lowers animation detail for better performance with low memory -;-pilot Select this pilot automatically -;-autodemo Start in demo mode -;-window Run the game in a window -;-nomovies Don't play movies -;-noborders Do not show borders in window mode +;-nonicefps Don't free CPU-cycles +;-maxfps Set maximum framerate to (default: 1000, availble: 1-1000) +;-hogdir set shared data directory to +;-nohogdir don't try to use shared data directory +;-use_players_dir put player files and saved games in Players subdirectory +;-lowmem Lowers animation detail for better performance with low memory +;-pilot Select pilot automatically +;-autodemo Start in demo mode +;-window Run the game in a window +;-noborders Do not show borders in window mode +;-nomovies Don't play movies Controls: -;-nomouse Deactivate mouse -;-nojoystick Deactivate joystick -;-nostickykeys Make CapsLock and NumLock non-sticky so they can be used as normal keys +;-nomouse Deactivate mouse +;-nojoystick Deactivate joystick +;-nostickykeys Make CapsLock and NumLock non-sticky Sound: -;-nosound Disables sound output -;-nomusic Disables music output -;-sound11k Use 11KHz sounds -;-nosdlmixer Disable Sound output via SDL_mixer +;-nosound Disables sound output +;-nomusic Disables music output +;-sound11k Use 11KHz sounds +;-nosdlmixer Disable Sound output via SDL_mixer Graphics: -;-lowresfont Force to use LowRes fonts -;-lowresgraphics Force to use LowRes graphics -;-lowresmovies Play low resolution movies if available (for slow machines) -;-gl_fixedfont Do not scale fonts to current resolution +;-lowresfont Force to use LowRes fonts +;-lowresgraphics Force to use LowRes graphics +;-lowresmovies Play low resolution movies if available (for slow machines) +;-gl_fixedfont Do not scale fonts to current resolution Multiplayer: -;-ipxnetwork Use IPX network number -;-udp_hostaddr When manually joining a game use default IP Address to connect to -;-udp_hostport When manually joining a game use default UDP Port to connect to -;-udp_myport When hosting/joining a game use default UDP Port to send packets from -;-tracker_hostaddr Address of Tracker server to register/query games to/from (default: dxxtracker.reenigne.net) -;-tracker_hostport Port of Tracker server to register/query games to/from (default: 42420) +;-ipxnetwork Use IPX network number +;-udp_hostaddr Use IP address/Hostname for manual game joining (default: localhost) +;-udp_hostport Use UDP port for manual game joining (default: 42424) +;-udp_myport Set my own UDP port to (default: 42424) +;-tracker_hostaddr Address of Tracker server to register/query games to/from (default: dxxtracker.reenigne.net) +;-tracker_hostport Port of Tracker server to register/query games to/from (default: 42420) Debug (use only if you know what you're doing): -;-debug Enable very verbose output -;-verbose Shows initialization steps for tech support -;-norun Bail out after initialization -;-renderstats Enable renderstats info by default -;-text Specify alternate .tex file -;-tmap Select texmapper to use (c,fp,quad,i386) -;-showmeminfo Show memory statistics -;-nodoublebuffer Disable Doublebuffering -;-bigpig Use uncompressed RLE bitmaps -;-16bpp Use 16Bpp instead of 32Bpp -;-gl_oldtexmerge Use old texmerge, uses more ram, but _might_ be a bit faster -;-gl_intensity4_ok Override DbgGlIntensity4Ok - Default: 1 -;-gl_luminance4_alpha4_ok Override DbgGlLuminance4Alpha4Ok - Default: 1 -;-gl_rgba2_ok Override DbgGlRGBA2Ok - Default: 1 -;-gl_readpixels_ok Override DbgGlReadPixelsOk - Default: 1 -;-gl_gettexlevelparam_ok Override DbgGlGetTexLevelParamOk - Default: 1 +;-debug Enable very verbose output +;-verbose Shows initialization steps for tech support +;-norun Bail out after initialization +;-renderstats Enable renderstats info by default +;-text Specify alternate .tex file +;-tmap Select texmapper to use (default: c, available: c, fp, quad, i386) +;-showmeminfo Show memory statistics +;-nodoublebuffer Disable Doublebuffering +;-bigpig Use uncompressed RLE bitmaps +;-16bpp Use 16Bpp instead of 32Bpp +;-gl_oldtexmerge Use old texmerge, uses more ram, but might be faster +;-gl_intensity4_ok Override DbgGlIntensity4Ok (default: 1) +;-gl_luminance4_alpha4_ok Override DbgGlLuminance4Alpha4Ok (default: 1) +;-gl_rgba2_ok Override DbgGlRGBA2Ok (default: 1) +;-gl_readpixels_ok Override DbgGlReadPixelsOk (default: 1) +;-gl_gettexlevelparam_ok Override DbgGlGetTexLevelParamOk (default: 1) diff --git a/main/inferno.c b/main/inferno.c index 35b07bcc1..c94f91641 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -95,6 +95,9 @@ char copyright[] = "DESCENT II COPYRIGHT (C) 1994-1996 PARALLAX SOFTWARE CORPOR #include "ui.h" #endif #include "vers_id.h" +#ifdef USE_UDP +#include "net_udp.h" +#endif //Current version number @@ -118,83 +121,87 @@ extern void arch_init(void); void print_commandline_help() { printf( "\n System Options:\n\n"); - printf( " -nonicefps %s\n", "Don't free CPU-cycles"); - printf( " -maxfps %s\n", "Set maximum framerate (1-200)"); - printf( " -hogdir %s\n", "set shared data directory to "); - printf( " -nohogdir %s\n", "don't try to use shared data directory"); - printf( " -use_players_dir %s\n", "put player files and saved games in Players subdirectory"); - printf( " -lowmem %s\n", "Lowers animation detail for better performance with low memory"); - printf( " -pilot %s\n", "Select this pilot automatically"); - printf( " -autodemo %s\n", "Start in demo mode"); - printf( " -window %s\n", "Run the game in a window"); - printf( " -noborders %s\n", "Do not show borders in window mode"); - printf( " -nomovies %s\n", "Don't play movies"); + printf( " -nonicefps Don't free CPU-cycles\n"); + printf( " -maxfps Set maximum framerate to \n\t\t\t\t(default: %i, availble: 1-%i)\n", MAXIMUM_FPS, MAXIMUM_FPS); + printf( " -hogdir set shared data directory to \n"); + printf( " -nohogdir don't try to use shared data directory\n"); + printf( " -use_players_dir put player files and saved games in Players subdirectory\n"); + printf( " -lowmem Lowers animation detail for better performance with\n\t\t\t\tlow memory\n"); + printf( " -pilot Select pilot automatically\n"); + printf( " -autodemo Start in demo mode\n"); + printf( " -window Run the game in a window\n"); + printf( " -noborders Do not show borders in window mode\n"); + printf( " -nomovies Don't play movies\n"); printf( "\n Controls:\n\n"); - printf( " -nomouse %s\n", "Deactivate mouse"); - printf( " -nojoystick %s\n", "Deactivate joystick"); - printf( " -nostickykeys %s\n", "Make CapsLock and NumLock non-sticky so they can be used as normal keys"); + printf( " -nomouse Deactivate mouse\n"); + printf( " -nojoystick Deactivate joystick\n"); + printf( " -nostickykeys Make CapsLock and NumLock non-sticky\n"); printf( "\n Sound:\n\n"); - printf( " -nosound %s\n", "Disables sound output"); - printf( " -nomusic %s\n", "Disables music output"); - printf( " -sound11k %s\n", "Use 11KHz sounds"); + printf( " -nosound Disables sound output\n"); + printf( " -nomusic Disables music output\n"); + printf( " -sound11k Use 11KHz sounds\n"); #ifdef USE_SDLMIXER - printf( " -nosdlmixer %s\n", "Disable Sound output via SDL_mixer"); + printf( " -nosdlmixer Disable Sound output via SDL_mixer\n"); #endif // USE SDLMIXER printf( "\n Graphics:\n\n"); - printf( " -lowresfont %s\n", "Force to use LowRes fonts"); - printf( " -lowresgraphics %s\n", "Force to use LowRes graphics"); - printf( " -lowresmovies %s\n", "Play low resolution movies if available (for slow machines)"); + printf( " -lowresfont Force to use LowRes fonts\n"); + printf( " -lowresgraphics Force to use LowRes graphics\n"); + printf( " -lowresmovies Play low resolution movies if available (for slow machines)\n"); #ifdef OGL - printf( " -gl_fixedfont %s\n", "Do not scale fonts to current resolution"); + printf( " -gl_fixedfont Do not scale fonts to current resolution\n"); #endif // OGL -#ifdef NETWORK +#if defined(USE_IPX) || defined(USE_UDP) printf( "\n Multiplayer:\n\n"); - printf( " -ipxnetwork %s\n", "Use IPX network number "); - printf( " -udp_hostaddr %s\n", "When manually joining a game use default IP Address to connect to"); - printf( " -udp_hostport %s\n", "When manually joining a game use default UDP Port to connect to"); - printf( " -udp_myport %s\n", "When hosting/joining a game use default UDP Port to send packets from"); +#ifdef USE_IPX + printf( " -ipxnetwork Use IPX network number \n"); +#endif +#ifdef USE_UDP + printf( " -udp_hostaddr Use IP address/Hostname for manual game joining\n\t\t\t\t(default: %s)\n", UDP_MANUAL_ADDR_DEFAULT); + printf( " -udp_hostport Use UDP port for manual game joining (default: %i)\n", UDP_PORT_DEFAULT); + printf( " -udp_myport Set my own UDP port to (default: %i)\n", UDP_PORT_DEFAULT); #ifdef USE_TRACKER - printf( " -tracker_hostaddr %s\n", "Address of Tracker server to register/query games to/from (default: dxxtracker.reenigne.net)"); - printf( " -tracker_hostport %s\n", "Port of Tracker server to register/query games to/from (default: 42420)"); + printf( " -tracker_hostaddr Address of Tracker server to register/query games to/from\n\t\t\t\t(default: %s)\n", TRACKER_ADDR_DEFAULT); + printf( " -tracker_hostport Port of Tracker server to register/query games to/from\n\t\t\t\t(default: %i)\n", TRACKER_PORT_DEFAULT); #endif // USE_TRACKER -#endif // NETWORK +#endif // USE_UDP +#endif // defined(USE_IPX) || defined(USE_UDP) #ifdef EDITOR printf( "\n Editor:\n\n"); - printf( " -autoload %s\n", "Autoload a level in the editor"); - printf( " -macdata %s\n", "Read and write mac data files in editor (swap colors)"); - printf( " -hoarddata %s\n", "Make the hoard ham file from some files, then exit"); + printf( " -autoload Autoload level in the editor\n"); + printf( " -macdata Read and write mac data files in editor (swap colors)\n"); + printf( " -hoarddata Make the hoard ham file from some files, then exit\n"); #endif // EDITOR printf( "\n Debug (use only if you know what you're doing):\n\n"); - printf( " -debug %s\n", "Enable very verbose output"); - printf( " -verbose %s\n", "Shows initialization steps for tech support"); - printf( " -norun %s\n", "Bail out after initialization"); - printf( " -renderstats %s\n", "Enable renderstats info by default"); - printf( " -text %s\n", "Specify alternate .tex file"); - printf( " -tmap %s\n", "Select texmapper to use (c,fp,quad,i386)"); - printf( " -showmeminfo %s\n", "Show memory statistics"); - printf( " -nodoublebuffer %s\n", "Disable Doublebuffering"); - printf( " -bigpig %s\n", "Use uncompressed RLE bitmaps"); - printf( " -16bpp %s\n", "Use 16Bpp instead of 32Bpp"); + printf( " -debug Enable very verbose output\n"); + printf( " -verbose Shows initialization steps for tech support\n"); + printf( " -norun Bail out after initialization\n"); + printf( " -renderstats Enable renderstats info by default\n"); + printf( " -text Specify alternate .tex file\n"); + printf( " -tmap Select texmapper to use\n\t\t\t\t(default: c, available: c, fp, quad, i386)\n"); + printf( " -showmeminfo Show memory statistics\n"); + printf( " -nodoublebuffer Disable Doublebuffering\n"); + printf( " -bigpig Use uncompressed RLE bitmaps\n"); + printf( " -16bpp Use 16Bpp instead of 32Bpp\n"); #ifdef OGL - printf( " -gl_oldtexmerge %s\n", "Use old texmerge, uses more ram, but _might_ be a bit faster"); - printf( " -gl_intensity4_ok %s\n", "Override DbgGlIntensity4Ok - Default: 1"); - printf( " -gl_luminance4_alpha4_ok %s\n", "Override DbgGlLuminance4Alpha4Ok - Default: 1"); - printf( " -gl_rgba2_ok %s\n", "Override DbgGlRGBA2Ok - Default: 1"); - printf( " -gl_readpixels_ok %s\n", "Override DbgGlReadPixelsOk - Default: 1"); - printf( " -gl_gettexlevelparam_ok %s\n", "Override DbgGlGetTexLevelParamOk - Default: 1"); + printf( " -gl_oldtexmerge Use old texmerge, uses more ram, but might be faster\n"); + printf( " -gl_intensity4_ok Override DbgGlIntensity4Ok (default: 1)\n"); + printf( " -gl_luminance4_alpha4_ok Override DbgGlLuminance4Alpha4Ok (default: 1)\n"); + printf( " -gl_rgba2_ok Override DbgGlRGBA2Ok (default: 1)\n"); + printf( " -gl_readpixels_ok Override DbgGlReadPixelsOk (default: 1)\n"); + printf( " -gl_gettexlevelparam_ok Override DbgGlGetTexLevelParamOk (default: 1)\n"); #else - printf( " -hwsurface %s\n", "Use SDL HW Surface"); - printf( " -asyncblit %s\n", "Use queued blits over SDL. Can speed up rendering"); + printf( " -hwsurface Use SDL HW Surface\n"); + printf( " -asyncblit Use queued blits over SDL. Can speed up rendering\n"); #endif // OGL printf( "\n Help:\n\n"); - printf( " -help, -h, -?, ? %s\n", "View this help screen"); + printf( " -help, -h, -?, ? View this help screen\n"); printf( "\n\n"); } diff --git a/main/net_udp.h b/main/net_udp.h index 76c1355fc..54426982d 100644 --- a/main/net_udp.h +++ b/main/net_udp.h @@ -30,6 +30,11 @@ void net_udp_send_netgame_update(); #endif #define UDP_BCAST_ADDR "255.255.255.255" #define UDP_PORT_DEFAULT 42424 // Our default port - easy to remember: D = 4, X = 24, X = 24 +#define UDP_MANUAL_ADDR_DEFAULT "localhost" +#ifdef USE_TRACKER +#define TRACKER_ADDR_DEFAULT "dxxtracker.reenigne.net" +#define TRACKER_PORT_DEFAULT 42420 +#endif #define UDP_REQ_ID "D2XR" // ID string for a request packet #define UDP_MAX_NETGAMES 3000 #define UDP_NETGAMES_PPAGE 12 // Netgames on one page of Netlist diff --git a/misc/args.c b/misc/args.c index 8d8bbc49e..0a88e3031 100644 --- a/misc/args.c +++ b/misc/args.c @@ -29,6 +29,9 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "game.h" #include "gauges.h" #include "console.h" +#ifdef USE_UDP +#include "net_udp.h" +#endif #define MAX_ARGS 1000 #define INI_FILENAME "d2x.ini" @@ -179,13 +182,17 @@ void ReadCmdArgs(void) // Multiplayer Options +#ifdef USE_IPX GameArg.MplIpxNetwork = get_str_arg("-ipxnetwork", NULL); - GameArg.MplUdpHostAddr = get_str_arg("-udp_hostaddr", "localhost"); +#endif +#ifdef USE_UDP + GameArg.MplUdpHostAddr = get_str_arg("-udp_hostaddr", UDP_MANUAL_ADDR_DEFAULT); GameArg.MplUdpHostPort = get_int_arg("-udp_hostport", 0); GameArg.MplUdpMyPort = get_int_arg("-udp_myport", 0); #ifdef USE_TRACKER - GameArg.MplTrackerAddr = get_str_arg("-tracker_hostaddr", "dxxtracker.reenigne.net"); - GameArg.MplTrackerPort = get_int_arg("-tracker_hostport", 42420); + GameArg.MplTrackerAddr = get_str_arg("-tracker_hostaddr", TRACKER_ADDR_DEFAULT); + GameArg.MplTrackerPort = get_int_arg("-tracker_hostport", TRACKER_PORT_DEFAULT); +#endif #endif #ifdef EDITOR