Save decorations and gravity field drawing to prefs

This commit is contained in:
Simon Robertshaw 2012-08-28 13:06:45 +01:00
parent 99b2d8d67d
commit df26523e10

View File

@ -51,6 +51,9 @@ GameModel::GameModel():
std::vector<unsigned int> renderModes(tempArray.begin(), tempArray.end()); std::vector<unsigned int> renderModes(tempArray.begin(), tempArray.end());
ren->SetRenderMode(renderModes); ren->SetRenderMode(renderModes);
} }
ren->gravityFieldEnabled = Client::Ref().GetPrefBool("Renderer.GravityField", false);
ren->decorations_enable = Client::Ref().GetPrefBool("Renderer.Decorations", true);
} }
catch(json::Exception & e) catch(json::Exception & e)
{ {
@ -98,6 +101,9 @@ GameModel::~GameModel()
std::vector<unsigned int> renderModes = ren->GetRenderMode(); std::vector<unsigned int> renderModes = ren->GetRenderMode();
Client::Ref().SetPref("Renderer.RenderModes", std::vector<unsigned int>(renderModes.begin(), renderModes.end())); Client::Ref().SetPref("Renderer.RenderModes", std::vector<unsigned int>(renderModes.begin(), renderModes.end()));
Client::Ref().SetPref("Renderer.GravityField", (bool)ren->gravityFieldEnabled);
Client::Ref().SetPref("Renderer.Decorations", (bool)ren->decorations_enable);
Client::Ref().SetPref("Simulation.EdgeMode", sim->edgeMode); Client::Ref().SetPref("Simulation.EdgeMode", sim->edgeMode);
Client::Ref().SetPref("Decoration.Red", (int)colour.Red); Client::Ref().SetPref("Decoration.Red", (int)colour.Red);