public LarvContent(GraphicsDevice graphicsDevice, ContentManager content, IEnumerable<string> sceneDescription) : base(graphicsDevice, content) { SpriteBatch = new SpriteBatch(graphicsDevice); Font = Load<SpriteFont>("fonts/BlackCastle"); SignTextEffect = LoadEffect("effects/signtexteffect"); TextureEffect = LoadEffect("effects/simpletextureeffect"); BumpEffect = LoadEffect("effects/simplebumpeffect"); Sphere = new SpherePrimitive<VertexPositionNormalTangentTexture>(GraphicsDevice, (p, n, t, tx) => new VertexPositionNormalTangentTexture(p, n, t, tx), 2, 10); Sky = new SkySphere(this, Load<TextureCube>(@"Textures\clouds")); Ground = new Ground(this); ShadowMap = new ShadowMap(this, 800, 800, 1, 50); ShadowMap.UpdateProjection(50, 30); HallOfFame = HofStorage.Load(); PlayingFieldInfos = PlayingFieldsDecoder.Create(sceneDescription); }
protected override void LoadContent() { base.LoadContent(); _spriteBatch = ToDisposeContent(new SpriteBatch(GraphicsDevice)); _vContent = new VisionContent(_graphicsDeviceManager.GraphicsDevice, Content); _arial16Font = Content.Load<SpriteFont>("Fonts/Arial16"); _basicEffect = new VBasicEffect(_graphicsDeviceManager.GraphicsDevice); _basicEffect.EnableDefaultLighting(); _ball = new SpherePrimitive<VertexPositionNormalTexture>(GraphicsDevice, (p, n, t, tx) => new VertexPositionNormalTexture(p, n, tx), 1); var x = _vContent.LoadEffect("effects/simpletextureeffect"); x.Texture = _vContent.Load<Texture2D>("terraintextures/sand"); _ballInstance = new VDrawableInstance(x, _ball, Matrix.Translation(10, 2, 10)); Sky = new SkySphere(_vContent, _vContent.Load<TextureCube>(@"Textures\clouds")); _movingShip = new MovingShip(new ShipModel(_vContent)); _water = WaterFactory.Create(_vContent); _water.ReflectedObjects.Add(_movingShip._shipModel); _water.ReflectedObjects.Add(_ballInstance); _water.ReflectedObjects.Add(Sky); _camera = new Camera( _vContent.ClientSize, new KeyboardManager(this), new MouseManager(this), null, //new PointerManager(this), new Vector3(0, 15, 0), new Vector3(-10, 15, 0)); _rasterizerState = RasterizerState.New(GraphicsDevice, new RasterizerStateDescription { FillMode = FillMode.Solid, CullMode = CullMode.Back, IsFrontCounterClockwise = false, DepthBias = 0, SlopeScaledDepthBias = 0.0f, DepthBiasClamp = 0.0f, IsDepthClipEnabled = true, IsScissorEnabled = false, IsMultisampleEnabled = false, IsAntialiasedLineEnabled = false }); _shadow = new ShadowMap(_vContent, 1024, 1024); //_shadow.ShadowCastingObjects.Add(_sailingShip); //_shadow.ShadowCastingObjects.Add(reimersTerrain); //_shadow.ShadowCastingObjects.Add(generatedTerrain); //_shadow.ShadowCastingObjects.Add(bridge); //_archipelag = new Archipelag(_vContent, _water, _shadow); _data.VContent = _vContent; _data.Camera = _camera; _data.Water = _water; _data.Shadow = _shadow; _q = new CxBillboard(_vContent, Matrix.Identity, _vContent.Load<Texture2D>("billboards/wheat_billboard"), 20, 10, 0.5f); _q.AddPositionsWithSameNormal(Vector3.Up, Vector3.Zero, Vector3.Left*10.5f, Vector3.Up, Vector3.Right*10.4f, Vector3.Up, Vector3.ForwardRH*3.45f, Vector3.Up, Vector3.BackwardRH*2.9f, Vector3.Up); _q.CreateVertices(); }