private void LoadMapDPP(BinaryReader reader) { Nsbmd nsbmd; BinaryWriter writer; string[] materialListForNsbmd; PkmnMapDemuxer demuxer = new PkmnMapDemuxer(reader, type); mapHeader = PkmnMapHeader.FromReader(reader); streamMovement = new ClosableMemoryStream(); writer = new BinaryWriter(streamMovement); writer.Write(demuxer.DemuxMovBytes(mapHeader)); arrayMovement = MovLoader.LoadMov(streamMovement); streamObject = new ClosableMemoryStream(); writer = new BinaryWriter(streamObject); writer.Write(demuxer.DemuxObjBytes(mapHeader)); listObjects = ObjLoader.LoadObj(streamObject); streamNSBMD = new ClosableMemoryStream(); writer = new BinaryWriter(streamNSBMD); writer.Write(demuxer.DemuxBMDBytes(mapHeader, 0)); streamBDHC = new ClosableMemoryStream(); writer = new BinaryWriter(streamBDHC); writer.Write(demuxer.DemuxBdhcBytes(mapHeader)); nsbmd = new Nsbmd(); var reader2 = new BinaryReader(streamNSBMD); nsbmd.LoadBMD0(reader2, (int)mapHeader.BMDOffset); actualModel = nsbmd; getMatrixInfo(); materialListForNsbmd = actualModel.getTexNameArray(); if (actualModel.actualTex != null) { nsbmd.MatchTextures(); } }
private void LoadMapBW(BinaryReader reader) { Nsbmd nsbmd; BinaryWriter writer; string[] materialListForNsbmd; PkmnMapDemuxer_Bw bw = new PkmnMapDemuxer_Bw(reader, type); mapHeaderBW = PkmnMapHeader_Bw.FromReader(reader); streamNSBMD = new ClosableMemoryStream(); writer = new BinaryWriter(streamNSBMD); writer.Write(bw.DemuxBMDBytes(mapHeaderBW, 0)); streamMovement = new ClosableMemoryStream(); writer = new BinaryWriter(streamMovement); writer.Write(bw.DemuxMovBytes(mapHeaderBW)); arrayMovementBW = MovLoader.LoadMov_Bw(streamMovement); streamObject = new ClosableMemoryStream(); writer = new BinaryWriter(streamObject); writer.Write(bw.DemuxObjBytes(mapHeaderBW)); listObjectsBW = ObjLoader.LoadObj_Bw(streamObject); nsbmd = new Nsbmd(); var reader2 = new BinaryReader(streamNSBMD); reader2.BaseStream.Position = 0; nsbmd.LoadBMD0(reader2, (int)mapHeaderBW.BMDOffset); actualModel = nsbmd; getMatrixInfo(); materialListForNsbmd = actualModel.getTexNameArray(); if (actualModel.actualTex != null) { nsbmd.MatchTextures(); } }
private void LoadGenericNSBMD(BinaryReader reader) { PkmnMapDemuxer demuxer; Nsbmd nsbmd; List <NsbmdModel.MatTexPalStruct> list; Nsbtx.type = NSBMD_MODEL; demuxer = new PkmnMapDemuxer(reader, 1); PkmnMapHeader map = new PkmnMapHeader(); streamNSBMD = new ClosableMemoryStream(); new BinaryWriter(streamNSBMD).Write(demuxer.DemuxBMDBytes(map, 1)); nsbmd = new Nsbmd(); var reader2 = new BinaryReader(streamNSBMD); nsbmd.LoadBMD0(reader2, 0); actualModel = nsbmd; list = null; list = nsbmd.getMaterials(); if (actualModel.actualTex != null) { nsbmd.MatchTextures(); } }