   having an issue with my renderer!
  2 major problems...1 it looks like this code is rendering my tiles on top of eachother in a specific region.2 it will only render so far then it stops, it doesn't render past a certain point to the bottom left.I know its something silly but I looked all night last night and couldn't find it.and i know i need to use an array for the mousemap but i just haven't gotten around to it :)Thanks public Point WorldToScreen(int x, int y)   {  Point p = new Point();  p.X = ((x - y) * TileWidth / 2) + (TileWidth*ScreenOffsetX);  p.Y = ((x + y) * TileHeight / 2) + (TileHeight*ScreenOffsetY);  return p; }public Point ScreenToWorld(int X, int Y)   {  int tilePosX = 0;  int tilePosY = 0;  int tileCoordX = 0;  int tileCoordY = 0;    Point p = new Point();  tilePosX = ((Y) / TileHeight) + ((X) / TileWidth) + ScreenOffsetX;  tilePosY = ((Y) / TileHeight) - ((X) / TileWidth) + ScreenOffsetY;  tileCoordX = (X) % TileWidth;  tileCoordY = (Y) % TileHeight;  if (tileCoordX < 0)  { tileCoordX += TileWidth; tilePosX -= 1;   }  if (tileCoordY < 0)  { tileCoordY += TileHeight; tilePosY -= 1;  }  System.Drawing.Color color =  SentientEnvironment.ENGINE.SentientInpt.MouseMap.GetPixel(tileCoordX, tileCoordY);  if (color.R == System.Drawing.Color.Red.R && color.G == System.Drawing.Color.Red.G && color.B == System.Drawing.Color.Red.B)  { tilePosX -= 1;  }  else if (color.R == System.Drawing.Color.Green.R && color.G == System.Drawing.Color.Green.G && color.B == System.Drawing.Color.Green.B)  { tilePosY += 1;  }  else if (color.R == System.Drawing.Color.Blue.R && color.G == System.Drawing.Color.Blue.G && color.B == System.Drawing.Color.Blue.B)  { tilePosX += 1;  }  else if (color.R == System.Drawing.Color.Magenta.R && color.G == System.Drawing.Color.Magenta.G && color.B == System.Drawing.Color.Magenta.B)  { tilePosY -= 1;  }  p.X = tilePosX;  p.Y =  tilePosY;  return p;   }public void UpdateExtent()   {  Point topRight = ScreenToWorld(SentientEnvironment.ENGINE._sentientView.Width, 0);  Point bottomRight = ScreenToWorld(SentientEnvironment.ENGINE._sentientView.Width, SentientEnvironment.ENGINE._sentientView.Height);  Point topLeft = ScreenToWorld(0, 0);  Point bottomLeft = ScreenToWorld(0, SentientEnvironment.ENGINE._sentientView.Height);  Rectangle screenRect1 = new Rectangle();  Rectangle screenRect2 = new Rectangle();  Rectangle screenRect3 = new Rectangle();  Rectangle screenRect4 = new Rectangle();  Rectangle space = new Rectangle();  screenRect1.Offset(topRight);  screenRect2.Offset(bottomLeft);  screenRect3.Offset(topLeft);  screenRect4.Offset(bottomRight);  space = Rectangle.Union(screenRect1, screenRect2);  space = Rectangle.Union(space, screenRect3);  space = Rectangle.Union(space, screenRect4);    _extent = space;   }public void RenderTerrain()   {  if (RenderTerrainLayer)  { int x = 0; int y = 0; if (SentientEnvironment.D3DDEVICE == null)return; for (y = _extent.Top; y <= _extent.Bottom; y++) {for (x = _extent.Left; x <= _extent.Right; x++){    SentientTile sTile = SentientEnvironment.REGION_MANAGER.CurrentRegion.GetRegionItem(x, y);    if (null != sTile)    {   Vector3 v3 = new Vector3();   Point p = WorldToScreen(x, y);   v3.X = p.X;   v3.Y = p.Y;   sTile.AnchorPoint = v3;   DrawSprite(SentientEnvironment.ENGINE._sentientView.D3DDevice, this._sprte, sTile, sTile.AnchorPoint);   if (sTile.Selected)   {  DrawSprite(SentientEnvironment.ENGINE._sentientView.D3DDevice, this._sprte, SentientEnvironment.REGION_MANAGER.CurrentRegion.SelectionTile, sTile.AnchorPoint);   }    }} }  }   }
  woops forgot to add the update extent method   