Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Draw(int layer = 0)
- {
- if (this._reRenderMap)
- {
- this.MapRendered = false;
- this.ReleaseRenderTextures();
- this._preRenderLayer = 0;
- this._preRenderStage = 0;
- this._reRenderMap = false;
- }
- if (layer == 0)
- {
- this.DrawPanorama();
- }
- if (!this.MapRendered)
- {
- if (Globals.Database.RenderCaching)
- {
- return;
- }
- switch (layer)
- {
- case 0:
- {
- for (int i = 0; i < 3; i++)
- {
- this.DrawMapLayer(null, i, Globals.AnimFrame, this.GetX(), this.GetY());
- }
- break;
- }
- case 1:
- {
- this.DrawMapLayer(null, 3, Globals.AnimFrame, this.GetX(), this.GetY());
- break;
- }
- case 2:
- {
- this.DrawMapLayer(null, 4, Globals.AnimFrame, this.GetX(), this.GetY());
- break;
- }
- }
- }
- else if (layer == 0)
- {
- GameGraphics.DrawGameTexture(this.LowerTextures[Globals.AnimFrame], this.GetX(), this.GetY(), null, GameBlendModes.None, null, 0f);
- }
- else if (layer != 1)
- {
- GameGraphics.DrawGameTexture(this.PeakTextures[Globals.AnimFrame], this.GetX(), this.GetY(), null, GameBlendModes.None, null, 0f);
- }
- else
- {
- GameGraphics.DrawGameTexture(this.UpperTextures[Globals.AnimFrame], this.GetX(), this.GetY(), null, GameBlendModes.None, null, 0f);
- }
- if (layer == 0)
- {
- foreach (KeyValuePair<int, MapItemInstance> item in this.MapItems)
- {
- ItemBase itemBase = ItemBase.GetItem(item.Value.ItemNum);
- if (itemBase != null)
- {
- GameTexture itemTex = Globals.ContentManager.GetTexture(GameContentManager.TextureType.Item, itemBase.Pic);
- if (itemTex != null)
- {
- GameGraphics.DrawGameTexture(itemTex, this.GetX() + (float)(item.Value.X * Options.TileWidth), this.GetY() + (float)(item.Value.Y * Options.TileHeight), null, GameBlendModes.None, null, 0f);
- }
- }
- }
- foreach (LightBase light in base.Lights)
- {
- double w = (double)light.Size;
- float x = this.GetX() + (float)(light.TileX * Options.TileWidth + light.OffsetX) + (float)Options.TileWidth / 2f;
- float y = this.GetY() + (float)(light.TileY * Options.TileHeight + light.OffsetY) + (float)Options.TileHeight / 2f;
- GameGraphics.AddLight((int)x, (int)y, (int)w, light.Intensity, light.Expand, light.Color);
- }
- this.UpdateMapAttributes();
- }
- if (layer == 2)
- {
- this.DrawFog();
- this.DrawOverlayGraphic();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement