Exemple #1
0
        internal static void Render(bool allowextras = true)
        {
            screen.Clear();
            _fbcache.Clear();

            camDir = game.game.GetLocalPlayer().dir;
            float fov = player.cvarFov.Valuef() / 100;

            camPlane.x = camDir.y * (fov * 1.33f);
            camPlane.y = -camDir.x * (fov * 1.33f);

            sb           = cache.GetTexture(world.skybox);
            centersprite = new screensprite {
                dist = -1
            };

            DrawWorld((int)DispHeight);
            world.RefreshSprites();
            DrawSprites((int)engine.SCREEN_HEIGHT);
            PostProcess();

            var velocity = new vector(0, 0);

            if (!ReferenceEquals(null, _plast))
            {
                velocity = world.Player.pos - _plast;
            }
            world.Player.weapon.Draw(velocity);

            _plast = world.Player.pos;
        }
Exemple #2
0
        public static texture ReadImage(ref BinaryReader r, uint w, uint h)
        {
            texture t = new texture(w, h);

            for (int i = 0; i < w * h; i++)
            {
                uint x = (uint)(i % w);
                uint y = (uint)(i / w);
                t.SetPixel(x, y, Color.FromArgb(r.ReadByte(), r.ReadByte(), r.ReadByte()));
            }

            return(t);
        }
Exemple #3
0
 public static void DrawStencil(texture tex, int sx, int sy, int w, int h, Color c)
 {
     for (var x = 0; x < w; x++)
     {
         for (var y = 0; y < h; y++)
         {
             if (c != renderer.magicpink && IsOnScreen(x + sx, y + sy))
             {
                 screen.SetPixel((uint)(x + sx), (uint)(y + sy), c);
             }
         }
     }
 }
Exemple #4
0
 public static void DrawTexture(texture tex, int sx, int sy, int w, int h)
 {
     for (var x = 0; x < w; x++)
     {
         for (var y = 0; y < h; y++)
         {
             var c = tex.GetPixel((uint)x, (uint)y);
             if (c != renderer.magicpink && IsOnScreen(x + sx, y + sy))
             {
                 screen.SetPixel((uint)(x + sx), (uint)(y + sy), c);
             }
         }
     }
 }
Exemple #5
0
 public static void Init()
 {
     font = new texture("gui/font");
 }
Exemple #6
0
 public static void DrawTexture(texture tex, int sx, int sy)
 {
     DrawTexture(tex, sx, sy, (int)tex.Width, (int)tex.Height);
 }