void Phy2dWorld::draw(const renderer::IRendererPtr& renderer) { m_renderList.clear(); for(int i=0, is=(int)m_actors.size(); i<is; i++) { if(m_actors[i]->getBasicAttr().isVisible) m_renderList.push_back(m_actors[i]); } sortActors(m_renderList); for(int i=0, is=(int)m_renderList.size(); i<is; i++) { m_renderList[i]->draw(renderer); } }
/** * Do restore scene * @param n Id */ static int DoRestoreSceneFrame(SAVED_DATA *sd, int n) { switch (n) { case RS_COUNT + COUNTOUT_COUNT: // Trigger pre-load and fade and start countdown FadeOutFast(NULL); break; case RS_COUNT: _vm->_sound->stopAllSamples(); ClearScreen(); // Master script only affected on restore game, not restore scene if (TinselV2 && (sd == &sgData)) { g_scheduler->killMatchingProcess(PID_MASTER_SCR); KillGlobalProcesses(); FreeMasterInterpretContext(); } if (TinselV2) { RestorePolygonStuff(sd->SavedPolygonStuff); // Abandon temporarily if different CD if (sd == &sgData && restoreCD != GetCurrentCD()) { SRstate = SR_IDLE; EndScene(); SetNextCD(restoreCD); CDChangeForRestore(restoreCD); return 0; } } else { RestoreDeadPolys(sd->SavedDeadPolys); } // Start up the scene StartNewScene(sd->SavedSceneHandle, NO_ENTRY_NUM); SetDoFadeIn(!bNoFade); bNoFade = false; StartupBackground(nullContext, sd->SavedBgroundHandle); if (TinselV2) { Offset(EX_USEXY, sd->SavedLoffset, sd->SavedToffset); } else { KillScroll(); PlayfieldSetPos(FIELD_WORLD, sd->SavedLoffset, sd->SavedToffset); SetNoBlocking(sd->SavedNoBlocking); } RestoreNoScrollData(&sd->SavedNoScrollData); if (TinselV2) { // create process to sort out the moving actors g_scheduler->createProcess(PID_MOVER, SortMAProcess, NULL, 0); bNotDoneYet = true; RestoreActorZ(sd->savedActorZ); RestoreZpositions(sd->zPositions); RestoreSysVars(sd->SavedSystemVars); CreateGhostPalette(BgPal()); RestoreActors(sd->NumSavedActors, sd->SavedActorInfo); RestoreSoundReels(sd->SavedSoundReels); return 1; } sortActors(sd); break; case 2: break; case 1: if (TinselV2) { if (bNotDoneYet) return n; if (sd == &sgData) HoldItem(thingHeld, true); if (sd->bTinselDim) _vm->_pcmMusic->dim(true); _vm->_pcmMusic->restoreThatTune(sd->SavedTune); ScrollFocus(sd->SavedScrollFocus); } else { RestoreMidiFacts(sd->SavedMidi, sd->SavedLoop); } if (sd->SavedControl) ControlOn(); // Control was on ResumeInterprets(); break; default: break; } return n - 1; }