Example #1
0
        public virtual void Init()
        {
            Globals.dedicated = Cvar.Get("dedicated", "0", Qcommon.CVAR_NOSET);
            Program.Q2Dialog  = new Q2DataDialog();
            Locale.SetDefault(Locale.US);
            Program.Q2Dialog.SetVisible(true);
            string DRIVER = "jsr231";

            Qcommon.Init(new string [] { "TestRenderer", "+set", "gl_mode", "6", "+set", "vid_fullscreen", "0", "+set", "vid_ref", DRIVER });
            VID.Shutdown();
            String[] names = Renderer.GetDriverNames();
            System.Diagnostics.Debug.WriteLine("Registered Drivers: " + Arrays.AsList(names));
            this.re    = Renderer.GetDriver(DRIVER);
            Globals.re = this.re;
            System.Diagnostics.Debug.WriteLine("Use driver: " + re);
            System.out_renamed.Flush();
            re.Init(0, 0);
            kbd = re.GetKeyboardHandler();
            kbd.Init();
            Cmd.AddCommand("nexttest", nexttest);
            Cbuf.AddText("bind n nexttest");
            Cbuf.Execute();
            Globals.cls.key_dest = Defines.key_game;
            Globals.cls.state    = Defines.ca_active;
        }
Example #2
0
        public virtual void Init()
        {
            Globals.dedicated = Cvar.Get("dedicated", "0", Qcommon.CVAR_NOSET);
            Program.Q2Dialog  = new Q2DataDialog();
            Locale.SetDefault(Locale.US);
            Program.Q2Dialog.SetVisible(true);
            string DRIVER = "lwjgl";

            Qcommon.Init(new string { "DancingQueens", "+set", "gl_mode", "4", "+set", "vid_fullscreen", "0", "+set", "vid_ref", DRIVER });
            VID.Shutdown();
            String[] names = Renderer.GetDriverNames();
            System.Diagnostics.Debug.WriteLine("Registered Drivers: " + Arrays.AsList(names));
            this.re    = Renderer.GetDriver(DRIVER);
            Globals.re = this.re;
            System.Diagnostics.Debug.WriteLine("Use driver: " + re);
            System.out_renamed.Flush();
            re.Init(0, 0);
            kbd = re.GetKeyboardHandler();
            kbd.Init();
            Cbuf.AddText("unbind t");
            Cbuf.Execute();
            Cmd.AddCommand("togglemouse", togglemouse);
            Cbuf.AddText("bind t togglemouse");
            Cbuf.Execute();
            Globals.cls.key_dest = Defines.key_game;
            Globals.cls.state    = Defines.ca_active;
            viddef = Globals.viddef;
            fov_y  = Math3D.CalcFov(fov_x, viddef.GetWidth(), viddef.GetHeight());
        }
Example #3
0
        public bool Init()
        {
            try
            {
                InitOpenAL();
                CheckError();
            }
            catch (Exception e)
            {
                Com.DPrintf(e.Message + '\\');
                return(false);
            }

            s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE);
            AL10.AlGenBuffers(buffers);
            int count = Channel.Init(buffers);

            Com.Printf("... using " + count + " channels\\n");
            AL10.AlDistanceModel(AL10.AL_INVERSE_DISTANCE_CLAMPED);
            Cmd.AddCommand("play", new Anonymousxcommand_t(this));
            Cmd.AddCommand("stopsound", new Anonymousxcommand_t1(this));
            Cmd.AddCommand("soundlist", new Anonymousxcommand_t2(this));
            Cmd.AddCommand("soundinfo", new Anonymousxcommand_t3(this));
            num_sfx = 0;
            Com.Printf("sound sampling rate: 44100Hz\\n");
            StopAllSounds();
            Com.Printf("------------------------------------\\n");
            return(true);
        }
