/*! \fn UniversalPana::updateBrowser() */ void UniversalPana::updateBrowser(const QString& file) { if (! (QFile::exists(file) ) ) { showIntroduction(); return; } QString text; QFile f_file(file); if( f_file.open(IO_ReadOnly) ) { QTextStream stream( &f_file ); stream.setEncoding( QTextStream::UnicodeUTF8 ); QString line; while ( !stream.atEnd() ) { line = stream.readLine(); // line of text excluding '\n' text += QString("\n") + line; } f_file.close(); text=text.replace("<img id='current_box-largecover-image' ", "<img id='current_box-largecover-image' width=70 height=70 "); browser->begin(); browser->write(text); browser->end(); } else browser->openURL(file); }
Common::Error MortevielleEngine::run() { // Initialize the game Common::ErrorCode err = initialize(); if (err != Common::kNoError) return err; // Check for a savegame int loadSlot = 0; if (ConfMan.hasKey("save_slot")) { int gameToLoad = ConfMan.getInt("save_slot"); if ((gameToLoad >= 1) && (gameToLoad <= 999)) loadSlot = gameToLoad; } if (loadSlot == 0) // Show the game introduction showIntroduction(); else { _caff = 51; _text->taffich(); } // Either load the initial game state savegame, or the specified savegame number adzon(); resetVariables(); if (loadSlot != 0) _savegameManager->loadSavegame(generateSaveFilename(loadSlot)); // Run the main game loop mainGame(); // Cleanup (allocated in initialize()) _screenSurface->free(); free(_soundManager->_cfiphBuffer); free(_cfiecBuffer); return Common::kNoError; }