public LBDDocument CreateDocument(LBD lbd) { TMDDocument tileTmd = _tmdController.CreateDocument(lbd.Tiles); List <IRenderable> tileLayout = new List <IRenderable>(); int tileNo = 0; foreach (LBDTile tile in lbd.TileLayout) { int x = tileNo / lbd.Header.TileWidth; int y = tileNo % lbd.Header.TileWidth; if (tile.DrawTile) { tileLayout.AddRange(LibLSDUtil.CreateLBDTileMesh(tile, lbd.ExtraTiles, x, y, lbd.Tiles, _shader, _vramController.VRAMTexture)); } tileNo++; } List <MOMDocument> entities = null; if (lbd.Header.HasMML) { entities = new List <MOMDocument>(); foreach (MOM mom in lbd.MML?.MOMs) { entities.Add(_momController.CreateDocument(mom)); } } return(new LBDDocument(lbd, tileTmd, tileLayout, entities)); }
public MOMDocument CreateDocument(MOM mom) { TMDDocument models = _tmdController.CreateDocument(mom.TMD); return(new MOMDocument(mom, models)); }