예제 #1
0
        public static Texture Add(Texture.Name name, string filename)
        {
            Texture texture = (Texture)instance.AddToFront();

            texture.Initialize(name, new Azul.Texture(filename));
            return(texture);
        }
예제 #2
0
        public static Image Add(Image.Name ImageName, Texture.Name TextureName, float x, float y, float width, float height)
        {
            ImageMan pMan = ImageMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            Image pNode = (Image)pMan.BaseAdd();

            Debug.Assert(pNode != null);

            // Initialize the data
            Texture pTexture = TextureMan.Find(TextureName);

            //Debug.Assert(pTexture != null);
            if (pTexture == null)
            {
                pTexture = TextureMan.Find(Texture.Name.Default);
                Debug.Assert(pTexture != null);
                x      = 0;
                y      = 0;
                width  = 128;
                height = 128;
            }

            pNode.Set(ImageName, pTexture, x, y, width, height);

            return(pNode);
        }
예제 #3
0
        public static Texture Find(Texture.Name name)
        {
            instance.pNodeCompare.name = name;
            Texture texture = (Texture)instance.baseFind(instance.pNodeCompare);

            return(texture);
        }
예제 #4
0
        public void Set(Texture.Name name)
        {
            String assetName = null;

            switch (name)
            {
            case Name.Consolas36pt:
                assetName = Constants.fontAsset;
                break;

            case Name.Invader:
                assetName = Constants.invaderAsset;
                break;

            case Name.NullObject:
                assetName = Constants.uninitializedAsset;
                break;

            case Name.Uninitialized:
                assetName = Constants.uninitializedAsset;
                break;

            default:
                Debug.Assert(false, "Invalid texture name");
                break;
            }

            this.poTexture = new Azul.Texture(assetName);
            Debug.Assert(poTexture != null);

            this.name = name;
        }
예제 #5
0
        public static Image Add(Image.Name name, Texture.Name texture, Azul.Rect poRect)
        {
            Image   image    = (Image)instance.AddToFront();
            Texture pTexture = TextureMan.Find(texture);

            image.Initialize(name, pTexture, poRect);
            return(image);
        }
        ///////////////////////////////////////////////////////
        //
        // Methods
        //
        ///////////////////////////////////////////////////////

        /// <summary>
        ///     Create a new texture from the object pool
        /// </summary>
        /// <param name="name">Identification of the texture</param>
        /// <param name="fileName">Local file name of the texture</param>
        /// <returns></returns>
        public Texture Create(Texture.Name name, string fileName)
        {
            Texture newNode = this.BaseCreate() as Texture;

            newNode.SetName(name);
            newNode.SetTexture(fileName);
            return(newNode);
        }
        /// <summary>
        ///		Create a new image map from the object pool
        /// </summary>
        /// <param name="newName"></param>
        /// <param name="texName"></param>
        /// <param name="s"></param>
        /// <param name="t"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <returns></returns>
        public Image Create(Image.Name newName, Texture.Name texName, float s, float t, float width, float height)
        {
            Image newImage = this.BaseCreate() as Image;

            newImage.SetName(newName);
            newImage.SetImageMapping(s, t, width, height);
            newImage.SetTexture(TextureManager.Self.Find(texName));
            return(newImage);
        }
예제 #8
0
        public static Texture Add(Texture.Name name, string path)
        {
            Debug.Assert(pMan != null);
            Texture pTexture = (Texture)pMan.baseAdd();

            Debug.Assert(pTexture != null);

            pTexture.SetTexture(name, path);
            return(pTexture);
        }
        ///////////////////////////////////////////////////////
        //
        // Methods
        //
        ///////////////////////////////////////////////////////

        /// <summary>
        ///		Create a new image map from the object pool
        /// </summary>
        /// <param name="newName"></param>
        /// <param name="textureName"></param>
        /// <returns></returns>
        public Image Create(Image.Name newName, Texture.Name textureName)
        {
            Azul.Rect stMap    = this.LookupImageMapping(newName);
            Image     newImage = this.BaseCreate() as Image;

            newImage.SetName(newName);
            newImage.SetImageMapping(stMap.x, stMap.y, stMap.w, stMap.h);
            newImage.SetTexture(TextureManager.Self.Find(textureName));
            return(newImage);
        }
