Ejemplo n.º 1
0
 public void SetClipper(Clipper c)
 {
     base.Clipper = c;
     this.m_Label.Clipper = c;
     for (int i = 0; i < this.m_Entries.Length; i++)
     {
         this.m_Entries[i].SetClipper(c);
     }
 }
Ejemplo n.º 2
0
 protected internal override void Draw(int x, int y)
 {
     base.Draw(x, y);
     if ((this.m_xLast != x) || (this.m_yLast != y))
     {
         this.m_xLast = x;
         this.m_yLast = y;
         Clipper clipper = new Clipper(x + base.OffsetX, y + base.OffsetY, base.UseWidth, base.UseHeight);
         for (int i = 0; i < this.m_Entries.Length; i++)
         {
             this.m_Entries[i].Clipper = clipper;
         }
     }
 }
Ejemplo n.º 3
0
 protected internal override void Draw(int x, int y)
 {
     base.Draw(x, y);
     if ((this.m_xLast != x) || (this.m_yLast != y))
     {
         Clipper clipper = new Clipper(x + base.OffsetX, y + base.OffsetY, base.UseWidth, base.UseHeight);
         Gump[] gumpArray = base.m_Children.ToArray();
         for (int i = 0; i < gumpArray.Length; i++)
         {
             GServerEntry entry = gumpArray[i] as GServerEntry;
             if (entry != null)
             {
                 entry.Clipper = clipper;
             }
         }
     }
 }
Ejemplo n.º 4
0
 public GQuickHues(GHuePicker Picker, GBrightnessBar Brightness, GFlatButton Okay)
     : base(3, 0x57, 0x76, 20)
 {
     this.m_CompactHeight = 20;
     this.m_ExpandedHeight = Engine.GameHeight / 2;
     this.m_Picker = Picker;
     this.m_Brightness = Brightness;
     this.m_Okay = Okay;
     base.m_CanDrag = false;
     this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0);
     GLabel toAdd = new GLabel("Quick Hues", Engine.GetUniFont(0), Hues.Default, 2, 2);
     this.Height = 20;
     this.m_CompactHeight = base.m_Height;
     base.m_Children.Add(toAdd);
     toAdd.Center();
     QuickHues.Load();
     int count = QuickHues.Entries.Count;
     int num2 = 0x16;
     Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2);
     GTextButton button = new GTextButton("Create new..", Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 2, 2, new OnClick(this.Add_OnClick));
     base.m_Children.Add(button);
     button.Center();
     button.Y = num2;
     button.Scissor(clipper);
     num2 += button.Height;
     OnClick onClick = new OnClick(this.Entry_OnClick);
     OnHighlight highlight = new OnHighlight(this.Entry_OnHighlight);
     for (int i = 0; i < count; i++)
     {
         QuickHueEntry entry = (QuickHueEntry) QuickHues.Entries[i];
         GTextButton button2 = new GTextButton(entry.Name, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick);
         base.m_Children.Add(button2);
         button2.Center();
         button2.Y = num2;
         button2.Scissor(clipper);
         button2.SetTag("HueID", entry.Hue);
         button2.SetTag("Index", i);
         num2 += button2.Height;
         button2.OnHighlight = highlight;
         button2.Tooltip = new Tooltip(string.Format("0x{0:X}", entry.Hue));
     }
     num2 += 2;
     this.m_ExpandedHeight = num2;
 }
Ejemplo n.º 5
0
 protected internal override void Draw(int X, int Y)
 {
     if ((X != this.m_xLast) || (Y != this.m_yLast))
     {
         this.m_xLast = X;
         this.m_yLast = Y;
         Clipper clipper = new Clipper(X + 1, Y + 1, base.m_Width - 0x10, base.m_Height - 2);
         for (int i = 0; i < 0x100; i++)
         {
             if (m_Labels[i] != null)
             {
                 m_Labels[i].Scissor(clipper);
             }
             if (m_Values[i] != null)
             {
                 m_Values[i].Scissor(clipper);
             }
         }
     }
     base.Draw(X, Y);
 }
Ejemplo n.º 6
0
 protected internal override void Draw(int X, int Y)
 {
     this.m_LastX = X;
     if (Y != this.m_LastY)
     {
         this.m_LastY = Y;
         Clipper clipper = new Clipper(this.m_LastX + 1, this.m_LastY + 1, base.m_Width - 2, base.m_Height - 2);
         Gump[] gumpArray = base.m_Children.ToArray();
         for (int i = 1; i < gumpArray.Length; i++)
         {
             ((GTextButton) gumpArray[i]).Scissor(clipper);
         }
     }
     if ((Gumps.LastOver != null) && Gumps.LastOver.IsChildOf(this))
     {
         if (!this.m_Expanded && !this.m_Expanding)
         {
             this.m_From = this.Height;
             this.m_To = this.m_ExpandedHeight;
             this.m_Sync = new TimeSync(0.10000000149011612);
             this.m_Timer.Start(false);
             this.m_Expanded = false;
             this.m_Expanding = true;
             this.m_Compacted = false;
             this.m_Compacting = false;
         }
     }
     else if (!this.m_Compacted && !this.m_Compacting)
     {
         this.m_From = this.Height;
         this.m_To = this.m_CompactHeight;
         this.m_Sync = new TimeSync(0.10000000149011612);
         this.m_Timer.Start(false);
         this.m_Expanded = false;
         this.m_Expanding = false;
         this.m_Compacted = false;
         this.m_Compacting = true;
     }
     Renderer.SetTexture(null);
     Renderer.SetAlphaEnable(true);
     Renderer.AlphaTestEnable = false;
     Renderer.SetAlpha(0.5f);
     Renderer.DrawLine(X + 20, (Y + this.m_CompactHeight) - 1, (X + base.m_Width) - 20, (Y + this.m_CompactHeight) - 1);
     Renderer.SetAlphaEnable(false);
     Renderer.AlphaTestEnable = true;
     base.Draw(X, Y);
 }
Ejemplo n.º 7
0
 public void Scissor(Clipper c)
 {
     this.m_Clipper = c;
 }
