private PlantDensity() { densityTable = new byte[TypeCount][]; for (int i = 0; i < TypeCount; i++) { FileLocation fl = FileSystem.Instance.Locate(TableNames[i], GameFileLocs.Nature); ContentBinaryReader br = new ContentBinaryReader(fl); densityTable[i] = br.ReadBytes(Width * Height); br.Close(); } //density = new byte[Width * Height]; FileLocation fl2 = FileSystem.Instance.Locate(DensityFile, GameFileLocs.Nature); ContentBinaryReader br2 = new ContentBinaryReader(fl2); density = br2.ReadBytes(Width * Height); br2.Close(); }
private void MeasureCharWidth(string fontName) { FileLocation fl = FileSystem.Instance.Locate(fontName + ".raw", GameFileLocs.GUI); ContentBinaryReader br = new ContentBinaryReader(fl); byte[] buffur = br.ReadBytes(fl.Size); //rowPitch = (int)fs.Length / font.Height; for (int row = 0; row < charsPerHeight; row++) { for (int col = 0; col < charsPerWidth; col++) { byte ascii = Find(row, col); if (ascii != 0) { CharWidthHelper(buffur, col * charWidth, row * charHeight, ascii); } } } br.Close(); }