| version 1.28 | | version 1.29 |
|---|
| | |
| * main() for Inferno | | * main() for Inferno |
| * | | * |
| * $Log$ | | * $Log$ |
| | | * Revision 1.29 2002/04/01 01:21:57 donut |
| | | * allow arbitrary resolutions to be specified on command line |
| | | * |
| * Revision 1.28 2002/03/21 20:49:55 donut | | * Revision 1.28 2002/03/21 20:49:55 donut |
| * add -ip_bind_addr option | | * add -ip_bind_addr option |
| * | | * |
| | |
| | | |
| void show_cmdline_help() { | | void show_cmdline_help() { |
| printf( "%s\n", TXT_COMMAND_LINE_0 ); | | printf( "%s\n", TXT_COMMAND_LINE_0 ); |
| | | #ifdef __MSDOS__ |
| printf( " -<X>x<Y> %s\n", "Change screen resolution. Options:"); | | printf( " -<X>x<Y> %s\n", "Change screen resolution. Options:"); |
| printf( " 320x100;320x200;320x240;320x400;640x400;640x480;800x600;1024x768\n"); | | printf( " 320x100;320x200;320x240;320x400;640x400;640x480;800x600;1024x768\n"); |
| | | #else |
| | | printf( " -<X>x<Y> %s\n", "Change screen resolution to <X> by <Y>"); |
| | | #endif |
| printf( "%s\n", TXT_COMMAND_LINE_5 ); | | printf( "%s\n", TXT_COMMAND_LINE_5 ); |
| printf( "%s\n", TXT_COMMAND_LINE_6 ); | | printf( "%s\n", TXT_COMMAND_LINE_6 ); |
| printf( "%s\n", TXT_COMMAND_LINE_7 ); | | printf( "%s\n", TXT_COMMAND_LINE_7 ); |
| | |
| { | | { |
| int i,t; | | int i,t; |
| char start_demo[13]; | | char start_demo[13]; |
| int screen_width = 640; | | |
| int screen_height = 480; | | |
| u_int32_t screen_mode = SM(640,480); | | |
| | | |
| error_init(NULL); | | error_init(NULL); |
| | | |
| | |
| #endif | | #endif |
| | | |
| { | | { |
| //added on 12/14/98 by Matt Mueller - override res in d1x.ini with command line args | | int screen_width = 640; |
| int i, argnum=INT_MAX; | | int screen_height = 480; |
| //end addition -MM | | |
| int vr_mode = VR_NONE; | | int vr_mode = VR_NONE; |
| int screen_compatible = 1; | | int screen_compatible = 1; |
| int use_double_buffer = 0; | | int use_double_buffer = 0; |
| | | |
| //added/edited on 12/14/98 by Matt Mueller - override res in d1x.ini with command line args | | if (FindResArg("", &screen_width, &screen_height)) { |
| //added on 9/30/98 by Matt Mueller clean up screen mode code, and add higher resolutions | | if (screen_width==320 && screen_height==200) |
| #define SCREENMODE(X,Y,C) if ( (i=FindArg( "-" #X "x" #Y ))&&(i<argnum)) {argnum=i; screen_mode = SM( X , Y );if (Inferno_verbose) printf( "Using " #X "x" #Y " ...\n" );screen_width = X;screen_height = Y;use_double_buffer = 1;screen_compatible = C;} | | screen_compatible=1; |
| //aren't #defines great? :) | | else |
| | | screen_compatible=0; |
| | | |
| | | if (Inferno_verbose) |
| | | printf( "Using %ix%i ...\n", screen_width, screen_height); |
| | | } |
| | | |
| SCREENMODE(320,100,0); | | |
| SCREENMODE(320,200,1); | | |
| //end addition/edit -MM | | |
| SCREENMODE(320,240,0); | | |
| SCREENMODE(320,400,0); | | |
| SCREENMODE(640,400,0); | | |
| SCREENMODE(640,480,0); | | |
| SCREENMODE(800,600,0); | | |
| SCREENMODE(1024,768,0); | | |
| SCREENMODE(1152,864,0); | | |
| SCREENMODE(1280,960,0); | | |
| SCREENMODE(1280,1024,0); | | |
| SCREENMODE(1600,1200,0); | | |
| //end addition -MM | | |
| | | |
| //added ifdefs on 9/30/98 by Matt Mueller to fix high res in linux | | //added ifdefs on 9/30/98 by Matt Mueller to fix high res in linux |
| #ifdef __MSDOS__ | | #ifdef __MSDOS__ |
| | |
| //end addition -MM | | //end addition -MM |
| | | |
| //added 3/24/99 by Owen Evans for screen res changing | | //added 3/24/99 by Owen Evans for screen res changing |
| Game_screen_mode = screen_mode; | | Game_screen_mode = SM(screen_width, screen_height); |
| //end added -OE | | //end added -OE |
| game_init_render_buffers(screen_mode, screen_width, screen_height, use_double_buffer, vr_mode, screen_compatible); | | game_init_render_buffers(Game_screen_mode, screen_width, screen_height, use_double_buffer, vr_mode, screen_compatible); |
| | | |
| } | | } |
| { | | { |
| //added/edited on 12/14/98 by Matt Mueller - override res in d1x.ini with command line args | | //added/edited on 12/14/98 by Matt Mueller - override res in d1x.ini with command line args |
| int i, argnum=INT_MAX; | | int i, argnum=INT_MAX, w, h; |
| //added on 9/30/98 by Matt Mueller for selectable automap modes - edited 11/21/99 whee, more fun with defines. | | |
| #define SMODE(V,VV,VG,X,Y) if ( (i=FindArg( "-" #V #X "x" #Y )) && (i<argnum)) {argnum=i; VV = SM( X , Y );VG=0;} | | //added on 9/30/98 by Matt Mueller for selectable automap modes - edited 11/21/99 whee, more fun with defines. - edited 03/31/02 to use new FindResArg. |
| | | #define SMODE(V,VV,VG) if ( (i=FindResArg(#V, &w, &h)) && (i<argnum)) {argnum=i; VV = SM( w , h );VG=0;} |
| #define SMODE_GR(V,VG) if ((i=FindArg("-" #V "_gameres"))){if (i<argnum) VG=1;} | | #define SMODE_GR(V,VG) if ((i=FindArg("-" #V "_gameres"))){if (i<argnum) VG=1;} |
| #define SMODE_PRINT(V,VV,VG) if (Inferno_verbose) { if (VG) printf( #V " using game resolution ...\n"); else printf( #V " using %ix%i ...\n",SM_W(VV),SM_H(VV) ); } | | #define SMODE_PRINT(V,VV,VG) if (Inferno_verbose) { if (VG) printf( #V " using game resolution ...\n"); else printf( #V " using %ix%i ...\n",SM_W(VV),SM_H(VV) ); } |
| //aren't #defines great? :) | | //aren't #defines great? :) |
| //end addition/edit -MM | | //end addition/edit -MM |
| #define S_MODE(V,VV,VG) argnum=INT_MAX;SMODE(V,VV,VG,320,200);SMODE(V,VV,VG,320,240);SMODE(V,VV,VG,320,400);SMODE(V,VV,VG,640,400);SMODE(V,VV,VG,640,480);SMODE(V,VV,VG,800,600);SMODE(V,VV,VG,1024,768);SMODE(V,VV,VG,1280,1024);SMODE(V,VV,VG,1600,1200);SMODE_GR(V,VG);SMODE_PRINT(V,VV,VG); | | #define S_MODE(V,VV,VG) argnum=INT_MAX;SMODE(V,VV,VG);SMODE_GR(V,VG);SMODE_PRINT(V,VV,VG); |
| | | |
| | | |
| S_MODE(automap,automap_mode,automap_use_game_res); | | S_MODE(automap,automap_mode,automap_use_game_res); |