X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=direct.c;h=dc44e8e62371b5b5eb72229801c8800bd347fdf6;hp=70f4469602278ad708811706181f5a37146a2c3f;hb=3c68061b9cd5cc9b67d602f3f5b621efe1e844d8;hpb=3a5a7740b7a06a69852c8f9a7925ed0d00a73f8c diff --git a/direct.c b/direct.c index 70f4469..dc44e8e 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,30 @@ 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) +{ + while (*tok != EOL) + { + if (*tok == STRING) + { + tok++; + char * 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"); + } + + return OK; +} +