コード例 #1
0
        public Smoke()
        {
            this.MouseActive   = true;
            this.TextureFilter = Sprite.TextureFilters.High;
            this.Scaling       = new EPointF(5, 5);
            this.Ink           = RasterOps.ROPs.AddPin;

            this.Create(100, 100);

            lwidth  = this.Width / res;
            lheight = this.Height / res;

            v = new vsquare[lwidth + 1][];
            for (int i = 0; i < v.Length; i++)
            {
                v[i] = new vsquare[lheight + 1];
            }

            vbuf = new vbuffer[lwidth + 1][];
            for (int i = 0; i < vbuf.Length; i++)
            {
                vbuf[i] = new vbuffer[lheight + 1];
            }

            p = new particle[pnum];

            CurrentColor = Color.FromArgb(2, 255, 0, 0);

            ERectangle emitter = ERectangle.FromLTRB(this.Width / 2 - 20, this.Height - 20, this.Width / 2 + 20, this.Height);

            for (int i = 0; i < pnum; i++)
            {
                p[i] = new particle(emitter, this);
                p[i].Init();
            }
            for (int i = 0; i <= lwidth; i++)
            {
                for (int u = 0; u <= lheight; u++)
                {
                    v[i][u]    = new vsquare(i * res, u * res, this);
                    vbuf[i][u] = new vbuffer(i * res, u * res, this);
                }
            }

            RandomGust = new Gust();
        }
コード例 #2
0
ファイル: Smoke.cs プロジェクト: timdetering/Endogine
        public Smoke()
        {
            this.MouseActive = true;
            this.TextureFilter = Sprite.TextureFilters.High;
            this.Scaling = new EPointF(5,5);
            this.Ink = RasterOps.ROPs.AddPin;

            this.Create(100,100);

            lwidth = this.Width/res;
            lheight = this.Height/res;

            v = new vsquare[lwidth+1][];
            for (int i=0; i<v.Length;i++)
                v[i] = new vsquare[lheight+1];

            vbuf = new vbuffer[lwidth+1][];
            for (int i=0; i<vbuf.Length;i++)
                vbuf[i] = new vbuffer[lheight+1];

            p = new particle[pnum];

            CurrentColor = Color.FromArgb(2,255,0,0);

            ERectangle emitter = ERectangle.FromLTRB(this.Width/2-20,this.Height-20,this.Width/2+20,this.Height);
            for(int i = 0; i < pnum; i++)
            {
                p[i] = new particle(emitter, this);
                p[i].Init();
            }
            for(int i = 0; i <= lwidth; i++)
            {
                for(int u = 0; u <= lheight; u++)
                {
                    v[i][u] = new vsquare(i*res,u*res, this);
                    vbuf[i][u] = new vbuffer(i*res,u*res, this);
                }
            }

            RandomGust = new Gust();
        }