[612] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
[1293] | 3 | * > www.orxonox.net < |
---|
[612] | 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
[1349] | 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
[612] | 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
[1535] | 23 | * Reto Grieder |
---|
[1755] | 24 | * Benjamin Knecht <beni_at_orxonox.net>, (C) 2007 |
---|
[612] | 25 | * Co-authors: |
---|
[1755] | 26 | * Felix Schulthess |
---|
[612] | 27 | * |
---|
| 28 | */ |
---|
[1035] | 29 | |
---|
[2801] | 30 | #include "GraphicsManager.h" |
---|
[612] | 31 | |
---|
[2801] | 32 | #include <fstream> |
---|
[5689] | 33 | #include <sstream> |
---|
[2801] | 34 | #include <boost/filesystem.hpp> |
---|
[5689] | 35 | #include <boost/shared_array.hpp> |
---|
[2801] | 36 | |
---|
[5689] | 37 | #include <OgreArchiveFactory.h> |
---|
| 38 | #include <OgreArchiveManager.h> |
---|
[2801] | 39 | #include <OgreFrameListener.h> |
---|
| 40 | #include <OgreRoot.h> |
---|
| 41 | #include <OgreLogManager.h> |
---|
[1755] | 42 | #include <OgreRenderWindow.h> |
---|
[2801] | 43 | #include <OgreRenderSystem.h> |
---|
[5654] | 44 | #include <OgreResourceGroupManager.h> |
---|
[5682] | 45 | #include <OgreTextureManager.h> |
---|
[2801] | 46 | #include <OgreViewport.h> |
---|
| 47 | #include <OgreWindowEventUtilities.h> |
---|
[1538] | 48 | |
---|
[2801] | 49 | #include "SpecialConfig.h" |
---|
| 50 | #include "util/Exception.h" |
---|
[3280] | 51 | #include "util/StringUtils.h" |
---|
[2801] | 52 | #include "util/SubString.h" |
---|
[3346] | 53 | #include "Clock.h" |
---|
| 54 | #include "ConsoleCommand.h" |
---|
| 55 | #include "ConfigValueIncludes.h" |
---|
| 56 | #include "CoreIncludes.h" |
---|
| 57 | #include "Core.h" |
---|
| 58 | #include "Game.h" |
---|
| 59 | #include "GameMode.h" |
---|
[5654] | 60 | #include "Loader.h" |
---|
[5689] | 61 | #include "MemoryArchive.h" |
---|
[3346] | 62 | #include "WindowEventListener.h" |
---|
[5654] | 63 | #include "XMLFile.h" |
---|
[1032] | 64 | |
---|
[1625] | 65 | namespace orxonox |
---|
| 66 | { |
---|
[3327] | 67 | class OgreWindowEventListener : public Ogre::WindowEventListener |
---|
[2801] | 68 | { |
---|
[3327] | 69 | public: |
---|
| 70 | void windowResized (Ogre::RenderWindow* rw) |
---|
| 71 | { orxonox::WindowEventListener::resizeWindow(rw->getWidth(), rw->getHeight()); } |
---|
| 72 | void windowFocusChange (Ogre::RenderWindow* rw) |
---|
| 73 | { orxonox::WindowEventListener::changeWindowFocus(); } |
---|
| 74 | void windowClosed (Ogre::RenderWindow* rw) |
---|
| 75 | { orxonox::Game::getInstance().stop(); } |
---|
| 76 | void windowMoved (Ogre::RenderWindow* rw) |
---|
| 77 | { orxonox::WindowEventListener::moveWindow(); } |
---|
[2801] | 78 | }; |
---|
[1032] | 79 | |
---|
[3366] | 80 | GraphicsManager* GraphicsManager::singletonPtr_s = 0; |
---|
[1293] | 81 | |
---|
[1755] | 82 | /** |
---|
| 83 | @brief |
---|
[2801] | 84 | Non-initialising constructor. |
---|
[1755] | 85 | */ |
---|
[5614] | 86 | GraphicsManager::GraphicsManager(bool bLoadRenderer) |
---|
[5662] | 87 | : ogreWindowEventListener_(new OgreWindowEventListener()) |
---|
[5689] | 88 | #if OGRE_VERSION < 0x010600 |
---|
| 89 | , memoryArchiveFactory_(new MemoryArchiveFactory()) |
---|
| 90 | #endif |
---|
[5662] | 91 | , renderWindow_(0) |
---|
[2801] | 92 | , viewport_(0) |
---|
[1024] | 93 | { |
---|
[2801] | 94 | RegisterObject(GraphicsManager); |
---|
| 95 | |
---|
| 96 | this->setConfigValues(); |
---|
[612] | 97 | |
---|
[5614] | 98 | // Ogre setup procedure (creating Ogre::Root) |
---|
| 99 | this->loadOgreRoot(); |
---|
| 100 | // load all the required plugins for Ogre |
---|
| 101 | this->loadOgrePlugins(); |
---|
[2801] | 102 | |
---|
[5654] | 103 | // At first, add the root paths of the data directories as resource locations |
---|
| 104 | Ogre::ResourceGroupManager::getSingleton().addResourceLocation(Core::getDataPathString(), "FileSystem", "dataRoot", false); |
---|
| 105 | // Load resources |
---|
| 106 | resources_.reset(new XMLFile("resources.oxr", "dataRoot")); |
---|
[5660] | 107 | resources_->setLuaSupport(false); |
---|
[5654] | 108 | Loader::open(resources_.get()); |
---|
| 109 | |
---|
| 110 | // Only for development runs |
---|
| 111 | if (Core::isDevelopmentRun()) |
---|
| 112 | { |
---|
| 113 | Ogre::ResourceGroupManager::getSingleton().addResourceLocation(Core::getExternalDataPathString(), "FileSystem", "externalDataRoot", false); |
---|
| 114 | extResources_.reset(new XMLFile("resources.oxr", "externalDataRoot")); |
---|
[5660] | 115 | extResources_->setLuaSupport(false); |
---|
[5654] | 116 | Loader::open(extResources_.get()); |
---|
| 117 | } |
---|
| 118 | |
---|
[5614] | 119 | if (bLoadRenderer) |
---|
[3280] | 120 | { |
---|
[5614] | 121 | // Reads the ogre config and creates the render window |
---|
[5654] | 122 | this->upgradeToGraphics(); |
---|
[3280] | 123 | } |
---|
[2801] | 124 | } |
---|
| 125 | |
---|
[1755] | 126 | /** |
---|
| 127 | @brief |
---|
[5614] | 128 | Destruction is done by the member scoped_ptrs. |
---|
[1755] | 129 | */ |
---|
[2801] | 130 | GraphicsManager::~GraphicsManager() |
---|
[1535] | 131 | { |
---|
[5670] | 132 | Ogre::WindowEventUtilities::removeWindowEventListener(renderWindow_, ogreWindowEventListener_.get()); |
---|
[5654] | 133 | // TODO: Destroy the console command |
---|
[1535] | 134 | } |
---|
| 135 | |
---|
[2801] | 136 | void GraphicsManager::setConfigValues() |
---|
[1535] | 137 | { |
---|
[2801] | 138 | SetConfigValue(ogreConfigFile_, "ogre.cfg") |
---|
| 139 | .description("Location of the Ogre config file"); |
---|
[5641] | 140 | SetConfigValue(ogrePluginsDirectory_, specialConfig::ogrePluginsDirectory) |
---|
[2801] | 141 | .description("Folder where the Ogre plugins are located."); |
---|
[5641] | 142 | SetConfigValue(ogrePlugins_, specialConfig::ogrePlugins) |
---|
[2801] | 143 | .description("Comma separated list of all plugins to load."); |
---|
| 144 | SetConfigValue(ogreLogFile_, "ogre.log") |
---|
| 145 | .description("Logfile for messages from Ogre. Use \"\" to suppress log file creation."); |
---|
| 146 | SetConfigValue(ogreLogLevelTrivial_ , 5) |
---|
| 147 | .description("Corresponding orxonox debug level for ogre Trivial"); |
---|
| 148 | SetConfigValue(ogreLogLevelNormal_ , 4) |
---|
| 149 | .description("Corresponding orxonox debug level for ogre Normal"); |
---|
| 150 | SetConfigValue(ogreLogLevelCritical_, 2) |
---|
| 151 | .description("Corresponding orxonox debug level for ogre Critical"); |
---|
[1535] | 152 | } |
---|
[612] | 153 | |
---|
[5614] | 154 | /** |
---|
| 155 | @brief |
---|
| 156 | Loads the renderer and creates the render window if not yet done so. |
---|
| 157 | @remarks |
---|
| 158 | This operation is irreversible without recreating the GraphicsManager! |
---|
[5658] | 159 | So if it throws you HAVE to recreate the GraphicsManager!!! |
---|
| 160 | It therefore offers almost no exception safety. |
---|
[5614] | 161 | */ |
---|
| 162 | void GraphicsManager::upgradeToGraphics() |
---|
[2801] | 163 | { |
---|
[5654] | 164 | if (renderWindow_ != NULL) |
---|
| 165 | return; |
---|
| 166 | |
---|
| 167 | this->loadRenderer(); |
---|
| 168 | |
---|
[5689] | 169 | #if OGRE_VERSION < 0x010600 |
---|
| 170 | // WORKAROUND: There is an incompatibility for particle scripts when trying |
---|
| 171 | // to support both Ogre 1.4 and 1.6. The hacky solution is to create |
---|
| 172 | // scripts for the 1.6 version and then remove the inserted "particle_system" |
---|
| 173 | // keyword. But we need to supply these new scripts as well, which is why |
---|
| 174 | // there is an extra Ogre::Archive dealing with in the memory. |
---|
| 175 | using namespace Ogre; |
---|
| 176 | ArchiveManager::getSingleton().addArchiveFactory(memoryArchiveFactory_.get()); |
---|
| 177 | const StringVector& groups = ResourceGroupManager::getSingleton().getResourceGroups(); |
---|
| 178 | // Travers all groups |
---|
| 179 | for (StringVector::const_iterator itGroup = groups.begin(); itGroup != groups.end(); ++itGroup) |
---|
| 180 | { |
---|
| 181 | FileInfoListPtr files = ResourceGroupManager::getSingleton().findResourceFileInfo(*itGroup, "*.particle"); |
---|
| 182 | for (FileInfoList::const_iterator itFile = files->begin(); itFile != files->end(); ++itFile) |
---|
| 183 | { |
---|
| 184 | // open file |
---|
| 185 | Ogre::DataStreamPtr input = ResourceGroupManager::getSingleton().openResource(itFile->filename, *itGroup, false); |
---|
| 186 | std::stringstream output; |
---|
| 187 | // Parse file and replace "particle_system" with nothing |
---|
| 188 | while (!input->eof()) |
---|
| 189 | { |
---|
| 190 | std::string line = input->getLine(); |
---|
| 191 | size_t pos = line.find("particle_system"); |
---|
| 192 | if (pos != std::string::npos) |
---|
| 193 | { |
---|
| 194 | // 15 is the length of "particle_system" |
---|
| 195 | line.replace(pos, 15, ""); |
---|
| 196 | } |
---|
| 197 | output << line << std::endl; |
---|
| 198 | } |
---|
| 199 | // Add file to the memory archive |
---|
| 200 | shared_array<char> data(new char[output.str().size()]); |
---|
| 201 | // Debug optimisations |
---|
| 202 | const std::string outputStr = output.str(); |
---|
| 203 | char* rawData = data.get(); |
---|
| 204 | for (unsigned i = 0; i < outputStr.size(); ++i) |
---|
| 205 | rawData[i] = outputStr[i]; |
---|
| 206 | MemoryArchive::addFile("particle_scripts_ogre_1.4_" + *itGroup, itFile->filename, data, output.str().size()); |
---|
| 207 | } |
---|
| 208 | if (!files->empty()) |
---|
| 209 | { |
---|
| 210 | // Declare the files, but using a new group |
---|
| 211 | ResourceGroupManager::getSingleton().addResourceLocation("particle_scripts_ogre_1.4_" + *itGroup, |
---|
| 212 | "Memory", "particle_scripts_ogre_1.4_" + *itGroup); |
---|
| 213 | } |
---|
| 214 | } |
---|
| 215 | #endif |
---|
| 216 | |
---|
[5657] | 217 | // Initialise all resources (do this AFTER the renderer has been loaded!) |
---|
[5654] | 218 | // Note: You can only do this once! Ogre will check whether a resource group has |
---|
| 219 | // already been initialised. If you need to load resources later, you will have to |
---|
| 220 | // choose another resource group. |
---|
| 221 | Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); |
---|
[2801] | 222 | } |
---|
| 223 | |
---|
[1755] | 224 | /** |
---|
| 225 | @brief |
---|
[2801] | 226 | Creates the Ogre Root object and sets up the ogre log. |
---|
[1755] | 227 | */ |
---|
[5614] | 228 | void GraphicsManager::loadOgreRoot() |
---|
[1538] | 229 | { |
---|
[2801] | 230 | COUT(3) << "Setting up Ogre..." << std::endl; |
---|
| 231 | |
---|
| 232 | if (ogreConfigFile_ == "") |
---|
| 233 | { |
---|
| 234 | COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl; |
---|
| 235 | ModifyConfigValue(ogreConfigFile_, tset, "config.cfg"); |
---|
| 236 | } |
---|
| 237 | if (ogreLogFile_ == "") |
---|
| 238 | { |
---|
| 239 | COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl; |
---|
| 240 | ModifyConfigValue(ogreLogFile_, tset, "ogre.log"); |
---|
| 241 | } |
---|
| 242 | |
---|
| 243 | boost::filesystem::path ogreConfigFilepath(Core::getConfigPath() / this->ogreConfigFile_); |
---|
| 244 | boost::filesystem::path ogreLogFilepath(Core::getLogPath() / this->ogreLogFile_); |
---|
| 245 | |
---|
| 246 | // create a new logManager |
---|
| 247 | // Ogre::Root will detect that we've already created a Log |
---|
[5614] | 248 | ogreLogger_.reset(new Ogre::LogManager()); |
---|
[2801] | 249 | COUT(4) << "Ogre LogManager created" << std::endl; |
---|
| 250 | |
---|
| 251 | // create our own log that we can listen to |
---|
| 252 | Ogre::Log *myLog; |
---|
[5614] | 253 | myLog = ogreLogger_->createLog(ogreLogFilepath.string(), true, false, false); |
---|
[2801] | 254 | COUT(4) << "Ogre Log created" << std::endl; |
---|
| 255 | |
---|
| 256 | myLog->setLogDetail(Ogre::LL_BOREME); |
---|
| 257 | myLog->addListener(this); |
---|
| 258 | |
---|
| 259 | COUT(4) << "Creating Ogre Root..." << std::endl; |
---|
| 260 | |
---|
| 261 | // check for config file existence because Ogre displays (caught) exceptions if not |
---|
| 262 | if (!boost::filesystem::exists(ogreConfigFilepath)) |
---|
| 263 | { |
---|
| 264 | // create a zero sized file |
---|
| 265 | std::ofstream creator; |
---|
| 266 | creator.open(ogreConfigFilepath.string().c_str()); |
---|
| 267 | creator.close(); |
---|
| 268 | } |
---|
| 269 | |
---|
| 270 | // Leave plugins file empty. We're going to do that part manually later |
---|
[5614] | 271 | ogreRoot_.reset(new Ogre::Root("", ogreConfigFilepath.string(), ogreLogFilepath.string())); |
---|
[2801] | 272 | |
---|
| 273 | COUT(3) << "Ogre set up done." << std::endl; |
---|
[1538] | 274 | } |
---|
[2801] | 275 | |
---|
| 276 | void GraphicsManager::loadOgrePlugins() |
---|
| 277 | { |
---|
| 278 | // just to make sure the next statement doesn't segfault |
---|
[5641] | 279 | if (ogrePluginsDirectory_ == "") |
---|
| 280 | ogrePluginsDirectory_ = "."; |
---|
[2801] | 281 | |
---|
[5641] | 282 | boost::filesystem::path folder(ogrePluginsDirectory_); |
---|
[2801] | 283 | // Do some SubString magic to get the comma separated list of plugins |
---|
[3323] | 284 | SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '(', ')', false, '\0'); |
---|
[2801] | 285 | // Use backslash paths on Windows! file_string() already does that though. |
---|
| 286 | for (unsigned int i = 0; i < plugins.size(); ++i) |
---|
| 287 | ogreRoot_->loadPlugin((folder / plugins[i]).file_string()); |
---|
| 288 | } |
---|
| 289 | |
---|
| 290 | void GraphicsManager::loadRenderer() |
---|
| 291 | { |
---|
| 292 | CCOUT(4) << "Configuring Renderer" << std::endl; |
---|
| 293 | |
---|
| 294 | if (!ogreRoot_->restoreConfig()) |
---|
| 295 | if (!ogreRoot_->showConfigDialog()) |
---|
[3280] | 296 | ThrowException(InitialisationFailed, "OGRE graphics configuration dialogue failed."); |
---|
[2801] | 297 | |
---|
| 298 | CCOUT(4) << "Creating render window" << std::endl; |
---|
| 299 | |
---|
| 300 | this->renderWindow_ = ogreRoot_->initialise(true, "Orxonox"); |
---|
[5614] | 301 | // Propagate the size of the new winodw |
---|
[3327] | 302 | this->ogreWindowEventListener_->windowResized(renderWindow_); |
---|
[2801] | 303 | |
---|
[5614] | 304 | Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, ogreWindowEventListener_.get()); |
---|
[2801] | 305 | |
---|
| 306 | // create a full screen default viewport |
---|
[5614] | 307 | // Note: This may throw when adding a viewport with an existing z-order! |
---|
| 308 | // But in our case we only have one viewport for now anyway, therefore |
---|
| 309 | // no ScopeGuards or anything to handle exceptions. |
---|
[2801] | 310 | this->viewport_ = this->renderWindow_->addViewport(0, 0); |
---|
[5614] | 311 | |
---|
[5682] | 312 | Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(0); |
---|
| 313 | |
---|
[5614] | 314 | // add console commands |
---|
| 315 | FunctorMember<GraphicsManager>* functor1 = createFunctor(&GraphicsManager::printScreen); |
---|
| 316 | ccPrintScreen_ = createConsoleCommand(functor1->setObject(this), "printScreen"); |
---|
| 317 | CommandExecutor::addConsoleCommandShortcut(ccPrintScreen_); |
---|
[2801] | 318 | } |
---|
| 319 | |
---|
[5614] | 320 | void GraphicsManager::update(const Clock& time) |
---|
[2801] | 321 | { |
---|
[5614] | 322 | Ogre::FrameEvent evt; |
---|
| 323 | evt.timeSinceLastFrame = time.getDeltaTime(); |
---|
| 324 | evt.timeSinceLastEvent = time.getDeltaTime(); // note: same time, but shouldn't matter anyway |
---|
| 325 | |
---|
| 326 | // don't forget to call _fireFrameStarted to OGRE to make sure |
---|
| 327 | // everything goes smoothly |
---|
| 328 | ogreRoot_->_fireFrameStarted(evt); |
---|
| 329 | |
---|
| 330 | // Pump messages in all registered RenderWindows |
---|
| 331 | // This calls the WindowEventListener objects. |
---|
| 332 | Ogre::WindowEventUtilities::messagePump(); |
---|
| 333 | // make sure the window stays active even when not focused |
---|
| 334 | // (probably only necessary on windows) |
---|
| 335 | this->renderWindow_->setActive(true); |
---|
| 336 | |
---|
| 337 | // Time before rendering |
---|
| 338 | uint64_t timeBeforeTick = time.getRealMicroseconds(); |
---|
| 339 | |
---|
| 340 | // Render frame |
---|
| 341 | ogreRoot_->_updateAllRenderTargets(); |
---|
| 342 | |
---|
| 343 | uint64_t timeAfterTick = time.getRealMicroseconds(); |
---|
| 344 | // Subtract the time used for rendering from the tick time counter |
---|
| 345 | Game::getInstance().subtractTickTime(timeAfterTick - timeBeforeTick); |
---|
| 346 | |
---|
| 347 | // again, just to be sure OGRE works fine |
---|
| 348 | ogreRoot_->_fireFrameEnded(evt); // note: uses the same time as _fireFrameStarted |
---|
[2801] | 349 | } |
---|
| 350 | |
---|
[5614] | 351 | void GraphicsManager::setCamera(Ogre::Camera* camera) |
---|
| 352 | { |
---|
| 353 | this->viewport_->setCamera(camera); |
---|
| 354 | } |
---|
| 355 | |
---|
[2801] | 356 | /** |
---|
| 357 | @brief |
---|
| 358 | Method called by the LogListener interface from Ogre. |
---|
| 359 | We use it to capture Ogre log messages and handle it ourselves. |
---|
| 360 | @param message |
---|
| 361 | The message to be logged |
---|
| 362 | @param lml |
---|
| 363 | The message level the log is using |
---|
| 364 | @param maskDebug |
---|
| 365 | If we are printing to the console or not |
---|
| 366 | @param logName |
---|
| 367 | The name of this log (so you can have several listeners |
---|
| 368 | for different logs, and identify them) |
---|
| 369 | */ |
---|
| 370 | void GraphicsManager::messageLogged(const std::string& message, |
---|
| 371 | Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName) |
---|
| 372 | { |
---|
| 373 | int orxonoxLevel; |
---|
| 374 | switch (lml) |
---|
| 375 | { |
---|
| 376 | case Ogre::LML_TRIVIAL: |
---|
| 377 | orxonoxLevel = this->ogreLogLevelTrivial_; |
---|
| 378 | break; |
---|
| 379 | case Ogre::LML_NORMAL: |
---|
| 380 | orxonoxLevel = this->ogreLogLevelNormal_; |
---|
| 381 | break; |
---|
| 382 | case Ogre::LML_CRITICAL: |
---|
| 383 | orxonoxLevel = this->ogreLogLevelCritical_; |
---|
| 384 | break; |
---|
| 385 | default: |
---|
| 386 | orxonoxLevel = 0; |
---|
| 387 | } |
---|
| 388 | OutputHandler::getOutStream().setOutputLevel(orxonoxLevel) |
---|
| 389 | << "Ogre: " << message << std::endl; |
---|
| 390 | } |
---|
| 391 | |
---|
[5670] | 392 | size_t GraphicsManager::getRenderWindowHandle() |
---|
| 393 | { |
---|
| 394 | size_t windowHnd = 0; |
---|
| 395 | renderWindow_->getCustomAttribute("WINDOW", &windowHnd); |
---|
| 396 | return windowHnd; |
---|
| 397 | } |
---|
| 398 | |
---|
| 399 | bool GraphicsManager::isFullScreen() const |
---|
| 400 | { |
---|
| 401 | Ogre::ConfigOptionMap& options = ogreRoot_->getRenderSystem()->getConfigOptions(); |
---|
| 402 | if (options.find("Full Screen") != options.end()) |
---|
| 403 | { |
---|
| 404 | if (options["Full Screen"].currentValue == "Yes") |
---|
| 405 | return true; |
---|
| 406 | else |
---|
| 407 | return false; |
---|
| 408 | } |
---|
| 409 | else |
---|
| 410 | { |
---|
| 411 | COUT(0) << "Could not find 'Full Screen' render system option. Fix This!!!" << std::endl; |
---|
| 412 | return false; |
---|
| 413 | } |
---|
| 414 | } |
---|
| 415 | |
---|
[2801] | 416 | void GraphicsManager::printScreen() |
---|
| 417 | { |
---|
| 418 | assert(this->renderWindow_); |
---|
| 419 | |
---|
| 420 | this->renderWindow_->writeContentsToTimestampedFile(Core::getLogPathString() + "screenShot_", ".jpg"); |
---|
| 421 | } |
---|
[612] | 422 | } |
---|