/// <summary> /// Reload /// </summary> protected override void GetParameters() { // Can't get parameters if loading failed! if (effect == null) { return; } windowSize = effect.Parameters["windowSize"]; sceneMap = effect.Parameters["sceneMap"]; // We need both windowSize and sceneMap. if (windowSize == null || sceneMap == null) { throw new NotSupportedException("windowSize and sceneMap must be " + "valid in PostScreenShader=" + Filename); } // Init additional stuff downsampleMap = effect.Parameters["downsampleMap"]; blurMap1 = effect.Parameters["blurMap1"]; blurMap2 = effect.Parameters["blurMap2"]; radialSceneMap = effect.Parameters["radialSceneMap"]; // Load screen border texture screenBorderFadeoutMap = effect.Parameters["screenBorderFadeoutMap"]; screenBorderFadeoutMapTexture = new Texture("ScreenBorderFadeout.dds"); // Set texture screenBorderFadeoutMap.SetValue( screenBorderFadeoutMapTexture.XnaTexture); radialBlurScaleFactor = effect.Parameters["radialBlurScaleFactor"]; }
/// <summary> /// Reload /// </summary> protected override void GetParameters() { // Can't get parameters if loading failed! if (effect == null) { return; } windowSize = effect.Parameters["windowSize"]; sceneMap = effect.Parameters["sceneMap"]; // We need both windowSize and sceneMap. if (windowSize == null || sceneMap == null) { throw new NotSupportedException("windowSize and sceneMap must be " + "valid in PostScreenShader=" + Filename); } // Init additional stuff downsampleMap = effect.Parameters["downsampleMap"]; blurMap1 = effect.Parameters["blurMap1"]; blurMap2 = effect.Parameters["blurMap2"]; timer = effect.Parameters["Timer"]; // Load noise texture for stripes effect noiseMap = effect.Parameters["noiseMap"]; noiseMapTexture = new Texture("Noise128x128.dds"); // Set texture noiseMap.SetValue(noiseMapTexture.XnaTexture); }
/// <summary> /// Load car stuff /// </summary> protected override void Initialize() { base.Initialize(); // Load models carModel = new Model("Car"); carSelectionPlate = new Model("CarSelectionPlate"); // Load landscape landscape = new Landscape(Level.Beginner); // Load textures, first one is grabbed from the imported one through // the car.x model, the other two are loaded seperately. carTextures = new Texture[3]; carTextures[0] = new Texture("RacerCar"); carTextures[1] = new Texture("RacerCar2"); carTextures[2] = new Texture("RacerCar3"); colorSelectionTexture = new Texture("ColorSelection"); brakeTrackMaterial = new Material("track"); }
/// <summary> /// Initializes and loads some content, previously referred to as the /// "car stuff". /// </summary> private void LoadResources() { LoadEvent("Models...", null); // Load models carModel = new Model("Car"); carSelectionPlate = new Model("CarSelectionPlate"); LoadEvent("Landscape...", null); // Load landscape landscape = new Landscape(Level.Beginner); LoadEvent("Textures...", null); // Load textures, first one is grabbed from the imported one through // the car.x model, the other two are loaded seperately. carTextures = new Texture[3]; carTextures[0] = new Texture("RacerCar"); carTextures[1] = new Texture("RacerCar2"); carTextures[2] = new Texture("RacerCar3"); colorSelectionTexture = new Texture("ColorSelection"); brakeTrackMaterial = new Material("track"); LoadEvent("All systems go!", null); Thread.Sleep(1000); }
/// <summary> /// Reload /// </summary> protected override void GetParameters() { // Can't get parameters if loading failed! if (effect == null) return; windowSize = effect.Parameters["windowSize"]; sceneMap = effect.Parameters["sceneMap"]; // We need both windowSize and sceneMap. if (windowSize == null || sceneMap == null) throw new NotSupportedException("windowSize and sceneMap must be " + "valid in PostScreenShader=" + Filename); // Init additional stuff downsampleMap = effect.Parameters["downsampleMap"]; blurMap1 = effect.Parameters["blurMap1"]; blurMap2 = effect.Parameters["blurMap2"]; radialSceneMap = effect.Parameters["radialSceneMap"]; // Load screen border texture screenBorderFadeoutMap = effect.Parameters["screenBorderFadeoutMap"]; screenBorderFadeoutMapTexture = new Texture("ScreenBorderFadeout.dds"); // Set texture screenBorderFadeoutMap.SetValue( screenBorderFadeoutMapTexture.XnaTexture); radialBlurScaleFactor = effect.Parameters["radialBlurScaleFactor"]; }
/// <summary> /// Reload /// </summary> protected override void GetParameters() { // Can't get parameters if loading failed! if (effect == null) return; windowSize = effect.Parameters["windowSize"]; sceneMap = effect.Parameters["sceneMap"]; // We need both windowSize and sceneMap. if (windowSize == null || sceneMap == null) throw new NotSupportedException("windowSize and sceneMap must be " + "valid in PostScreenShader=" + Filename); // Init additional stuff downsampleMap = effect.Parameters["downsampleMap"]; blurMap1 = effect.Parameters["blurMap1"]; blurMap2 = effect.Parameters["blurMap2"]; timer = effect.Parameters["Timer"]; // Load noise texture for stripes effect noiseMap = effect.Parameters["noiseMap"]; noiseMapTexture = new Texture("Noise128x128.dds"); // Set texture noiseMap.SetValue(noiseMapTexture.XnaTexture); }
/// <summary> /// Load car stuff /// </summary> protected override void Initialize() { base.Initialize(); // Load models carModel = new Model("Car"); carSelectionPlate = new Model("CarSelectionPlate"); // Load landscape landscape = new Landscape(Level.Beginner); // Load textures, first one is grabbed from the imported one through // the car.x model, the other two are loaded seperately. carTextures = new Texture[3]; carTextures[0] = new Texture("RacerCar%0"); carTextures[1] = new Texture("RacerCar2"); carTextures[2] = new Texture("RacerCar3"); colorSelectionTexture = new Texture("ColorSelection"); brakeTrackMaterial = new Material("track"); //For testing: //Directly start the game and load a certain level, this code is // only used in the debug mode. Remove it when you are don with // testing! If you press Esc you will also quit the game and not // just end up in the menu again. //gameScreens.Clear(); //gameScreens.Push(new GameScreen()); }