Example #4
0
        public static void Init()
        {
            for (int i = 0; i < 32; i++)
            {
                Globals.key_lines[i][0] = (byte)']';
                Globals.key_lines[i][1] = 0;
            }

            Globals.key_linepos = 1;
            for (int i = 32; i < 128; i++)
            {
                consolekeys[i] = true;
            }
            consolekeys[K_ENTER]         = true;
            consolekeys[K_KP_ENTER]      = true;
            consolekeys[K_TAB]           = true;
            consolekeys[K_LEFTARROW]     = true;
            consolekeys[K_KP_LEFTARROW]  = true;
            consolekeys[K_RIGHTARROW]    = true;
            consolekeys[K_KP_RIGHTARROW] = true;
            consolekeys[K_UPARROW]       = true;
            consolekeys[K_KP_UPARROW]    = true;
            consolekeys[K_DOWNARROW]     = true;
            consolekeys[K_KP_DOWNARROW]  = true;
            consolekeys[K_BACKSPACE]     = true;
            consolekeys[K_HOME]          = true;
            consolekeys[K_KP_HOME]       = true;
            consolekeys[K_END]           = true;
            consolekeys[K_KP_END]        = true;
            consolekeys[K_PGUP]          = true;
            consolekeys[K_KP_PGUP]       = true;
            consolekeys[K_PGDN]          = true;
            consolekeys[K_KP_PGDN]       = true;
            consolekeys[K_SHIFT]         = true;
            consolekeys[K_INS]           = true;
            consolekeys[K_KP_INS]        = true;
            consolekeys[K_KP_DEL]        = true;
            consolekeys[K_KP_SLASH]      = true;
            consolekeys[K_KP_PLUS]       = true;
            consolekeys[K_KP_MINUS]      = true;
            consolekeys[K_KP_5]          = true;
            consolekeys['`']             = false;
            consolekeys['~']             = false;
            menubound[K_ESCAPE]          = true;
            for (int i = 0; i < 12; i++)
            {
                menubound[K_F1 + i] = true;
            }
            Cmd.AddCommand("bind", Key.Bind_f);
            Cmd.AddCommand("unbind", Key.Unbind_f);
            Cmd.AddCommand("unbindall", Key.Unbindall_f);
            Cmd.AddCommand("bindlist", Key.Bindlist_f);
        }
Example #5
0
 public static void Init()
 {
     Cmd.AddCommand("gun_next", V.Gun_Next_f);
     Cmd.AddCommand("gun_prev", V.Gun_Prev_f);
     Cmd.AddCommand("gun_model", V.Gun_Model_f);
     Cmd.AddCommand("viewpos", V.Viewpos_f);
     Globals.crosshair  = Cvar.Get("crosshair", "0", Defines.CVAR_ARCHIVE);
     V.cl_testblend     = Cvar.Get("cl_testblend", "0", 0);
     V.cl_testparticles = Cvar.Get("cl_testparticles", "0", 0);
     V.cl_testentities  = Cvar.Get("cl_testentities", "0", 0);
     V.cl_testlights    = Cvar.Get("cl_testlights", "0", 0);
     V.cl_stats         = Cvar.Get("cl_stats", "0", 0);
 }
Example #6
0
 public static void Init()
 {
     vid_ref              = Cvar.Get("vid_ref", Renderer.GetPreferedName(), CVAR_ARCHIVE);
     vid_xpos             = Cvar.Get("vid_xpos", "3", CVAR_ARCHIVE);
     vid_ypos             = Cvar.Get("vid_ypos", "22", CVAR_ARCHIVE);
     vid_width            = Cvar.Get("vid_width", "640", CVAR_ARCHIVE);
     vid_height           = Cvar.Get("vid_height", "480", CVAR_ARCHIVE);
     vid_fullscreen       = Cvar.Get("vid_fullscreen", "0", CVAR_ARCHIVE);
     vid_gamma            = Cvar.Get("vid_gamma", "1", CVAR_ARCHIVE);
     vid_modes[11].width  = (int)vid_width.value;
     vid_modes[11].height = (int)vid_height.value;
     Cmd.AddCommand("vid_restart", new Anonymousxcommand_t());
     CheckChanges();
 }
Example #7
0
 public static void Init( )
 {
     Globals.con.linewidth = -1;
     CheckResize();
     Com.Printf("Console initialized.\\n");
     Globals.con_notifytime = Cvar.Get("con_notifytime", "3", 0);
     Cmd.AddCommand("toggleconsole", ToggleConsole_f);
     Cmd.AddCommand("togglechat", ToggleChat_f);
     Cmd.AddCommand("messagemode", MessageMode_f);
     Cmd.AddCommand("messagemode2", MessageMode2_f);
     Cmd.AddCommand("clear", Clear_f);
     Cmd.AddCommand("condump", Dump_f);
     Globals.con.initialized = true;
 }
Example #8
0
 public static void Real_IN_Init( )
 {
     Globals.m_filter    = Cvar.Get("m_filter", "0", 0);
     Globals.in_mouse    = Cvar.Get("in_mouse", "1", CVAR_ARCHIVE);
     Globals.freelook    = Cvar.Get("freelook", "1", 0);
     Globals.lookstrafe  = Cvar.Get("lookstrafe", "0", 0);
     Globals.sensitivity = Cvar.Get("sensitivity", "3", 0);
     Globals.m_pitch     = Cvar.Get("m_pitch", "0.022", 0);
     Globals.m_yaw       = Cvar.Get("m_yaw", "0.022", 0);
     Globals.m_forward   = Cvar.Get("m_forward", "1", 0);
     Globals.m_side      = Cvar.Get("m_side", "0.8", 0);
     Cmd.AddCommand("+mlook", new Anonymousxcommand_t());
     Cmd.AddCommand("-mlook", new Anonymousxcommand_t1());
     Cmd.AddCommand("force_centerview", new Anonymousxcommand_t2());
     Cmd.AddCommand("togglemouse", new Anonymousxcommand_t3());
     IN.mouse_avail = true;
 }
