⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 displaylist.java

📁 j2me 上面flash播放器。非常值得研究。就是版本只到2.0
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
            {                int i1 = sparser.GetWord();//                int j1 = sobject.id + sparser.GetWord();                int depth=sparser.GetWord();                Matrix matrix = sparser.GetMatrix();//                int k1 = i1 << 16 | j1;                if((k & 8) != 0)                {                    SCharacter scharacter = scriptplayer.findCharacter(i1);                    if(scharacter != null)                    {                        SObject sobject1 = new SObject();                        sobject1.display = this;                        sobject1.character = scharacter;                        sobject1.ID=i1;                        sobject1.depth=depth;                        sobject1.mat = Matrix.concat(matrix, sobject.mat);                        sobject1.devMat = Matrix.concat(sobject1.mat, cameraMat);                        sobject1.devBounds = sobject1.devMat.transform(scharacter.bounds);                        if(sobject1.HitTest(point))                            return true;                    }                }            } else            {                return false;            }        } while(true);    }/*    private final void pixelInit()    {        rgb = 0L;        pixelW = 0;        pixelX = -32000;    }    private final void pixelPaint()    {        if(pixelW > 0)        {            int i = pixelX;            long l = rgb;            long l1;            SetPixel(i, (int)((l1 = l / 16L) >> 24) & 0xff000000 | (int)(l1 >> 16) & 0xff0000 | (int)(l1 >> 8) & 0xff00 | (int)l1 & 0xff);            rgb = 0L;            pixelW = 0;        }    }*/    private final void pixelAdd(long l, int i, int j, int k)    {        if(pixelX != j)        {            if(pixelW > 0)            {                int i1 = pixelX;                long l1 = rgb;                long l2;                setPixel(i1, (int)((l2 = l1 / 16L) >> 24) & 0xff000000 | (int)(l2 >> 16) & 0xff0000 | (int)(l2 >> 8) & 0xff00 | (int)l2 & 0xff);                rgb = 0L;                pixelW = 0;            }            pixelX = j;        }        rgb += k * l;        pixelW += k * i;    }    static final long ExpandColor(int i)    {        return (i & 0xff000000L) << 24 | (i & 0xff0000L) << 16 | (i & 65280L) << 8 | i & 255L;    }    static final int PackColor(long l)    {        return (int)(l >> 24) & 0xff000000 | (int)(l >> 16) & 0xff0000 | (int)(l >> 8) & 0xff00 | (int)l & 0xff;    }/*    private final void drawPixel(int i, long l, int j)    {        long l1;        SetPixel(i, (int)((l1 = l / 16L) >> 24) & 0xff000000 | (int)(l1 >> 16) & 0xff0000 | (int)(l1 >> 8) & 0xff00 | (int)l1 & 0xff);    }*/    private final void setPixel(int i, int j)    {        if(indexedColor)        {            pixels8[i + pixelOrg] = (byte)RGBToIndex(j);            return;        } else        {            pixels32[i + pixelOrg] = j;            return;        }    }/*    private final void DrawSlab(int i, int j, RColor rcolor)    {        if(i < bitClip.xmin)            i = bitClip.xmin;        if(j > bitClip.xmax)            j = bitClip.xmax;        switch(rcolor.fillType)        {        case 64: // '@'        case 65: // 'A'        case 66: // 'B'            rcolor.bitmap.DrawSlab(pixelOrg, i, j, rcolor);            return;        case 0: // '\0'            int k = i + pixelOrg;            int l = j - i;            if(k + l > pixelSize)                return;            if(indexedColor)            {                while(l-- > 0)                     pixels8[k++] = rcolor.index;                return;            }            while(l-- > 0)                 pixels32[k++] = rcolor.color;            return;        case 16: // '\020'            Point point = new Point(i << 8, bitY << 8);            rcolor.ginvMat.transform(point);            int i1 = rcolor.ginvMat.a >> 8;            int k1 = rcolor.ginvMat.b >> 8;            for(int i2 = i; i2 < j; i2++)            {                int k2 = (point.x >> 15) + 128;                if(k2 > 256)                    k2 = 256;                else                if(k2 < 0)                    k2 = 0;                setPixel(i2, rcolor.gcolorRamp[k2]);                point.x += i1;                point.y += k1;            }            return;        case 18: // '\022'            Point point1 = new Point(i << 8, bitY << 8);            rcolor.ginvMat.transform(point1);            int j1 = rcolor.ginvMat.a >> 8;            int l1 = rcolor.ginvMat.b >> 8;            int j2 = 0;            int l2 = Matrix.length(point1.x, point1.y) >> 14;            if(l2 > 256)                l2 = 256;            for(int i3 = i; i3 < j; i3++)            {                int j3 = point1.x >> 14;                int k3 = j3 * j3;                j3 = point1.y >> 14;                k3 += j3 * j3;                int l3 = l2;                l2 += j2;                if(l2 < 0)                    l2 = 0;                else                if(l2 > 256)                    l2 = 256;                do                {                    for(; k3 < l2 * l2; l2--);                    if(k3 <= (l2 + 1) * (l2 + 1) || l2 >= 256)                        break;                    l2++;                } while(true);                j2 = l2 - l3;                setPixel(i3, rcolor.gcolorRamp[l2]);                point1.x += j1;                point1.y += l1;            }            return;        }    }*//*    private final void UpdateColor(int i)    {        RColor rcolor = null;        RColor rcolor1 = null;        for(RColor rcolor2 = activeColors; rcolor2 != null; rcolor2 = rcolor2.nextActive)            if(rcolor2.visible != 0)            {                if(rcolor == null || rcolor2.order > rcolor.order)                    rcolor = rcolor2;                rcolor1 = rcolor2;            } else            {                if(rcolor1 != null)                    rcolor1.nextActive = rcolor2.nextActive;                else                    activeColors = rcolor2.nextActive;                rcolor2.onActiveList = false;            }        if(topColor != rcolor)        {            if(topColor != null)                if(antialias)                    PaintAASlab(topColorXleft, i);                else                    DrawSlab(topColorXleft, i, topColor);            topColor = rcolor;            topColorXleft = i;        }    }*//*    private final void ShowColor(RColor rcolor, int i)    {        if(topColor != null)        {            if(rcolor.order > topColor.order)            {                if(antialias)                    PaintAASlab(topColorXleft, i);                else                    DrawSlab(topColorXleft, i, topColor);                topColor = rcolor;                topColorXleft = i;            }        } else        {            topColor = rcolor;            topColorXleft = i;        }        if(!rcolor.onActiveList)        {            rcolor.onActiveList = true;            rcolor.nextActive = activeColors;            activeColors = rcolor;        }    }*//*    private final void hideColor(RColor rcolor, int i)    {        if(rcolor == topColor)            UpdateColor(i);    }*/    private final void PaintAASlab(int i, int j)    {        RRun rrun = curRun;        if(rrun == null || rrun.xmin >= j)            return;        while(rrun.xmax < i)         {            rrun = rrun.next;            if(rrun == null)            {                curRun = null;                return;            }        }        if(rrun.xmin < i)            rrun = rrun.Split(this, i);        for(; rrun != null && rrun.xmin < j; rrun = rrun.next)        {            if(rrun.xmax > j)            {                curRun = rrun.Split(this, j);                rrun.AddColor(topColor);                return;            }            rrun.AddColor(topColor);        }        curRun = rrun;    }/*    private final void PaintAARuns()    {        bitY = y / 4;        rgb = 0L;        pixelW = 0;        pixelX = -32000;        RRun rrun = firstRun;        do        {            if(rrun.nColors > 0)            {                if(rrun.isPure && rrun.nColors == 4)                    do                    {                        RRun rrun1 = rrun.next;                        if(rrun1 == null || !rrun1.isPure || rrun1.colors[0] != rrun.colors[0] || rrun1.nColors < 4)                            break;                        rrun.xmax = rrun1.xmax;                        rrun.next = rrun1.next;                    } while(true);                int i = rrun.xmin / 4;                int k = rrun.xmin & 3;                int i1 = rrun.xmax / 4;                int j1 = rrun.xmax & 3;                long l2 = rrun.CalcColor(i, bitY);                if(i == i1)                {                    pixelAdd(l2, rrun.nColors, i, j1 - k);                } else                {                    if(k > 0)                    {                        pixelAdd(l2, rrun.nColors, i, 4 - k);                        i++;                    }                    if(i < i1)                        if(rrun.isPure && rrun.nColors == 4)                            DrawSlab(i, i1, rrun.colors[0]);                        else                        if(rrun.isComplex)                        {                            for(int j2 = i; j2 < i1; j2++)                            {                                long l3 = rrun.CalcColor(j2, bitY) * 4L;                                long l5;                                setPixel(j2, (int)((l5 = l3 / 16L) >> 24) & 0xff000000 | (int)(l5 >> 16) & 0xff0000 | (int)(l5 >> 8) & 0xff00 | (int)l5 & 0xff);                            }                        } else                        {                            long l4 = 4L * l2;                            for(int k2 = i; k2 < i1; k2++)                            {                                long l6;                                setPixel(k2, (int)((l6 = l4 / 16L) >> 24) & 0xff000000 | (int)(l6 >> 16) & 0xff0000 | (int)(l6 >> 8) & 0xff00 | (int)l6 & 0xff);                            }                        }                    if(j1 > 0)                    {                        if(rrun.isComplex)                            l2 = rrun.CalcColor(i1, bitY);                        pixelAdd(l2, rrun.nColors, i1, j1);                    }                }            }            if(rrun.next == null)                break;            rrun = rrun.next;        } while(true);        rrun.next = runPool;        runPool = firstRun;        firstRun = null;        if(pixelW > 0)        {            int j = pixelX;            long l = rgb;            long l1;            setPixel(j, (int)((l1 = l / 16L) >> 24) & 0xff000000 | (int)(l1 >> 16) & 0xff0000 | (int)(l1 >> 8) & 0xff00 | (int)l1 & 0xff);            rgb = 0L;            pixelW = 0;        }    }*/    private final void AddEdges(REdge redge)    {        for(; redge != null; redge = redge.nextObj)            if(((Curve) (redge)).anchor1y <= edgeClip.ymax && ((Curve) (redge)).anchor2y > edgeClip.ymin)            {                int i = ((Curve) (redge)).anchor1y - edgeClip.ymin;                if(i < 0)                    i = 0;                redge.nextActive = yindex[i];                yindex[i] = redge;            }    }    private final void InitPixels()    {        pixelOrg = -bitClip.xmin;        pbufWidth = bitClip.xmax - bitClip.xmin;        pbufNLines = 0;        pbufMaxLines = pixelSize / pbufWidth;        pbufTop = bitClip.ymin;    }/*    private final void AdvanceLine()    {        pbufNLines++;        if(pbufNLines >= pbufMaxLines)            SendPixels();        pixelOrg = pbufNLines * pbufWidth - bitClip.xmin;    }*//*    private final void SendPixels()    {        if(pbufNLines > 0)            if(indexedColor)                theConsumer.setPixels(bitClip.xmin, pbufTop, pbufWidth, pbufNLines, model, pixels8, 0, pbufWidth);            else                theConsumer.setPixels(bitClip.xmin, pbufTop, pbufWidth, pbufNLines, model, pixels32, 0, pbufWidth);        pbufTop += pbufNLines;        pbufNLines = 0;    }*//*    private final void PaintBits()    {        InitPixels();        for(y = edgeClip.ymin; y < edgeClip.ymax; y++)        {            for(REdge redge = yindex[y - edgeClip.ymin]; redge != null; redge = redge.nextActive)            {                redge.initStep(y);                if(nActive == maxActive)                {                    maxActive *= 2;                    REdge aredge[] = new REdge[maxActive];                    System.arraycopy(activeEdges, 0, aredge, 0, nActive);                    activeEdges = aredge;                }                int i = nActive;                do                {                    if(i == 0 || activeEdges[i - 1].x < redge.x)                    {                        activeEdges[i] = redge;                        break;                    }                    activeEdges[i] = activeEdges[i - 1];                    i--;                } while(true);                nActive++;            }            int j = nActive - 1;            boolean flag;            do            {                flag = false;                for(int k = 0; k < j; k++)                    if(activeEdges[k].x > activeEdges[k + 1].x)                    {                        REdge redge1 = activeEdges[k];                        activeEdges[k] = activeEdges[k + 1];                        activeEdges[k + 1] = redge1;                        if(!flag && k > 0 && activeEdges[k - 1].x > activeEdges[k].x)                            flag = true;                    }                j--;            } while(flag && j > 0);            if(antialias)            {                if(firstRun == null)                {                    if(runPool != null)                    {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -