![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | argoptions |
Functions | |
| int | getargs (int argc, char **argv, argoptions *opt) |
| int | useoptions (argoptions *opt, SceneHandle scene) |
| int getargs | ( | int | argc, |
| char ** | argv, | ||
| argoptions * | opt | ||
| ) |
Definition at line 149 of file getargs.cpp.
References argoptions::filename, argoptions::foundfilename, getparm(), initoptions(), and printusage().
Referenced by main_init_parts().
{
int i, rc, unknowncnt;
if (opt == NULL)
return -1;
initoptions(opt);
if (argc < 2) {
printusage(argv);
#ifndef DEFAULT_MODELFILE
return -1;
#else
return 0;
#endif//DEFAULT_MODELFILE
}
i = 1;
unknowncnt = 0;
while (i < argc) {
if (argv[i][0] == '-' || argv[i][0] == '+') {
rc = getparm(argc, argv, i, opt);
if (rc != -1) {
i += rc;
}
else {
printusage(argv);
return -1;
}
}
else {
unknowncnt++;
if (unknowncnt > 1) {
fprintf(stderr, "Too many model file names found!\n");
printusage(argv);
return -1;
}
else {
strcpy(opt->filename, argv[i]);
opt->foundfilename = 1;
i++;
}
}
}
if (opt->foundfilename == -1) {
fprintf(stderr, "Missing model file name!\n");
printusage(argv);
return -1;
}
return 0;
}
| int useoptions | ( | argoptions * | opt, |
| SceneHandle | scene | ||
| ) |
Definition at line 94 of file getargs.cpp.
References argoptions::antialiasing, argoptions::boundmode, argoptions::boundthresh, argoptions::displaymode, argoptions::outfilename, rt_boundmode(), rt_boundthresh(), rt_displaymode(), rt_outputfile(), rt_verbose(), argoptions::useoutfilename, and argoptions::verbosemode.
Referenced by main_init_parts().
{
if (opt->useoutfilename == 1) {
rt_outputfile(scene, opt->outfilename);
}
if (opt->verbosemode == 1) {
rt_verbose(scene, 1);
}
if (opt->antialiasing != -1) {
/* need new api code for this */
}
if (opt->displaymode != -1) {
rt_displaymode(scene, opt->displaymode);
}
if (opt->boundmode != -1) {
rt_boundmode(scene, opt->boundmode);
}
if (opt->boundthresh != -1) {
rt_boundthresh(scene, opt->boundthresh);
}
return 0;
}
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.