public LoadFromStream ( Stream inChunk ) : void | ||
inChunk | Stream | |
Résultat | void |
/// <summary> /// Generic load - called by <see cref="Plugin_BSPSceneManager.BspResourceManager"/>. /// </summary> public override void Load() { Hashtable options = SceneManagerEnumerator.Instance.GetSceneManager(SceneType.Interior).Options; if (options.ContainsKey("SetYAxisUp")) { bspOptions.setYAxisUp = (bool)options["SetYAxisUp"]; } if (options.ContainsKey("Scale")) { bspOptions.scale = (float)options["Scale"]; } if (options.ContainsKey("Move")) { bspOptions.move = (Vector3)options["Move"]; } if (options.ContainsKey("UseLightmaps")) { bspOptions.useLightmaps = (bool)options["UseLightmaps"]; } if (options.ContainsKey("AmbientEnabled")) { bspOptions.ambientEnabled = (bool)options["AmbientEnabled"]; } if (options.ContainsKey("AmbientRatio")) { bspOptions.ambientRatio = (float)options["AmbientRatio"]; } Quake3Level q3 = new Quake3Level(bspOptions); Stream chunk = BspResourceManager.Instance.FindResourceData(name); q3.LoadFromStream(chunk); LoadQuake3Level(q3); chunk.Close(); isLoaded = true; }
/// <summary> /// Generic load - called by <see cref="Plugin_BSPSceneManager.BspResourceManager"/>. /// </summary> public override void Load() { Hashtable options = SceneManagerEnumerator.Instance.GetSceneManager(SceneType.Interior).Options; if (options.ContainsKey("SetYAxisUp")) bspOptions.setYAxisUp = (bool)options["SetYAxisUp"]; if (options.ContainsKey("Scale")) bspOptions.scale = (float)options["Scale"]; if (options.ContainsKey("Move")) bspOptions.move = (Vector3)options["Move"]; if (options.ContainsKey("UseLightmaps")) bspOptions.useLightmaps = (bool)options["UseLightmaps"]; if (options.ContainsKey("AmbientEnabled")) bspOptions.ambientEnabled = (bool)options["AmbientEnabled"]; if (options.ContainsKey("AmbientRatio")) bspOptions.ambientRatio = (float)options["AmbientRatio"]; Quake3Level q3 = new Quake3Level(bspOptions); Stream chunk = BspResourceManager.Instance.FindResourceData(name); q3.LoadFromStream(chunk); LoadQuake3Level(q3); chunk.Close(); isLoaded = true; }
public void Load( Stream stream ) { if ( createParam.ContainsKey( "SetYAxisUp" ) ) bool.TryParse( createParam[ "SetYAxisUp" ], out bspOptions.setYAxisUp ); if ( createParam.ContainsKey( "Scale" ) ) float.TryParse( createParam[ "Scale" ], out bspOptions.scale ); Vector3 move = Vector3.Zero; if ( createParam.ContainsKey( "MoveX" ) ) Real.TryParse( createParam[ "MoveX" ], out move.x ); if ( createParam.ContainsKey( "MoveY" ) ) Real.TryParse( createParam[ "MoveY" ], out move.y ); if ( createParam.ContainsKey( "MoveZ" ) ) Real.TryParse( createParam[ "MoveZ" ], out move.z ); if ( createParam.ContainsKey( "UseLightmaps" ) ) bool.TryParse( createParam[ "UseLightmaps" ], out bspOptions.useLightmaps ); if ( createParam.ContainsKey( "AmbientEnabled" ) ) bool.TryParse( createParam[ "AmbientEnabled" ], out bspOptions.ambientEnabled ); if ( createParam.ContainsKey( "AmbientRatio" ) ) float.TryParse( createParam[ "AmbientRatio" ], out bspOptions.ambientRatio ); Quake3Level q3 = new Quake3Level( bspOptions ); q3.LoadFromStream( stream ); LoadQuake3Level( q3 ); }
/// <summary> /// Generic load - called by <see cref="Plugin_BSPSceneManager.BspResourceManager"/>. /// </summary> protected override void load() { //if ( createParam.ContainsKey( "SetYAxisUp" ) ) // bool.TryParse( createParam[ "SetYAxisUp" ], out bspOptions.setYAxisUp); //if ( createParam.ContainsKey( "Scale" ) ) // float.TryParse( createParam[ "Scale" ], out bspOptions.scale ); //Vector3 move = Vector3.Zero; //if ( createParam.ContainsKey( "MoveX" ) ) // float.TryParse( createParam[ "MoveX" ], out move.x ); //if ( createParam.ContainsKey("MoveY" ) ) // float.TryParse( createParam["MoveY"], out move.y ); //if ( createParam.ContainsKey( "MoveZ" ) ) // float.TryParse( createParam["MoveZ"], out move.z ); //if ( createParam.ContainsKey( "UseLightmaps" ) ) // bool.TryParse( createParam[ "UseLightmaps" ], out bspOptions.useLightmaps ); //if ( createParam.ContainsKey( "AmbientEnabled" ) ) // bool.TryParse( createParam[ "AmbientEnabled" ], out bspOptions.ambientEnabled ); //if ( createParam.ContainsKey( "AmbientRatio") ) // float.TryParse( createParam[ "AmbientRatio" ], out bspOptions.ambientRatio ); Quake3Level q3 = new Quake3Level( bspOptions ); Stream chunk = ResourceGroupManager.Instance.OpenResource( Name, ResourceGroupManager.Instance.WorldResourceGroupName ); q3.LoadFromStream( chunk ); LoadQuake3Level( q3 ); chunk.Close(); }