static Core() { console = new DoomConsole(); video = new NullVideoSystem(false); music = new MusicPlayer(); archives = new MultiArchive(); topstate = null; stopwatch = Stopwatch.StartNew(); lasttime = 0; coresystems = new Dictionary <string, Type>(); PushState(new RootState()); }
static Core() { console = new DoomConsole(); video = new NullVideoSystem(false); music = new MusicPlayer(); archives = new MultiArchive(); topstate = null; stopwatch = Stopwatch.StartNew(); lasttime = 0; coresystems = new Dictionary<string,Type>(); PushState(new RootState()); }
public static void ChangeVideoSystem(string name, bool fullscreen) { if (name == null) { throw new ArgumentNullException("name"); } Type type; if (!coresystems.TryGetValue("video_" + name, out type)) { console.LogError("There is no video system named '{0}'.", name); return; } // cast to avoid calling (type,bool) overload IVideoSystem newvideo = (IVideoSystem)Activator.CreateInstance(type, (object)fullscreen); video.Dispose(); video = newvideo; console.LogInfo("Switched to video system '{0}'.", name); }
public static void ChangeVideoSystem(string name,bool fullscreen) { if (name == null) throw new ArgumentNullException("name"); Type type; if (!coresystems.TryGetValue("video_" + name,out type)) { console.LogError("There is no video system named '{0}'.",name); return; } // cast to avoid calling (type,bool) overload IVideoSystem newvideo = (IVideoSystem)Activator.CreateInstance(type,(object)fullscreen); video.Dispose(); video = newvideo; console.LogInfo("Switched to video system '{0}'.",name); }