IOFileTypeBase::IOFileTypeBase(UInt32 const flags)
    
    : _flags   (flags),
      _optStack(     )
{
    _optStack.push(OptionSet());
}
/*! Pushes the current options onto the option stack. If \c copyTop is \c true
    a copy of the current options is used as the new current options, otherwise
    an empty options set is used.
    
    \param[in] copyTop Whether to copy the current options.
 */
void
    IOFileTypeBase::pushOptions(bool copyTop)
{
    if(copyTop == true)
    {
        _optStack.push(_optStack.top());
    }
    else
    {
        _optStack.push(OptionSet());
    }
}
Beispiel #3
0
static void parseOptions(int argc, char *argv[])
{
    int i;
    const char *s;

    /* default values. */
    setup.FullScreen    = false;
    setup.SfxVolume     = SND_MAX_VOLUME;
    setup.MusicVolume   = SND_MAX_VOLUME;
    setup.Profidisk     = false;
    setup.CDRom         = false;
    setup.Debug         = 1;
    setup.CDAudio       = false;
    setup.Scale         = GFX_SCALE_NORMAL;

    for (i = 1; i < argc; i++) {
        s = argv[i];

        if (s[0] == '-') {
            switch (s[1]) {
            case 'g':
                if (strcmp(s+2, "2x") == 0)
                    setup.Scale = GFX_SCALE_2X;
                else
                if (strcmp(s+2, "linear2x") == 0)
                    setup.Scale = GFX_SCALE_LINEAR2X;
                else

            case 'd':
                setup.Debug = max(atoi(s+2), 0);
                break;

            case 'f':
                setup.FullScreen = true;
                break;

            case 's':
                setup.SfxVolume = clamp(atoi(s+2), 0, SND_MAX_VOLUME);
                break;

            case 'm':
                setup.MusicVolume = clamp(atoi(s+2), 0, SND_MAX_VOLUME);
                break;

            case 't':
                if (OptionSet(s+2, 'd'))
                    GamePlayMode |= GP_DEMO | GP_STORY_OFF;

                if (OptionSet(s+2, 's'))
                    GamePlayMode |= GP_STORY_OFF;

                if (OptionSet(s+2, 'f'))
                    GamePlayMode |= GP_FULL_ENV;

                if (OptionSet(s+2, 'l'))
                    GamePlayMode |= GP_LEVEL_DESIGN;

                if (OptionSet(s+2, 'g'))
                    GamePlayMode |= GP_GUARD_DESIGN;

                if (OptionSet(s+2, 'x'))
                    GamePlayMode |= GP_NO_SAMPLES;

                if (OptionSet(s+2, 'c'))
                    GamePlayMode |= GP_COLLISION_CHECKING_OFF;

                if (OptionSet(s+2, 'r'))
                    GamePlayMode |= GP_SHOW_ROOMS;
                break;

            case 'h':
                puts(aboutString);
                puts(syntaxString);
                exit(0);
                return;

            default:
                puts(aboutString);
                puts(syntaxString);
                exit(1);
                return;
            }
        }
    }
}