Example #9
0
 public static void InitFilesystem( )
 {
     Cmd.AddCommand("path", new Anonymousxcommand_t());
     Cmd.AddCommand("link", new Anonymousxcommand_t1());
     Cmd.AddCommand("dir", new Anonymousxcommand_t2());
     fs_userdir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "/.jake2";
     FS.CreatePath(fs_userdir + "/");
     FS.AddGameDirectory(fs_userdir);
     fs_basedir = Cvar.Get("basedir", ".", CVAR_NOSET);
     SetCDDir();
     AddGameDirectory(fs_basedir.string_renamed + '/' + Globals.BASEDIRNAME);
     MarkBaseSearchPaths();
     fs_gamedirvar = Cvar.Get("game", "", CVAR_LATCH | CVAR_SERVERINFO);
     if (fs_gamedirvar.string_renamed.Length > 0)
     {
         SetGamedir(fs_gamedirvar.string_renamed);
     }
 }
Example #10
0
        public bool Init()
        {
            try
            {
                var deviceName = ALC.GetString(ALDevice.Null, AlcGetString.DefaultDeviceSpecifier);
                OpenTkSound.device = ALC.OpenDevice(deviceName);
                var context = ALC.CreateContext(OpenTkSound.device, (int[])null);
                ALC.MakeContextCurrent(context);
                this.checkError();
                this.initOpenALExtensions();
            }
            catch (Exception e)
            {
                Com.Printf(e.Message + '\n');

                return(false);
            }

            // set the master volume
            this.s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE);

            AL.GenBuffers(this.buffers.Length, this.buffers);
            var count = Channel.init(this.buffers, OpenTkSound.efxSlot);

            Com.Printf("... using " + count + " channels\n");
            AL.DistanceModel(ALDistanceModel.InverseDistanceClamped);

            Cmd.AddCommand("play", () => { this.Play(); });

            Cmd.AddCommand("stopsound", () => { this.StopAllSounds(); });

            Cmd.AddCommand("soundlist", () => { this.SoundList(); });

            Cmd.AddCommand("soundinfo", () => { this.SoundInfo_f(); });

            OpenTkSound.num_sfx = 0;

            Com.Println("sound sampling rate: 44100Hz");

            this.StopAllSounds();
            Com.Println("------------------------------------");

            return(true);
        }
Example #11
0
 public static void SV_InitOperatorCommands( )
 {
     Cmd.AddCommand("heartbeat", new Anonymousxcommand_t());
     Cmd.AddCommand("kick", new Anonymousxcommand_t1());
     Cmd.AddCommand("status", new Anonymousxcommand_t2());
     Cmd.AddCommand("serverinfo", new Anonymousxcommand_t3());
     Cmd.AddCommand("dumpuser", new Anonymousxcommand_t4());
     Cmd.AddCommand("map", new Anonymousxcommand_t5());
     Cmd.AddCommand("demomap", new Anonymousxcommand_t6());
     Cmd.AddCommand("gamemap", new Anonymousxcommand_t7());
     Cmd.AddCommand("setmaster", new Anonymousxcommand_t8());
     if (Globals.dedicated.value != 0)
     {
         Cmd.AddCommand("say", new Anonymousxcommand_t9());
     }
     Cmd.AddCommand("serverrecord", new Anonymousxcommand_t10());
     Cmd.AddCommand("serverstop", new Anonymousxcommand_t11());
     Cmd.AddCommand("save", new Anonymousxcommand_t12());
     Cmd.AddCommand("load", new Anonymousxcommand_t13());
     Cmd.AddCommand("killserver", new Anonymousxcommand_t14());
     Cmd.AddCommand("sv", new Anonymousxcommand_t15());
 }
Example #12
0
        public static void Init( )
        {
            cvar_t cv;

            Com.Printf("\\n------- sound initialization -------\\n");
            cv = Cvar.Get("s_initsound", "0", 0);
            if (cv.value == 0F)
            {
                Com.Printf("not initializing.\\n");
            }
            else
            {
                s_volume     = Cvar.Get("s_volume", "0.7", CVAR_ARCHIVE);
                s_khz        = Cvar.Get("s_khz", "11", CVAR_ARCHIVE);
                s_loadas8bit = Cvar.Get("s_loadas8bit", "1", CVAR_ARCHIVE);
                s_mixahead   = Cvar.Get("s_mixahead", "0.2", CVAR_ARCHIVE);
                s_show       = Cvar.Get("s_show", "0", 0);
                s_testsound  = Cvar.Get("s_testsound", "0", 0);
                s_primary    = Cvar.Get("s_primary", "0", CVAR_ARCHIVE);
                Cmd.AddCommand("play", new Anonymousxcommand_t());
                Cmd.AddCommand("stopsound", new Anonymousxcommand_t1());
                Cmd.AddCommand("soundlist", new Anonymousxcommand_t2());
                Cmd.AddCommand("soundinfo", new Anonymousxcommand_t3());
                if (!SNDDMA_Init())
                {
                    return;
                }
                InitScaletable();
                sound_started = true;
                num_sfx       = 0;
                soundtime     = 0;
                paintedtime   = 0;
                Com.Printf("sound sampling rate: " + dma.speed + "\\n");
                StopAllSounds();
            }

            Com.Printf("------------------------------------\\n");
        }
