Esempio n. 1
0
 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());
 }
Esempio n. 2
0
 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());
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 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);
 }