Ejemplo n.º 8
0
 public static unsafe void DrawUnsafe()
 {
     if ((Engine.m_Device != null) && Validate())
     {
         Stats.Reset();
         Engine.m_Device.Clear(3, Color.Black, 1f, 0);
         Queue toUpdateQueue = m_ToUpdateQueue;
         if (toUpdateQueue == null)
         {
             toUpdateQueue = m_ToUpdateQueue = new Queue();
         }
         else if (toUpdateQueue.Count > 0)
         {
             toUpdateQueue.Clear();
         }
         Mobile mobile = null;
         Engine.m_Device.BeginScene();
         try
         {
             int num = 0;
             int num2 = 0;
             int num3 = 0;
             bool preserveHue = false;
             bool flag2 = false;
             m_xWorld = m_yWorld = m_zWorld = 0;
             Mobile player = World.Player;
             if (player != null)
             {
                 preserveHue = player.Ghost;
                 flag2 = player.Flags[MobileFlag.Warmode];
                 m_xWorld = num = player.X;
                 m_yWorld = num2 = player.Y;
                 m_zWorld = num3 = player.Z;
             }
             m_Dead = preserveHue;
             m_xScroll = 0;
             m_yScroll = 0;
             ArrayList textToDrawList = m_TextToDrawList;
             if (textToDrawList == null)
             {
                 textToDrawList = m_TextToDrawList = new ArrayList();
             }
             else if (textToDrawList.Count > 0)
             {
                 textToDrawList.Clear();
             }
             m_TextToDraw = textToDrawList;
             Queue miniHealthQueue = m_MiniHealthQueue;
             if (miniHealthQueue == null)
             {
                 miniHealthQueue = m_MiniHealthQueue = new Queue();
             }
             else if (miniHealthQueue.Count > 0)
             {
                 miniHealthQueue.Clear();
             }
             eOffsetX = 0;
             eOffsetY = 0;
             if (Engine.m_Ingame)
             {
                 if (GDesktopBorder.Instance != null)
                 {
                     GDesktopBorder.Instance.DoRender();
                 }
                 SetViewport(Engine.GameX, Engine.GameY, Engine.GameWidth, Engine.GameHeight);
                 if (m_VertexPool == null)
                 {
                     m_VertexPool = new CustomVertex.TransformedColoredTextured[cellWidth][][];
                     for (int m = 0; m < cellWidth; m++)
                     {
                         m_VertexPool[m] = new CustomVertex.TransformedColoredTextured[cellHeight][];
                         for (int n = 0; n < cellHeight; n++)
                         {
                             m_VertexPool[m][n] = VertexConstructor.Create();
                         }
                     }
                 }
                 Map.Lock();
                 MapPackage package = Map.GetMap((num >> 3) - (blockWidth >> 1), (num2 >> 3) - (blockHeight >> 1), blockWidth, blockHeight);
                 int num6 = ((num >> 3) - (blockWidth >> 1)) << 3;
                 int num7 = ((num2 >> 3) - (blockHeight >> 1)) << 3;
                 ArrayList[,] cells = package.cells;
                 LandTile[,] landTiles = package.landTiles;
                 byte[,] buffer = package.flags;
                 int[,] colorMap = package.colorMap;
                 int num8 = num & 7;
                 int num9 = num2 & 7;
                 int num10 = ((blockWidth / 2) * 8) + num8;
                 int num11 = ((blockHeight / 2) * 8) + num9;
                 int num12 = 0;
                 int num13 = 0;
                 num12 = Engine.GameWidth >> 1;
                 num12 -= 0x16;
                 num12 += (4 - num8) * 0x16;
                 num12 -= (4 - num9) * 0x16;
                 num13 += (4 - num8) * 0x16;
                 num13 += (4 - num9) * 0x16;
                 num13 += num3 << 2;
                 num13 += ((((Engine.GameHeight >> 1) - ((num10 + num11) * 0x16)) - ((4 - num9) * 0x16)) - ((4 - num8) * 0x16)) - 0x16;
                 num12--;
                 num13--;
                 num12 += Engine.GameX;
                 num13 += Engine.GameY;
                 Mobile mobile3 = World.Player;
                 bool flag3 = false;
                 m_xScroll = m_yScroll = 0;
                 if ((player != null) && (player.Walking.Count > 0))
                 {
                     WalkAnimation animation = (WalkAnimation) player.Walking.Peek();
                     int xOffset = 0;
                     int yOffset = 0;
                     int fOffset = 0;
                     if (!animation.Snapshot(ref xOffset, ref yOffset, ref fOffset))
                     {
                         if (!animation.Advance)
                         {
                             xOffset = animation.xOffset;
                             yOffset = animation.yOffset;
                         }
                         else
                         {
                             xOffset = 0;
                             yOffset = 0;
                         }
                     }
                     num12 -= xOffset;
                     num13 -= yOffset;
                     m_xScroll = xOffset;
                     m_yScroll = yOffset;
                 }
                 if (Engine.m_Quake)
                 {
                     Random random = new Random();
                     num12 += -2 + random.Next(5);
                     num13 += -2 + random.Next(5);
                 }
                 bool flag4 = (((!m_Invalidate && !Engine.m_Quake) && ((m_CharX == num) && (m_CharY == num2))) && (((m_CharZ == num3) && (m_WasDead == preserveHue)) && (m_xBaseLast == num12))) && (m_yBaseLast == num13);
                 m_xBaseLast = num12;
                 m_yBaseLast = num13;
                 m_Invalidate = false;
                 m_WasDead = preserveHue;
                 m_CharX = num;
                 m_CharY = num2;
                 m_CharZ = num3;
                 int z = 0x7fffffff;
                 int num18 = 0x7fffffff;
                 ArrayList list2 = new ArrayList();
                 int count = cells[num10 + 1, num11 + 1].Count;
                 for (int i = 0; i < count; i++)
                 {
                     ICell cell = (ICell) cells[num10 + 1, num11 + 1][i];
                     Type cellType = cell.CellType;
                     if ((cellType == tStaticItem) || (cellType == tDynamicItem))
                     {
                         ITile tile = (ITile) cell;
                         if ((Map.m_ItemFlags[tile.ID & 0x3fff][TileFlag.Roof] && (tile.Z >= (num3 + 15))) && (tile.Z < z))
                         {
                             z = tile.Z;
                         }
                     }
                 }
                 count = cells[num10, num11].Count;
                 for (int j = 0; j < count; j++)
                 {
                     ICell cell2 = (ICell) cells[num10, num11][j];
                     Type type2 = cell2.CellType;
                     if (((type2 == tStaticItem) || (type2 == tDynamicItem)) || (type2 == tLandTile))
                     {
                         ITile tile2 = (ITile) cell2;
                         if (!Map.GetTileFlags(tile2.ID)[TileFlag.Roof])
                         {
                             int num22 = (type2 == tLandTile) ? tile2.SortZ : tile2.Z;
                             if (num22 >= (num3 + 15))
                             {
                                 if (type2 == tLandTile)
                                 {
                                     if (num22 < z)
                                     {
                                         z = num22;
                                     }
                                     if ((num3 + 0x10) < num18)
                                     {
                                         num18 = num3 + 0x10;
                                     }
                                 }
                                 else if (num22 < z)
                                 {
                                     z = num22;
                                 }
                             }
                         }
                     }
                 }
                 m_CullLand = num18 < 0x7fffffff;
                 IHue hue = preserveHue ? Hues.Grayscale : Hues.Default;
                 m_hGray = hue;
                 Queue transDrawQueue = m_TransDrawQueue;
                 if (transDrawQueue == null)
                 {
                     transDrawQueue = m_TransDrawQueue = new Queue();
                 }
                 else if (transDrawQueue.Count > 0)
                 {
                     transDrawQueue.Clear();
                 }
                 bool multiPreview = Engine.m_MultiPreview;
                 int num23 = 0;
                 int num24 = 0;
                 int num25 = 0;
                 int num26 = 0;
                 int num27 = 0;
                 int num28 = 0;
                 int num29 = 0;
                 int num30 = 0;
                 int num31 = 0;
                 int num32 = 0;
                 int num33 = 0;
                 int num34 = 0;
                 int num35 = 0;
                 IHue lightRed = null;
                 if (multiPreview)
                 {
                     if (Gumps.IsWorldAt(Engine.m_xMouse, Engine.m_yMouse, true))
                     {
                         short tileX = 0;
                         short tileY = 0;
                         ICell cell3 = FindTileFromXY(Engine.m_xMouse, Engine.m_yMouse, ref tileX, ref tileY, false);
                         if (cell3 == null)
                         {
                             multiPreview = false;
                         }
                         else if ((cell3.CellType == tLandTile) || (cell3.CellType == tStaticItem))
                         {
                             num23 = tileX - num6;
                             num24 = tileY - num7;
                             num25 = cell3.Z + ((cell3.CellType == tStaticItem) ? cell3.Height : 0);
                             num27 = Engine.m_MultiList.Count;
                             num23 -= Engine.m_xMultiOffset;
                             num24 -= Engine.m_yMultiOffset;
                             num25 -= Engine.m_zMultiOffset;
                             num28 = num23 + Engine.m_MultiMinX;
                             num29 = num24 + Engine.m_MultiMinY;
                             num30 = num23 + Engine.m_MultiMaxX;
                             num31 = num24 + Engine.m_MultiMaxY;
                         }
                         else
                         {
                             multiPreview = false;
                         }
                     }
                     else
                     {
                         multiPreview = false;
                     }
                 }
                 else if (((Control.ModifierKeys & (Keys.Control | Keys.Shift)) == (Keys.Control | Keys.Shift)) && (((Gumps.LastOver is GSpellIcon) && (((GSpellIcon) Gumps.LastOver).m_SpellID == 0x39)) || ((Gumps.LastOver is GContainerItem) && ((((GContainerItem) Gumps.LastOver).Item.ID & 0x3fff) == 0x1f65))))
                 {
                     int num38 = 1 + ((int) (Engine.Skills[SkillName.Magery].Value / 15f));
                     if (m_LightRed == null)
                     {
                         m_LightRed = new Hues.HTemperedHue(Engine.C32216(0xff0000), 80);
                     }
                     lightRed = m_LightRed;
                     num32 = (player.X - num6) - num38;
                     num33 = (player.Y - num7) - num38;
                     num34 = (player.X - num6) + num38;
                     num35 = (player.Y - num7) + num38;
                 }
                 else if (Engine.TargetHandler is ServerTargetHandler)
                 {
                     ServerTargetHandler targetHandler = (ServerTargetHandler) Engine.TargetHandler;
                     IHue lightBlue = null;
                     int num39 = -1;
                     bool flag6 = false;
                     if ((targetHandler.Action == TargetAction.MeteorSwarm) || (targetHandler.Action == TargetAction.ChainLightning))
                     {
                         if (m_LightRed == null)
                         {
                             m_LightRed = new Hues.HTemperedHue(Engine.C32216(0xff0000), 80);
                         }
                         lightBlue = m_LightRed;
                         num39 = 2;
                     }
                     else if (targetHandler.Action == TargetAction.MassCurse)
                     {
                         if (m_LightRed == null)
                         {
                             m_LightRed = new Hues.HTemperedHue(Engine.C32216(0xff0000), 80);
                         }
                         lightBlue = m_LightRed;
                         num39 = 3;
                     }
                     else if (targetHandler.Action == TargetAction.Reveal)
                     {
                         if (m_LightBlue == null)
                         {
                             m_LightBlue = new Hues.HTemperedHue(Engine.C32216(0x99ccff), 80);
                         }
                         lightBlue = m_LightBlue;
                         num39 = 1 + ((int) (Engine.Skills[SkillName.Magery].Value / 20f));
                     }
                     else if (targetHandler.Action == TargetAction.DetectHidden)
                     {
                         if (m_LightBlue == null)
                         {
                             m_LightBlue = new Hues.HTemperedHue(Engine.C32216(0x99ccff), 80);
                         }
                         lightBlue = m_LightBlue;
                         num39 = (int) (Engine.Skills[SkillName.DetectingHidden].Value / 10f);
                     }
                     else if (targetHandler.Action == TargetAction.ArchProtection)
                     {
                         if (m_LightBlue == null)
                         {
                             m_LightBlue = new Hues.HTemperedHue(Engine.C32216(0x99ccff), 80);
                         }
                         lightBlue = m_LightBlue;
                         num39 = Engine.Features.AOS ? 2 : 3;
                     }
                     else if (targetHandler.Action == TargetAction.ArchCure)
                     {
                         if (m_LightBlue == null)
                         {
                             m_LightBlue = new Hues.HTemperedHue(Engine.C32216(0x99ccff), 80);
                         }
                         lightBlue = m_LightBlue;
                         num39 = 3;
                     }
                     else if (targetHandler.Action == TargetAction.WallOfStone)
                     {
                         if (m_LightRed == null)
                         {
                             m_LightRed = new Hues.HTemperedHue(Engine.C32216(0xff0000), 80);
                         }
                         lightBlue = m_LightRed;
                         num39 = 1;
                         flag6 = true;
                     }
                     else if (((targetHandler.Action == TargetAction.EnergyField) || (targetHandler.Action == TargetAction.FireField)) || ((targetHandler.Action == TargetAction.ParalyzeField) || (targetHandler.Action == TargetAction.PoisonField)))
                     {
                         if (m_LightRed == null)
                         {
                             m_LightRed = new Hues.HTemperedHue(Engine.C32216(0xff0000), 80);
                         }
                         lightBlue = m_LightRed;
                         num39 = 2;
                         flag6 = true;
                     }
                     if ((lightBlue != null) && Gumps.IsWorldAt(Engine.m_xMouse, Engine.m_yMouse, true))
                     {
                         short num40 = 0;
                         short num41 = 0;
                         ICell cell4 = FindTileFromXY(Engine.m_xMouse, Engine.m_yMouse, ref num40, ref num41, false);
                         if ((cell4 != null) && (((cell4.CellType == tLandTile) || (cell4.CellType == tStaticItem)) || ((cell4.CellType == tMobileCell) || (cell4.CellType == tDynamicItem))))
                         {
                             lightRed = lightBlue;
                             if (num39 >= 0)
                             {
                                 if (flag6)
                                 {
                                     bool flag7;
                                     int num42 = player.X - num40;
                                     int num43 = player.Y - num41;
                                     int num44 = num42 - num43;
                                     int num45 = num42 + num43;
                                     if ((num44 >= 0) && (num45 >= 0))
                                     {
                                         flag7 = false;
                                     }
                                     else if (num44 >= 0)
                                     {
                                         flag7 = true;
                                     }
                                     else if (num45 >= 0)
                                     {
                                         flag7 = true;
                                     }
                                     else
                                     {
                                         flag7 = false;
                                     }
                                     if (flag7)
                                     {
                                         num32 = (num40 - num6) - num39;
                                         num34 = (num40 - num6) + num39;
                                         num33 = num41 - num7;
                                         num35 = num41 - num7;
                                     }
                                     else
                                     {
                                         num32 = num40 - num6;
                                         num34 = num40 - num6;
                                         num33 = (num41 - num7) - num39;
                                         num35 = (num41 - num7) + num39;
                                     }
                                 }
                                 else
                                 {
                                     num32 = (num40 - num6) - num39;
                                     num33 = (num41 - num7) - num39;
                                     num34 = (num40 - num6) + num39;
                                     num35 = (num41 - num7) + num39;
                                 }
                             }
                         }
                     }
                 }
                 int id = 0;
                 int num47 = 0;
                 IHue hue4 = null;
                 bool flag8 = false;
                 bool flag9 = false;
                 DynamicItem item = null;
                 StaticItem item2 = null;
                 Item owner = null;
                 bool xDouble = false;
                 ArrayList equip = null;
                 int num48 = (cellWidth < cellHeight) ? (cellWidth - 1) : (cellHeight - 1);
                 if (num18 < 0x7fffffff)
                 {
                     colorMap = package.frameColors;
                     int[,] realColors = package.realColors;
                     for (int num49 = -1; num49 < (cellHeight - 1); num49++)
                     {
                         for (int num50 = -1; num50 < (cellWidth - 1); num50++)
                         {
                             colorMap[num50 + 1, num49 + 1] = realColors[num50 + 1, num49 + 1];
                             if ((num50 >= 0) && (num49 >= 0))
                             {
                                 LandTile tile3 = landTiles[num50, num49];
                                 if (tile3.m_FoldLeftRight)
                                 {
                                     bool flag11 = ((landTiles[num50, num49].Z <= num18) && (landTiles[num50, num49 + 1].Z <= num18)) && (landTiles[num50 + 1, num49 + 1].Z <= num18);
                                     bool flag12 = ((landTiles[num50, num49].Z <= num18) && (landTiles[num50 + 1, num49].Z <= num18)) && (landTiles[num50 + 1, num49 + 1].Z <= num18);
                                     if (!flag11 && !flag12)
                                     {
                                         colorMap[num50, num49] = 0;
                                         colorMap[num50 + 1, num49] = 0;
                                         colorMap[num50 + 1, num49 + 1] = 0;
                                         colorMap[num50, num49 + 1] = 0;
                                     }
                                     else if (!flag11)
                                     {
                                         colorMap[num50, num49] = 0;
                                         colorMap[num50 + 1, num49 + 1] = 0;
                                         colorMap[num50, num49 + 1] = 0;
                                     }
                                     else if (!flag12)
                                     {
                                         colorMap[num50, num49] = 0;
                                         colorMap[num50 + 1, num49 + 1] = 0;
                                         colorMap[num50 + 1, num49] = 0;
                                     }
                                 }
                                 else
                                 {
                                     bool flag13 = ((landTiles[num50, num49].Z <= num18) && (landTiles[num50, num49 + 1].Z <= num18)) && (landTiles[num50 + 1, num49].Z <= num18);
                                     bool flag14 = ((landTiles[num50 + 1, num49].Z <= num18) && (landTiles[num50, num49 + 1].Z <= num18)) && (landTiles[num50 + 1, num49 + 1].Z <= num18);
                                     if (!flag13 && !flag14)
                                     {
                                         colorMap[num50, num49] = 0;
                                         colorMap[num50 + 1, num49] = 0;
                                         colorMap[num50 + 1, num49 + 1] = 0;
                                         colorMap[num50, num49 + 1] = 0;
                                     }
                                     else if (!flag13)
                                     {
                                         colorMap[num50, num49] = 0;
                                         colorMap[num50 + 1, num49] = 0;
                                         colorMap[num50, num49 + 1] = 0;
                                     }
                                     else if (!flag14)
                                     {
                                         colorMap[num50 + 1, num49 + 1] = 0;
                                         colorMap[num50 + 1, num49] = 0;
                                         colorMap[num50, num49 + 1] = 0;
                                     }
                                 }
                             }
                         }
                     }
                 }
                 for (int k = 0; k < ((num48 * 2) - 1); k++)
                 {
                     int y = k;
                     int num53 = 0;
                     if (y >= num48)
                     {
                         num53 = (k - num48) + 1;
                         y = num48 - 1;
                     }
                     int x = num53;
                     while ((x < num48) && (y >= 0))
                     {
                         int bx = ((x - y) * 0x16) + num12;
                         int by = ((x + y) * 0x16) + num13;
                         int num57 = cells[x, y].Count;
                         for (int num58 = 0; num58 < num57; num58++)
                         {
                             TileFlags flags;
                             Texture texture;
                             float num69;
                             bool flag17;
                             int num71;
                             int num72;
                             ICell cell5 = (ICell) cells[x, y][num58];
                             Type type3 = cell5.CellType;
                             if ((type3 != tStaticItem) && (type3 != tDynamicItem))
                             {
                                 goto Label_177B;
                             }
                             flag8 = type3 == tStaticItem;
                             flag9 = !flag8;
                             IItem item3 = (IItem) cell5;
                             if (flag8)
                             {
                                 item2 = (StaticItem) item3;
                                 id = item2.m_ID;
                                 switch (id)
                                 {
                                     case 0x4001:
                                     case 0x5796:
                                     case 0x61a4:
                                     case 0x6198:
                                     case 0x61bc:
                                     case 0x6199:
                                     {
                                         continue;
                                     }
                                 }
                                 num47 = item2.m_Z;
                                 flags = Map.m_ItemFlags[id & 0x3fff];
                                 if ((z < 0x7fffffff) && ((num47 >= z) || flags[TileFlag.Roof]))
                                 {
                                     continue;
                                 }
                                 hue4 = item2.m_Hue;
                                 xDouble = false;
                             }
                             else
                             {
                                 item = (DynamicItem) item3;
                                 id = item.m_ID;
                                 switch (id)
                                 {
                                     case 0x4001:
                                     case 0x5796:
                                     case 0x61a4:
                                     case 0x6198:
                                     case 0x61bc:
                                     case 0x6199:
                                     {
                                         continue;
                                     }
                                 }
                                 num47 = item.m_Z;
                                 flags = Map.m_ItemFlags[id & 0x3fff];
                                 if ((z < 0x7fffffff) && ((num47 >= z) || flags[TileFlag.Roof]))
                                 {
                                     continue;
                                 }
                                 hue4 = item.m_Hue;
                                 owner = item.m_Item;
                                 id = Map.GetDispID(id, (ushort) owner.Amount, ref xDouble);
                             }
                             bool flag15 = false;
                             if ((((lightRed != null) && (x >= num32)) && ((y >= num33) && (x <= num34))) && (y <= num35))
                             {
                                 hue4 = lightRed;
                                 flag15 = true;
                             }
                             if ((flag4 && flag8) && !flag15)
                             {
                                 StaticItem item5 = item2;
                                 if (item5.m_bInit)
                                 {
                                     if (item5.m_bDraw)
                                     {
                                         if (item5.m_bAlpha)
                                         {
                                             if (!m_AlphaEnable)
                                             {
                                                 m_AlphaEnable = true;
                                             }
                                             m_fAlpha = ((float) item5.m_vAlpha) / 255f;
                                             m_Alpha = item5.m_vAlpha << 0x18;
                                         }
                                         else if (m_AlphaEnable)
                                         {
                                             m_AlphaEnable = false;
                                         }
                                         if (!m_AlphaTestEnable)
                                         {
                                             m_AlphaTestEnable = true;
                                         }
                                         if (m_FilterEnable)
                                         {
                                             SetFilterEnablePrecalc(false);
                                         }
                                         m_Texture = item5.m_sDraw;
                                         fixed (CustomVertex.TransformedColoredTextured* texturedRef = item5.m_vPool)
                                         {
                                             PushQuad(texturedRef);
                                         }
                                     }
                                     continue;
                                 }
                             }
                             if ((!flag8 && (owner != null)) && (owner.ID == 0x2006))
                             {
                                 IHue hue5;
                                 int amount = owner.Amount;
                                 CorpseTableEntry entry = (CorpseTableEntry) CorpseTable.m_Entries[amount];
                                 if ((entry != null) && (BodyConverter.GetFileSet(amount) == 1))
                                 {
                                     amount = entry.m_OldID;
                                     hue4 = Hues.Load(entry.m_NewHue ^ 0x8000);
                                 }
                                 int animDirection = Engine.GetAnimDirection(owner.Direction);
                                 int actionID = Engine.m_Animations.ConvertAction(amount, owner.Serial, owner.X, owner.Y, animDirection, GenericAction.Die, null);
                                 int num63 = Engine.m_Animations.GetFrameCount(amount, actionID, animDirection);
                                 int xCenter = bx + 0x17;
                                 int yCenter = (by - (num47 << 2)) + 20;
                                 if (preserveHue)
                                 {
                                     hue5 = hue;
                                 }
                                 else
                                 {
                                     hue5 = hue4;
                                 }
                                 int textureX = 0;
                                 int textureY = 0;
                                 if (m_AlphaEnable)
                                 {
                                     SetAlphaEnablePrecalc(false);
                                 }
                                 if (!m_AlphaTestEnable)
                                 {
                                     m_AlphaTestEnable = true;
                                 }
                                 if (m_FilterEnable)
                                 {
                                     SetFilterEnablePrecalc(false);
                                 }
                                 Frame frame = Engine.m_Animations.GetFrame(owner, amount, actionID, animDirection, num63 - 1, xCenter, yCenter, hue5, ref textureX, ref textureY, preserveHue);
                                 owner.DrawGame(frame.Image, textureX, textureY);
                                 owner.MessageX = (textureX + frame.Image.xMin) + ((frame.Image.xMax - frame.Image.xMin) / 2);
                                 owner.MessageY = textureY;
                                 owner.BottomY = textureY + frame.Image.yMax;
                                 owner.MessageFrame = m_ActFrames;
                                 for (int num68 = 0; num68 < owner.CorpseEquip.Count; num68++)
                                 {
                                     EquipEntry entry2 = (EquipEntry) owner.CorpseEquip[num68];
                                     if (owner.Items.Contains(entry2.m_Item))
                                     {
                                         if (!preserveHue)
                                         {
                                             hue5 = Hues.Load(entry2.m_Item.Hue);
                                         }
                                         frame = Engine.m_Animations.GetFrame(entry2.m_Item, entry2.m_Animation, actionID, animDirection, num63 - 1, xCenter, yCenter, hue5, ref textureX, ref textureY, preserveHue);
                                         entry2.m_Item.DrawGame(frame.Image, textureX, textureY);
                                     }
                                 }
                             }
                             else
                             {
                                 IHue grayscale;
                                 texture = null;
                                 num69 = 1f;
                                 flag17 = false;
                                 int itemID = id & 0x3fff;
                                 bool flag18 = false;
                                 if (preserveHue)
                                 {
                                     grayscale = hue;
                                 }
                                 else if (flag8)
                                 {
                                     grayscale = hue4;
                                 }
                                 else if ((owner != null) && owner.Flags[ItemFlag.Hidden])
                                 {
                                     grayscale = Hues.Grayscale;
                                     flag17 = true;
                                     num69 = 0.5f;
                                 }
                                 else if ((owner != null) && ((owner.Hue & 0x4000) != 0))
                                 {
                                     grayscale = Hues.Load(0xbb8);
                                     flag17 = true;
                                     num69 = 1f;
                                     flag18 = true;
                                 }
                                 else
                                 {
                                     grayscale = hue4;
                                 }
                                 AnimData anim = Map.GetAnim(itemID);
                                 if ((anim.frameCount == 0) || !flags[TileFlag.Animation])
                                 {
                                     texture = item3.GetItem(grayscale, (short) id);
                                 }
                                 else
                                 {
                                     texture = item3.GetItem(grayscale, (short) (id + anim[(m_Frames / (anim.frameInterval + 1)) % anim.frameCount]));
                                 }
                                 if ((texture != null) && !texture.IsEmpty())
                                 {
                                     num71 = (bx + 0x16) - (texture.Width >> 1);
                                     num72 = ((by - (num47 << 2)) + 0x2b) - texture.Height;
                                     if (flag3 && flags[TileFlag.Foliage])
                                     {
                                         Rectangle rectangle = new Rectangle(num71 + texture.xMin, num72 + texture.yMin, texture.xMax, texture.yMax);
                                         if (rectangle.IntersectsWith(m_FoliageCheck))
                                         {
                                             flag17 = true;
                                             num69 *= 0.4f;
                                         }
                                     }
                                     else if (flags[TileFlag.Translucent])
                                     {
                                         flag17 = true;
                                         num69 *= 0.9f;
                                     }
                                     if (m_AlphaEnable != flag17)
                                     {
                                         SetAlphaEnablePrecalc(flag17);
                                     }
                                     if (flag17)
                                     {
                                         SetAlpha(num69);
                                     }
                                     if (!m_AlphaTestEnable)
                                     {
                                         m_AlphaTestEnable = true;
                                     }
                                     if (m_FilterEnable)
                                     {
                                         SetFilterEnablePrecalc(false);
                                     }
                                     if (!flag9)
                                     {
                                         goto Label_170C;
                                     }
                                     if (owner != null)
                                     {
                                         if (flag18)
                                         {
                                             SetBlendType(DrawBlendType.BlackTransparency);
                                         }
                                         owner.DrawGame(texture, num71, num72);
                                         if (xDouble)
                                         {
                                             owner.DrawGame(texture, num71 + 5, num72 + 5);
                                         }
                                         if (flag18)
                                         {
                                             SetBlendType(DrawBlendType.Normal);
                                         }
                                         goto Label_16A2;
                                     }
                                     texture.DrawGame(num71, num72);
                                     if (xDouble)
                                     {
                                         texture.DrawGame(num71 + 5, num72 + 5);
                                     }
                                 }
                             }
                             continue;
                         Label_16A2:
                             if (m_Transparency)
                             {
                                 transDrawQueue.Enqueue(TransparentDraw.PoolInstance(texture, num71, num72, flag17, num69, xDouble));
                             }
                             owner.MessageX = (num71 + texture.xMin) + ((texture.xMax - texture.xMin) / 2);
                             owner.MessageY = num72;
                             owner.BottomY = num72 + texture.yMax;
                             owner.MessageFrame = m_ActFrames;
                             continue;
                         Label_170C:
                             if (flags[TileFlag.Animation])
                             {
                                 texture.DrawGame(num71, num72, item2.m_vPool);
                             }
                             else
                             {
                                 item2.m_bDraw = texture.DrawGame(num71, num72, item2.m_vPool);
                                 item2.m_vAlpha = (byte) (m_Alpha >> 0x18);
                                 item2.m_bInit = !flag15;
                                 item2.m_bAlpha = flag17;
                                 item2.m_sDraw = texture;
                             }
                             continue;
                         Label_177B:
                             if (type3 == tLandTile)
                             {
                                 LandTile lt = (LandTile) cell5;
                                 num47 = lt.m_Z;
                                 int iD = lt.m_ID;
                                 if (iD != 2)
                                 {
                                     int num74 = bx;
                                     int num75 = by;
                                     int num76 = package.CellX + x;
                                     int num77 = package.CellY + y;
                                     bool flag19 = false;
                                     if ((((lightRed != null) && (x >= num32)) && ((y >= num33) && (x <= num34))) && (y <= num35))
                                     {
                                         flag19 = true;
                                     }
                                     if ((flag4 && lt.m_bInit) && !flag19)
                                     {
                                         if (lt.m_bDraw)
                                         {
                                             AlphaTestEnable = !lt.m_bFilter;
                                             if (m_AlphaEnable)
                                             {
                                                 SetAlphaEnablePrecalc(false);
                                             }
                                             SetTexture(lt.m_sDraw);
                                             if (m_FilterEnable != lt.m_bFilter)
                                             {
                                                 SetFilterEnablePrecalc(!m_FilterEnable);
                                             }
                                             DrawQuadPrecalc(lt.m_vDraw);
                                             if (m_DrawGrid)
                                             {
                                                 Grid(lt, landTiles, x, y, bx, by);
                                             }
                                             if (((num76 == m_xServerStart) || (num76 == m_xServerEnd)) && ((num77 >= m_yServerStart) && (num77 < m_yServerEnd)))
                                             {
                                                 DrawMapLine(landTiles, num74, num75, x, y, 0, 1);
                                             }
                                             else if ((x > 0) && (lt.m_Guarded != landTiles[x - 1, y].m_Guarded))
                                             {
                                                 DrawMapLine(landTiles, num74, num75, x, y, 0, 1);
                                             }
                                             if (((num77 == m_yServerStart) || (num77 == m_yServerEnd)) && ((num76 >= m_xServerStart) && (num76 < m_xServerEnd)))
                                             {
                                                 DrawMapLine(landTiles, num74, num75, x, y, 1, 0);
                                             }
                                             else if ((y > 0) && (lt.m_Guarded != landTiles[x, y - 1].m_Guarded))
                                             {
                                                 DrawMapLine(landTiles, num74, num75, x, y, 1, 0);
                                             }
                                         }
                                     }
                                     else
                                     {
                                         CustomVertex.TransformedColoredTextured[] texturedArray;
                                         IHue hue7 = flag19 ? lightRed : hue;
                                         int textureID = Map.GetTexture(iD);
                                         if ((((buffer[x, y] & 1) == 0) || (textureID == 0)) || (textureID >= 0x1000))
                                         {
                                             Texture land = hue7.GetLand(iD);
                                             if ((land != null) && !land.IsEmpty())
                                             {
                                                 if ((num18 < 0x7fffffff) && (num47 >= num18))
                                                 {
                                                     lt.m_bDraw = false;
                                                     lt.m_bInit = true;
                                                 }
                                                 else
                                                 {
                                                     AlphaTestEnable = true;
                                                     if (m_AlphaEnable)
                                                     {
                                                         SetAlphaEnablePrecalc(false);
                                                     }
                                                     if (m_FilterEnable)
                                                     {
                                                         SetFilterEnablePrecalc(false);
                                                     }
                                                     texturedArray = m_VertexPool[x][y];
                                                     lt.m_bDraw = land.DrawGame(num74, num75 - (num47 << 2), texturedArray);
                                                     lt.m_vDraw = texturedArray;
                                                     lt.m_bInit = !flag19;
                                                     lt.m_sDraw = land;
                                                     lt.m_bFilter = false;
                                                     if (m_DrawGrid)
                                                     {
                                                         Grid(lt, landTiles, x, y, bx, by);
                                                     }
                                                     if (((num76 == m_xServerStart) || (num76 == m_xServerEnd)) && ((num77 >= m_yServerStart) && (num77 < m_yServerEnd)))
                                                     {
                                                         DrawMapLine(landTiles, num74, num75, x, y, 0, 1);
                                                     }
                                                     else if ((x > 0) && (lt.m_Guarded != landTiles[x - 1, y].m_Guarded))
                                                     {
                                                         DrawMapLine(landTiles, num74, num75, x, y, 0, 1);
                                                     }
                                                     if (((num77 == m_yServerStart) || (num77 == m_yServerEnd)) && ((num76 >= m_xServerStart) && (num76 < m_xServerEnd)))
                                                     {
                                                         DrawMapLine(landTiles, num74, num75, x, y, 1, 0);
                                                     }
                                                     else if ((y > 0) && (lt.m_Guarded != landTiles[x, y - 1].m_Guarded))
                                                     {
                                                         DrawMapLine(landTiles, num74, num75, x, y, 1, 0);
                                                     }
                                                 }
                                             }
                                         }
                                         else
                                         {
                                             Texture texture3 = hue7.GetTexture(textureID);
                                             if ((texture3 == null) || texture3.IsEmpty())
                                             {
                                                 texture3 = hue7.GetTexture(1);
                                                 if ((texture3 == null) || texture3.IsEmpty())
                                                 {
                                                     continue;
                                                 }
                                             }
                                             if ((num74 >= (Engine.GameX + Engine.GameWidth)) || ((num74 + 0x2c) <= Engine.GameX))
                                             {
                                                 lt.m_vDraw = null;
                                                 lt.m_bDraw = false;
                                                 lt.m_bInit = true;
                                                 lt.m_sDraw = null;
                                                 lt.m_bFilter = false;
                                             }
                                             else
                                             {
                                                 texturedArray = m_VertexPool[x][y];
                                                 fixed (CustomVertex.TransformedColoredTextured* texturedRef2 = texturedArray)
                                                 {
                                                     if (lt.m_FoldLeftRight)
                                                     {
                                                         texturedRef2[1].X = num74 + 0x16;
                                                         texturedRef2[1].Y = num75 - (num47 << 2);
                                                         texturedRef2->Y = (num75 + 0x16) - (landTiles[x + 1, y].m_Z << 2);
                                                         texturedRef2->X = num74 + 0x2c;
                                                         texturedRef2[2].Y = (num75 + 0x2c) - (landTiles[x + 1, y + 1].m_Z << 2);
                                                         texturedRef2[2].X = num74 + 0x16;
                                                         texturedRef2[3].Y = (num75 + 0x16) - (landTiles[x, y + 1].m_Z << 2);
                                                         texturedRef2[3].X = num74;
                                                         if ((((texturedRef2->Y < Engine.GameY) || (texturedRef2->Y >= (Engine.GameY + Engine.GameHeight))) && ((texturedRef2[1].Y < Engine.GameY) || (texturedRef2[1].Y >= (Engine.GameY + Engine.GameHeight)))) && (((texturedRef2[2].Y < Engine.GameY) || (texturedRef2[2].Y >= (Engine.GameY + Engine.GameHeight))) && ((texturedRef2[3].Y < Engine.GameY) || (texturedRef2[3].Y >= (Engine.GameY + Engine.GameHeight)))))
                                                         {
                                                             lt.m_vDraw = texturedArray;
                                                             lt.m_bDraw = false;
                                                             lt.m_bInit = true;
                                                             lt.m_sDraw = null;
                                                             lt.m_bFilter = false;
                                                             continue;
                                                         }
                                                         texturedRef2[2].Color = colorMap[x + 1, y + 1];
                                                         texturedRef2->Color = colorMap[x + 1, y];
                                                         texturedRef2[3].Color = colorMap[x, y + 1];
                                                         texturedRef2[1].Color = colorMap[x, y];
                                                         if (texture3.Width == 0x2c)
                                                         {
                                                             texturedRef2[1].Tu = 0.5f * texture3.MaxTU;
                                                             texturedRef2[1].Tv = 0f;
                                                             texturedRef2->Tu = 1f * texture3.MaxTU;
                                                             texturedRef2->Tv = 0.5f * texture3.MaxTV;
                                                             texturedRef2[2].Tu = 0.5f * texture3.MaxTU;
                                                             texturedRef2[2].Tv = 1f * texture3.MaxTV;
                                                             texturedRef2[3].Tu = 0f;
                                                             texturedRef2[3].Tv = 0.5f * texture3.MaxTV;
                                                             texturedRef2->Color = ((texturedRef2->Color & 0xff) * 0xff) / 210;
                                                             texturedRef2[1].Color = ((texturedRef2[1].Color & 0xff) * 0xff) / 210;
                                                             texturedRef2[2].Color = ((texturedRef2[2].Color & 0xff) * 0xff) / 210;
                                                             texturedRef2[3].Color = ((texturedRef2[3].Color & 0xff) * 0xff) / 210;
                                                             if (texturedRef2->Color < 0)
                                                             {
                                                                 texturedRef2->Color = 0;
                                                             }
                                                             else if (texturedRef2->Color > 0xff)
                                                             {
                                                                 texturedRef2->Color = 0xffffff;
                                                             }
                                                             else
                                                             {
                                                                 IntPtr ptr1 = texturedRef2;
                                                                 ptr1.Color *= 0x10101;
                                                             }
                                                             if (texturedRef2[1].Color < 0)
                                                             {
                                                                 texturedRef2[1].Color = 0;
                                                             }
                                                             else if (texturedRef2[1].Color > 0xff)
                                                             {
                                                                 texturedRef2[1].Color = 0xffffff;
                                                             }
                                                             else
                                                             {
                                                                 IntPtr ptr2 = texturedRef2 + 1;
                                                                 ptr2.Color *= 0x10101;
                                                             }
                                                             if (texturedRef2[2].Color < 0)
                                                             {
                                                                 texturedRef2[2].Color = 0;
                                                             }
                                                             else if (texturedRef2[2].Color > 0xff)
                                                             {
                                                                 texturedRef2[2].Color = 0xffffff;
                                                             }
                                                             else
                                                             {
                                                                 IntPtr ptr3 = texturedRef2 + 2;
                                                                 ptr3.Color *= 0x10101;
                                                             }
                                                             if (texturedRef2[3].Color < 0)
                                                             {
                                                                 texturedRef2[3].Color = 0;
                                                             }
                                                             else if (texturedRef2[3].Color > 0xff)
                                                             {
                                                                 texturedRef2[3].Color = 0xffffff;
                                                             }
                                                             else
                                                             {
                                                                 IntPtr ptr4 = texturedRef2 + 3;
                                                                 ptr4.Color *= 0x10101;
                                                             }
                                                         }
                                                         else
                                                         {
                                                             texturedRef2->Tv = 0f;
                                                             texturedRef2[1].Tv = 0f;
                                                             texturedRef2[1].Tu = 0f;
                                                             texturedRef2[3].Tu = 0f;
                                                             texturedRef2->Tu = 1f;
                                                             texturedRef2[2].Tu = 1f;
                                                             texturedRef2[2].Tv = 1f;
                                                             texturedRef2[3].Tv = 1f;
                                                         }
                                                         if (num18 < 0x7fffffff)
                                                         {
                                                             bool flag20 = ((landTiles[x, y].Z <= num18) && (landTiles[x, y + 1].Z <= num18)) && (landTiles[x + 1, y + 1].Z <= num18);
                                                             bool flag21 = ((landTiles[x, y].Z <= num18) && (landTiles[x + 1, y].Z <= num18)) && (landTiles[x + 1, y + 1].Z <= num18);
                                                             if (!flag20 && !flag21)
                                                             {
                                                                 lt.m_vDraw = texturedArray;
                                                                 lt.m_bDraw = false;
                                                                 lt.m_bInit = true;
                                                                 lt.m_sDraw = null;
                                                                 lt.m_bFilter = false;
                                                                 continue;
                                                             }
                                                             if (!flag20)
                                                             {
                                                                 texturedRef2[1].Color = texturedRef2[2].Color = 0;
                                                                 texturedRef2[3] = texturedRef2[1];
                                                             }
                                                             else if (!flag21)
                                                             {
                                                                 texturedRef2[1].Color = texturedRef2[2].Color = 0;
                                                                 texturedRef2 = texturedRef2[1];
                                                             }
                                                         }
                                                     }
                                                     else
                                                     {
                                                         texturedRef2[3].X = num74 + 0x16;
                                                         texturedRef2[3].Y = num75 - (num47 << 2);
                                                         texturedRef2[1].Y = (num75 + 0x16) - (landTiles[x + 1, y].m_Z << 2);
                                                         texturedRef2[1].X = num74 + 0x2c;
                                                         texturedRef2->Y = (num75 + 0x2c) - (landTiles[x + 1, y + 1].m_Z << 2);
                                                         texturedRef2->X = num74 + 0x16;
                                                         texturedRef2[2].Y = (num75 + 0x16) - (landTiles[x, y + 1].m_Z << 2);
                                                         texturedRef2[2].X = num74;
                                                         if ((((texturedRef2->Y < Engine.GameY) || (texturedRef2->Y >= (Engine.GameY + Engine.GameHeight))) && ((texturedRef2[1].Y < Engine.GameY) || (texturedRef2[1].Y >= (Engine.GameY + Engine.GameHeight)))) && (((texturedRef2[2].Y < Engine.GameY) || (texturedRef2[2].Y >= (Engine.GameY + Engine.GameHeight))) && ((texturedRef2[3].Y < Engine.GameY) || (texturedRef2[3].Y >= (Engine.GameY + Engine.GameHeight)))))
                                                         {
                                                             lt.m_vDraw = texturedArray;
                                                             lt.m_bDraw = false;
                                                             lt.m_bInit = true;
                                                             lt.m_sDraw = null;
                                                             lt.m_bFilter = false;
                                                             continue;
                                                         }
                                                         texturedRef2->Color = colorMap[x + 1, y + 1];
                                                         texturedRef2[1].Color = colorMap[x + 1, y];
                                                         texturedRef2[2].Color = colorMap[x, y + 1];
                                                         texturedRef2[3].Color = colorMap[x, y];
                                                         if (texture3.Width == 0x2c)
                                                         {
                                                             texturedRef2[3].Tu = 0.5f * texture3.MaxTU;
                                                             texturedRef2[3].Tv = 0f;
                                                             texturedRef2[1].Tu = 1f * texture3.MaxTU;
                                                             texturedRef2[1].Tv = 0.5f * texture3.MaxTV;
                                                             texturedRef2->Tu = 0.5f * texture3.MaxTU;
                                                             texturedRef2->Tv = 1f * texture3.MaxTV;
                                                             texturedRef2[2].Tu = 0f;
                                                             texturedRef2[2].Tv = 0.5f * texture3.MaxTV;
                                                             texturedRef2->Color = ((texturedRef2->Color & 0xff) * 0xff) / 210;
                                                             texturedRef2[1].Color = ((texturedRef2[1].Color & 0xff) * 0xff) / 210;
                                                             texturedRef2[2].Color = ((texturedRef2[2].Color & 0xff) * 0xff) / 210;
                                                             texturedRef2[3].Color = ((texturedRef2[3].Color & 0xff) * 0xff) / 210;
                                                             if (texturedRef2->Color < 0)
                                                             {
                                                                 texturedRef2->Color = 0;
                                                             }
                                                             else if (texturedRef2->Color > 0xff)
                                                             {
                                                                 texturedRef2->Color = 0xffffff;
                                                             }
                                                             else
                                                             {
                                                                 IntPtr ptr5 = texturedRef2;
                                                                 ptr5.Color *= 0x10101;
                                                             }
                                                             if (texturedRef2[1].Color < 0)
                                                             {
                                                                 texturedRef2[1].Color = 0;
                                                             }
                                                             else if (texturedRef2[1].Color > 0xff)
                                                             {
                                                                 texturedRef2[1].Color = 0xffffff;
                                                             }
                                                             else
                                                             {
                                                                 IntPtr ptr6 = texturedRef2 + 1;
                                                                 ptr6.Color *= 0x10101;
                                                             }
                                                             if (texturedRef2[2].Color < 0)
                                                             {
                                                                 texturedRef2[2].Color = 0;
                                                             }
                                                             else if (texturedRef2[2].Color > 0xff)
                                                             {
                                                                 texturedRef2[2].Color = 0xffffff;
                                                             }
                                                             else
                                                             {
                                                                 IntPtr ptr7 = texturedRef2 + 2;
                                                                 ptr7.Color *= 0x10101;
                                                             }
                                                             if (texturedRef2[3].Color < 0)
                                                             {
                                                                 texturedRef2[3].Color = 0;
                                                             }
                                                             else if (texturedRef2[3].Color > 0xff)
                                                             {
                                                                 texturedRef2[3].Color = 0xffffff;
                                                             }
                                                             else
                                                             {
                                                                 IntPtr ptr8 = texturedRef2 + 3;
                                                                 ptr8.Color *= 0x10101;
                                                             }
                                                         }
                                                         else
                                                         {
                                                             texturedRef2[1].Tv = 0f;
                                                             texturedRef2[2].Tu = 0f;
                                                             texturedRef2[3].Tu = 0f;
                                                             texturedRef2[3].Tv = 0f;
                                                             texturedRef2->Tv = 1f;
                                                             texturedRef2->Tu = 1f;
                                                             texturedRef2[1].Tu = 1f;
                                                             texturedRef2[2].Tv = 1f;
                                                         }
                                                         if (num18 < 0x7fffffff)
                                                         {
                                                             bool flag22 = ((landTiles[x, y].Z <= num18) && (landTiles[x, y + 1].Z <= num18)) && (landTiles[x + 1, y].Z <= num18);
                                                             bool flag23 = ((landTiles[x + 1, y].Z <= num18) && (landTiles[x, y + 1].Z <= num18)) && (landTiles[x + 1, y + 1].Z <= num18);
                                                             if (!flag22 && !flag23)
                                                             {
                                                                 lt.m_vDraw = texturedArray;
                                                                 lt.m_bDraw = false;
                                                                 lt.m_bInit = true;
                                                                 lt.m_sDraw = null;
                                                                 lt.m_bFilter = false;
                                                                 continue;
                                                             }
                                                             if (!flag22)
                                                             {
                                                                 texturedRef2[3] = texturedRef2[1];
                                                             }
                                                             else if (!flag23)
                                                             {
                                                                 texturedRef2 = texturedRef2[1];
                                                             }
                                                         }
                                                     }
                                                     IntPtr ptr9 = texturedRef2;
                                                     ptr9.X -= 0.5f;
                                                     IntPtr ptr10 = texturedRef2;
                                                     ptr10.Y -= 0.5f;
                                                     IntPtr ptr11 = texturedRef2 + 1;
                                                     ptr11.X -= 0.5f;
                                                     IntPtr ptr12 = texturedRef2 + 1;
                                                     ptr12.Y -= 0.5f;
                                                     IntPtr ptr13 = texturedRef2 + 2;
                                                     ptr13.X -= 0.5f;
                                                     IntPtr ptr14 = texturedRef2 + 2;
                                                     ptr14.Y -= 0.5f;
                                                     IntPtr ptr15 = texturedRef2 + 3;
                                                     ptr15.X -= 0.5f;
                                                     IntPtr ptr16 = texturedRef2 + 3;
                                                     ptr16.Y -= 0.5f;
                                                     if (m_AlphaEnable)
                                                     {
                                                         SetAlphaEnablePrecalc(false);
                                                     }
                                                     if (!m_FilterEnable)
                                                     {
                                                         SetFilterEnablePrecalc(true);
                                                     }
                                                     AlphaTestEnable = false;
                                                     SetTexture(texture3);
                                                     DrawQuadPrecalc(texturedRef2);
                                                 }
                                                 lt.m_vDraw = texturedArray;
                                                 lt.m_bDraw = true;
                                                 lt.m_bInit = !flag19;
                                                 lt.m_bFilter = true;
                                                 lt.m_sDraw = texture3;
                                                 if (m_DrawGrid)
                                                 {
                                                     Grid(lt, landTiles, x, y, bx, by);
                                                 }
                                                 if (((num76 == m_xServerStart) || (num76 == m_xServerEnd)) && ((num77 >= m_yServerStart) && (num77 < m_yServerEnd)))
                                                 {
                                                     DrawMapLine(landTiles, num74, num75, x, y, 0, 1);
                                                 }
                                                 else if ((x > 0) && (lt.m_Guarded != landTiles[x - 1, y].m_Guarded))
                                                 {
                                                     DrawMapLine(landTiles, num74, num75, x, y, 0, 1);
                                                 }
                                                 if (((num77 == m_yServerStart) || (num77 == m_yServerEnd)) && ((num76 >= m_xServerStart) && (num76 < m_xServerEnd)))
                                                 {
                                                     DrawMapLine(landTiles, num74, num75, x, y, 1, 0);
                                                 }
                                                 else if ((y > 0) && (lt.m_Guarded != landTiles[x, y - 1].m_Guarded))
                                                 {
                                                     DrawMapLine(landTiles, num74, num75, x, y, 1, 0);
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                             else if (((type3 == tMobileCell) || (type3 == tCorpseCell)) && ((z >= 0x7fffffff) || (cell5.Z < z)))
                             {
                                 IAnimatedCell cell6 = (IAnimatedCell) cell5;
                                 int body = 0;
                                 int direction = 0;
                                 int num81 = 0;
                                 int action = 0;
                                 int num83 = 0;
                                 bool flag24 = type3 == tMobileCell;
                                 Mobile mobile4 = flag24 ? ((MobileCell) cell5).m_Mobile : null;
                                 int frames = 0;
                                 int num85 = 0;
                                 int num86 = 0;
                                 if (flag24 && (mobile4 != null))
                                 {
                                     equip = mobile4.Equip;
                                     if (mobile4.Player)
                                     {
                                         flag3 = true;
                                     }
                                     if (mobile4.Walking.Count > 0)
                                     {
                                         WalkAnimation animation2 = (WalkAnimation) mobile4.Walking.Peek();
                                         if (!animation2.Snapshot(ref num85, ref num86, ref frames))
                                         {
                                             if (!animation2.Advance)
                                             {
                                                 num85 = animation2.xOffset;
                                                 num86 = animation2.yOffset;
                                             }
                                             else
                                             {
                                                 num85 = 0;
                                                 num86 = 0;
                                             }
                                             frames = animation2.Frames;
                                             mobile4.SetLocation((short) animation2.NewX, (short) animation2.NewY, (short) animation2.NewZ);
                                             ((WalkAnimation) mobile4.Walking.Dequeue()).Dispose();
                                             if (mobile4.Player)
                                             {
                                                 if (Engine.amMoving)
                                                 {
                                                     Engine.DoWalk(Engine.movingDir, true);
                                                 }
                                                 eOffsetX += num85;
                                                 eOffsetY += num86;
                                             }
                                             if (mobile4.Walking.Count == 0)
                                             {
                                                 Engine.EquipSort(mobile4, animation2.NewDir);
                                                 mobile4.Direction = (byte) animation2.NewDir;
                                                 mobile4.IsMoving = false;
                                                 mobile4.MovedTiles = 0;
                                                 mobile4.HorseFootsteps = 0;
                                             }
                                             else
                                             {
                                                 ((WalkAnimation) mobile4.Walking.Peek()).Start();
                                             }
                                             toUpdateQueue.Enqueue(mobile4);
                                         }
                                     }
                                 }
                                 cell6.GetPackage(ref body, ref action, ref direction, ref num83, ref num81);
                                 int num87 = num83;
                                 int num88 = Engine.m_Animations.GetFrameCount(body, action, direction);
                                 if (num88 != 0)
                                 {
                                     IHue notoriety;
                                     Frame frame2;
                                     num87 = num87 % num88;
                                     int num89 = bx + 0x16;
                                     int num90 = (by - (cell6.Z << 2)) + 0x16;
                                     num89++;
                                     num90 -= 2;
                                     num89 += num85;
                                     num90 += num86;
                                     if (frames != 0)
                                     {
                                         num87 += frames;
                                         num87 = num87 % num88;
                                         num83 += frames;
                                         num83 = num83 % num88;
                                     }
                                     if (flag24 && (mobile4 != null))
                                     {
                                         if ((mobile4.Human && mobile4.IsMoving) && (mobile4.LastFrame != num83))
                                         {
                                             int num143;
                                             if ((equip.Count > 0) && (((EquipEntry) equip[0]).m_Layer == Layer.Mount))
                                             {
                                                 if ((direction & 0x80) == 0x80)
                                                 {
                                                     if ((mobile4.HorseFootsteps != mobile4.MovedTiles) && ((mobile4.MovedTiles & 1) == 1))
                                                     {
                                                         mobile4.Sounds = (num143 = mobile4.Sounds) + 1;
                                                         int soundID = 0x129 + (num143 & 1);
                                                         Engine.Sounds.PlaySound(soundID, mobile4.X, mobile4.Y, mobile4.Z, 0.8f);
                                                         mobile4.HorseFootsteps = mobile4.MovedTiles;
                                                     }
                                                 }
                                                 else if ((mobile4.HorseFootsteps != mobile4.MovedTiles) && ((mobile4.MovedTiles & 1) == 1))
                                                 {
                                                     mobile4.Sounds = (num143 = mobile4.Sounds) + 1;
                                                     int num92 = 0x12b + (num143 & 1);
                                                     Engine.Sounds.PlaySound(num92, mobile4.X, mobile4.Y, mobile4.Z, 0.8f);
                                                     mobile4.HorseFootsteps = mobile4.MovedTiles;
                                                 }
                                             }
                                             else
                                             {
                                                 switch (num83)
                                                 {
                                                     case 1:
                                                     case 6:
                                                     {
                                                         mobile4.Sounds = (num143 = mobile4.Sounds) + 1;
                                                         int num93 = 0x12b + (num143 & 1);
                                                         Engine.Sounds.PlaySound(num93, mobile4.X, mobile4.Y, mobile4.Z, 0.65f);
                                                         break;
                                                     }
                                                 }
                                             }
                                         }
                                         mobile4.LastFrame = num83;
                                     }
                                     bool ghost = false;
                                     bool flag26 = false;
                                     IHue hue9 = null;
                                     bool enable = false;
                                     bool flag28 = false;
                                     float alpha = 1f;
                                     if (preserveHue)
                                     {
                                         notoriety = hue;
                                         flag26 = true;
                                         hue9 = notoriety;
                                         if (flag24 && (mobile4 != null))
                                         {
                                             ghost = mobile4.Ghost;
                                         }
                                     }
                                     else if ((((lightRed != null) && (x >= num32)) && ((y >= num33) && (x <= num34))) && (y <= num35))
                                     {
                                         notoriety = lightRed;
                                         flag26 = true;
                                         hue9 = notoriety;
                                         flag28 = false;
                                     }
                                     else if (flag24)
                                     {
                                         if (mobile4 != null)
                                         {
                                             ghost = mobile4.Ghost;
                                             if ((mobile4.Flags.Value & -223) != 0)
                                             {
                                                 notoriety = Hues.Load(0x8485);
                                                 flag26 = true;
                                                 hue9 = notoriety;
                                                 flag28 = false;
                                             }
                                             else if (mobile4.Flags[MobileFlag.Hidden])
                                             {
                                                 notoriety = Hues.Grayscale;
                                                 flag26 = true;
                                                 hue9 = notoriety;
                                             }
                                             else if (((Engine.m_Highlight == mobile4) || (m_AlwaysHighlight == mobile4.Serial)) && !mobile4.Player)
                                             {
                                                 notoriety = Hues.GetNotoriety(mobile4.Notoriety);
                                                 flag26 = true;
                                                 hue9 = notoriety;
                                                 flag28 = true;
                                             }
                                             else if (mobile4.Ignored)
                                             {
                                                 notoriety = Hues.Load(0x8035);
                                                 flag26 = true;
                                                 hue9 = notoriety;
                                                 flag28 = true;
                                             }
                                             else if (mobile4.Bonded)
                                             {
                                                 notoriety = Hues.Grayscale;
                                                 flag26 = true;
                                                 hue9 = notoriety;
                                                 flag28 = true;
                                             }
                                             else if ((mobile4.Hue & 0x4000) != 0)
                                             {
                                                 notoriety = Hues.Load(0x8bb8);
                                             }
                                             else
                                             {
                                                 notoriety = Hues.Load(num81);
                                             }
                                         }
                                         else
                                         {
                                             notoriety = Hues.Load(num81);
                                         }
                                     }
                                     else
                                     {
                                         notoriety = Hues.Load(num81);
                                     }
                                     int num95 = 0;
                                     int num96 = 0;
                                     try
                                     {
                                         frame2 = Engine.m_Animations.GetFrame(mobile4, body, action, direction, num87, num89, num90, notoriety, ref num95, ref num96, flag26);
                                     }
                                     catch
                                     {
                                         frame2 = Engine.m_Animations.GetFrame(mobile4, body, action, direction, num87, num89, num90, notoriety, ref num95, ref num96, flag26);
                                     }
                                     bool flag29 = false;
                                     bool alphaEnable = false;
                                     bool flag31 = false;
                                     float fAlpha = 1f;
                                     int num98 = -1;
                                     int num99 = -1;
                                     Texture t = null;
                                     if ((frame2.Image != null) && !frame2.Image.IsEmpty())
                                     {
                                         if (flag24 && (mobile4 != null))
                                         {
                                             mobile4.MessageFrame = m_ActFrames;
                                             mobile4.ScreenX = mobile4.MessageX = num89;
                                             mobile4.ScreenY = num90;
                                             mobile4.MessageY = num96;
                                             if (mobile4.Player)
                                             {
                                                 m_FoliageCheck = new Rectangle(num95, num96, frame2.Image.Width, frame2.Image.Height);
                                             }
                                         }
                                         if (((flag2 && flag24) && ((mobile4 != null) && !mobile4.Player)) && (((mobile4.Notoriety >= Notoriety.Innocent) && (mobile4.Notoriety <= Notoriety.Vendor)) && World.CharData.Halos))
                                         {
                                             if (!m_AlphaEnable)
                                             {
                                                 SetAlphaEnablePrecalc(true);
                                             }
                                             if (m_FilterEnable)
                                             {
                                                 SetFilterEnablePrecalc(false);
                                             }
                                             SetAlpha(1f);
                                             ColorAlphaEnable = true;
                                             Engine.m_Halo.DrawGame(num89 - (Engine.m_Halo.Width >> 1), num90 - (Engine.m_Halo.Height >> 1), Engine.C16232(Hues.GetNotorietyData(mobile4.Notoriety).colors[0x2f]), m_vHaloPool);
                                             ColorAlphaEnable = false;
                                         }
                                         bool flag32 = false;
                                         if (flag24 && (mobile4 != null))
                                         {
                                             if ((mobile4.Flags[MobileFlag.Hidden] || (body == 970)) || (mobile4.Bonded || mobile4.Ghost))
                                             {
                                                 if (!m_AlphaEnable)
                                                 {
                                                     SetAlphaEnablePrecalc(true);
                                                 }
                                                 SetAlpha(0.5f);
                                                 enable = true;
                                                 alpha = 0.5f;
                                             }
                                             else if ((mobile4.Hue & 0x4000) != 0)
                                             {
                                                 if (!m_AlphaEnable)
                                                 {
                                                     SetAlphaEnablePrecalc(true);
                                                 }
                                                 SetAlpha(1f);
                                                 alpha = 1f;
                                                 flag32 = true;
                                             }
                                             else if (m_AlphaEnable)
                                             {
                                                 SetAlphaEnablePrecalc(false);
                                             }
                                         }
                                         else if (body == 970)
                                         {
                                             if (!m_AlphaEnable)
                                             {
                                                 SetAlphaEnablePrecalc(true);
                                             }
                                             SetAlpha(0.5f);
                                             enable = true;
                                             alpha = 0.5f;
                                         }
                                         else if (m_AlphaEnable)
                                         {
                                             SetAlphaEnablePrecalc(false);
                                         }
                                         flag29 = type3 == tMobileCell;
                                         if (flag29)
                                         {
                                             if (((mobile4 != null) && mobile4.HumanOrGhost) && ((equip.Count > 0) && (((EquipEntry) equip[0]).m_Layer == Layer.Mount)))
                                             {
                                                 alphaEnable = m_AlphaEnable;
                                                 fAlpha = m_fAlpha;
                                                 flag31 = flag32;
                                                 t = frame2.Image;
                                                 num98 = num95;
                                                 num99 = num96;
                                             }
                                             else
                                             {
                                                 flag29 = false;
                                             }
                                         }
                                         if (m_FilterEnable)
                                         {
                                             SetFilterEnablePrecalc(false);
                                         }
                                         AlphaTestEnable = true;
                                         if (!ghost && !flag29)
                                         {
                                             if ((((num96 >= ((Engine.GameY + Engine.GameHeight) + 30)) || ((num96 + frame2.Image.Height) <= (Engine.GameY - 30))) || (num95 >= ((Engine.GameX + Engine.GameWidth) + 30))) || ((num95 + frame2.Image.Width) <= (Engine.GameX - 30)))
                                             {
                                                 continue;
                                             }
                                             if (flag32)
                                             {
                                                 SetBlendType(DrawBlendType.BlackTransparency);
                                             }
                                             if (flag24 && (mobile4 != null))
                                             {
                                                 mobile4.DrawGame(frame2.Image, num95, num96);
                                             }
                                             else
                                             {
                                                 frame2.Image.DrawGame(num95, num96);
                                             }
                                             if (flag32)
                                             {
                                                 SetBlendType(DrawBlendType.Normal);
                                             }
                                         }
                                     }
                                     if (type3 == tCorpseCell)
                                     {
                                         Item item6 = World.FindItem(((CorpseCell) cell5).Serial);
                                         if ((item6 != null) && (Engine.m_Animations.GetBodyType(body) == BodyType.Human))
                                         {
                                             int num100 = item6.Equip.Count;
                                             for (int num101 = 0; num101 < num100; num101++)
                                             {
                                                 EquipEntry entry3 = (EquipEntry) item6.Equip[num101];
                                                 int bodyID = entry3.m_Animation;
                                                 if (!flag26)
                                                 {
                                                     notoriety = Hues.GetItemHue(item6.ID, entry3.m_Item.Hue);
                                                 }
                                                 int num103 = num83;
                                                 int num104 = Engine.m_Animations.GetFrameCount(bodyID, action, direction);
                                                 if (num104 == 0)
                                                 {
                                                     num103 = 0;
                                                 }
                                                 else
                                                 {
                                                     num103 = num103 % num104;
                                                 }
                                                 if (m_FilterEnable)
                                                 {
                                                     SetFilterEnablePrecalc(false);
                                                 }
                                                 if (m_AlphaEnable != enable)
                                                 {
                                                     SetAlphaEnablePrecalc(enable);
                                                 }
                                                 if (enable)
                                                 {
                                                     SetAlpha(alpha);
                                                 }
                                                 frame2 = Engine.m_Animations.GetFrame(null, bodyID, action, direction, num103, num89, num90, notoriety, ref num95, ref num96, flag26);
                                                 if ((frame2.Image != null) && !frame2.Image.IsEmpty())
                                                 {
                                                     AlphaTestEnable = true;
                                                     frame2.Image.DrawGame(num95, num96);
                                                 }
                                             }
                                         }
                                     }
                                     else if ((type3 == tMobileCell) && (mobile4 != null))
                                     {
                                         int num105 = 0;
                                         int num106 = ((by - (cell5.Z << 2)) + 0x12) - (num105 = Engine.m_Animations.GetHeight(body, action, direction));
                                         int num107 = bx + 0x16;
                                         num107 += num85;
                                         num106 += num86;
                                         if (((m_MiniHealth && mobile4.OpenedStatus) && ((mobile4.StatusBar == null) && !mobile4.Ghost)) && (mobile4.HPMax > 0))
                                         {
                                             miniHealthQueue.Enqueue(MiniHealthEntry.PoolInstance(num107, (num106 + 4) + num105, mobile4));
                                         }
                                         if (mobile4.HumanOrGhost)
                                         {
                                             int num108 = equip.Count;
                                             bool flag33 = false;
                                             bool flag34 = false;
                                             for (int num109 = 0; num109 < num108; num109++)
                                             {
                                                 EquipEntry entry4 = (EquipEntry) equip[num109];
                                                 if (!ghost || (entry4.m_Layer == Layer.OuterTorso))
                                                 {
                                                     int num110 = entry4.m_Animation;
                                                     int num111 = action;
                                                     int num112 = num83;
                                                     if (ghost)
                                                     {
                                                         num110 = 970;
                                                     }
                                                     if (entry4.m_Layer == Layer.Mount)
                                                     {
                                                         flag33 = true;
                                                         if (mobile4.IsMoving)
                                                         {
                                                             num111 = ((direction & 0x80) == 0) ? 0 : 1;
                                                         }
                                                         else if (mobile4.Animation == null)
                                                         {
                                                             num111 = 2;
                                                         }
                                                         else if (num111 == 0x17)
                                                         {
                                                             num111 = 0;
                                                         }
                                                         else if (num111 == 0x18)
                                                         {
                                                             num111 = 1;
                                                         }
                                                         else
                                                         {
                                                             if ((num111 < 0x19) || (num111 > 0x1d))
                                                             {
                                                                 goto Label_3A65;
                                                             }
                                                             num111 = 2;
                                                         }
                                                     }
                                                     else if (flag33)
                                                     {
                                                         if (mobile4.IsMoving)
                                                         {
                                                             num111 = 0x17 + ((direction & 0x80) >> 7);
                                                         }
                                                         else if (mobile4.Animation == null)
                                                         {
                                                             num111 = 0x19;
                                                         }
                                                     }
                                                     bool flag35 = enable;
                                                     float num113 = alpha;
                                                     int num114 = entry4.m_Item.Hue;
                                                     if (entry4.m_Layer == Layer.Mount)
                                                     {
                                                         int num115 = num110;
                                                         Engine.m_Animations.Translate(ref num115, ref num114);
                                                     }
                                                     bool flag36 = false;
                                                     if ((!flag26 || ((entry4.m_Layer == Layer.Mount) && flag28)) && ((num114 & 0x4000) != 0))
                                                     {
                                                         flag35 = true;
                                                         num113 = 1f;
                                                         flag36 = true;
                                                         notoriety = Hues.Load(0x8bb8);
                                                         flag34 = true;
                                                     }
                                                     else if (!flag26 || ((entry4.m_Layer == Layer.Mount) && flag28))
                                                     {
                                                         notoriety = Hues.GetItemHue(entry4.m_Item.ID, entry4.m_Item.Hue);
                                                         flag34 = false;
                                                     }
                                                     else if (flag26)
                                                     {
                                                         notoriety = hue9;
                                                         flag34 = true;
                                                     }
                                                     else
                                                     {
                                                         flag34 = false;
                                                     }
                                                     int num116 = Engine.m_Animations.GetFrameCount(num110, num111, direction);
                                                     if (num116 == 0)
                                                     {
                                                         num112 = 0;
                                                     }
                                                     else
                                                     {
                                                         num112 = num112 % num116;
                                                     }
                                                     frame2 = Engine.m_Animations.GetFrame(entry4.m_Item, num110, num111, direction, num112, num89, num90, notoriety, ref num95, ref num96, flag34);
                                                     if ((frame2.Image != null) && !frame2.Image.IsEmpty())
                                                     {
                                                         if (!ghost)
                                                         {
                                                             if (m_AlphaEnable != flag35)
                                                             {
                                                                 SetAlphaEnablePrecalc(flag35);
                                                             }
                                                             SetAlpha(num113);
                                                         }
                                                         else
                                                         {
                                                             if (!m_AlphaEnable)
                                                             {
                                                                 SetAlphaEnablePrecalc(true);
                                                             }
                                                             SetAlpha(0.5f);
                                                         }
                                                         if (m_FilterEnable)
                                                         {
                                                             SetFilterEnablePrecalc(false);
                                                         }
                                                         AlphaTestEnable = true;
                                                         if (flag36)
                                                         {
                                                             SetBlendType(DrawBlendType.BlackTransparency);
                                                         }
                                                         entry4.DrawGame(frame2.Image, num95, num96);
                                                         if (flag36)
                                                         {
                                                             SetBlendType(DrawBlendType.Normal);
                                                         }
                                                     }
                                                 }
                                             Label_3A65:
                                                 if ((entry4.m_Layer == Layer.Mount) && flag29)
                                                 {
                                                     if (m_AlphaEnable != alphaEnable)
                                                     {
                                                         SetAlphaEnablePrecalc(alphaEnable);
                                                     }
                                                     if (alphaEnable)
                                                     {
                                                         SetAlpha(fAlpha);
                                                     }
                                                     if (flag31)
                                                     {
                                                         SetBlendType(DrawBlendType.BlackTransparency);
                                                     }
                                                     if (flag24 && (mobile4 != null))
                                                     {
                                                         mobile4.DrawGame(t, num98, num99);
                                                     }
                                                     else
                                                     {
                                                         t.DrawGame(num98, num99);
                                                     }
                                                     if (flag31)
                                                     {
                                                         SetBlendType(DrawBlendType.Normal);
                                                     }
                                                 }
                                             }
                                         }
                                         if (flag24 && (mobile4 != null))
                                         {
                                             if ((mobile4 == Engine.m_LastHarmTarget) && (player.Warmode || ((Engine.TargetHandler is ServerTargetHandler) && ((((ServerTargetHandler) Engine.TargetHandler).Flags & ServerTargetFlags.Harmful) != ServerTargetFlags.None))))
                                             {
                                                 DrawColoredIcon(num89, num90, 0xff2200, false, true);
                                             }
                                             else if ((mobile4 == Engine.m_LastBenTarget) && (player.Warmode || ((Engine.TargetHandler is ServerTargetHandler) && ((((ServerTargetHandler) Engine.TargetHandler).Flags & ServerTargetFlags.Beneficial) != ServerTargetFlags.None))))
                                             {
                                                 DrawColoredIcon(num89, num90, 0xffff, false, true);
                                             }
                                             else if ((mobile4 == Engine.m_LastTarget) && (player.Warmode || ((Engine.TargetHandler is ServerTargetHandler) && ((((ServerTargetHandler) Engine.TargetHandler).Flags & (ServerTargetFlags.Beneficial | ServerTargetFlags.Harmful)) == ServerTargetFlags.None))))
                                             {
                                                 DrawColoredIcon(num89, num90, 0xcccccc, false, true);
                                             }
                                         }
                                         if ((flag24 && (mobile4 != null)) && World.CharData.Halos)
                                         {
                                             int color = -1;
                                             bool formation = false;
                                             if (mobile4.m_IsFriend)
                                             {
                                                 color = 0xff22;
                                             }
                                             else if (!mobile4.Player && player.Warmode)
                                             {
                                                 bool flag38 = false;
                                                 if (mobile4.Notoriety == Notoriety.Innocent)
                                                 {
                                                     int num118 = mobile4.X - package.CellX;
                                                     int num119 = mobile4.Y - package.CellY;
                                                     if ((((num118 >= 0) && (num118 < cellWidth)) && ((num119 >= 0) && (num119 < cellHeight))) && package.landTiles[num118, num119].m_Guarded)
                                                     {
                                                         flag38 = true;
                                                     }
                                                 }
                                                 if (!flag38 && mobile4.Human)
                                                 {
                                                     if (((mobile == null) || (mobile4.Serial < mobile.Serial)) && player.InSquareRange(mobile4, 12))
                                                     {
                                                         mobile = mobile4;
                                                     }
                                                     color = 0xff2200;
                                                     formation = mobile4 == m_LastEnemy;
                                                 }
                                             }
                                             if (color != -1)
                                             {
                                                 DrawColoredIcon(num89, num96 - 10, color, formation, false);
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         if (((multiPreview && (x >= num28)) && ((x <= num30) && (y >= num29))) && (y <= num31))
                         {
                             int num120 = bx + 0x16;
                             int num121 = by + 0x2b;
                             if (m_vMultiPool == null)
                             {
                                 m_vMultiPool = VertexConstructor.Create();
                             }
                             for (int num122 = 0; num122 < num27; num122++)
                             {
                                 MultiItem item7 = (MultiItem) Engine.m_MultiList[num122];
                                 if (((item7.X == (x - num23)) && (item7.Y == (y - num24))) && (item7.Z == 0))
                                 {
                                     num26 = num122 + 1;
                                     int num123 = item7.ItemID & 0x3fff;
                                     AnimData data2 = Map.GetAnim(num123);
                                     Texture texture5 = null;
                                     if ((data2.frameCount == 0) || !Map.m_ItemFlags[num123][TileFlag.Animation])
                                     {
                                         texture5 = hue.GetItem(item7.ItemID);
                                     }
                                     else
                                     {
                                         texture5 = hue.GetItem(item7.ItemID + data2[(m_Frames / (data2.frameInterval + 1)) % data2.frameCount]);
                                     }
                                     if ((texture5 != null) && !texture5.IsEmpty())
                                     {
                                         if (m_AlphaEnable)
                                         {
                                             m_AlphaEnable = false;
                                         }
                                         if (!m_AlphaTestEnable)
                                         {
                                             m_AlphaTestEnable = true;
                                         }
                                         if (m_FilterEnable)
                                         {
                                             SetFilterEnablePrecalc(false);
                                         }
                                         texture5.DrawGame(num120 - (texture5.Width >> 1), (num121 - ((num25 + item7.Z) << 2)) - texture5.Height, m_vMultiPool);
                                     }
                                 }
                                 else if (((item7.X + num23) > x) || (((item7.X + num23) == x) && ((item7.Y + num24) >= y)))
                                 {
                                     break;
                                 }
                             }
                         }
                         for (int num124 = 0; num124 < list2.Count; num124++)
                         {
                             DrawQueueEntry entry5 = (DrawQueueEntry) list2[num124];
                             if ((entry5.m_TileX == x) && (entry5.m_TileY == y))
                             {
                                 list2.RemoveAt(num124);
                                 num124--;
                                 entry5.m_Texture.Flip = entry5.m_Flip;
                                 Clipper clipper = new Clipper(Engine.GameX, by - 0x2e, Engine.GameWidth, (Engine.GameHeight - by) + 0x2e);
                                 if (m_AlphaEnable != entry5.m_bAlpha)
                                 {
                                     SetAlphaEnablePrecalc(entry5.m_bAlpha);
                                 }
                                 if (entry5.m_bAlpha)
                                 {
                                     SetAlpha(entry5.m_fAlpha);
                                 }
                                 if (!m_AlphaTestEnable)
                                 {
                                     m_AlphaTestEnable = true;
                                 }
                                 if (m_FilterEnable)
                                 {
                                     SetFilterEnablePrecalc(false);
                                 }
                                 entry5.m_Texture.DrawClipped(entry5.m_DrawX, entry5.m_DrawY, clipper);
                             }
                         }
                         x++;
                         y--;
                     }
                 }
                 if (m_FilterEnable)
                 {
                     SetFilterEnablePrecalc(false);
                 }
                 if (m_Transparency)
                 {
                     if (m_vTransDrawPool == null)
                     {
                         m_vTransDrawPool = VertexConstructor.Create();
                     }
                     while (transDrawQueue.Count > 0)
                     {
                         TransparentDraw draw = (TransparentDraw) transDrawQueue.Dequeue();
                         if (m_AlphaEnable != draw.m_bAlpha)
                         {
                             SetAlphaEnablePrecalc(draw.m_bAlpha);
                         }
                         if (draw.m_bAlpha)
                         {
                             SetAlpha(draw.m_fAlpha);
                         }
                         AlphaTestEnable = true;
                         draw.m_Texture.DrawGame(draw.m_X, draw.m_Y, m_vTransDrawPool);
                         if (draw.m_Double)
                         {
                             draw.m_Texture.DrawGame(draw.m_X + 5, draw.m_Y + 5, m_vTransDrawPool);
                         }
                         draw.Dispose();
                     }
                 }
                 SetTexture(null);
                 if (miniHealthQueue.Count > 0)
                 {
                     while (miniHealthQueue.Count > 0)
                     {
                         int num127;
                         int num128;
                         MiniHealthEntry entry6 = (MiniHealthEntry) miniHealthQueue.Dequeue();
                         Mobile mobile5 = entry6.m_Mobile;
                         if (m_AlphaEnable)
                         {
                             SetAlphaEnablePrecalc(false);
                         }
                         AlphaTestEnable = false;
                         TransparentRect(0, entry6.m_X - 0x10, entry6.m_Y + 8, 0x20, 7);
                         double num125 = ((double) mobile5.HPCur) / ((double) mobile5.HPMax);
                         if (num125 == double.NaN)
                         {
                             num125 = 0.0;
                         }
                         else if (num125 < 0.0)
                         {
                             num125 = 0.0;
                         }
                         else if (num125 > 1.0)
                         {
                             num125 = 1.0;
                         }
                         int width = (int) ((30.0 * num125) + 0.5);
                         if (!m_AlphaEnable)
                         {
                             SetAlphaEnablePrecalc(true);
                         }
                         SetAlpha(0.6f);
                         MobileFlags flags2 = mobile5.Flags;
                         if (flags2[MobileFlag.Poisoned])
                         {
                             num127 = 0xff00;
                             num128 = 0x8000;
                         }
                         else if (flags2[MobileFlag.YellowHits])
                         {
                             num127 = 0xffc000;
                             num128 = 0x806000;
                         }
                         else
                         {
                             num127 = 0x20c0ff;
                             num128 = 0x106080;
                         }
                         GradientRect(num127, num128, entry6.m_X - 15, entry6.m_Y + 9, width, 5);
                         GradientRect(0xc80000, 0x640000, (entry6.m_X - 15) + width, entry6.m_Y + 9, 30 - width, 5);
                         AlphaTestEnable = true;
                         entry6.Dispose();
                     }
                 }
                 if (Engine.m_Ingame)
                 {
                     if (m_AlphaEnable)
                     {
                         SetAlphaEnablePrecalc(false);
                     }
                     AlphaTestEnable = true;
                     Engine.Effects.Draw();
                     if ((eOffsetX != 0) || (eOffsetY != 0))
                     {
                         Engine.Effects.Offset(eOffsetX, eOffsetY);
                     }
                 }
                 Map.Unlock();
                 SetViewport(0, 0, Engine.ScreenWidth, Engine.ScreenHeight);
             }
             if (!Engine.m_Loading)
             {
                 if (m_AlphaEnable)
                 {
                     SetAlphaEnablePrecalc(false);
                 }
                 AlphaTestEnable = true;
                 MessageManager.BeginRender();
                 if (Engine.m_Ingame && (m_TextSurface != null))
                 {
                     SetTexture(null);
                     AlphaTestEnable = false;
                     if (!m_AlphaEnable)
                     {
                         SetAlphaEnablePrecalc(true);
                     }
                     SetAlpha(0.5f);
                     if (((player != null) && player.OpenedStatus) && (player.StatusBar == null))
                     {
                         SolidRect(0, Engine.GameX + 2, (Engine.GameY + Engine.GameHeight) - 0x15, Engine.GameWidth - 0x2e, 0x13);
                         SetAlphaEnablePrecalc(false);
                         int num129 = (Engine.GameX + Engine.GameWidth) - 0x2c;
                         int num130 = (Engine.GameY + Engine.GameHeight) - 0x15;
                         SolidRect(0, num129, num130, 0x2a, 0x13);
                         num129++;
                         num130++;
                         if (player.Ghost)
                         {
                             GradientRect(0xc0c0c0, 0x606060, num129, num130, 40, 5);
                             num130 += 6;
                             GradientRect(0xc0c0c0, 0x606060, num129, num130, 40, 5);
                             num130 += 6;
                             GradientRect(0xc0c0c0, 0x606060, num129, num130, 40, 5);
                         }
                         else
                         {
                             int num132;
                             int num133;
                             int num131 = (int) ((((double) player.HPCur) / ((double) player.HPMax)) * 40.0);
                             if (num131 > 40)
                             {
                                 num131 = 40;
                             }
                             else if (num131 < 0)
                             {
                                 num131 = 0;
                             }
                             MobileFlags flags3 = player.Flags;
                             if (flags3[MobileFlag.Poisoned])
                             {
                                 num132 = 0xff00;
                                 num133 = 0x8000;
                             }
                             else if (flags3[MobileFlag.YellowHits])
                             {
                                 num132 = 0xffc000;
                                 num133 = 0x806000;
                             }
                             else
                             {
                                 num132 = 0x20c0ff;
                                 num133 = 0x106080;
                             }
                             GradientRect(num132, num133, num129, num130, num131, 5);
                             GradientRect(0xff0000, 0x800000, num129 + num131, num130, 40 - num131, 5);
                             num130 += 6;
                             num131 = (int) ((((double) player.ManaCur) / ((double) player.ManaMax)) * 40.0);
                             if (num131 > 40)
                             {
                                 num131 = 40;
                             }
                             else if (num131 < 0)
                             {
                                 num131 = 0;
                             }
                             GradientRect(0x20c0ff, 0x106080, num129, num130, 40, 5);
                             GradientRect(0xff0000, 0x800000, num129 + num131, num130, 40 - num131, 5);
                             num130 += 6;
                             num131 = (int) ((((double) player.StamCur) / ((double) player.StamMax)) * 40.0);
                             if (num131 > 40)
                             {
                                 num131 = 40;
                             }
                             else if (num131 < 0)
                             {
                                 num131 = 0;
                             }
                             GradientRect(0x20c0ff, 0x106080, num129, num130, 40, 5);
                             GradientRect(0xff0000, 0x800000, num129 + num131, num130, 40 - num131, 5);
                         }
                     }
                     else
                     {
                         SolidRect(0, Engine.GameX + 2, (Engine.GameY + Engine.GameHeight) - 0x15, Engine.GameWidth - 4, 0x13);
                     }
                     if (m_AlphaEnable)
                     {
                         SetAlphaEnablePrecalc(false);
                     }
                     AlphaTestEnable = true;
                     m_vTextCache.Draw(m_TextSurface, Engine.GameX + 2, ((Engine.GameY + Engine.GameHeight) - 2) - m_TextSurface.Height);
                 }
                 Gumps.Draw();
             }
             if (Engine.m_Ingame)
             {
                 int num134 = (Engine.GameY + Engine.GameHeight) - ((m_TextSurface == null) ? 2 : (m_TextSurface.Height + 4));
                 ArrayList rectsList = m_RectsList;
                 if (rectsList == null)
                 {
                     rectsList = m_RectsList = new ArrayList();
                 }
                 else if (rectsList.Count > 0)
                 {
                     rectsList.Clear();
                 }
                 World.DrawAllMessages();
                 textToDrawList.Sort();
                 int num135 = textToDrawList.Count;
                 for (int num136 = 0; num136 < num135; num136++)
                 {
                     TextMessage message = (TextMessage) textToDrawList[num136];
                     int num137 = message.X + Engine.GameX;
                     int num138 = message.Y + Engine.GameY;
                     if (num137 < (Engine.GameX + 2))
                     {
                         num137 = Engine.GameX + 2;
                     }
                     else if ((num137 + message.Image.Width) >= ((Engine.GameX + Engine.GameWidth) - 2))
                     {
                         num137 = ((Engine.GameX + Engine.GameWidth) - message.Image.Width) - 2;
                     }
                     if (num138 < (Engine.GameY + 2))
                     {
                         num138 = Engine.GameY + 2;
                     }
                     else if ((num138 + message.Image.Height) >= ((Engine.GameY + Engine.GameHeight) - 2))
                     {
                         num138 = ((Engine.GameY + Engine.GameHeight) - message.Image.Height) - 2;
                     }
                     rectsList.Add(new Rectangle(num137, num138, message.Image.Width, message.Image.Height));
                 }
                 for (int num139 = 0; num139 < num135; num139++)
                 {
                     TextMessage message2 = (TextMessage) textToDrawList[num139];
                     Rectangle rect = (Rectangle) rectsList[num139];
                     float num140 = 1f;
                     int num141 = rectsList.Count;
                     for (int num142 = num139 + 1; num142 < num141; num142++)
                     {
                         Rectangle rectangle3 = (Rectangle) rectsList[num142];
                         if (rectangle3.IntersectsWith(rect))
                         {
                             num140 += ((TextMessage) textToDrawList[num142]).Alpha;
                         }
                     }
                     if ((num140 == 1f) && !message2.Disposing)
                     {
                         if (m_AlphaEnable)
                         {
                             SetAlphaEnablePrecalc(false);
                         }
                     }
                     else
                     {
                         if (!m_AlphaEnable)
                         {
                             SetAlphaEnablePrecalc(true);
                         }
                         if (message2.Disposing)
                         {
                             SetAlpha((1f / num140) * message2.Alpha);
                         }
                         else
                         {
                             SetAlpha(1f / num140);
                         }
                     }
                     AlphaTestEnable = true;
                     message2.Draw(rect.X, rect.Y);
                 }
                 if ((eOffsetX != 0) || (eOffsetY != 0))
                 {
                     World.Offset(eOffsetX, eOffsetY);
                 }
             }
             if (!Engine.m_Loading)
             {
                 if (m_AlphaEnable)
                 {
                     SetAlphaEnablePrecalc(false);
                 }
                 AlphaTestEnable = true;
                 Cursor.Draw();
             }
             PushAll();
         }
         catch (Exception exception)
         {
             Debug.Trace("Draw Exception:");
             Debug.Error(exception);
         }
         finally
         {
             Engine.m_Device.EndScene();
         }
         Engine.m_Device.Present();
         m_Count = 0;
         m_LastEnemy = mobile;
         if (m_ScreenShot != null)
         {
             Save(m_ScreenShot);
         }
         m_ActFrames++;
         while (toUpdateQueue.Count > 0)
         {
             Mobile mobile6 = (Mobile) toUpdateQueue.Dequeue();
             mobile6.MovedTiles++;
             mobile6.Update();
         }
         Map.Unlock();
     }
 }
Ejemplo n.º 9
0
 protected internal override void Draw(int x, int y)
 {
     base.Draw(x, y);
     if ((this.m_xLast != x) || (this.m_yLast != y))
     {
         this.m_xLast = x;
         this.m_yLast = y;
         Clipper clipper = new Clipper(x + 0x25, y + 0x2d, 0xde, 0x2f);
         for (int i = 0; i < base.m_Children.Count; i++)
         {
             if (base.m_Children[i] is GItemListEntry)
             {
                 ((GItemListEntry) base.m_Children[i]).Clipper = clipper;
             }
         }
         this.m_EntryLabel.Scissor(new Clipper(x + 0x27, y + 0x6a, 0xda, 11));
     }
 }
Ejemplo n.º 10
0
 public void SetClipper(Clipper c)
 {
     this.m_Clipper = c;
     this.m_Name.Clipper = c;
     this.m_Value.Clipper = c;
     this.m_NameBack.Clipper = c;
     this.m_ValueBack.Clipper = c;
     if (this.m_Hue != null)
     {
         this.m_Hue.Clipper = c;
     }
 }
Ejemplo n.º 11
0
 protected internal override void Draw(int x, int y)
 {
     if (((this.m_xLast != x) || (this.m_yLast != y)) || ((this.m_xWidthLast != base.m_Width) || (this.m_yHeightLast != base.m_Height)))
     {
         Clipper clipper = new Clipper(x + 1, y + 1, base.m_Width - 0x11, base.m_Height - 2);
         foreach (Gump gump in base.m_Children.ToArray())
         {
             Type type = gump.GetType();
             if (type == tGLabel)
             {
                 ((GLabel) gump).Scissor(clipper);
             }
             else if (type == tGSkillGump)
             {
                 ((GSkillGump) gump).Scissor(clipper);
             }
         }
         this.m_xLast = x;
         this.m_yLast = y;
         this.m_xWidthLast = base.m_Width;
         this.m_yHeightLast = base.m_Height;
     }
     base.Draw(x, y);
 }
Ejemplo n.º 12
0
 public void DrawClipped(int X, int Y, Clipper Clipper)
 {
     if (Clipper == null)
     {
         this.Draw(X, Y, m_BadClipperPool);
     }
     else if (this.m_Surface != null)
     {
         CustomVertex.TransformedColoredTextured[] poolClipped = m_PoolClipped;
         if (Clipper.Clip(X, Y, this.Width, this.Height, poolClipped))
         {
             poolClipped[0].Color = poolClipped[1].Color = poolClipped[2].Color = poolClipped[3].Color = Renderer.GetQuadColor(0xffffff);
             if (this.m_Flip)
             {
                 poolClipped[3].Tu = poolClipped[2].Tu = 1f - poolClipped[3].Tu;
                 poolClipped[1].Tu = poolClipped[0].Tu = 1f - poolClipped[1].Tu;
             }
             poolClipped[0].Tu *= this.m_MaxTU;
             poolClipped[1].Tu *= this.m_MaxTU;
             poolClipped[2].Tu *= this.m_MaxTU;
             poolClipped[3].Tu *= this.m_MaxTU;
             poolClipped[0].Tv *= this.m_MaxTV;
             poolClipped[1].Tv *= this.m_MaxTV;
             poolClipped[2].Tv *= this.m_MaxTV;
             poolClipped[3].Tv *= this.m_MaxTV;
             Renderer.SetTexture(this);
             Renderer.DrawQuadPrecalc(poolClipped);
         }
     }
 }
Ejemplo n.º 13
0
 public GQuickLogin()
     : base(0, 0, 200, 20)
 {
     this.m_CompactHeight = 20;
     this.m_ExpandedHeight = Engine.GameHeight / 2;
     base.m_CanDrag = false;
     this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0);
     GLabel toAdd = new GLabel("Quick Login", Engine.GetUniFont(0), Hues.Default, 2, 2);
     this.Height = toAdd.Height + 4;
     this.m_CompactHeight = base.m_Height;
     base.m_Children.Add(toAdd);
     toAdd.Center();
     QuickLogin.Load();
     int count = QuickLogin.Entries.Count;
     if (count == 0)
     {
         base.Visible = false;
     }
     else
     {
         if (count > 12)
         {
             count = 12;
         }
         int num2 = (2 + toAdd.Height) + 4;
         if (count == 0)
         {
             num2 -= 2;
         }
         OnClick onClick = new OnClick(Engine.QuickLogin_OnClick);
         Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2);
         for (int i = 0; i < count; i++)
         {
             Entry entry = (Entry) QuickLogin.Entries[i];
             GTextButton button = new GTextButton(entry.CharName, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick);
             base.m_Children.Add(button);
             button.Center();
             button.Y = num2;
             button.Scissor(clipper);
             button.SetTag("Index", i);
             num2 += button.Height;
             int num4 = 0;
             bool flag = false;
             for (int j = 0; j < count; j++)
             {
                 Entry entry2 = (Entry) QuickLogin.Entries[j];
                 if (entry2.CharName == entry.CharName)
                 {
                     if (j <= i)
                     {
                         num4++;
                     }
                     if (j != i)
                     {
                         flag = true;
                     }
                 }
             }
             if (flag)
             {
                 button.Tooltip = new Tooltip(string.Format("{0}\n{1}", num4, entry.ServerName));
             }
             else
             {
                 button.Tooltip = new Tooltip(entry.ServerName);
             }
         }
         if (count != 0)
         {
             num2 += 2;
         }
         if (num2 > 480)
         {
             num2 = 480;
         }
         this.m_ExpandedHeight = num2;
     }
 }
Ejemplo n.º 14
0
 protected internal override void Draw(int X, int Y)
 {
     if ((this.m_xLast != X) || (this.m_yLast != Y))
     {
         this.m_xLast = X;
         this.m_yLast = Y;
         this.m_Clipper = new Clipper(this.m_xLast + 5, this.m_yLast, this.Width - 10, this.Height);
         for (int i = 0; i < this.m_Panels.Length; i++)
         {
             this.m_Panels[i].SetClipper(this.m_Clipper);
         }
     }
     Renderer.SetTexture(null);
     GumpPaint.DrawSunken3D(X - 2, Y - 2, this.Width + 4, this.Height + 4);
 }
Ejemplo n.º 15
0
 protected internal override void Draw(int x, int y)
 {
     if ((this.m_xLast != x) || (this.m_yLast != y))
     {
         this.m_xLast = x;
         this.m_yLast = y;
         Clipper clipper = new Clipper(x + 0x1f, y + 0x3b, 0xc5, 0xb1);
         foreach (Gump gump in base.m_Children.ToArray())
         {
             if (gump is GSellGump_InventoryItem)
             {
                 ((GSellGump_InventoryItem) gump).Clipper = clipper;
             }
         }
     }
     base.Draw(x, y);
 }
Ejemplo n.º 16
0
 protected internal override void Draw(int x, int y)
 {
     if ((this.m_xLast != x) || (this.m_yLast != y))
     {
         this.m_xLast = x;
         this.m_yLast = y;
         Clipper clipper = new Clipper(x + 0x20, y + 0x42, 0xc4, 0x5c);
         this.m_ContentClipper = clipper;
         foreach (Gump gump in base.m_Children.ToArray())
         {
             if (gump is GBuyGump_OfferedItem)
             {
                 ((GBuyGump_OfferedItem) gump).Clipper = clipper;
             }
         }
     }
     if ((this.m_Signature != null) && (this.m_SignatureAnimation != null))
     {
         double normalized = this.m_SignatureAnimation.Normalized;
         if (normalized >= 1.0)
         {
             this.m_Signature.Scissor(null);
             this.m_SignatureAnimation = null;
         }
         else
         {
             this.m_Signature.Scissor(0, 0, (int) (normalized * this.m_Signature.Width), this.m_Signature.Height);
         }
         Engine.Redraw();
     }
     if (this.m_LastHeight >= 0)
     {
         this.m_yOffset = 0x43 - ((int) ((this.m_Slider.GetValue() / 50.0) * this.m_LastHeight));
     }
     else
     {
         this.m_yOffset = 0x43;
     }
     this.m_LastOffset = 0x43 - this.m_yOffset;
     base.Draw(x, y);
 }
Ejemplo n.º 17
0
 public static unsafe void SolidRect(int Color, int X, int Y, int Width, int Height, Clipper c)
 {
     if ((Width > 0) && (Height > 0))
     {
         float num = -0.5f + X;
         float num2 = -0.5f + Y;
         CustomVertex.TransformedColoredTextured[] vertices = GeoPool(4);
         vertices[0].Color = vertices[1].Color = vertices[2].Color = vertices[3].Color = GetQuadColor(Color);
         vertices[0].X = vertices[1].X = num + Width;
         vertices[0].Y = vertices[2].Y = num2 + Height;
         vertices[1].Y = vertices[3].Y = num2;
         vertices[2].X = vertices[3].X = num;
         if (c.Clip(X, Y, Width, Height, vertices))
         {
             fixed (CustomVertex.TransformedColoredTextured* texturedRef = vertices)
             {
                 PushQuad(texturedRef);
             }
         }
     }
 }
Ejemplo n.º 18
0
 public void Scissor(Clipper c)
 {
     this.m_Name.Scissor(c);
     this.m_Value.Scissor(c);
     this.m_Lock.Scissor(c);
 }
Ejemplo n.º 19
0
 public static void TransparentRect(int Color, int X, int Y, int Width, int Height, Clipper c)
 {
     SolidRect(Color, X, Y, 1, Height, c);
     SolidRect(Color, (X + Width) - 1, Y, 1, Height, c);
     SolidRect(Color, X + 1, Y, Width - 2, 1, c);
     SolidRect(Color, X + 1, (Y + Height) - 1, Width - 2, 1, c);
 }