Beispiel #1
0
        /// <summary>

        /// Constructor

        /// </summary>

        private TextureManager()

        {
            long w = Options.Instance.World_Width;
            long h = Options.Instance.World_Height;

            long i, j;

            //Setup the page array
            //    mTexture.reserve (w);
            //    mTexture.resize (w);
            textures = new TexturePages();
            for (i = 0; i < w; i++)
            {
                TextureRow tr = new TextureRow();
                textures.Add(tr);

                //        mTexture[i].reserve (h);
                //        mTexture[i].resize (h);
                for (j = 0; j < h; j++)
                {
                    tr.Add(null);
                }
            }
            //Populate the page array
            if (Options.Instance.TextureFormat == "Image")
            {
                for (j = 0; j < h; j++)
                {
                    for (i = 0; i < w; i++)
                    {
                        textures[i][j] = new Texture_Image();
                    }
                }
            }
            else if (Options.Instance.TextureFormat == "Splatting5")
            {
                for (j = 0; j < h; j++)
                {
                    for (i = 0; i < w; i++)
                    {
                        textures[i][j] = new Texture_Splatting5();
                    }
                }
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        private TextureManager()
        {
            long w = Options.Instance.World_Width;
            long h = Options.Instance.World_Height;

            long i, j;
            //Setup the page array
            //    mTexture.reserve (w);
            //    mTexture.resize (w);
            textures = new TexturePages();
            for ( i = 0; i < w; i++)
            {
                TextureRow tr = new TextureRow();
                textures.Add( tr );

            //        mTexture[i].reserve (h);
            //        mTexture[i].resize (h);
                for (j = 0; j < h; j++ ) tr.Add( null );
            }
            //Populate the page array
            if ( Options.Instance.TextureFormat == "Image" )
            {
                for ( j = 0; j < h; j++ )
                {
                    for ( i = 0; i < w; i++ )
                    {
                        textures[i][j] = new Texture_Image();

                    }
                }
            } else if ( Options.Instance.TextureFormat == "Splatting5" )
            {
                for ( j = 0; j < h; j++ )
                {
                    for ( i = 0; i < w; i++ )
                    {
                        textures[i][j] = new Texture_Splatting5();

                    }
                }
            }
        }