// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

import java.awt.*;
import java.awt.image.PixelGrabber;
import java.io.PrintStream;
import sign.signlink;

public class Class31_Sub3_Sub1_Sub2 extends Class31_Sub3_Sub1
{

    public Class31_Sub3_Sub1_Sub2(int i, int j)
    {
        aByte1487 = 1;
        aBoolean1488 = false;
        anInt1489 = -462;
        anInt1490 = 231;
        aBoolean1491 = false;
        anIntArray1492 = new int[i * j];
        anInt1493 = anInt1497 = i;
        anInt1494 = anInt1498 = j;
        anInt1495 = anInt1496 = 0;
    }

    public Class31_Sub3_Sub1_Sub2(byte abyte0[], Component component)
    {
        aByte1487 = 1;
        aBoolean1488 = false;
        anInt1489 = -462;
        anInt1490 = 231;
        aBoolean1491 = false;
        try
        {
            Image image = Toolkit.getDefaultToolkit().createImage(abyte0);
            MediaTracker mediatracker = new MediaTracker(component);
            mediatracker.addImage(image, 0);
            mediatracker.waitForAll();
            anInt1493 = image.getWidth(component);
            anInt1494 = image.getHeight(component);
            anInt1497 = anInt1493;
            anInt1498 = anInt1494;
            anInt1495 = 0;
            anInt1496 = 0;
            anIntArray1492 = new int[anInt1493 * anInt1494];
            PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, anInt1493, anInt1494, anIntArray1492, 0, anInt1493);
            pixelgrabber.grabPixels();
            return;
        }
        catch(Exception _ex)
        {
            System.out.println("Error converting jpg");
        }
    }

    public Class31_Sub3_Sub1_Sub2(Class11 class11, String s, int i)
    {
        aByte1487 = 1;
        aBoolean1488 = false;
        anInt1489 = -462;
        anInt1490 = 231;
        aBoolean1491 = false;
        Class31_Sub3_Sub2 class31_sub3_sub2 = new Class31_Sub3_Sub2((byte)114, class11.method204(s + ".dat", null));
        Class31_Sub3_Sub2 class31_sub3_sub2_1 = new Class31_Sub3_Sub2((byte)114, class11.method204("index.dat", null));
        class31_sub3_sub2_1.anInt1440 = class31_sub3_sub2.method424();
        anInt1497 = class31_sub3_sub2_1.method424();
        anInt1498 = class31_sub3_sub2_1.method424();
        int j = class31_sub3_sub2_1.method422();
        int ai[] = new int[j];
        for(int k = 0; k < j - 1; k++)
        {
            ai[k + 1] = class31_sub3_sub2_1.method426();
            if(ai[k + 1] == 0)
                ai[k + 1] = 1;
        }

        for(int l = 0; l < i; l++)
        {
            class31_sub3_sub2_1.anInt1440 += 2;
            class31_sub3_sub2.anInt1440 += class31_sub3_sub2_1.method424() * class31_sub3_sub2_1.method424();
            class31_sub3_sub2_1.anInt1440++;
        }

        anInt1495 = class31_sub3_sub2_1.method422();
        anInt1496 = class31_sub3_sub2_1.method422();
        anInt1493 = class31_sub3_sub2_1.method424();
        anInt1494 = class31_sub3_sub2_1.method424();
        int i1 = class31_sub3_sub2_1.method422();
        int j1 = anInt1493 * anInt1494;
        anIntArray1492 = new int[j1];
        if(i1 == 0)
        {
            for(int k1 = 0; k1 < j1; k1++)
                anIntArray1492[k1] = ai[class31_sub3_sub2.method422()];

            return;
        }
        if(i1 == 1)
        {
            for(int l1 = 0; l1 < anInt1493; l1++)
            {
                for(int i2 = 0; i2 < anInt1494; i2++)
                    anIntArray1492[l1 + i2 * anInt1493] = ai[class31_sub3_sub2.method422()];

            }

        }
    }

    public void method374(int i)
    {
        Class31_Sub3_Sub1.method345(anInt1494, anInt1493, -357, anIntArray1492);
        if(i == 0);
    }

    public void method375(int i, byte byte0, int j, int k)
    {
        for(int l = 0; l < anIntArray1492.length; l++)
        {
            int i1 = anIntArray1492[l];
            if(i1 != 0)
            {
                int j1 = i1 >> 16 & 0xff;
                j1 += j;
                if(j1 < 1)
                    j1 = 1;
                else
                if(j1 > 255)
                    j1 = 255;
                int k1 = i1 >> 8 & 0xff;
                k1 += i;
                if(k1 < 1)
                    k1 = 1;
                else
                if(k1 > 255)
                    k1 = 255;
                int l1 = i1 & 0xff;
                l1 += k;
                if(l1 < 1)
                    l1 = 1;
                else
                if(l1 > 255)
                    l1 = 255;
                anIntArray1492[l] = (j1 << 16) + (k1 << 8) + l1;
            }
        }

        if(byte0 != aByte1487)
            aBoolean1491 = !aBoolean1491;
    }

    public void method376(int i)
    {
        int ai[] = new int[anInt1497 * anInt1498];
        for(int j = 0; j < anInt1494; j++)
        {
            for(int k = 0; k < anInt1493; k++)
                ai[(j + anInt1496) * anInt1497 + (k + anInt1495)] = anIntArray1492[j * anInt1493 + k];

        }

        anIntArray1492 = ai;
        anInt1493 = anInt1497;
        anInt1494 = anInt1498;
        while(i >= 0) 
            anInt1490 = -95;
        anInt1495 = 0;
        anInt1496 = 0;
    }

    public void method377(int i, int j, int k)
    {
        j += anInt1495;
        if(i != 143)
        {
            for(int l = 1; l > 0; l++);
        }
        k += anInt1496;
        int i1 = j + k * Class31_Sub3_Sub1.anInt1412;
        int j1 = 0;
        int k1 = anInt1494;
        int l1 = anInt1493;
        int i2 = Class31_Sub3_Sub1.anInt1412 - l1;
        int j2 = 0;
        if(k < Class31_Sub3_Sub1.anInt1414)
        {
            int k2 = Class31_Sub3_Sub1.anInt1414 - k;
            k1 -= k2;
            k = Class31_Sub3_Sub1.anInt1414;
            j1 += k2 * l1;
            i1 += k2 * Class31_Sub3_Sub1.anInt1412;
        }
        if(k + k1 > Class31_Sub3_Sub1.anInt1415)
            k1 -= (k + k1) - Class31_Sub3_Sub1.anInt1415;
        if(j < Class31_Sub3_Sub1.anInt1416)
        {
            int l2 = Class31_Sub3_Sub1.anInt1416 - j;
            l1 -= l2;
            j = Class31_Sub3_Sub1.anInt1416;
            j1 += l2;
            i1 += l2;
            j2 += l2;
            i2 += l2;
        }
        if(j + l1 > Class31_Sub3_Sub1.anInt1417)
        {
            int i3 = (j + l1) - Class31_Sub3_Sub1.anInt1417;
            l1 -= i3;
            j2 += i3;
            i2 += i3;
        }
        if(l1 <= 0 || k1 <= 0)
        {
            return;
        } else
        {
            method378(anIntArray1492, j2, 611, i1, k1, Class31_Sub3_Sub1.anIntArray1411, j1, l1, i2);
            return;
        }
    }

    public void method378(int ai[], int i, int j, int k, int l, int ai1[], int i1, 
            int j1, int k1)
    {
        int l1 = -(j1 >> 2);
        j1 = -(j1 & 3);
        j = 23 / j;
        for(int i2 = -l; i2 < 0; i2++)
        {
            for(int j2 = l1; j2 < 0; j2++)
            {
                ai1[k++] = ai[i1++];
                ai1[k++] = ai[i1++];
                ai1[k++] = ai[i1++];
                ai1[k++] = ai[i1++];
            }

            for(int k2 = j1; k2 < 0; k2++)
                ai1[k++] = ai[i1++];

            k += k1;
            i1 += i;
        }

    }

    public void method379(int i, int j, int k)
    {
        j += anInt1495;
        k += anInt1496;
        int l = j + k * Class31_Sub3_Sub1.anInt1412;
        int i1 = 0;
        if(i != -4899)
            return;
        int j1 = anInt1494;
        int k1 = anInt1493;
        int l1 = Class31_Sub3_Sub1.anInt1412 - k1;
        int i2 = 0;
        if(k < Class31_Sub3_Sub1.anInt1414)
        {
            int j2 = Class31_Sub3_Sub1.anInt1414 - k;
            j1 -= j2;
            k = Class31_Sub3_Sub1.anInt1414;
            i1 += j2 * k1;
            l += j2 * Class31_Sub3_Sub1.anInt1412;
        }
        if(k + j1 > Class31_Sub3_Sub1.anInt1415)
            j1 -= (k + j1) - Class31_Sub3_Sub1.anInt1415;
        if(j < Class31_Sub3_Sub1.anInt1416)
        {
            int k2 = Class31_Sub3_Sub1.anInt1416 - j;
            k1 -= k2;
            j = Class31_Sub3_Sub1.anInt1416;
            i1 += k2;
            l += k2;
            i2 += k2;
            l1 += k2;
        }
        if(j + k1 > Class31_Sub3_Sub1.anInt1417)
        {
            int l2 = (j + k1) - Class31_Sub3_Sub1.anInt1417;
            k1 -= l2;
            i2 += l2;
            l1 += l2;
        }
        if(k1 <= 0 || j1 <= 0)
        {
            return;
        } else
        {
            method380(Class31_Sub3_Sub1.anIntArray1411, anIntArray1492, 0, i1, l, k1, j1, l1, i2);
            return;
        }
    }

    public void method380(int ai[], int ai1[], int i, int j, int k, int l, int i1, 
            int j1, int k1)
    {
        int l1 = -(l >> 2);
        l = -(l & 3);
        for(int i2 = -i1; i2 < 0; i2++)
        {
            for(int j2 = l1; j2 < 0; j2++)
            {
                i = ai1[j++];
                if(i != 0)
                    ai[k++] = i;
                else
                    k++;
                i = ai1[j++];
                if(i != 0)
                    ai[k++] = i;
                else
                    k++;
                i = ai1[j++];
                if(i != 0)
                    ai[k++] = i;
                else
                    k++;
                i = ai1[j++];
                if(i != 0)
                    ai[k++] = i;
                else
                    k++;
            }

            for(int k2 = l; k2 < 0; k2++)
            {
                i = ai1[j++];
                if(i != 0)
                    ai[k++] = i;
                else
                    k++;
            }

            k += j1;
            j += k1;
        }

    }

    public void method381(int i, int j, int k, int l)
    {
        if(i <= 0)
            return;
        k += anInt1495;
        l += anInt1496;
        int i1 = k + l * Class31_Sub3_Sub1.anInt1412;
        int j1 = 0;
        int k1 = anInt1494;
        int l1 = anInt1493;
        int i2 = Class31_Sub3_Sub1.anInt1412 - l1;
        int j2 = 0;
        if(l < Class31_Sub3_Sub1.anInt1414)
        {
            int k2 = Class31_Sub3_Sub1.anInt1414 - l;
            k1 -= k2;
            l = Class31_Sub3_Sub1.anInt1414;
            j1 += k2 * l1;
            i1 += k2 * Class31_Sub3_Sub1.anInt1412;
        }
        if(l + k1 > Class31_Sub3_Sub1.anInt1415)
            k1 -= (l + k1) - Class31_Sub3_Sub1.anInt1415;
        if(k < Class31_Sub3_Sub1.anInt1416)
        {
            int l2 = Class31_Sub3_Sub1.anInt1416 - k;
            l1 -= l2;
            k = Class31_Sub3_Sub1.anInt1416;
            j1 += l2;
            i1 += l2;
            j2 += l2;
            i2 += l2;
        }
        if(k + l1 > Class31_Sub3_Sub1.anInt1417)
        {
            int i3 = (k + l1) - Class31_Sub3_Sub1.anInt1417;
            l1 -= i3;
            j2 += i3;
            i2 += i3;
        }
        if(l1 <= 0 || k1 <= 0)
        {
            return;
        } else
        {
            method382(j1, l1, i1, Class31_Sub3_Sub1.anIntArray1411, k1, j, 0, i2, anIntArray1492, (byte)3, j2);
            return;
        }
    }

    public void method382(int i, int j, int k, int ai[], int l, int i1, int j1, 
            int k1, int ai1[], byte byte0, int l1)
    {
        int i2 = 256 - i1;
        for(int j2 = -l; j2 < 0; j2++)
        {
            for(int k2 = -j; k2 < 0; k2++)
            {
                j1 = ai1[i++];
                if(j1 != 0)
                {
                    int l2 = ai[k];
                    ai[k++] = ((j1 & 0xff00ff) * i1 + (l2 & 0xff00ff) * i2 & 0xff00ff00) + ((j1 & 0xff00) * i1 + (l2 & 0xff00) * i2 & 0xff0000) >> 8;
                } else
                {
                    k++;
                }
            }

            k += k1;
            i += l1;
        }

        if(byte0 != 3)
            anInt1486 = 148;
    }

    public void method383(int i, boolean flag, int j, int k, int l, int ai[], int i1, 
            int ai1[], int j1, int k1, int l1)
    {
        if(flag)
            return;
        try
        {
            int i2 = -j1 / 2;
            int j2 = -k / 2;
            int k2 = (int)(Math.sin((double)i / 326.11000000000001D) * 65536D);
            int l2 = (int)(Math.cos((double)i / 326.11000000000001D) * 65536D);
            k2 = k2 * l >> 8;
            l2 = l2 * l >> 8;
            int i3 = (k1 << 16) + (j2 * k2 + i2 * l2);
            int j3 = (j << 16) + (j2 * l2 - i2 * k2);
            int k3 = l1 + i1 * Class31_Sub3_Sub1.anInt1412;
            for(i1 = 0; i1 < k; i1++)
            {
                int l3 = ai[i1];
                int i4 = k3 + l3;
                int j4 = i3 + l2 * l3;
                int k4 = j3 - k2 * l3;
                for(l1 = -ai1[i1]; l1 < 0; l1++)
                {
                    Class31_Sub3_Sub1.anIntArray1411[i4++] = anIntArray1492[(j4 >> 16) + (k4 >> 16) * anInt1493];
                    j4 += l2;
                    k4 -= k2;
                }

                i3 += k2;
                j3 += l2;
                k3 += Class31_Sub3_Sub1.anInt1412;
            }

            return;
        }
        catch(Exception _ex)
        {
            return;
        }
    }

    public void method384(int i, int j, int k, int l, double d, int i1, 
            int j1, int k1, int l1)
    {
        if(i1 <= 0)
            return;
        try
        {
            int i2 = -j / 2;
            int j2 = -l / 2;
            int k2 = (int)(Math.sin(d) * 65536D);
            int l2 = (int)(Math.cos(d) * 65536D);
            k2 = k2 * j1 >> 8;
            l2 = l2 * j1 >> 8;
            int i3 = (k << 16) + (j2 * k2 + i2 * l2);
            int j3 = (i << 16) + (j2 * l2 - i2 * k2);
            int k3 = l1 + k1 * Class31_Sub3_Sub1.anInt1412;
            for(k1 = 0; k1 < l; k1++)
            {
                int l3 = k3;
                int i4 = i3;
                int j4 = j3;
                for(l1 = -j; l1 < 0; l1++)
                {
                    int k4 = anIntArray1492[(i4 >> 16) + (j4 >> 16) * anInt1493];
                    if(k4 != 0)
                        Class31_Sub3_Sub1.anIntArray1411[l3++] = k4;
                    else
                        l3++;
                    i4 += l2;
                    j4 -= k2;
                }

                i3 += k2;
                j3 += l2;
                k3 += Class31_Sub3_Sub1.anInt1412;
            }

            return;
        }
        catch(Exception _ex)
        {
            return;
        }
    }

    public void method385(int i, int j, byte byte0, Class31_Sub3_Sub1_Sub3 class31_sub3_sub1_sub3)
    {
        if(byte0 != -9)
            return;
        j += anInt1495;
        i += anInt1496;
        int k = j + i * Class31_Sub3_Sub1.anInt1412;
        int l = 0;
        int i1 = anInt1494;
        int j1 = anInt1493;
        int k1 = Class31_Sub3_Sub1.anInt1412 - j1;
        int l1 = 0;
        if(i < Class31_Sub3_Sub1.anInt1414)
        {
            int i2 = Class31_Sub3_Sub1.anInt1414 - i;
            i1 -= i2;
            i = Class31_Sub3_Sub1.anInt1414;
            l += i2 * j1;
            k += i2 * Class31_Sub3_Sub1.anInt1412;
        }
        if(i + i1 > Class31_Sub3_Sub1.anInt1415)
            i1 -= (i + i1) - Class31_Sub3_Sub1.anInt1415;
        if(j < Class31_Sub3_Sub1.anInt1416)
        {
            int j2 = Class31_Sub3_Sub1.anInt1416 - j;
            j1 -= j2;
            j = Class31_Sub3_Sub1.anInt1416;
            l += j2;
            k += j2;
            l1 += j2;
            k1 += j2;
        }
        if(j + j1 > Class31_Sub3_Sub1.anInt1417)
        {
            int k2 = (j + j1) - Class31_Sub3_Sub1.anInt1417;
            j1 -= k2;
            l1 += k2;
            k1 += k2;
        }
        if(j1 <= 0 || i1 <= 0)
        {
            return;
        } else
        {
            method386(k1, anIntArray1492, class31_sub3_sub1_sub3.aByteArray1502, 0, l, l1, true, Class31_Sub3_Sub1.anIntArray1411, k, i1, j1);
            return;
        }
    }

    public void method386(int i, int ai[], byte abyte0[], int j, int k, int l, boolean flag, 
            int ai1[], int i1, int j1, int k1)
    {
        int l1 = -(k1 >> 2);
        k1 = -(k1 & 3);
        for(int i2 = -j1; i2 < 0; i2++)
        {
            for(int j2 = l1; j2 < 0; j2++)
            {
                j = ai[k++];
                if(j != 0 && abyte0[i1] == 0)
                    ai1[i1++] = j;
                else
                    i1++;
                j = ai[k++];
                if(j != 0 && abyte0[i1] == 0)
                    ai1[i1++] = j;
                else
                    i1++;
                j = ai[k++];
                if(j != 0 && abyte0[i1] == 0)
                    ai1[i1++] = j;
                else
                    i1++;
                j = ai[k++];
                if(j != 0 && abyte0[i1] == 0)
                    ai1[i1++] = j;
                else
                    i1++;
            }

            for(int k2 = k1; k2 < 0; k2++)
            {
                j = ai[k++];
                if(j != 0 && abyte0[i1] == 0)
                    ai1[i1++] = j;
                else
                    i1++;
            }

            i1 += i;
            k += l;
        }

        if(!flag)
            anInt1489 = -483;
    }

    public int anInt1486;
    public byte aByte1487;
    public boolean aBoolean1488;
    public int anInt1489;
    public int anInt1490;
    public boolean aBoolean1491;
    public int anIntArray1492[];
    public int anInt1493;
    public int anInt1494;
    public int anInt1495;
    public int anInt1496;
    public int anInt1497;
    public int anInt1498;
}
