Beispiel #1
0
        ///////////

        public void DrawHologram(SpriteBatch sb, Vector2 wldPos, bool isUI)
        {
            switch (this.Mode)
            {
            case HologramMode.NPC:
                Main.instance.LoadNPC(this.Type);
                break;

            case HologramMode.Projectile:
                Main.instance.LoadProjectile(this.Type);
                break;

            case HologramMode.Gore:
                Main.instance.LoadGore(this.Type);
                break;
            }

            Texture2D tex         = HologramDefinition.GetTexture(this.Mode, this.Type);
            var       frameCount  = HologramDefinition.GetFrameCount(this.Mode, this.Type);
            var       frameHeight = tex.Height / frameCount;


            try
            {
                switch (this.ShaderMode)
                {
                case HologramShaderMode.None:
                    this.BeginBatch(sb, null);
                    break;

                case HologramShaderMode.Vanilla:
                    this.BeginBatch(sb, null);
                    this.VanillaShaderBegin(tex, frameHeight);
                    break;

                case HologramShaderMode.Custom:
                    this.BeginBatch(sb, this.CustomEffectsBegin(tex));
                    this.CustomEffectsBegin(tex);
                    break;
                }

                this.DrawHologramRaw(sb, wldPos, isUI, tex, frameHeight);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            } finally {
                if (this.ShaderMode != HologramShaderMode.None)
                {
                    this.BatchEnd(sb);
                }
            }
        }