Axiom.SceneManagers.Bsp.Quake3Level.LoadFromStream C# (CSharp) Method

LoadFromStream() public method

Reads Quake3 bsp data from a chunk of memory as read from the file.
Since ResourceManagers generally locate data in a variety of places they typically manipulate them as a chunk of data, rather than a file pointer since this is unsupported through compressed archives.

Quake3 files are made up of a header (which contains version info and a table of the contents) and 17 'lumps' i.e. sections of data, the offsets to which are kept in the table of contents. The 17 types are predefined.

public LoadFromStream ( Stream inChunk ) : void
inChunk Stream
return void
		public void LoadFromStream( Stream inChunk )
		{
			chunk = inChunk;

			Initialize();
			DumpContents();
		}

Usage Example

Exemplo n.º 1
0
        /// <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;
        }
All Usage Examples Of Axiom.SceneManagers.Bsp.Quake3Level::LoadFromStream