Howto:Optimizing FlightGear for mobile devices: Difference between revisions

Jump to navigation Jump to search
Line 157: Line 157:


<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
std::string mode = fgGetString("/startup/mode", "default");
std::string target_mode = fgGetString("/startup/target", "default");
if (mode == "default") {
if (target_mode == "default") {
  // default code
  // default code
}
}
else {
else if (target_mode =="android") {
  // without default code
  // android-specific code
}
else if (target_mode =="maemo") {
// maemo-specific code
}
}
</syntaxhighlight>
</syntaxhighlight>


To test the non-default code path, just start up with something like --prop:/startup/target=android
This is really just intended to get us started. Ideally, subsystem-specific switches would be added, so that all subsystems can be individually disabled or customized, analogous to how other subsystems like the AI traffic system can already be disabled purely from the command line.


Some possible candidates include:
Some possible candidates include:

Navigation menu