Example #13
0
        public static void Real_IN_Init()
        {
            // mouse variables
            Globals.m_filter    = Cvar.Get("m_filter", "0", 0);
            Globals.in_mouse    = Cvar.Get("in_mouse", "1", Defines.CVAR_ARCHIVE);
            Globals.freelook    = Cvar.Get("freelook", "1", 0);
            Globals.lookstrafe  = Cvar.Get("lookstrafe", "0", 0);
            Globals.sensitivity = Cvar.Get("sensitivity", "3", 0);
            Globals.m_pitch     = Cvar.Get("m_pitch", "0.022", 0);
            Globals.m_yaw       = Cvar.Get("m_yaw", "0.022", 0);
            Globals.m_forward   = Cvar.Get("m_forward", "1", 0);
            Globals.m_side      = Cvar.Get("m_side", "0.8", 0);

            Cmd.AddCommand("+mlook", () => { IN.MLookDown(); });

            Cmd.AddCommand("-mlook", () => { IN.MLookUp(); });

            Cmd.AddCommand("force_centerview", () => { IN.Force_CenterView_f(); });

            Cmd.AddCommand("togglemouse", () => { IN.toggleMouse(); });

            IN.mouse_avail = true;
        }
Example #14
0
        public Boolean Init( )
        {
            try
            {
                if (!initialized)
                {
                    //ALut.AlutInit();
                    initialized = true;
                }
                // Do we need this?
                //al = ALFactory.GetAL();
                //alc = ALFactory.GetALC();
                CheckError();
                InitOpenALExtensions();
            }
            catch (Exception e)
            {
                Com.Printf(e.Message + '\\');
                return(false);
            }

            s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE);
            AL.GenBuffers(buffers.Length, buffers);
            var count = Channel.Init(buffers);

            Com.Printf("... using " + count + " channels\\n");
            AL.DistanceModel(ALDistanceModel.InverseDistanceClamped);
            Cmd.AddCommand("play", new Anonymousxcommand_t(this));
            Cmd.AddCommand("stopsound", new Anonymousxcommand_t1(this));
            Cmd.AddCommand("soundlist", new Anonymousxcommand_t2(this));
            Cmd.AddCommand("soundinfo", new Anonymousxcommand_t3(this));
            num_sfx = 0;
            Com.Println("sound sampling rate: 44100Hz");
            StopAllSounds();
            Com.Println("------------------------------------");
            return(true);
        }
Example #15
0
        public virtual void Init()
        {
            Globals.dedicated = Cvar.Get("dedicated", "0", Qcommon.CVAR_NOSET);
            if (Globals.dedicated.value != 1F)
            {
                Program.Q2Dialog = new Q2DataDialog();
                Locale.SetDefault(Locale.US);
                Program.Q2Dialog.SetVisible(true);
            }

            Qcommon.Init(new string[] { "TestMap" });
            VID.Shutdown();
            Globals.re = this.re = Renderer.GetDriver("jsr231", true);
            re.Init(0, 0);
            Cmd.AddCommand("+tforward", forward_down);
            Cmd.AddCommand("-tforward", forward_up);
            Cbuf.AddText("bind UPARROW +tforward");
            Cbuf.Execute();
            Cmd.AddCommand("+tbackward", backward_down);
            Cmd.AddCommand("-tbackward", backward_up);
            Cbuf.AddText("bind DOWNARROW +tbackward");
            Cbuf.Execute();
            Cmd.AddCommand("+tleft", left_down);
            Cmd.AddCommand("-tleft", left_up);
            Cbuf.AddText("bind LEFTARROW +tleft");
            Cbuf.Execute();
            Cmd.AddCommand("+tright", right_down);
            Cmd.AddCommand("-tright", right_up);
            Cbuf.AddText("bind RIGHTARROW +tright");
            Cbuf.Execute();
            Cmd.AddCommand("togglemouse", togglemouse);
            Cbuf.AddText("bind t togglemouse");
            Cbuf.Execute();
            Globals.cls.key_dest = Defines.key_game;
            Globals.cls.state    = Defines.ca_active;
            viddef = Globals.viddef;
        }
