Пример #1
0
        /// <summary>
        /// R_Init
        /// </summary>
        public void Initialise( )
        {
            for (var i = 0; i < _Frustum.Length; i++)
            {
                _Frustum[i] = new Plane( );
            }

            Host.Commands.Add("timerefresh", TimeRefresh_f);
            //Cmd.Add("envmap", Envmap_f);
            //Cmd.Add("pointfile", ReadPointFile_f);

            InitialiseClientVariables();

            Particles.InitParticles( );
            Particles.InitParticleTexture( );

            // reserve 16 textures
            PlayerTextures = new BaseTexture[16];

            for (var i = 0; i < PlayerTextures.Length; i++)
            {
                PlayerTextures[i] = BaseTexture.FromDynamicBuffer(Host.Video.Device, "_PlayerTexture{i}", new ByteArraySegment(new Byte[512 * 256 * 4]), 512, 256, false, false);
            }

            TextureChains = new TextureChains();
            Occlusion     = new Occlusion(Host, TextureChains);
        }
Пример #2
0
        /// <summary>
        /// R_Init
        /// </summary>
        public void Initialise( )
        {
            for (var i = 0; i < _Frustum.Length; i++)
            {
                _Frustum[i] = new Plane( );
            }

            Host.Commands.Add("timerefresh", TimeRefresh_f);
            //Cmd.Add("envmap", Envmap_f);
            //Cmd.Add("pointfile", ReadPointFile_f);

            if (Host.Cvars.NoRefresh == null)
            {
                Host.Cvars.NoRefresh     = Host.CVars.Add("r_norefresh", false);
                Host.Cvars.DrawEntities  = Host.CVars.Add("r_drawentities", true);
                Host.Cvars.DrawViewModel = Host.CVars.Add("r_drawviewmodel", true);
                Host.Cvars.Speeds        = Host.CVars.Add("r_speeds", false);
                Host.Cvars.FullBright    = Host.CVars.Add("r_fullbright", false);
                Host.Cvars.LightMap      = Host.CVars.Add("r_lightmap", false);
                Host.Cvars.Shadows       = Host.CVars.Add("r_shadows", false);
                //_MirrorAlpha = Host.CVars.Add( "r_mirroralpha", "1" );
                Host.Cvars.WaterAlpha = Host.CVars.Add("r_wateralpha", 1f);
                Host.Cvars.Dynamic    = Host.CVars.Add("r_dynamic", true);
                Host.Cvars.NoVis      = Host.CVars.Add("r_novis", false);

                Host.Cvars.glFinish           = Host.CVars.Add("gl_finish", false);
                Host.Cvars.glClear            = Host.CVars.Add("gl_clear", 0f);
                Host.Cvars.glCull             = Host.CVars.Add("gl_cull", true);
                Host.Cvars.glTexSort          = Host.CVars.Add("gl_texsort", true);
                Host.Cvars.glSmoothModels     = Host.CVars.Add("gl_smoothmodels", true);
                Host.Cvars.glAffineModels     = Host.CVars.Add("gl_affinemodels", false);
                Host.Cvars.glPolyBlend        = Host.CVars.Add("gl_polyblend", true);
                Host.Cvars.glFlashBlend       = Host.CVars.Add("gl_flashblend", true);
                Host.Cvars.glPlayerMip        = Host.CVars.Add("gl_playermip", 0);
                Host.Cvars.glNoColors         = Host.CVars.Add("gl_nocolors", false);
                Host.Cvars.glKeepTJunctions   = Host.CVars.Add("gl_keeptjunctions", false);
                Host.Cvars.glReportTJunctions = Host.CVars.Add("gl_reporttjunctions", false);
                Host.Cvars.glDoubleEyes       = Host.CVars.Add("gl_doubleeys", true);
            }

            if (Host.Video.Device.Desc.SupportsMultiTexture)
            {
                Host.CVars.Set("gl_texsort", 0.0f);
            }

            Particles.InitParticles( );
            Particles.InitParticleTexture( );

            // reserve 16 textures
            PlayerTextures = new BaseTexture[16];

            for (var i = 0; i < PlayerTextures.Length; i++)
            {
                PlayerTextures[i] = BaseTexture.FromDynamicBuffer(Host.Video.Device, "_PlayerTexture{i}", new ByteArraySegment(new Byte[512 * 256 * 4]), 512, 256, false, false);
            }

            TextureChains = new TextureChains();
            Occlusion     = new Occlusion(Host, TextureChains);
        }