Exemplo n.º 1
0
 protected internal override void OnDispose()
 {
     this.VCPool.ReleaseInstance(this.m_vCache);
     this.m_vCache = (VertexCache)null;
     this.VCPool.ReleaseInstance(this.m_vCacheDouble);
     this.m_vCacheDouble = (VertexCache)null;
 }
Exemplo n.º 2
0
 public void ReleaseInstance(VertexCache vc)
 {
     if (vc == null)
     {
         return;
     }
     this.m_Queue.Enqueue(vc);
 }
Exemplo n.º 3
0
 public void Draw(int x, int y)
 {
     if (this.m_vCache == null)
     {
         this.m_vCache = this.VCPool.GetInstance();
     }
     this.m_vCache.Draw(this.m_Image, x, y);
 }
Exemplo n.º 4
0
 public CursorEntry(int graphic, int type, int xOffset, int yOffset, Texture image)
 {
     this.m_Graphic = graphic;
     this.m_Type    = type;
     this.m_xOffset = xOffset;
     this.m_yOffset = yOffset;
     this.m_Image   = image;
     this.m_Draw    = this.m_Image != null && !this.m_Image.IsEmpty();
     this.m_vCache  = new VertexCache();
 }
Exemplo n.º 5
0
 public void DrawGame(Texture t, int x, int y, int color)
 {
     if (this.m_vCache == null)
     {
         this.m_vCache = new VertexCache();
     }
     if (this.m_tPool != t)
     {
         this.m_tPool = t;
         this.m_vCache.Invalidate();
     }
     this.m_vCache.DrawGame(t, x, y, color);
 }
Exemplo n.º 6
0
 public void Draw(Texture t, int x, int y)
 {
     if (this.m_vCache == null)
     {
         this.m_vCache = new VertexCache();
     }
     if (this.m_tPool != t)
     {
         this.m_tPool = t;
         this.m_vCache.Invalidate();
     }
     this.m_vCache.Draw(t, x, y);
 }
Exemplo n.º 7
0
 protected internal override void Draw(int x, int y)
 {
     if (!this.m_Draw[this.m_State])
     {
         return;
     }
     Renderer.PushAlpha(this.m_fAlpha);
     if (this.m_vCache == null)
     {
         this.m_vCache = this.VCPool.GetInstance();
     }
     this.m_vCache.Draw(this.m_Gump[this.m_State], x, y);
     Renderer.PopAlpha();
 }
Exemplo n.º 8
0
 protected internal override void Draw(int x, int y)
 {
   if (!this.m_Draw[this.m_State])
     return;
   if (this.m_Clipper != null)
   {
     this.m_Images[this.m_State].DrawClipped(x, y, this.m_Clipper);
   }
   else
   {
     if (this.m_vCache == null)
       this.m_vCache = this.VCPool.GetInstance();
     this.m_vCache.Draw(this.m_Images[this.m_State], x, y);
   }
 }
Exemplo n.º 9
0
 public GMouseRouter(int GumpID, IHue Hue, int X, int Y, Gump Target)
     : base(X, Y)
 {
     this.m_vCache = new VertexCache();
     this.m_Target = Target;
     this.m_GumpID = GumpID;
     this.m_Gump   = Hue.GetGump(this.m_GumpID);
     if (this.m_Gump == null || this.m_Gump.IsEmpty())
     {
         return;
     }
     this.m_Width  = this.m_Gump.Width;
     this.m_Height = this.m_Gump.Height;
     this.m_Draw   = true;
 }
Exemplo n.º 10
0
        public VertexCache GetInstance()
        {
            VertexCache vertexCache;

            if (this.m_Queue.Count > 0)
            {
                vertexCache = this.m_Queue.Dequeue();
                vertexCache.Invalidate();
            }
            else
            {
                vertexCache = new VertexCache();
            }
            return(vertexCache);
        }
Exemplo n.º 11
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Invalidated)
     {
         this.Refresh();
     }
     if (!this.m_Draw)
     {
         return;
     }
     if (this.m_vCache == null)
     {
         this.m_vCache = this.VCPool.GetInstance();
     }
     this.m_vCache.Draw(this.m_Image, x, y);
 }
Exemplo n.º 12
0
 public GSlider(int SliderID, IHue Hue, int X, int Y, int Width, int Height, double Value, double Start, double End, double Increase)
     : base(X, Y)
 {
     this.m_vCache   = new VertexCache();
     this.m_Width    = Width;
     this.m_Height   = Height;
     this.m_Start    = Start;
     this.m_End      = End;
     this.m_Increase = Increase;
     this.m_Gump     = Hue.GetGump(SliderID);
     if (this.m_Gump != null && !this.m_Gump.IsEmpty())
     {
         this.m_HalfWidth = this.m_Gump.Width / 2;
         this.m_yOffset   = (this.m_Height - this.m_Gump.Height) / 2;
         this.m_Draw      = true;
     }
     this.SetValue(Value, false);
 }
Exemplo n.º 13
0
 public GDragable(int GumpID, IHue Hue, int X, int Y)
     : base(X, Y)
 {
     this.m_vCache    = new VertexCache();
     this.m_GumpID    = GumpID;
     this.m_Hue       = Hue;
     this.m_CanDrag   = true;
     this.m_QuickDrag = true;
     this.m_Dockers   = new ArrayList();
     this.m_Linked    = new ArrayList();
     this.m_Gump      = Hue.GetGump(GumpID);
     if (this.m_Gump == null || this.m_Gump.IsEmpty())
     {
         return;
     }
     this.m_Width  = this.m_Gump.Width;
     this.m_Height = this.m_Gump.Height;
     this.m_Draw   = true;
 }
Exemplo n.º 14
0
 protected internal override void Draw(int x, int y)
 {
     if (!this.m_Draw)
     {
         return;
     }
     this.m_vCache.Draw(this.m_Image, x, y);
     if (this.m_Double)
     {
         if (this.m_vCacheDouble == null)
         {
             this.m_vCacheDouble = new VertexCache();
         }
         this.m_vCacheDouble.Draw(this.m_Image, x + 5, y + 5);
     }
     this.m_Item.MessageX     = this.X + this.m_xOffset;
     this.m_Item.MessageY     = this.Y + this.m_yOffset;
     this.m_Item.BottomY      = this.Y + this.m_Image.yMax;
     this.m_Item.MessageFrame = Renderer.m_ActFrames;
 }
Exemplo n.º 15
0
        public GDraggedItem(Item item)
            : base(0, 0)
        {
            this.m_vCache = new VertexCache();
            this.m_Item   = item;
            int index = this.m_Item.ID & 16383;
            int num1  = (int)(ushort)this.m_Item.Amount;

            this.m_Double = Map.m_ItemFlags[index][(TileFlag)2048L] && num1 > 1;
            if (index >= 3818 && index <= 3826)
            {
                int num2 = (index - 3818) / 3 * 3 + 3818;
                this.m_Double = false;
                index         = num1 > 1 ? (num1 < 2 || num1 > 5 ? num2 + 2 : num2 + 1) : num2;
            }
            this.m_Hue   = Hues.GetItemHue(index, (int)this.m_Item.Hue);
            this.m_Image = this.m_Hue.GetItem(index);
            if (this.m_Image != null && !this.m_Image.IsEmpty())
            {
                this.m_Draw   = true;
                this.m_Width  = this.m_Image.Width;
                this.m_Height = this.m_Image.Height;
                int num2 = this.m_Double ? 6 : 1;
                this.m_xOffset = this.m_OffsetX = this.m_Image.xMin + (this.m_Image.xMax - this.m_Image.xMin + num2) / 2;
                this.m_yOffset = this.m_Image.yMin;
                this.m_OffsetY = this.m_yOffset + (this.m_Image.yMax - this.m_Image.yMin + num2) / 2;
                if (this.m_Double)
                {
                    this.m_Width  += 5;
                    this.m_Height += 5;
                }
            }
            this.m_DragCursor = false;
            this.m_CanDrag    = true;
            this.m_QuickDrag  = true;
            this.m_IsDragging = true;
            Gumps.Drag        = (Gump)this;
            Gumps.LastOver    = (Gump)this;
            this.m_X          = Engine.m_xMouse - this.m_OffsetX;
            this.m_Y          = Engine.m_yMouse - this.m_OffsetY;
        }
Exemplo n.º 16
0
 protected internal override void Draw(int X, int Y)
 {
     if (!this.m_Draw)
     {
         return;
     }
     if (this.m_vCache == null)
     {
         this.m_vCache = this.VCPool.GetInstance();
     }
     this.m_vCache.Draw(this.m_Image, X, Y);
     if (this.m_Double)
     {
         if (this.m_vCacheDouble == null)
         {
             this.m_vCacheDouble = this.VCPool.GetInstance();
         }
         this.m_vCacheDouble.Draw(this.m_Image, X + 5, Y + 5);
     }
     this.m_Item.MessageX     = X + this.m_xOffset;
     this.m_Item.MessageY     = Y + this.m_yOffset;
     this.m_Item.BottomY      = Y + this.m_Image.yMax;
     this.m_Item.MessageFrame = Renderer.m_ActFrames;
 }
Exemplo n.º 17
0
 public LightningEffect(IHue Hue)
 {
     this.m_vCache   = new VertexCache();
     this.m_Children = new EffectList();
     this.m_Hue      = Hue;
 }
Exemplo n.º 18
0
        protected internal override void Draw(int x, int y)
        {
            Renderer.SetTexture((Texture)null);
            int num = 0;

            switch (this.m_Style)
            {
            case WindowsButtonStyle.Normal:
                switch (this.m_State)
                {
                case 0:
                    GumpPaint.DrawRaised3D(x, y, this.m_Width, this.m_Height);
                    this.CaptionDown = false;
                    break;

                case 1:
                    GumpPaint.DrawRaised3D(x, y, this.m_Width, this.m_Height);
                    this.CaptionDown = false;
                    break;

                case 2:
                    GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDark, GumpColors.Control);
                    this.CaptionDown = true;
                    num = 1;
                    break;
                }
                break;

            case WindowsButtonStyle.Flat:
                switch (this.m_State)
                {
                case 0:
                    GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpColors.Control);
                    this.CaptionDown = false;
                    break;

                case 1:
                    GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpColors.ControlAlternate);
                    this.CaptionDown = false;
                    break;

                case 2:
                    GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpPaint.Blend(GumpColors.ControlAlternate, GumpColors.ControlLightLight, 128));
                    this.CaptionDown = false;
                    break;
                }
                break;
            }
            if (this.m_Image == null)
            {
                return;
            }
            if (this.m_vCache == null)
            {
                this.m_vCache = new VertexCache();
            }
            if (this.m_ImageColor == -1)
            {
                this.m_vCache.Draw(this.m_Image, num + x + (this.m_Width - (this.m_Image.xMax - this.m_Image.xMin + 1)) / 2 - this.m_Image.xMin, num + y + (this.m_Height - (this.m_Image.yMax - this.m_Image.yMin + 1)) / 2 - this.m_Image.yMin);
            }
            else
            {
                this.m_vCache.Draw(this.m_Image, num + x + (this.m_Width - (this.m_Image.xMax - this.m_Image.xMin + 1)) / 2 - this.m_Image.xMin, num + y + (this.m_Height - (this.m_Image.yMax - this.m_Image.yMin + 1)) / 2 - this.m_Image.yMin, this.m_ImageColor);
            }
        }
Exemplo n.º 19
0
 public void OnRemove()
 {
     this.VCPool.ReleaseInstance(this.m_vCache);
     this.m_vCache = (VertexCache)null;
 }