Example #16
0
 public static void InitInput()
 {
     Cmd.AddCommand("centerview", new Anonymousxcommand_t());
     Cmd.AddCommand("+moveup", new Anonymousxcommand_t1());
     Cmd.AddCommand("-moveup", new Anonymousxcommand_t2());
     Cmd.AddCommand("+movedown", new Anonymousxcommand_t3());
     Cmd.AddCommand("-movedown", new Anonymousxcommand_t4());
     Cmd.AddCommand("+left", new Anonymousxcommand_t5());
     Cmd.AddCommand("-left", new Anonymousxcommand_t6());
     Cmd.AddCommand("+right", new Anonymousxcommand_t7());
     Cmd.AddCommand("-right", new Anonymousxcommand_t8());
     Cmd.AddCommand("+forward", new Anonymousxcommand_t9());
     Cmd.AddCommand("-forward", new Anonymousxcommand_t10());
     Cmd.AddCommand("+back", new Anonymousxcommand_t11());
     Cmd.AddCommand("-back", new Anonymousxcommand_t12());
     Cmd.AddCommand("+lookup", new Anonymousxcommand_t13());
     Cmd.AddCommand("-lookup", new Anonymousxcommand_t14());
     Cmd.AddCommand("+lookdown", new Anonymousxcommand_t15());
     Cmd.AddCommand("-lookdown", new Anonymousxcommand_t16());
     Cmd.AddCommand("+strafe", new Anonymousxcommand_t17());
     Cmd.AddCommand("-strafe", new Anonymousxcommand_t18());
     Cmd.AddCommand("+moveleft", new Anonymousxcommand_t19());
     Cmd.AddCommand("-moveleft", new Anonymousxcommand_t20());
     Cmd.AddCommand("+moveright", new Anonymousxcommand_t21());
     Cmd.AddCommand("-moveright", new Anonymousxcommand_t22());
     Cmd.AddCommand("+speed", new Anonymousxcommand_t23());
     Cmd.AddCommand("-speed", new Anonymousxcommand_t24());
     Cmd.AddCommand("+attack", new Anonymousxcommand_t25());
     Cmd.AddCommand("-attack", new Anonymousxcommand_t26());
     Cmd.AddCommand("+use", new Anonymousxcommand_t27());
     Cmd.AddCommand("-use", new Anonymousxcommand_t28());
     Cmd.AddCommand("impulse", new Anonymousxcommand_t29());
     Cmd.AddCommand("+klook", new Anonymousxcommand_t30());
     Cmd.AddCommand("-klook", new Anonymousxcommand_t31());
     cl_nodelta = Cvar.Get("cl_nodelta", "0", 0);
 }