예제 #10
0
        public Texture(Texture.Name name, string pTextureName)
        {
            Debug.Assert(pTextureName != null);

            // Do the create and load
            this.pAzulTex = new Azul.Texture(pTextureName);
            Debug.Assert(this.pAzulTex != null);

            this.name = name;
        }
예제 #11
0
        public Glyph Add(Glyph.Name name, int key, Texture.Name textName, float x, float y, float width, float height)
        {
            Glyph pNode = (Glyph)this.PullFromReserved();

            Debug.Assert(pNode != null);

            pNode.Set(name, key, textName, x, y, width, height);
            this.Add(pNode);
            return(pNode);
        }
예제 #12
0
        public static Glyph Add(Glyph.Name name, int key, Texture.Name textName, float x, float y, float width, float height)
        {
            GlyphManager pInstance = GlyphManager.PrivGetInstance();

            Glyph pNode = (Glyph)pInstance.BaseAdd();

            Debug.Assert(pNode != null);

            pNode.Set(name, key, textName, x, y, width, height);
            return(pNode);
        }
        /// <summary>
        ///     Removes the given texture to be used again from the pool
        /// </summary>
        /// <param name="name"></param>
        /// <returns> <c>true</c> if a texture could be found </returns>
        public bool Recycle(Texture.Name name)
        {
            Texture oldNode = this.BaseRecycle(name) as Texture;

            if (oldNode == null)
            {
                return(false);
            }
            oldNode.Reset();
            return(true);
        }
        public static Texture Find(Texture.Name name)
        {
            TextureManager pMan = TextureManager.GetInstance();

            Debug.Assert(pMan != null);

            pMan.pNodeCompare.SetName(name);
            Texture pData = (Texture)pMan.BaseFind(pMan.pNodeCompare);

            return(pData);
        }
예제 #15
0
        //----------------------------------------------------------------------------------
        // Methods
        //----------------------------------------------------------------------------------

        public void Set(Glyph.Name theName, int key, Texture.Name textName, float x, float y, float width, float height)
        {
            this.name     = theName;
            this.pTexture = TextureManager.Find(textName);

            Debug.Assert(this.pTexture != null);
            Debug.Assert(this.pSubRect != null);

            this.pSubRect.Set(x, y, width, height);
            this.key = key;
        }
예제 #16
0
        public static Texture Find(Texture.Name name)
        {
            TextureMan pTMan = TextureMan.PrivGetInstance();

            Debug.Assert(pTMan != null);

            pTMan.poTexCompare.SetName(name);

            Texture pTNode = (Texture)pTMan.BaseFind(pTMan.poTexCompare);

            return(pTNode);
        }
        public static Texture Find(Texture.Name name)
        {
            TextureMan pMan = TextureMan.privGetInstance();

            Debug.Assert(pMan != null);

            pMan.poNodeCompare.name = name;

            Texture pData = (Texture)pMan.baseFind(pMan.poNodeCompare);

            return(pData);
        }
예제 #18
0
        public void Set(Glyph.Name name, int key, Texture.Name textName, float x, float y, float width, float height)
        {
            Debug.Assert(this.pSubRect != null);
            this.name = name;

            this.pTexture = TextureManager.getInstance().FindTextureByName(textName);
            Debug.Assert(this.pTexture != null);

            this.pSubRect.Set(x, y, width, height);

            this.key = key;
        }
예제 #19
0
        public static Texture Find(Texture.Name name)
        {
            //ensure call Create() first
            TextureMan pMan = TextureMan.GetInstance();

            Debug.Assert(pMan != null);

            // find the texture by specific texture name
            pMan.poNodeForCompare.setName(name);
            Texture pTexture = (Texture)pMan.baseFind(pMan.poNodeForCompare);

            return(pTexture);
        }
