Skip to content

Commit

Permalink
init: add command line option to disable sound
Browse files Browse the repository at this point in the history
  • Loading branch information
kazzmir committed May 18, 2017
1 parent 7bb10b7 commit 42e50cb
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/main-menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,31 @@ class WindowedArgument: public Argument::Parameter {
}
};

class SoundArgument: public Argument::Parameter {
public:
SoundArgument(Global::InitConditions * conditions):
conditions(conditions){
}

Global::InitConditions * conditions;

vector<string> keywords() const {
vector<string> out;
out.push_back("-s");
out.push_back("nosound");
return out;
}

string description() const {
return " : Disable sound";
}

vector<string>::iterator parse(vector<string>::iterator current, vector<string>::iterator end, Argument::ActionRefs & actions){
conditions->sound = false;
return current;
}
};

class HelpArgument: public Argument::Parameter {
public:
HelpArgument(const vector<Util::ReferenceCount<Argument::Parameter> > & arguments):
Expand Down Expand Up @@ -835,6 +860,7 @@ int rtech_main(int argc, char ** argv){
vector<Util::ReferenceCount<Argument::Parameter> > arguments;
arguments.push_back(Util::ReferenceCount<Argument::Parameter>(new WindowedArgument(&conditions)));
arguments.push_back(Util::ReferenceCount<Argument::Parameter>(new DataPathArgument()));
arguments.push_back(Util::ReferenceCount<Argument::Parameter>(new SoundArgument(&conditions)));
arguments.push_back(Util::ReferenceCount<Argument::Parameter>(new MusicArgument(&music_on)));
arguments.push_back(Util::ReferenceCount<Argument::Parameter>(new DebugArgument()));
arguments.push_back(Util::ReferenceCount<Argument::Parameter>(new DebugFileArgument()));
Expand Down

0 comments on commit 42e50cb

Please # to comment.