Exemple #1
0
        public static GUIData Read(BinaryReader reader)
        {
            GUIData gui = new GUIData();

            gui.Name = reader.ReadTString();

            uint dataLength = reader.ReadUInt32();
            long dataEnd    = reader.BaseStream.Position + dataLength;

            //Load_GUI
            {
                uint i1 = reader.ReadUInt32();                 //Num something - inits array to NULLs

                ReadGUIElement(reader);

                uint numActions = reader.ReadUInt32();
                for (uint x = 0; x < numActions; x++)
                {
                    GameFunction f = GameFunction.ReadFunction(reader);
                }
            }

            if (reader.BaseStream.Position != dataEnd)
            {
                throw new Exception();
            }

            return(gui);
        }
Exemple #2
0
        public static ObjectData Read(BinaryReader reader)
        {
            uint i1 = reader.ReadUInt32();             //As float
            uint i2 = reader.ReadUInt32();             //As float

            uint i3 = reader.ReadUInt32();
            uint i4 = reader.ReadUInt32();
            uint i5 = reader.ReadUInt32();
            uint i6 = reader.ReadUInt32();

            string s1 = reader.ReadTString();

            int i7 = reader.ReadInt32();

            if (i7 > 0)             //Load some kind of array
            {
                uint[] ar1 = new uint[i7];

                for (int x = 0; x < i7; x++)
                {
                    ar1[x] = reader.ReadUInt32();
                }
            }

            uint i8 = reader.ReadUInt32();

            if (i8 > 0)             //Load some kind of array
            {
                uint[] ar2 = new uint[i8];

                for (int x = 0; x < i8; x++)
                {
                    ar2[x] = reader.ReadUInt32();
                }
            }

            //Num tiles?
            uint numTiles = reader.ReadUInt32();

            TileData[] tiles = new TileData[numTiles];
            for (uint tx = 0; tx < numTiles; tx++)
            {
                tiles[tx] = TileData.Read(reader);
            }

            uint i9 = reader.ReadUInt32();             //Function num?

            if (i9 > 0)
            {
                //0x004375A6
                for (int fx = 0; fx < i9; fx++)
                {
                    GameFunction func = GameFunction.ReadFunction(reader);
                }
            }

            return(null);
        }
Exemple #3
0
        public GameFunction[] ReadFunctionTable(IEXEntry entry)
        {
            JumpToEntry(entry);

            uint entries = _reader.ReadUInt32();

            GameFunction[] array = new GameFunction[entries];

            for (uint x = 0; x < entries; x++)
            {
                array[x] = GameFunction.ReadFunction(_reader);
            }

            CheckFilePosition(entry);

            return(array);
        }
Exemple #4
0
        private static void ReadRectAndFuncs(BinaryReader reader)         //GUI_load_rect_and_funcs
        {
            uint i3 = reader.ReadUInt32();

            byte b1 = reader.ReadByte();

            uint i4 = reader.ReadUInt32();             //as float
            uint i5 = reader.ReadUInt32();             //as float
            uint i6 = reader.ReadUInt32();             //as float
            uint i7 = reader.ReadUInt32();             //as float

            uint funcCount = reader.ReadUInt32();

            for (uint x = 0; x < funcCount; x++)
            {
                GameFunction f = GameFunction.ReadFunction(reader);
            }
        }
Exemple #5
0
            public static LayerType3 Read(BinaryReader reader)
            {
                LayerType3 layer = new LayerType3();

                layer.Name = reader.ReadTString();

                uint i1 = reader.ReadUInt32();
                uint i2 = reader.ReadUInt32();

                uint numData = reader.ReadUInt32();

                for (uint x = 0; x < numData; x++)
                {
                    uint objIndex = reader.ReadUInt32();

                    int i3 = reader.ReadInt32();
                    int i4 = reader.ReadInt32();
                    int i5 = reader.ReadInt32();

                    byte b1 = reader.ReadByte();
                    if (b1 > 0)
                    {
                        uint i6 = reader.ReadUInt32();
                        uint i7 = reader.ReadUInt32();
                    }

                    b1 = reader.ReadByte();
                    if (b1 > 0)
                    {
                        uint i8  = reader.ReadUInt32();
                        uint i9  = reader.ReadUInt32();
                        uint i10 = reader.ReadUInt32();
                        uint i11 = reader.ReadUInt32();
                    }

                    uint numActions = reader.ReadUInt32();
                    for (uint y = 0; y < numActions; y++)
                    {
                        GameFunction func = GameFunction.ReadFunction(reader);
                    }
                }

                return(layer);
            }
        public static GameFunction ReadFunction(BinaryReader reader)
        {
            GameFunction func = new GameFunction();

            func.Name = reader.ReadTString();

            int i1_1 = reader.ReadInt32();

            int numActions = reader.ReadInt32();

            if (numActions > 0)
            {
                func.Actions = new GameAction[numActions];
                for (int x = 0; x < numActions; x++)
                {
                    func.Actions[x] = GameAction.ReadAction(reader);
                }
            }

            return(func);
        }
Exemple #7
0
        public static LevelData Read(BinaryReader reader)
        {
            LevelData level = new LevelData();

            level.Name = reader.ReadTString();

            uint dataLength = reader.ReadUInt32();
            long dataEnd    = reader.BaseStream.Position + dataLength;

            //Read level
            {
                uint widthPixel  = reader.ReadUInt32();
                uint heightPixel = reader.ReadUInt32();

                uint i1 = reader.ReadUInt32();

                uint layerCount = reader.ReadUInt32();
                level.Layers = new Layer[layerCount];

                for (uint x = 0; x < layerCount; x++)
                {
                    uint type = reader.ReadUInt32();

                    Layer layer = null;
                    switch (type)
                    {
                    case 0:
                        layer = LayerType0.Read(reader);
                        break;

                    case 1:
                        layer = LayerType1.Read(reader);
                        break;

                    case 2:
                        layer = LayerType2.Read(reader);
                        break;

                    case 3:
                        layer = LayerType3.Read(reader);
                        break;

                    default:
                        throw new Exception();
                    }

                    level.Layers[x] = layer;
                }
            }

            uint levelActions = reader.ReadUInt32();

            for (uint x = 0; x < levelActions; x++)
            {
                GameFunction func = GameFunction.ReadFunction(reader);
            }

            if (reader.BaseStream.Position != dataEnd)
            {
                throw new Exception();
            }

            return(level);
        }