예제 #20
0
        public static Texture Find(Texture.Name name)
        {
            TextureManager pMan = TextureManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            // Use compare node to compare to search nodes
            pMan.pTextureCompare.SetName(name);

            Texture pData = (Texture)pMan.BaseFind(pMan.pTextureCompare);

            return(pData);
        }
예제 #21
0
        // PA2: Factory Method
        public Texture AddTexture(Texture.Name name, String source)
        {
            // Create new texture
            Texture ret = (Texture)this.PullFromReserved();

            // Set Data
            ret.Set(name, source);

            // Add to the list
            this.Add(ret);

            return(ret);
        }
예제 #22
0
        public static Texture Find(Texture.Name targetName)
        {
            TextureManager pTextMan = TextureManager.privGetInstance();

            Debug.Assert(pTextMan != null);

            // set up the comparison node
            pTextMan.poNodeCompare.SetName(targetName);

            // delegate searching to base class
            Texture pText = (Texture)pTextMan.baseFind(pTextMan.poNodeCompare);

            return(pText);
        }
예제 #23
0
        public static Texture Add(Texture.Name theName, string pTextureName)
        {
            // grab the manager
            TextureManager pTextMan = TextureManager.privGetInstance();

            // grab an washed DLink cast as a Texture.  It is already set in place.
            Texture pTextNode = (Texture)pTextMan.baseAdd();

            // fill with values
            Debug.Assert(pTextureName != null);
            pTextNode.Set(theName, pTextureName);

            return(pTextNode);
        }
예제 #24
0
        public static Texture Find(Texture.Name name)
        {
            TextureManager pMan = TextureManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            pMan.poCompareNode.name = name;

            Texture pData = (Texture)pMan.BaseFind(pMan.poCompareNode);

            Debug.Assert(pData != null);

            return(pData);
        }
예제 #25
0
        //---------------------------------------------------------------------------------------------------------
        // Methods
        //---------------------------------------------------------------------------------------------------------
        public void set(Texture.Name name, string pTextureFile)
        {
            this.name = name;

            // ensure pTextureFile is not null
            Debug.Assert(pTextureFile != null);

            // ensure pAzulTexture has default texture
            Debug.Assert(this.poAzulTexture != null);

            // load pTextureFile
            this.poAzulTexture = new Azul.Texture(pTextureFile);
            Debug.Assert(this.poAzulTexture != null);
        }
예제 #26
0
        public static Texture Add(Texture.Name name)
        {
            TextureManager pMan = TextureManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            Texture pNode = (Texture)pMan.BaseAdd();

            Debug.Assert(pNode != null);

            pNode.Set(name);

            return(pNode);
        }
예제 #27
0
        public static Texture Add(Texture.Name name, string pTextureName)
        {
            TextureManager pMan = TextureManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            Texture pTexture = (Texture)pMan.BaseAdd();

            Debug.Assert(pTexture != null);

            // Initialize the date
            pTexture.Set(name, pTextureName);
            return(pTexture);
        }
예제 #28
0
        public static Texture Find(Texture.Name name)
        {
            TextureManager pMan = TextureManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            // So:  Use the Compare Node - as a reference
            //      use in the Compare() function
            pMan.poNodeCompare.SetName(name);

            Texture pData = (Texture)pMan.BaseFind(pMan.poNodeCompare);

            return(pData);
        }
예제 #29
0
        // PA2: Factory method, create and add image into actives
        public Image AddImage(Image.Name name, Texture.Name tName, float x, float y, float w, float h)
        {
            Texture texture = TextureManager.getInstance().FindTextureByName(tName);

            Debug.Assert(texture != null);

            // Create a new image
            Image ret = new Image(name, texture.poAzulTexture, x, y, w, h);

            // Add it to the list
            this.Add(ret);

            return(ret);
        }
예제 #30
0
        public static Texture Add(Texture.Name name, String pTexName)
        {
            TextureMan pTMan = TextureMan.PrivGetInstance();

            Debug.Assert(pTMan != null);

            Texture pTNode = (Texture)pTMan.BaseAdd();

            Debug.Assert(pTNode != null);

            Debug.Assert(pTexName != null);

            pTNode.Set(name, pTexName);
            return(pTNode);
        }