public static void Shutdown() { var sw = Stopwatch.StartNew(); Logger.Info("TIG shutdown started..."); MainWindow?.Dispose(); RenderingDevice?.Dispose(); MdfFactory?.Dispose(); ShapeRenderer2d?.Dispose(); ShapeRenderer3d?.Dispose(); TextLayouter?.Dispose(); Sound?.Dispose(); Fonts?.Dispose(); DynamicScripting = null; FS = null; Mouse = null; Keyboard = null; SystemEventPump = null; MainWindow = null; MessageQueue = null; RenderingDevice = null; DebugUI = null; MdfFactory = null; ShapeRenderer2d = null; ShapeRenderer3d = null; TextLayouter = null; Sound = null; Fonts = null; Console = null; Logger.Info("TIG shutdown completed in {0}.", sw.Elapsed); }
private ResourceRef <Material> mGaussBlurVer; // Material for vertical pass of gauss blur public AasRenderer(RenderingDevice device, ShapeRenderer2d shapeRenderer2d, ShapeRenderer3d shapeRenderer3d) { mDevice = device; mShapeRenderer2d = shapeRenderer2d; mShapeRenderer3d = shapeRenderer3d; mGeometryShadowMaterial = CreateGeometryShadowMaterial(device); mShadowTarget = device.CreateRenderTargetTexture(BufferFormat.A8R8G8B8, ShadowMapWidth, ShadowMapHeight, debugName: "AASShadowTarget"); mShadowTargetTmp = device.CreateRenderTargetTexture(BufferFormat.A8R8G8B8, ShadowMapWidth, ShadowMapHeight, debugName: "AASShadowTargetTmp"); mShadowMapMaterial = CreateShadowMapMaterial(device); mGaussBlurHor = CreateGaussBlurMaterial(device, mShadowTarget, true); mGaussBlurVer = CreateGaussBlurMaterial(device, mShadowTargetTmp, false); }
public static void Startup(GameConfig config, TigSettings tigSettings = null) { tigSettings ??= new TigSettings(); Logger.Info("Initializing TIG"); FS = CreateFileSystem(config.InstallationFolder, tigSettings.DataFolder); DynamicScripting = TryLoadDynamicScripting(); if (tigSettings.OffScreen) { MainWindow = new HeadlessMainWindow(); } else { MainWindow = new MainWindow(config.Window, FS); } var configRendering = config.Rendering; RenderingDevice = new RenderingDevice( FS, MainWindow, configRendering.AdapterIndex, configRendering.DebugDevice); if (config.EnableDebugUI) { DebugUI = new DebugUiSystem(MainWindow, RenderingDevice); } else { DebugUI = new NoOpDebugUI(); } MdfFactory = new MdfMaterialFactory(FS, RenderingDevice); ShapeRenderer2d = new ShapeRenderer2d(RenderingDevice); ShapeRenderer3d = new ShapeRenderer3d(RenderingDevice); TextLayouter = new TextLayouter(RenderingDevice, ShapeRenderer2d); // TODO mStartedSystems.emplace_back(StartSystem("idxtable.c", 0x101EC400, 0x101ECAD0)); // TODO mStartedSystems.emplace_back(StartSystem("trect.c", TigStartupNoop, 0x101E4E40)); // TODO mStartedSystems.emplace_back(StartSystem("color.c", 0x101ECB20, 0x101ED070)); // TODO mLegacyVideoSystem = std::make_unique<LegacyVideoSystem>(*mMainWindow, *mRenderingDevice); // mStartedSystems.emplace_back(StartSystem("video.c", 0x101DC6E0, 0x101D8540)); // TODO mStartedSystems.emplace_back(StartSystem("shader", 0x101E3350, 0x101E2090)); // TODO mStartedSystems.emplace_back(StartSystem("palette.c", 0x101EBE30, 0x101EBEB0)); // TODO mStartedSystems.emplace_back(StartSystem("window.c", 0x101DED20, 0x101DF320)); // TODO mStartedSystems.emplace_back(StartSystem("timer.c", 0x101E34E0, 0x101E34F0)); // mStartedSystems.emplace_back(StartSystem("dxinput.c", 0x101FF910, 0x101FF950)); // mStartedSystems.emplace_back(StartSystem("keyboard.c", 0x101DE430, 0x101DE2D0)); Keyboard = new TigKeyboard(); // mStartedSystems.emplace_back(StartSystem("texture.c", 0x101EDF60, 0x101EE0A0)); Mouse = new TigMouse(); // TODO mStartedSystems.emplace_back(StartSystem("mouse.c", 0x101DDF50, 0x101DDE30)); // TODO mStartedSystems.emplace_back(StartSystem("message.c", 0x101DE460, 0x101DE4E0)); MessageQueue = new MessageQueue(); SystemEventPump = new SystemEventPump(); // startedSystems.emplace_back(StartSystem("gfx.c", TigStartupNoop, TigShutdownNoop)); // TODO mStartedSystems.emplace_back(StartSystem("strparse.c", 0x101EBF00, TigShutdownNoop)); // TODO mStartedSystems.emplace_back(StartSystem("filecache.c", TigStartupNoop, TigShutdownNoop)); Sound = new TigSound( soundId => GameSystems.SoundGame.FindSoundFilename(soundId), tigSettings.DisableSound ); // TODO mSoundSystem = std::make_unique<temple::SoundSystem>(); // TODO mMovieSystem = std::make_unique<temple::MovieSystem>(*mSoundSystem); // mStartedSystems.emplace_back(StartSystem("movie.c", 0x101F1090, TigShutdownNoop)); // NOTE: WFT -> UiManager // TODO mStartedSystems.emplace_back(StartSystem("wft.c", 0x101F98A0, 0x101F9770)); // TODO mStartedSystems.emplace_back(StartSystem("font.c", 0x101EAEC0, 0x101EA140)); Fonts = new TigFonts(); Fonts.LoadAllFrom("art/arial-10"); Fonts.PushFont("arial-10", 10); // TODO mConsole = std::make_unique<Console>(); // mStartedSystems.emplace_back(StartSystem("console.c", 0x101E0290, 0x101DFBC0)); Console = new TigConsole(DynamicScripting); // TODO mStartedSystems.emplace_back(StartSystem("loadscreen.c", 0x101E8260, TigShutdownNoop)); // TODO *tigInternal.consoleDisabled = false; // tig init disables console by default }