Exemple #1
0
            public static GClass70 ReadGClass70(this SCMap scMap)
            {
                GClass70 gClass70 = new GClass70();

                gClass70.int_0 = scMap.ReadInt();
                gClass70.group = scMap.ReadString();
                int lenght = scMap.ReadInt();

                gClass70.int_1 = scMap.ReadInts(lenght);
                return(gClass70);
            }
Exemple #2
0
    public bool ParseSCMapFile(string filePath = "")
    {
        if (filePath != "")
        {
            OpenSCMap(filePath);
        }

        fs = scMapFile.Open(FileMode.Open, FileAccess.Read);

        header = this.ReadMapHeader();

        terrain = this.ReadSCTearrain();

        lightingSettings = this.ReadLightingSettings();

        fogSettings = this.ReadFogSettings();

        waterSettings = this.ReadWaterSettings();

        float_8          = this.ReadFloats(20);
        waterTexture     = this.ReadString();
        waterTextureRamp = this.ReadString();
        float_9          = this.ReadFloats(4);

        //Read Waves
        for (int i = 0; i < 4; i++)
        {
            Wave wave = this.ReadWave();
            waves.Add(wave);
        }

        //Read GClass0
        int gClass0Count = this.ReadInt();

        for (int i = 0; i < gClass0Count; i++)
        {
            GClass0 tmpGClass0 = this.ReadGClass0();
            gClass0.Add(tmpGClass0);
        }
        hasGClass0 = !waterSettings.hasWater || gClass0Count > 0;


        unk0 = this.ReadString();

        //Read GClass69
        int gClass69Count = this.ReadInt();

        for (int i = 0; i < gClass69Count; i++)
        {
            Layer tmpLayer = this.ReadGClass69();
            layers.Add(tmpLayer);
        }


        int_9  = this.ReadInt();
        int_10 = this.ReadInt();


        //Read gClass1
        int gClass1Count = this.ReadInt();

        for (int i = 0; i < gClass1Count; i++)
        {
            GClass1 gClass1 = this.ReadDecal();
            gClass1s.Add(gClass1);
        }

        //Read GClass70

        int gClass70Count = this.ReadInt();

        for (int i = 0; i < gClass70Count; i++)
        {
            GClass70 gClass70 = this.ReadGClass70();
            gClass70s.Add(gClass70);
        }

        unk1 = this.ReadInt();
        unk2 = this.ReadInt();

        //Read UnknowArray

        count3 = this.ReadInt();
        int lenght3 = this.ReadInt();

        numArray3 = this.ReadBytes(lenght3);// texture terrain colors?
        for (int i = 1; i < count3; i++)
        {
            lenght3 = this.ReadInt();
            this.SkipBytes(lenght3);
        }

        unk3 = this.ReadInt();

        int lenght2 = this.ReadInt();

        numArray2 = this.ReadBytes(lenght2);// texture?

        unk4 = this.ReadInt();

        toSkip0 = this.ReadInt();
        this.SkipBytes(toSkip0);

        toSkip1 = Mathf.RoundToInt(terrain.size.x / 2 * terrain.size.y / 2);
        this.SkipBytes(toSkip1);
        this.SkipBytes(toSkip1);
        this.SkipBytes(toSkip1);

        byte_0 = this.ReadBytes((int)(terrain.size.x * terrain.size.y));

        if (header.version <= 52)
        {
            unk5 = this.ReadShort();
        }

        //Read Prop

        int propCount = this.ReadInt();

        for (int i = 0; i < propCount; i++)
        {
            Prop prop = this.ReadProp();
            props.Add(prop);
        }

        fs.Close();

        return(true);
    }