diff --git a/tools/qfcc/doc/man/qfcc.1 b/tools/qfcc/doc/man/qfcc.1 index 9c64ab0fb..8df67f2a8 100644 --- a/tools/qfcc/doc/man/qfcc.1 +++ b/tools/qfcc/doc/man/qfcc.1 @@ -42,6 +42,14 @@ understand. .SH OPTIONS \fBqfcc\fP takes the following arguments: .TP +.B \-\-traditional +Use traditional QuakeC syntax, semantics and "bugs". Also implies v6only. This +is the default when using progs.src. +.TP +.B \-\-advanced +Use advanced Raumoko features. This is the default when using separate +compilation. +.TP .B \-C, \-\-code OPTION,... Set code generation options. See \fBCODE GENERATION OPTIONS\fP for details. .TP @@ -101,9 +109,6 @@ Do not delete temporary files. .B \-s, \-\-source DIR look for progs.src in DIR instead of the current directory. .TP -.B \-t, \-\-traditional -Use traditional QuakeC syntax, semantics and "bugs". Also implies v6only. -.TP .B \-U, \-\-undefine SYMBOL,... Undefine preprocessor symbols, if the preprocessor is in use. .TP diff --git a/tools/qfcc/include/options.h b/tools/qfcc/include/options.h index 2692a5d5f..e5920143e 100644 --- a/tools/qfcc/include/options.h +++ b/tools/qfcc/include/options.h @@ -64,6 +64,7 @@ typedef struct { qboolean save_temps; // save temporary files qboolean files_dat; // generate files.dat qboolean traditional; // behave more like qcc + qboolean advanced; // behold the power of Raumoko qboolean compile; // serparate compilation mode qboolean partial_link; // partial linking qboolean preprocess_only;// only run cpp, don't ocmpile diff --git a/tools/qfcc/source/options.c b/tools/qfcc/source/options.c index 9f7079a82..b4d93b361 100644 --- a/tools/qfcc/source/options.c +++ b/tools/qfcc/source/options.c @@ -70,7 +70,8 @@ static struct option const long_options[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, {"files", no_argument, 0, 'F'}, - {"traditional", no_argument, 0, 't'}, + {"traditional", no_argument, 0, 257}, + {"advanced", no_argument, 0, 258}, {"strip-path", required_argument, 0, 'p'}, {"define", required_argument, 0, 'D'}, {"include", required_argument, 0, 'I'}, @@ -89,7 +90,6 @@ static const char *short_options = "r" // partial linking "s:" // source dir "P:" // progs.src name - "t" // traditional "F" // generate files.dat "q" // quiet "v" // verbose @@ -115,6 +115,10 @@ usage (int status) printf ("Usage: %s [options] [files]\n", this_program); printf ( "Options:\n" +" --traditional Traditional QuakeC mode: implies v6only\n" +" default when using progs.src\n" +" --advanced Advanced Ruamoko mode\n" +" default for separate compilation mode\n" " -s, --source DIR Look for progs.src in DIR instead of \".\"\n" " -q, --quiet Inhibit usual output\n" " -v, --verbose Display more output than usual\n" @@ -122,7 +126,6 @@ usage (int status) " -o, --output-file FILE Specify output file name\n" " -P, --progs-src FILE File to use instead of progs.src\n" " -F, --files Generate files.dat\n" -" -t, --traditional Traditional QuakeC mode: implies v6only\n" " -p, --strip-path NUM Strip NUM leading path elements from file\n" " names\n" " -C, --code OPTION,... Set code generation options\n" @@ -165,8 +168,6 @@ DecodeArgs (int argc, char **argv) add_cpp_def ("-D__QFCC__=1"); add_cpp_def ("-D__QUAKEC__=1"); - add_cpp_def ("-D__RUAMOKO__=1"); - add_cpp_def ("-D__RAUMOKO__=1"); options.code.progsversion = PROG_VERSION; options.warnings.uninited_variable = true; @@ -227,10 +228,16 @@ DecodeArgs (int argc, char **argv) case 'g': // debug options.code.debug = true; break; - case 't': // traditional + case 257: // traditional options.traditional = true; + options.advanced = false; options.code.progsversion = PROG_ID_VERSION; break; + case 258: // advanced + options.traditional = false; + options.advanced = true; + options.code.progsversion = PROG_VERSION; + break; case 'c': options.compile = true; break; @@ -386,6 +393,16 @@ DecodeArgs (int argc, char **argv) usage (1); } } + if (!source_files && !options.advanced) { + // progs.src mode without --advanced implies --traditional + options.traditional = true; + options.advanced = false; + options.code.progsversion = PROG_ID_VERSION; + } + if (!options.traditional) { + add_cpp_def ("-D__RUAMOKO__=1"); + add_cpp_def ("-D__RAUMOKO__=1"); + } if (options.code.progsversion == PROG_ID_VERSION) add_cpp_def ("-D__VERSION6__=1");