//File conversion, very basic functionality for the moment public void convertFile(string file) { bool endianness = checkEndianness(file); byte[] fileBytes = convertToBinary(file); mldHeader header = makeHeader(fileBytes, endianness); Console.WriteLine("Object Total: {0}", header.objTotal); Console.WriteLine("Object Table Pointer EOF: {0}", header.objTable_eof); Console.WriteLine("Object Texture Array Pointer: {0}", header.texArr); Console.WriteLine("NMLD: {0}", isNMLD(fileBytes, endianness)); //Console.WriteLine("Object Master Pointer: {0}", getObjMaster(fileBytes, header.objTotal, getObjTablePtr(fileBytes, endianness), endianness)); //makeMLDObject(fileBytes, header.objTotal, getObjTablePtr(fileBytes, endianness), header.objTable_eof, endianness); }
//Make mld header public mldHeader makeHeader(byte[] arr, bool endian) { mldHeader header = new mldHeader(); header.objTotal = getObjTotal(arr, endian); header.objTable_eof = getObjTableEOF(arr, endian); header.objTable = makeObjTable(arr, header.objTotal, getObjTablePtr(arr, endian), header.objTable_eof, endian); //header.grndInfo = getgrndInfo(); - TODO: Find the grndInfo header.texArr = getTexArr(arr, endian); if (isNMLD(arr, endian)) { header.NMLD = "NMLD"; } return(header); }