MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / cAmbientLight

Function cAmbientLight

source/modes/ConsoleCommands.cpp:108–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108Command::Result cAmbientLight(const Command::ArgumentList_t& args, ConsoleInterface& c, AbstractModeManager&)
109{
110 Ogre::SceneManager* mSceneMgr = RenderManager::getSingletonPtr()->getSceneManager();
111
112 if (args.size() < 2)
113 {
114 // Display the current ambient light values.
115 Ogre::ColourValue curLight = mSceneMgr->getAmbientLight();
116 c.print("Current ambient light is:" + Helper::toString(curLight));
117 return Command::Result::SUCCESS;
118 }
119 else if(args.size() >= 4)
120 {
121 // Set the new color.
122 Ogre::ColourValue v(Helper::toFloat(args[1]), Helper::toFloat(args[2]), Helper::toFloat(args[3]));
123
124 mSceneMgr->setAmbientLight(v);
125 c.print("\nAmbient light set to:\n" +
126 Helper::toString(v));
127 }
128 else
129 {
130 c.print("To set a colour value, 3 colour values are needed");
131 return Command::Result::INVALID_ARGUMENT;
132 }
133 return Command::Result::SUCCESS;
134}
135
136Command::Result cFPS(const Command::ArgumentList_t& args, ConsoleInterface& c, AbstractModeManager&)
137{

Callers

nothing calls this directly

Calls 4

toFloatFunction · 0.85
getSceneManagerMethod · 0.80
toStringFunction · 0.50
printMethod · 0.45

Tested by

no test coverage detected