public virtual cSprite copy()
        {
            cSprite c = new cSprite();

            c.copy(this);
            return(c);
        }
Beispiel #2
0
        /* Useful for wrapping
         *  verts in a Shape class to pass to pgraphics->draw. */
        //Overloaded cSprite methods

        public override void copy(cSprite psprite) //Use this in copy constructor and operator=
        {
            /* Because our class has some CArray fields, we can't use the default overloaded
             * copy constructor and operator=.  So as to avoid having to maintain similar code
             * for these two different methods, we write a helper copy function that both
             * the copy constructor and the operator= can use. */
            base.copy(psprite); //does center(), _radius, _angle, _rotationspeed.
            if (!(psprite is cShape))
            {
                return;                        //You're done if psprite isn't a cShape*.
            }
            cShape pShape = (cShape)(psprite); /* I know it is a cShape
                                                * at this point, but I need to do a cast, so the compiler will let me
                                                * call a bunch of cShape methods. */

            //Arrays
            _vectorvert.Copy(pShape._vectorvert);
            //Decoration fields
            cColorStyle c = new cColorStyle();

            c.copy(pShape.pcolorstyle());
            ColorStyle = c;
            cColorStyle c2 = new cColorStyle();

            c2.copy(pShape.DotColorStyle);
            DotColorStyle        = c2;
            _dotted              = pShape._dotted;
            _realdotradiusweight = pShape._realdotradiusweight;
            //Helper fields
            _convex = pShape._convex;
        }
Beispiel #3
0
        /* Doesn't really need to be virtual as it
            calls the virtual add(new cSpriteIcon(resourceid)).*/

        public virtual void changeMember(int index, cSprite psprite)
        {
            if (index < 0 || index >= _childspriteptr.Size)
                return;
            _childspriteptr.RemoveAt(index);
            _childspriteptr.SetAt(psprite);
            NewGeometryFlag = true;
            fixResourceID();
        }
Beispiel #4
0
		//Just sets the fill colors 
	
		//cSprite overloads 
	
		public override void copy( cSprite psprite ) //Use this in copy constructor and operator= 
		{ 
			base.copy( psprite ); 
			if ( !psprite.IsKindOf( "cSpriteTextureBox" )) 
				return ; //You're done if psprite isn't a cSpriteTextureBox*.
			cSpriteTextureBox ptexturebox = ( cSpriteTextureBox )( psprite ); /* I know it is a
			cSpriteTextureBox at this point, but I need to do a cast, so the compiler will 
			let me call cSpriteTextureBox methods. */
            _pskeleton.copy(ptexturebox._pskeleton);
		} 
Beispiel #5
0
 public virtual void copy(cSprite psprite)
 {
     _radius = psprite._radius;
     _prismdz = psprite._prismdz;
     _spriteattitude.copy(psprite._spriteattitude);
     _resourceID = psprite._resourceID;
     cColorStyle c = new cColorStyle();
     c.copy(psprite.pcolorstyle());
     ColorStyle = c;
 }
Beispiel #6
0
	//cSprite overloads 
		

		
		public override void copy( cSprite psprite ) //Use this in copy constructor and operator= 
		{ 
			base.copy( psprite ); 
			if ( !psprite.IsKindOf( "cSpriteIcon" )) 
				return ; //You're done if psprite isn't a cSpriteIcon*.
			cSpriteIcon picon = ( cSpriteIcon )( psprite ); /* I know it is a
			cSpriteIcon at this point, but I need to do a cast, so the compiler will 
			let me call cSpriteIcon methods. */ 
			_transparent = picon._transparent; 
			Aspect = picon._aspect; //Sets _aspect, _sizex, _sizey, _visualradius 
			_presetaspect = picon._presetaspect;
            _bitmapcolor = picon._bitmapcolor;
            _xtilecount = picon._xtilecount;
            _tiled = picon._tiled;
		}
Beispiel #7
0
        public override void copy(cSprite psprite)
        {
            base.copy(psprite);
            _childspriteptr.RemoveAll();
            if (!psprite.IsKindOf("cSpriteComposite"))
                return; //You're done if psprite isn't a cSpriteComposite.
            cSpriteComposite pspritecomposite = (cSpriteComposite)psprite; /* I know it is a
			cSpriteComposite at this point, but I need to do a cast, so the compiler will 
			let me access it's cSpriteComposite member _childspriteptr. */

            foreach (cSprite s in pspritecomposite._childspriteptr)
                add(s);

            NewGeometryFlag = true;
        }
        /*  A cSpriteComposite
         *  will adopt as its _resourceID the first non-trivial resourceID of
         *  a member. */

        public virtual void add(cSprite psprite)
        {
            _childspriteptr.Add(psprite);
            NewGeometryFlag = true;
            fixResourceID();
        }
Beispiel #9
0
        }                                                                                   /* In sophisticated graphics
                                                                                             * implementations, this call gets an unsigned int _activeDisplayListID based on the
                                                                                             * psprite's spriteID and newgeometryflag.  If the list has already been recorded,	we set
                                                                                             * a BOOL _activeDisplayListIDIsReady to TRUE, otherwise we set _activeDisplayListIDIsReady
                                                                                             * to FALSE.  And then we return _activeDisplayListIDIsReady. If the return is FALSE,
                                                                                             * you need to call a drawsomething method before calling callActiveDisplayList. */

        public virtual void callActiveDisplayList(cSprite psprite)
        {
        }                                                                      /* In sophisticated graphics
Beispiel #10
0
 public virtual bool activateDisplayList(cSprite psprite)
 {
     return(false);
 }                                                                                   /* In sophisticated graphics
Beispiel #11
0
        }                                                                  /* CpopView calls this in OnSize to set the
                                                                            * pixel size of the view window. */

        public virtual void adjustAttributes(cSprite psprite)
        {
        }                                                                 /* You may want to adjust things like