public static void Init(quakeparms_t parms) { _Params = parms; Cache.Init(1024 * 1024 * 16); // debug Cbuf.Init(); Cmd.Init(); View.Init(); Chase.Init(); InitVCR(parms); Common.Init(parms.basedir, parms.argv); InitLocal(); Wad.LoadWadFile("gfx.wad"); Key.Init(); Con.Init(); Menu.Init(); Progs.Init(); Mod.Init(); Net.Init(); Server.Init(); //Con.Print("Exe: "__TIME__" "__DATE__"\n"); //Con.Print("%4.1f megabyte heap\n",parms->memsize/ (1024*1024.0)); Render.InitTextures(); // needed even for dedicated servers if (Client.Cls.state != ClientActivityState.Dedicated) { _BasePal = Common.LoadFile("gfx/palette.lmp"); if (_BasePal == null) { Sys.Error("Couldn't load gfx/palette.lmp"); } _ColorMap = Common.LoadFile("gfx/colormap.lmp"); if (_ColorMap == null) { Sys.Error("Couldn't load gfx/colormap.lmp"); } // on non win32, mouse comes before video for security reasons Input.Init(); Vid.Init(_BasePal); Drawer.Init(); Scr.Init(); Render.Init(); Sound.Init(); CDAudio.Init(); Sbar.Init(); Client.Init(); } Cbuf.InsertText("exec quake.rc\n"); _IsInitialized = true; Con.DPrint("========Quake Initialized=========\n"); }
public void Initialise(QuakeParameters parms) { Parameters = parms; //Command.SetupWrapper( ); // Temporary workaround - change soon! Cache.Initialise(1024 * 1024 * 512); // debug Commands.Add("flush", Cache.Flush); //CommandBuffer.Initialise( ); // Command.Initialise( ); View.Initialise( ); ChaseView.Initialise( ); InitialiseVCR(parms); MainWindow.Common.Initialise(MainWindow, parms.basedir, parms.argv); InitialiseLocal( ); // Search wads foreach (var wadFile in FileSystem.Search("*.wad")) { if (wadFile == "radiant.wad") { continue; } if (wadFile == "gfx.wad") { continue; } var data = FileSystem.LoadFile(wadFile); if (data == null) { continue; } var wad = new Wad( ); wad.LoadWadFile(wadFile, data); WadFiles.Add(wadFile, wad); var textures = wad._Lumps.Values .Select(s => Encoding.ASCII.GetString(s.name).Replace("\0", "")) .ToArray( ); foreach (var texture in textures) { if (!WadTextures.ContainsKey(texture)) { WadTextures.Add(texture, wadFile); } } } GfxWad.LoadWadFile("gfx.wad"); Keyboard.Initialise( ); Console.Initialise( ); Menu.Initialise( ); Programs.Initialise( ); ProgramsBuiltIn.Initialise( ); Model.Initialise( ); Network.Initialise( ); Server.Initialise( ); //Con.Print("Exe: "__TIME__" "__DATE__"\n"); //Con.Print("%4.1f megabyte heap\n",parms->memsize/ (1024*1024.0)); RenderContext.InitTextures( ); // needed even for dedicated servers if (Client.cls.state != cactive_t.ca_dedicated) { BasePal = FileSystem.LoadFile("gfx/palette.lmp"); if (BasePal == null) { Utilities.Error("Couldn't load gfx/palette.lmp"); } ColorMap = FileSystem.LoadFile("gfx/colormap.lmp"); if (ColorMap == null) { Utilities.Error("Couldn't load gfx/colormap.lmp"); } // on non win32, mouse comes before video for security reasons MainWindow.Input.Initialise(this); Video.Initialise(BasePal); DrawingContext.Initialise( ); Screen.Initialise( ); RenderContext.Initialise( ); Sound.Initialise( ); CDAudio.Initialise( ); Hud.Initialise( ); Client.Initialise( ); } else { DedicatedServer.Initialise( ); } Commands.Buffer.Insert("exec quake.rc\n"); IsInitialised = true; Console.DPrint("========Quake Initialized=========\n"); }