Ejemplo n.º 1
0
        /*
         * ====================
         * Host_Init
         * ====================
         */
        public static void Host_Init(quakedef.quakeparms_t parms)
        {
            if (common.standard_quake)
            {
                minimum_memory = quakedef.MINIMUM_MEMORY;
            }
            else
            {
                minimum_memory = quakedef.MINIMUM_MEMORY_LEVELPAK;
            }

            cmd.Cbuf_Init();
            cmd.Cmd_Init();
            view.V_Init();
            chase.Chase_Init();
            Host_InitVCR(parms);
            common.COM_Init(null);
            Host_InitLocal();
            wad.W_LoadWadFile("gfx.wad");
            keys.Key_Init();
            console.Con_Init();
            prog.PR_Init();
            menu.M_Init();
            model.Mod_Init();
            net.NET_Init();
            server.SV_Init();

            render.R_InitTextures();            // needed even for dedicated servers

            host_basepal = common.COM_LoadHunkFile("gfx/palette.lmp");
            if (host_basepal == null)
            {
                sys_linux.Sys_Error("Couldn't load gfx/palette.lmp");
            }
            host_colormap = common.COM_LoadHunkFile("gfx/colormap.lmp");
            if (host_colormap == null)
            {
                sys_linux.Sys_Error("Couldn't load gfx/colormap.lmp");
            }

            // on non win32, mouse comes before video for security reasons
            //IN_Init ();
            vid.VID_Init(host_basepal);

            draw.Draw_Init();
            screen.SCR_Init();
            render.R_Init();
            // on Win32, sound initialization has to come before video initialization, so we
            // can put up a popup if the sound hardware is in use
            sound.S_Init();
            //CDAudio_Init ();
            sbar.Sbar_Init();
            client.CL_Init();

            cmd.Cbuf_InsertText("exec quake.rc\n");

            host_initialized = true;
        }
Ejemplo n.º 2
0
        public static int main(int c, string[] v)
        {
            double		            time, oldtime, newtime;
            quakedef.quakeparms_t   parms = new quakedef.quakeparms_t();
            int j;

            //COM_InitArgv(c, v);
            //parms.argc = com_argc;
            //parms.argv = com_argv;

            parms.memsize = 8*1024*1024;

            parms.basedir = basedir;

            host.Host_Init(parms);

            Sys_Init();

            if (common.COM_CheckParm("-nostdout") != 0)
                nostdout = 1;
            else {
                Debug.WriteLine("Linux Quake -- Version " + quakedef.LINUX_VERSION);
            }

            //cmd.Cbuf_InsertText("menu_main\n");
            return 0;

            oldtime = Sys_FloatTime () - 0.1;
            while (true)
            {
            // find time spent rendering last frame
                newtime = Sys_FloatTime ();
                time = newtime - oldtime;

                /*if (cls.state == ca_dedicated)
                {   // play vcrfiles at max speed
                    if (time < sys_ticrate.value && (vcrFile == -1 || recording) )
                    {
                        usleep(1);
                        continue;       // not time to run a server only tic yet
                    }
                    time = sys_ticrate.value;
                }*/

                /*if (time > sys_ticrate.value*2)
                    oldtime = newtime;
                else
                    oldtime += time;*/

                host.Host_Frame (time);

            // graphic debugging aids
                if (sys_linerefresh.value != 0)
                    Sys_LineRefresh ();

                Thread.Sleep(200);
            }
        }
Ejemplo n.º 3
0
        // "VCR1"

        static void Host_InitVCR(quakedef.quakeparms_t parms)
        {
            int i, len, n;

            if (common.COM_CheckParm("-playback") != 0)
            {
            }

            if ((n = common.COM_CheckParm("-record")) != 0)
            {
            }
        }
Ejemplo n.º 4
0
        public static int main(int c, string[] v)
        {
            double time, oldtime, newtime;

            quakedef.quakeparms_t parms = new quakedef.quakeparms_t();
            int j;

            //COM_InitArgv(c, v);
            //parms.argc = com_argc;
            //parms.argv = com_argv;

            parms.memsize = 8 * 1024 * 1024;

            parms.basedir = basedir;

            host.Host_Init(parms);

            Sys_Init();

            if (common.COM_CheckParm("-nostdout") != 0)
            {
                nostdout = 1;
            }
            else
            {
                Debug.WriteLine("Linux Quake -- Version " + quakedef.LINUX_VERSION);
            }

            //cmd.Cbuf_InsertText("menu_main\n");
            return(0);

            oldtime = Sys_FloatTime() - 0.1;
            while (true)
            {
                // find time spent rendering last frame
                newtime = Sys_FloatTime();
                time    = newtime - oldtime;

                /*if (cls.state == ca_dedicated)
                 * {   // play vcrfiles at max speed
                 *  if (time < sys_ticrate.value && (vcrFile == -1 || recording) )
                 *  {
                 *                      usleep(1);
                 *      continue;       // not time to run a server only tic yet
                 *  }
                 *  time = sys_ticrate.value;
                 * }*/

                /*if (time > sys_ticrate.value*2)
                 *  oldtime = newtime;
                 * else
                 *  oldtime += time;*/

                host.Host_Frame(time);

                // graphic debugging aids
                if (sys_linerefresh.value != 0)
                {
                    Sys_LineRefresh();
                }

                Thread.Sleep(200);
            }
        }