Exemplo n.º 1
0
        //Makes mldObject
        public mldObject makeMLDObject(byte[] arr, int cursor, bool endian)
        {
            //Anything commented out is something I cannot find/don't know how to/don't know what it is, for the moment this will provide what I could find
            mldObject mldObj = new mldObject();

            mldObj.index = getIndex(arr, cursor, endian);
            //mldObj.yRot = getYRot(arr, cursor, endian);
            //mldObj.unkInt1 = getUnkInt1(arr, cursor, endian);
            //mldObj.unkInt2 = getUnkInt2(arr, cursor, endian);
            mldObj.objectMaster = makeObjMaster(arr, cursor + 20, endian);
            //mldObj.Ground = getGround(arr, cursor, endian);
            //mldObj.unkInt3 = getUnkInt3(arr, cursor, endian);
            //mldObj.unkInt4 = getUnkInt4(arr, cursor, endian);
            //mldObj.Texlist = getTexList(arr, cursor, endian);
            mldObj.Name = getObjName(arr, cursor + 36, endian);
            //mldObj.unkFloat1 = getUnkFloat1(arr, cursor, endian);
            //mldObj.unkFloat2 = getUnkFloat2(arr, cursor, endian);
            //mldObj.unkFloat3 = getUnkFloat3(arr, cursor, endian);
            //mldObj.unkInt5 = getUnkInt5(arr, cursor, endian);
            //mldObj.unkInt6 = getUnkInt6(arr, cursor, endian);
            //mldObj.unkInt7 = getUnkInt7(arr, cursor, endian);
            //mldObj.unkFloat4 = getUnkFloat4(arr, cursor, endian);
            //mldObj.unkFloat5 = getUnkFloat5(arr, cursor, endian);
            //mldObj.unkFloat6 = getUnkFloat6(arr, cursor, endian);

            return(mldObj);
        }
Exemplo n.º 2
0
        //Makes the Object Table
        public mldObject[] makeObjTable(byte[] arr, int objTotal, int objTablePtr, int objTablePtr_EOF, bool endian)
        {
            mldObject[] obj               = new mldObject[0];
            int[]       mldObjArray       = new int[0];
            int         cursor            = objTablePtr;
            int         objEntryMasterPtr = 0;

            //Gets all the obj pointers
            for (int i = 0; i < objTotal; i++)
            {
                cursor += 20;
                byte[] b = new byte[4];
                for (int j = 0; j <= 3; j++)
                {
                    b[j] = arr[j + cursor];
                }

                if (endian)
                {
                    Array.Reverse(b);
                }

                objEntryMasterPtr = BitConverter.ToInt32(b, 0);

                if (objEntryMasterPtr != 0)
                {
                    byte[] t = new byte[4];
                    for (int j = 0; j <= 3; j++)
                    {
                        t[j] = arr[j + objEntryMasterPtr + 4];
                    }

                    if (endian)
                    {
                        Array.Reverse(t);
                    }

                    if (BitConverter.ToInt32(t, 0) != 0)
                    {
                        obj.Append(makeMLDObject(arr, cursor - 20, endian));
                    }
                }
                cursor += 84;
            }

            return(obj);
        }