X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=direct.c;h=7010e4616980714d6fdd3242a63a047581c56330;hp=70f4469602278ad708811706181f5a37146a2c3f;hb=0fd4b86c9899d254d9aea0660e5046c4234cfd42;hpb=d570f2d80fed3a3254ff49748d4e2f50ee5e2a2c diff --git a/direct.c b/direct.c index 70f4469..7010e46 100644 --- a/direct.c +++ b/direct.c @@ -88,6 +88,7 @@ int (*dirtab[])() = { d_nojpad, // 55 .nojpad (deprecated) d_gpumain, // 56 .gpumain (deprecated) d_prgflags, // 57 .prgflags + d_opt, // 58 .opt }; @@ -1589,3 +1590,28 @@ int d_gpumain(void) return error("What the hell? Do you think we adhere to the Goof standard?"); } +// +// .opt - turn a specific (or all) optimisation on or off +// +int d_opt(void) +{ + char * tmpstr; + + while (*tok != EOL) + { + if (*tok == STRING) + { + tok++; + tmpstr = string[*tok++]; + + if (ParseOptimization(tmpstr) != OK) + { + char temperr[256]; + sprintf(temperr, "unknown optimisation flag '%s'.", tmpstr); + return error(temperr); + } + } + else + return error(".opt directive needs every switch enclosed inside quotation marks."); + } +} \ No newline at end of file