Example #17
0
 protected virtual void R_Register( )
 {
     r_lefthand           = Cvar.Get("hand", "0", Defines.CVAR_USERINFO | Defines.CVAR_ARCHIVE);
     r_norefresh          = Cvar.Get("r_norefresh", "0", 0);
     r_fullbright         = Cvar.Get("r_fullbright", "0", 0);
     r_drawentities       = Cvar.Get("r_drawentities", "1", 0);
     r_drawworld          = Cvar.Get("r_drawworld", "1", 0);
     r_novis              = Cvar.Get("r_novis", "0", 0);
     r_nocull             = Cvar.Get("r_nocull", "0", 0);
     r_lerpmodels         = Cvar.Get("r_lerpmodels", "1", 0);
     r_speeds             = Cvar.Get("r_speeds", "0", 0);
     r_lightlevel         = Cvar.Get("r_lightlevel", "1", 0);
     gl_nosubimage        = Cvar.Get("gl_nosubimage", "0", 0);
     gl_allow_software    = Cvar.Get("gl_allow_software", "0", 0);
     gl_particle_min_size = Cvar.Get("gl_particle_min_size", "2", Defines.CVAR_ARCHIVE);
     gl_particle_max_size = Cvar.Get("gl_particle_max_size", "40", Defines.CVAR_ARCHIVE);
     gl_particle_size     = Cvar.Get("gl_particle_size", "40", Defines.CVAR_ARCHIVE);
     gl_particle_att_a    = Cvar.Get("gl_particle_att_a", "0.01", Defines.CVAR_ARCHIVE);
     gl_particle_att_b    = Cvar.Get("gl_particle_att_b", "0.0", Defines.CVAR_ARCHIVE);
     gl_particle_att_c    = Cvar.Get("gl_particle_att_c", "0.01", Defines.CVAR_ARCHIVE);
     gl_modulate          = Cvar.Get("gl_modulate", "1.5", Defines.CVAR_ARCHIVE);
     gl_log                       = Cvar.Get("gl_log", "0", 0);
     gl_bitdepth                  = Cvar.Get("gl_bitdepth", "0", 0);
     gl_mode                      = Cvar.Get("gl_mode", "3", Defines.CVAR_ARCHIVE);
     gl_lightmap                  = Cvar.Get("gl_lightmap", "0", 0);
     gl_shadows                   = Cvar.Get("gl_shadows", "0", Defines.CVAR_ARCHIVE);
     gl_dynamic                   = Cvar.Get("gl_dynamic", "1", 0);
     gl_nobind                    = Cvar.Get("gl_nobind", "0", 0);
     gl_round_down                = Cvar.Get("gl_round_down", "1", 0);
     gl_picmip                    = Cvar.Get("gl_picmip", "0", 0);
     gl_skymip                    = Cvar.Get("gl_skymip", "0", 0);
     gl_showtris                  = Cvar.Get("gl_showtris", "0", 0);
     gl_ztrick                    = Cvar.Get("gl_ztrick", "0", 0);
     gl_finish                    = Cvar.Get("gl_finish", "0", Defines.CVAR_ARCHIVE);
     gl_clear                     = Cvar.Get("gl_clear", "0", 0);
     gl_cull                      = Cvar.Get("gl_cull", "1", 0);
     gl_polyblend                 = Cvar.Get("gl_polyblend", "1", 0);
     gl_flashblend                = Cvar.Get("gl_flashblend", "0", 0);
     gl_playermip                 = Cvar.Get("gl_playermip", "0", 0);
     gl_monolightmap              = Cvar.Get("gl_monolightmap", "0", 0);
     gl_driver                    = Cvar.Get("gl_driver", "opengl32", Defines.CVAR_ARCHIVE);
     gl_texturemode               = Cvar.Get("gl_texturemode", "(int)All.Linear_MIPMAP_NEAREST", Defines.CVAR_ARCHIVE);
     gl_texturealphamode          = Cvar.Get("gl_texturealphamode", "default", Defines.CVAR_ARCHIVE);
     gl_texturesolidmode          = Cvar.Get("gl_texturesolidmode", "default", Defines.CVAR_ARCHIVE);
     gl_lockpvs                   = Cvar.Get("gl_lockpvs", "0", 0);
     gl_vertex_arrays             = Cvar.Get("gl_vertex_arrays", "1", Defines.CVAR_ARCHIVE);
     gl_ext_swapinterval          = Cvar.Get("gl_ext_swapinterval", "1", Defines.CVAR_ARCHIVE);
     gl_ext_palettedtexture       = Cvar.Get("gl_ext_palettedtexture", "0", Defines.CVAR_ARCHIVE);
     gl_ext_multitexture          = Cvar.Get("gl_ext_multitexture", "1", Defines.CVAR_ARCHIVE);
     gl_ext_pointparameters       = Cvar.Get("gl_ext_pointparameters", "1", Defines.CVAR_ARCHIVE);
     gl_ext_compiled_vertex_array = Cvar.Get("gl_ext_compiled_vertex_array", "1", Defines.CVAR_ARCHIVE);
     gl_drawbuffer                = Cvar.Get("gl_drawbuffer", "GL_BACK", 0);
     gl_swapinterval              = Cvar.Get("gl_swapinterval", "0", Defines.CVAR_ARCHIVE);
     gl_saturatelighting          = Cvar.Get("gl_saturatelighting", "0", 0);
     gl_3dlabs_broken             = Cvar.Get("gl_3dlabs_broken", "1", Defines.CVAR_ARCHIVE);
     vid_fullscreen               = Cvar.Get("vid_fullscreen", "0", Defines.CVAR_ARCHIVE);
     vid_gamma                    = Cvar.Get("vid_gamma", "1.0", Defines.CVAR_ARCHIVE);
     vid_ref                      = Cvar.Get("vid_ref", "lwjgl", Defines.CVAR_ARCHIVE);
     Cmd.AddCommand("imagelist", new Anonymousxcommand_t(this));
     Cmd.AddCommand("screenshot", new Anonymousxcommand_t1(this));
     Cmd.AddCommand("modellist", new Anonymousxcommand_t2(this));
     Cmd.AddCommand("gl_strings", new Anonymousxcommand_t3(this));
 }
Example #18
0
 public static void Init( )
 {
     Cmd.AddCommand("set", Set_f);
     Cmd.AddCommand("cvarlist", List_f);
 }
