Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
- {
- Main.NewText("Before", 100, 220, 100);
- if (maxDepth >= 3.40282347E+38f && minDepth < 3.40282347E+38f)
- {
- spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * this._fadeOpacity);
- spriteBatch.Draw(this._bgTexture, new Rectangle(0, Math.Max(0, (int)((Main.worldSurface * 16.0 - (double)Main.screenPosition.Y - 2400.0) * 0.10000000149011612)), Main.screenWidth, Main.screenHeight), Color.White * Math.Min(1f, (Main.screenPosition.Y - 800f) / 1000f * this._fadeOpacity));
- Vector2 vector = new Vector2((float)(Main.screenWidth >> 1), (float)(Main.screenHeight >> 1));
- Vector2 vector2 = 0.01f * (new Vector2((float)Main.maxTilesX * 8f, (float)Main.worldSurface / 2f) - Main.screenPosition);
- spriteBatch.Draw(this._planetTexture, vector + new Vector2(-200f, -200f) + vector2, null, Color.White * 0.9f * this._fadeOpacity, 0f, new Vector2((float)(this._planetTexture.Width >> 1), (float)(this._planetTexture.Height >> 1)), 1f, 0, 1f);
- }
- int num = -1;
- int num2 = 0;
- for (int i = 0; i < this._stars.Length; i++)
- {
- float depth = this._stars[i].Depth;
- if (num == -1 && depth < maxDepth)
- {
- num = i;
- }
- if (depth <= minDepth)
- {
- break;
- }
- num2 = i;
- }
- if (num == -1)
- {
- return;
- }
- float num3 = Math.Min(1f, (Main.screenPosition.Y - 1000f) / 1000f);
- Vector2 vector3 = Main.screenPosition + new Vector2((float)(Main.screenWidth >> 1), (float)(Main.screenHeight >> 1));
- Rectangle rectangle = new Rectangle(-1000, -1000, 4000, 4000);
- for (int j = num; j < num2; j++)
- {
- Vector2 vector4 = new Vector2(1f / this._stars[j].Depth, 1.1f / this._stars[j].Depth);
- Vector2 vector5 = (this._stars[j].Position - vector3) * vector4 + vector3 - Main.screenPosition;
- if (rectangle.Contains((int)vector5.X, (int)vector5.Y))
- {
- float num4 = (float)Math.Sin((double)(this._stars[j].AlphaFrequency * Main.GlobalTime + this._stars[j].SinOffset)) * this._stars[j].AlphaAmplitude + this._stars[j].AlphaAmplitude;
- float num5 = (float)Math.Sin((double)(this._stars[j].AlphaFrequency * Main.GlobalTime * 5f + this._stars[j].SinOffset)) * 0.1f - 0.1f;
- num4 = MathHelper.Clamp(num4, 0f, 1f);
- Texture2D texture2D = this._starTextures[this._stars[j].TextureIndex];
- spriteBatch.Draw(texture2D, vector5, null, Color.White * num3 * num4 * 0.8f * (1f - num5) * this._fadeOpacity, 0f, new Vector2((float)(texture2D.Width >> 1), (float)(texture2D.Height >> 1)), (vector4.X * 0.5f + 0.5f) * (num4 * 0.3f + 0.7f), 0, 0f);
- }
- }
- Main.NewText("After", 100, 220, 100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement