Esempio n. 1
0
    private IEnumerator WaitForRecreateRenderTexture(GEOTEXANIMHEADER texAnimHeader, GEOTEXHEADER texHeader, Int32 i)
    {
        this.SetDefaultTextures(texHeader, i);
        yield return(new WaitForEndOfFrame());

        this.SetBackRenderTexture(texHeader, i);
        GeoTexAnim.RecreateMultiTexAnim(texAnimHeader, texHeader, i);
        yield break;
    }
Esempio n. 2
0
    public static void geoTexAnimStop(GEOTEXHEADER tab, Int32 anum)
    {
        if (tab == null || tab.geotex == null)
        {
            return;
        }
        Byte             b = 3;
        GEOTEXANIMHEADER geotexanimheader = tab.geotex[anum];

        geotexanimheader.flags = (Byte)(geotexanimheader.flags & (Byte)(~b));
    }
Esempio n. 3
0
    public void geoTexAnimStop(Int32 anum)
    {
        if (!this._isLoaded)
        {
            return;
        }
        Byte             b = 3;
        GEOTEXANIMHEADER geotexanimheader = this.Anims[anum];

        geotexanimheader.flags = (Byte)(geotexanimheader.flags & (Byte)(~b));
    }
Esempio n. 4
0
    public static void RecreateMultiTexAnim(GEOTEXANIMHEADER texAnimHeader, GEOTEXHEADER texHeader, Int32 i)
    {
        RenderTexture active = RenderTexture.active;

        RenderTexture.active = texHeader.RenderTexMapping[texHeader._mainTextureIndexs[i]];
        GL.PushMatrix();
        GL.Clear(true, true, Color.clear);
        GL.LoadPixelMatrix(0f, texHeader.RenderTexWidth, texHeader.RenderTexHeight, 0f);
        Graphics.DrawTexture(new Rect(0f, 0f, texHeader.RenderTexWidth, texHeader.RenderTexHeight), texHeader.TextureMapping[texHeader._mainTextureIndexs[i]]);
        GL.PopMatrix();
        RenderTexture.active = active;
    }
Esempio n. 5
0
    private static void MultiTexAnimService(GEOTEXANIMHEADER texAnimHeader, GEOTEXHEADER texHeader, Int32 i, Int16 framenum)
    {
        RenderTexture active = RenderTexture.active;

        RenderTexture.active = texHeader.RenderTexMapping[texHeader._mainTextureIndexs[i]];
        GL.PushMatrix();
        GL.LoadPixelMatrix(0f, texHeader.RenderTexWidth, texHeader.RenderTexHeight, 0f);
        Graphics.DrawTexture(new Rect(0f, 0f, texHeader.RenderTexWidth, texHeader.RenderTexHeight), texHeader.TextureMapping[texHeader._mainTextureIndexs[i]], GEOTEXANIMHEADER.texAnimMat);
        Graphics.DrawTexture(texAnimHeader.targetuv, texHeader.TextureMapping[texHeader._subTextureIndexs[i]], texAnimHeader.rectuvs[(Int32)framenum], 0, 0, 0, 0);
        GL.PopMatrix();
        RenderTexture.active = active;
    }
Esempio n. 6
0
    public static void geoTexAnimPlayOnce(GEOTEXHEADER tab, Int32 anum)
    {
        if (tab == null || tab.geotex == null)
        {
            return;
        }
        GEOTEXANIMHEADER geotexanimheader = tab.geotex[anum];

        geotexanimheader.flags     = (Byte)(geotexanimheader.flags | 3);
        tab.geotex[anum].frame     = 0;
        tab.geotex[anum].lastframe = 4096;
    }
Esempio n. 7
0
    public void geoTexAnimPlayOnce(Int32 anum)
    {
        if (!this._isLoaded)
        {
            return;
        }
        GEOTEXANIMHEADER geotexanimheader = this.Anims[anum];

        geotexanimheader.flags     = (Byte)(geotexanimheader.flags | 3);
        this.Anims[anum].frame     = 0;
        this.Anims[anum].lastframe = 4096;
    }
Esempio n. 8
0
    public static void geoBGTexAnimPlay(GEOTEXHEADER tab, Int32 anum)
    {
        if (tab.geotex[anum].numframes == 0)
        {
            tab.TexAnimTextures[anum].wrapMode = TextureWrapMode.Repeat;
            if (battlebg.nf_BbgNumber == 57)
            {
                tab.extraTexAnimTrTextures[anum].wrapMode = TextureWrapMode.Repeat;
            }
        }
        GEOTEXANIMHEADER geotexanimheader = tab.geotex[anum];

        geotexanimheader.flags     = (Byte)(geotexanimheader.flags | 1);
        tab.geotex[anum].frame     = 0;
        tab.geotex[anum].lastframe = 4096;
    }
Esempio n. 9
0
    public void geoTexAnimPlay(Int32 anum)
    {
        if (!this._isLoaded)
        {
            return;
        }
        GEOTEXANIMHEADER geotexanimheader = this.Anims[anum];

        geotexanimheader.flags     = (Byte)(geotexanimheader.flags | 1);
        this.Anims[anum].frame     = 0;
        this.Anims[anum].lastframe = 4096;
        if (anum == 0)
        {
            Byte             b = 3;
            GEOTEXANIMHEADER geotexanimheader2 = this.Anims[2];
            geotexanimheader2.flags = (Byte)(geotexanimheader2.flags & (Byte)(~b));
        }
    }
Esempio n. 10
0
 public void CheckRenderTexture(GEOTEXHEADER texHeader)
 {
     if (texHeader == null)
     {
         return;
     }
     for (Int32 i = 0; i < (Int32)texHeader.count; i++)
     {
         RenderTexture renderTexture = texHeader.RenderTexMapping[texHeader._mainTextureIndexs[i]];
         if (!renderTexture.IsCreated())
         {
             if (texHeader.geotex != null)
             {
                 GEOTEXANIMHEADER texAnimHeader = texHeader.geotex[i];
                 base.StartCoroutine(this.WaitForRecreateRenderTexture(texAnimHeader, texHeader, i));
             }
         }
     }
 }
Esempio n. 11
0
    public static void geoBGTexAnimService(GEOTEXHEADER texheaderptr)
    {
        UInt16 count = texheaderptr.count;

        GEOTEXANIMHEADER[] geotex = texheaderptr.geotex;
        for (Int32 i = 0; i < (Int32)count; i++)
        {
            GEOTEXANIMHEADER geotexanimheader = geotex[i];
            if ((geotexanimheader.flags & 1) != 0)
            {
                if (geotexanimheader.numframes != 0)
                {
                    Int32 num       = geotexanimheader.frame;
                    Int16 lastframe = geotexanimheader.lastframe;
                    Int16 num2      = (Int16)(num >> 12);
                    if (num2 >= 0)
                    {
                        if (geotexanimheader.numframes <= 0)
                        {
                            goto IL_2C3;
                        }
                        if (num2 != lastframe)
                        {
                            for (Int32 j = 0; j < (Int32)geotexanimheader.count; j++)
                            {
                                Single x    = (geotexanimheader.coords[(Int32)num2].x - geotexanimheader.target.x) / (Single)texheaderptr.TexAnimTextures[j].width;
                                Single num3 = (geotexanimheader.coords[(Int32)num2].y - geotexanimheader.target.y) / (Single)texheaderptr.TexAnimTextures[j].height;
                                texheaderptr.texAnimMaterials[i].SetTextureOffset("_MainTex", new Vector2(x, -num3));
                            }
                            geotexanimheader.lastframe = num2;
                        }
                        Int16 rate = geotexanimheader.rate;
                        num += (Int32)rate;
                    }
                    else
                    {
                        num += 4096;
                    }
                    if (num >> 12 < (Int32)geotexanimheader.numframes)
                    {
                        geotexanimheader.frame = num;
                    }
                    else if (geotexanimheader.randrange > 0)
                    {
                        UInt32 num4 = battlebg.geoBGTexAnimRandom((UInt32)geotexanimheader.randmin, (UInt32)geotexanimheader.randrange);
                        geotexanimheader.frame = (Int32)(-(Int32)((UInt64)((UInt64)num4 << 12)));
                    }
                    else if ((geotexanimheader.flags & 2) != 0)
                    {
                        Byte             b = 3;
                        GEOTEXANIMHEADER geotexanimheader2 = geotexanimheader;
                        geotexanimheader2.flags = (Byte)(geotexanimheader2.flags & (Byte)(~b));
                    }
                    else
                    {
                        geotexanimheader.frame = 0;
                    }
                }
                else if ((geotexanimheader.flags & 4) != 0)
                {
                    Int32 num  = geotexanimheader.frame;
                    Int16 num2 = (Int16)(num >> 12);
                    for (Int32 k = 0; k < (Int32)geotexanimheader.count; k++)
                    {
                        Int32  num5   = 0;
                        Int32  height = texheaderptr.TexAnimTextures[k].height;
                        Single num6   = (Single)num2 / (Single)height;
                        if (battlebg.nf_BbgNumber == 69 && i == 3)
                        {
                            num6 *= -1f;
                        }
                        texheaderptr.texAnimMaterials[i].SetTextureOffset("_MainTex", new Vector2((Single)num5, -num6));
                        if (battlebg.nf_BbgNumber == 57)
                        {
                            texheaderptr.extraTexAimMaterials[i].SetTextureOffset("_MainTex", new Vector2((Single)num5, -num6));
                        }
                        else if (battlebg.nf_BbgNumber == 71 && k == 0)
                        {
                            texheaderptr.extraTexAimMaterials[i].SetTextureOffset("_MainTex", new Vector2((Single)num5, -num6));
                        }
                    }
                    Int16 rate = geotexanimheader.rate;
                    geotexanimheader.frame += (Int32)rate;
                }
            }
            IL_2C3 :;
        }
    }
Esempio n. 12
0
 public static void geoTexAnimService(GEOTEXHEADER texHeader)
 {
     if (texHeader == null)
     {
         return;
     }
     for (Int32 i = 0; i < (Int32)texHeader.count; i++)
     {
         GEOTEXANIMHEADER geotexanimheader = texHeader.geotex[i];
         if ((geotexanimheader.flags & 1) != 0)
         {
             if (geotexanimheader.numframes != 0)
             {
                 Int32 num       = geotexanimheader.frame;
                 Int16 lastframe = geotexanimheader.lastframe;
                 Int16 num2      = (Int16)(num >> 12);
                 if (num2 >= 0)
                 {
                     if (num2 != lastframe)
                     {
                         for (Int32 j = 0; j < (Int32)geotexanimheader.count; j++)
                         {
                             if (texHeader.geotex != null)
                             {
                                 GeoTexAnim.MultiTexAnimService(geotexanimheader, texHeader, i, num2);
                             }
                         }
                         geotexanimheader.lastframe = num2;
                     }
                     Int16 rate = geotexanimheader.rate;
                     num += (Int32)rate;
                 }
                 else
                 {
                     num += 4096;
                 }
                 if (num >> 12 < (Int32)geotexanimheader.numframes)
                 {
                     geotexanimheader.frame = num;
                 }
                 else if (geotexanimheader.randrange > 0)
                 {
                     UInt32 num3 = (UInt32)UnityEngine.Random.Range((Int32)geotexanimheader.randmin, (Int32)(geotexanimheader.randrange + 1));
                     geotexanimheader.frame = (Int32)(-(Int32)((UInt64)((UInt64)num3 << 12)));
                 }
                 else if ((geotexanimheader.flags & 2) != 0)
                 {
                     Byte             b = 3;
                     GEOTEXANIMHEADER geotexanimheader2 = geotexanimheader;
                     geotexanimheader2.flags = (Byte)(geotexanimheader2.flags & (Byte)(~b));
                 }
                 else
                 {
                     geotexanimheader.frame = 0;
                 }
             }
             else if ((geotexanimheader.flags & 4) != 0)
             {
                 global::Debug.Log("SCROLL!!!");
             }
         }
     }
 }
Esempio n. 13
0
 public override void HonoUpdate()
 {
     if (!this._isLoaded)
     {
         return;
     }
     this._cTime += Time.deltaTime;
     if (this._cTime >= 0.06666667f)
     {
         this._cTime = 0f;
         for (Int32 i = 0; i < this.Count; i++)
         {
             GEOTEXANIMHEADER geotexanimheader = this.Anims[i];
             if ((geotexanimheader.flags & 1) != 0)
             {
                 Int32 num       = geotexanimheader.frame;
                 Int32 lastframe = (Int32)geotexanimheader.lastframe;
                 Int16 num2      = (Int16)(num >> 12);
                 if (num2 >= 0)
                 {
                     if ((Int32)num2 != lastframe)
                     {
                         for (Int32 j = 0; j < (Int32)geotexanimheader.count; j++)
                         {
                             RenderTexture active = RenderTexture.active;
                             RenderTexture.active = this.RenderTex;
                             GL.PushMatrix();
                             GL.LoadPixelMatrix(0f, this.RenderTexWidth, this.RenderTexHeight, 0f);
                             Graphics.DrawTexture(new Rect(0f, 0f, this.RenderTexWidth, this.RenderTexHeight), this._mainTexture);
                             Graphics.DrawTexture(geotexanimheader.targetuv, this._subTexture, geotexanimheader.rectuvs[(Int32)num2], 0, 0, 0, 0);
                             GL.PopMatrix();
                             RenderTexture.active = active;
                         }
                         geotexanimheader.lastframe = num2;
                     }
                     Int16 rate = geotexanimheader.rate;
                     num += (Int32)rate;
                 }
                 else
                 {
                     num += 4096;
                 }
                 if (num >> 12 < (Int32)geotexanimheader.numframes)
                 {
                     geotexanimheader.frame = num;
                 }
                 else if (geotexanimheader.randrange > 0)
                 {
                     UInt32 num3 = this.geoTexAnimRandom((UInt32)geotexanimheader.randmin, (UInt32)geotexanimheader.randrange);
                     geotexanimheader.frame = (Int32)(-(Int32)((UInt64)((UInt64)num3 << 12)));
                 }
                 else if ((geotexanimheader.flags & 2) != 0)
                 {
                     Byte             b = 3;
                     GEOTEXANIMHEADER geotexanimheader2 = geotexanimheader;
                     geotexanimheader2.flags = (Byte)(geotexanimheader2.flags & (Byte)(~b));
                 }
                 else
                 {
                     geotexanimheader.frame = 0;
                 }
             }
         }
         return;
     }
 }