Example #19
0
        /**
         *
         */
        public static void Init()
        {
            for (var i = 0; i < 32; i++)
            {
                Globals.key_lines[i][0] = (byte)']';
                Globals.key_lines[i][1] = 0;
            }

            Globals.key_linepos = 1;

            //
            // init ascii characters in console mode
            //
            for (var i = 32; i < 128; i++)
            {
                Key.consolekeys[i] = true;
            }

            Key.consolekeys[Key.K_ENTER]         = true;
            Key.consolekeys[Key.K_KP_ENTER]      = true;
            Key.consolekeys[Key.K_TAB]           = true;
            Key.consolekeys[Key.K_LEFTARROW]     = true;
            Key.consolekeys[Key.K_KP_LEFTARROW]  = true;
            Key.consolekeys[Key.K_RIGHTARROW]    = true;
            Key.consolekeys[Key.K_KP_RIGHTARROW] = true;
            Key.consolekeys[Key.K_UPARROW]       = true;
            Key.consolekeys[Key.K_KP_UPARROW]    = true;
            Key.consolekeys[Key.K_DOWNARROW]     = true;
            Key.consolekeys[Key.K_KP_DOWNARROW]  = true;
            Key.consolekeys[Key.K_BACKSPACE]     = true;
            Key.consolekeys[Key.K_HOME]          = true;
            Key.consolekeys[Key.K_KP_HOME]       = true;
            Key.consolekeys[Key.K_END]           = true;
            Key.consolekeys[Key.K_KP_END]        = true;
            Key.consolekeys[Key.K_PGUP]          = true;
            Key.consolekeys[Key.K_KP_PGUP]       = true;
            Key.consolekeys[Key.K_PGDN]          = true;
            Key.consolekeys[Key.K_KP_PGDN]       = true;
            Key.consolekeys[Key.K_SHIFT]         = true;
            Key.consolekeys[Key.K_INS]           = true;
            Key.consolekeys[Key.K_KP_INS]        = true;
            Key.consolekeys[Key.K_KP_DEL]        = true;
            Key.consolekeys[Key.K_KP_SLASH]      = true;
            Key.consolekeys[Key.K_KP_PLUS]       = true;
            Key.consolekeys[Key.K_KP_MINUS]      = true;
            Key.consolekeys[Key.K_KP_5]          = true;
            Key.consolekeys['`'] = false;
            Key.consolekeys['~'] = false;

            //		for (int i = 0; i < 256; i++)
            //			keyshift[i] = i;
            //		for (int i = 'a'; i <= 'z'; i++)
            //			keyshift[i] = i - 'a' + 'A';
            //		keyshift['1'] = '!';
            //		keyshift['2'] = '@';
            //		keyshift['3'] = '#';
            //		keyshift['4'] = '$';
            //		keyshift['5'] = '%';
            //		keyshift['6'] = '^';
            //		keyshift['7'] = '&';
            //		keyshift['8'] = '*';
            //		keyshift['9'] = '(';
            //		keyshift['0'] = ')';
            //		keyshift['-'] = '_';
            //		keyshift['='] = '+';
            //		keyshift[','] = '<';
            //		keyshift['.'] = '>';
            //		keyshift['/'] = '?';
            //		keyshift[';'] = ':';
            //		keyshift['\''] = '"';
            //		keyshift['['] = '{';
            //		keyshift[']'] = '}';
            //		keyshift['`'] = '~';
            //		keyshift['\\'] = '|';
            Key.menubound[Key.K_ESCAPE] = true;

            for (var i = 0; i < 12; i++)
            {
                Key.menubound[Key.K_F1 + i] = true;
            }

            //
            // register our functions
            //
            Cmd.AddCommand("bind", Key.Bind_f);
            Cmd.AddCommand("unbind", Key.Unbind_f);
            Cmd.AddCommand("unbindall", Key.Unbindall_f);
            Cmd.AddCommand("bindlist", Key.Bindlist_f);
        }
Example #20
0
        /**
         * This function initializes the different subsystems of
         * the game engine. The setjmp/longjmp mechanism of the original
         * was replaced with exceptions.
         * @param args the original unmodified command line arguments
         */
        public static void Init(string[] args)
        {
            try
            {
                // prepare enough of the subsystems to handle
                // cvar and command buffer management
                Com.InitArgv(args);

                Cbuf.Init();

                Cmd.Init();
                Cvar.Init();

                Key.Init();

                // we need to add the early commands twice, because
                // a basedir or cddir needs to be set before execing
                // config files, but we want other parms to override
                // the settings of the config files
                Cbuf.AddEarlyCommands(false);
                Cbuf.Execute();

                if (Globals.dedicated.value != 1.0f)
                {
                    Console.WriteLine("initializing filesystem...");
                }

                FS.InitFilesystem();

                if (Globals.dedicated.value != 1.0f)
                {
                    Console.WriteLine("loading config...");
                }

                Qcommon.reconfigure(false);

                FS.markBaseSearchPaths();                 // mark the default search paths

                Qcommon.reconfigure(true);                // reload default.cfg and config.cfg

                //
                // init commands and vars
                //
                Cmd.AddCommand("error", Com.Error_f);

                Globals.host_speeds    = Cvar.Get("host_speeds", "0", 0);
                Globals.log_stats      = Cvar.Get("log_stats", "0", 0);
                Globals.developer      = Cvar.Get("developer", "0", Defines.CVAR_ARCHIVE);
                Globals.timescale      = Cvar.Get("timescale", "0", 0);
                Globals.fixedtime      = Cvar.Get("fixedtime", "0", 0);
                Globals.logfile_active = Cvar.Get("logfile", "0", 0);
                Globals.showtrace      = Cvar.Get("showtrace", "0", 0);
                Globals.dedicated      = Cvar.Get("dedicated", "0", Defines.CVAR_NOSET);
                var s = Com.sprintf("%4.2f %s %s %s", Globals.VERSION, Qcommon.CPUSTRING, Globals.__DATE__, Qcommon.BUILDSTRING);

                Cvar.Get("version", s, Defines.CVAR_SERVERINFO | Defines.CVAR_NOSET);

                if (Globals.dedicated.value != 1.0f)
                {
                    Console.WriteLine("initializing network subsystem...");
                }

                NET.Init();                 //ok
                Netchan.Netchan_Init();     //ok

                if (Globals.dedicated.value != 1.0f)
                {
                    Console.WriteLine("initializing server subsystem...");
                }

                SV_MAIN.SV_Init();                 //ok

                if (Globals.dedicated.value != 1.0f)
                {
                    Console.WriteLine("initializing client subsystem...");
                }

                Cl.Init();

                // add + commands from command line
                if (!Cbuf.AddLateCommands())
                {
                    // if the user didn't give any commands, run default action
                    if (Globals.dedicated.value == 0)
                    {
                        Cbuf.AddText("d1\n");
                    }
                    else
                    {
                        Cbuf.AddText("dedicated_start\n");
                    }

                    Cbuf.Execute();
                }
                else
                {
                    // the user asked for something explicit
                    // so drop the loading plaque
                    SCR.EndLoadingPlaque();
                }

                Com.Printf("====== Quake2 Initialized ======\n\n");

                // save config when configuration is completed
                Cl.WriteConfiguration();
            }
            catch (Exception)
            {
                Sys.Error("Error during initialization");
            }
        }
Example #21
0
        public static void Init(String[] args)
        {
            try
            {
                Com.InitArgv(args);
                Cbuf.Init();
                Cmd.Init();
                Cvar.Init();
                Key.Init();
                Cbuf.AddEarlyCommands(false);
                Cbuf.Execute();
                if (Globals.dedicated.value != 1F)
                {
                    Program.Q2Dialog.SetStatus("initializing filesystem...");
                }
                FS.InitFilesystem();
                if (Globals.dedicated.value != 1F)
                {
                    Program.Q2Dialog.SetStatus("loading config...");
                }
                Reconfigure(false);
                FS.SetCDDir();
                FS.MarkBaseSearchPaths();
                if (Globals.dedicated.value != 1F)
                {
                    Program.Q2Dialog.TestQ2Data();
                }
                Reconfigure(true);
                Cmd.AddCommand("error", Com.Error_f);
                Globals.host_speeds    = Cvar.Get("host_speeds", "0", 0);
                Globals.log_stats      = Cvar.Get("log_stats", "0", 0);
                Globals.developer      = Cvar.Get("developer", "0", CVAR_ARCHIVE);
                Globals.timescale      = Cvar.Get("timescale", "0", 0);
                Globals.fixedtime      = Cvar.Get("fixedtime", "0", 0);
                Globals.logfile_active = Cvar.Get("logfile", "0", 0);
                Globals.showtrace      = Cvar.Get("showtrace", "0", 0);
                Globals.dedicated      = Cvar.Get("dedicated", "0", CVAR_NOSET);
                var s = Com.Sprintf("%4.2f %s %s %s", Globals.VERSION, CPUSTRING, Globals.__DATE__, BUILDSTRING);
                Cvar.Get("version", s, CVAR_SERVERINFO | CVAR_NOSET);
                if (Globals.dedicated.value != 1F)
                {
                    Program.Q2Dialog.SetStatus("initializing network subsystem...");
                }
                NET.Init();
                Netchan.Netchan_Init();
                if (Globals.dedicated.value != 1F)
                {
                    Program.Q2Dialog.SetStatus("initializing server subsystem...");
                }
                SV_MAIN.SV_Init();
                if (Globals.dedicated.value != 1F)
                {
                    Program.Q2Dialog.SetStatus("initializing client subsystem...");
                }
                CL.Init();
                if (!Cbuf.AddLateCommands())
                {
                    if (Globals.dedicated.value == 0)
                    {
                        Cbuf.AddText("d1\\n");
                    }
                    else
                    {
                        Cbuf.AddText("dedicated_start\\n");
                    }
                    Cbuf.Execute();
                }
                else
                {
                    SCR.EndLoadingPlaque();
                }

                Com.Printf("====== Quake2 Initialized ======\\n\\n");
                CL.WriteConfiguration();
                if (Globals.dedicated.value != 1F)
                {
                    Program.Q2Dialog.Dispose();
                }
            }
            catch (longjmpException e)
            {
                CoreSys.Error("Error during initialization");
            }
        }