DOKK / manpages / debian 11 / fteqcc / fteqcc.1.en
FTEQCC(1) General Commands Manual FTEQCC(1)

fteqcc - FTE QuakeC compiler

fteqcc [options]

This manual page documents briefly the fteqcc command.

fteqcc is a program that compiles QuakeC sourcecode to binaray game data of Quake1 or QuakeWorld based games.

Show summary of options.
enable automatic prototyping
dump all assembler code to qc.asm
turn language keywords on or off. Keywords available to toggle are: asm, break, case, class, const, continue, default, entity, enum, enumflags, extern, float, for, goto, int, integer, noref, nosave, shared, state, string, struct, switch, thinktime, typedef, union, var and vector.
use optimisation level between 0 and 3. With 0, no optimisation takes place, other values include more or less of the options in the section OPTIMISATION.
Specify a directory to look for source files (progs.src) in.
show all warnings

fteqcc supports several output formats.

This is the default setting and generates code compatible with original Quake1.
Outputs Hexen2 compatible code.
Generates KK Version 7 compatible progs
Generates code specific to FTE Quake.

The following options may be used to fine-tune optimisation. Some of them are activated automatically.

c = a*b is performed in one operation rather than two, and can cause older decompilers to fail.
if (!a) was traditionally compiled in two statements. This optimisation does it in one, but can cause some decompilers to get confused.
In the origional qcc, function parameters were specified as a vector store even for floats. This fixes that.
strips out the names of constants from your progs, resulting in smaller files. It makes decompilers leave out names or fabricate numerical ones.
strips out the names of string constants from your progs. This can break addons, so don't use it in those cases.
merge definitions of constants which are the same value. Pay extra attention to assignment to constant warnings.
compact the string table that is stored in the progs. It will be considerably smaller with this.
Strips out local names and definitions. This makes it REALLY hard to decompile
This strips out the names of functions which are never called. Doesn't make much of an impact though.
This strips out the filenames of the progs. This can confuse the really old decompilers, but is nothing to the more recent ones.
Removes the entries of unreferenced variables. Doesn't make a difference in well maintained code.
Optimises the pr_globals count by overlapping temporaries. In QC, every multiplication, division or operation in general produces a temporary variable. This optimisation prevents excess, and in the case of Hexen2's gamecode, reduces the count by 50k. This is the most important optimisation, ever.
5*6 actually emits an operation into the progs. This prevents that happening, effectivly making the compiler see 30
Strip out stuff wasted used in function calls and strings to the precache_file builtin (which is actually a stub in quake).
Functions ending in a return statement do not need a done statement at the end of the function. This can confuse some decompilers, making functions appear larger than they were.
This optimisation plays an effect mostly with nested if/else statements, instead of jumping to an unconditional jump statement, it'll jump to the final destination instead. This will bewilder decompilers.
Strips out the 'defs' of functions that were only ever called directly. This does not affect saved games.
Store all locals in one section of the pr_globals. Vastly reducing it. This effectivly does the job of overlaptemps. It's been noticed as buggy by a few, however, and the curcumstances where it causes problems are not yet known.
Where a function is called with just a vector, this causes the function call to store three floats instead of one vector. This can save a good number of pr_globals where those vectors contain many duplicate coordinates but do not match entirly.

fteqcc was written by David Walton <acceptthis@users.sourceforge.net> and J. Smith <timeserv@users.sourceforge.net>.

This manual page was written by René van Bevern <rvb@debian.org>, for the Debian project (but may be used by others). Most information was obtained from comments in the source codes.

Juni 26, 2005