OutdoorLighting::OutdoorLighting(const std::string& fname) { MPQFile f(fname); unsigned int n, d; f.seekRelative(4); f.read(&n, 4); // it's the same thing twice? :| f.seekRelative(4); f.read(&d, 4); // d is now the final offset f.seek(8 + n * 8); while (f.getPos() < d) { OutdoorLightStats ols; ols.init(&f); lightStats.push_back(ols); } f.close(); }
OutdoorLighting::OutdoorLighting(char *fname) { MPQFile f(fname); unsigned int n,d; f.seekRelative(4); // nFields - Number of fields f.read(&n, 4); // Number of fields (again), it's the same thing twice? :| f.seekRelative(4); // Always 0x53 f.read(&d, 4); // d is now the final offset f.seek(8 + n * 8); while (f.getPos() < d) { OutdoorLightStats ols; ols.init(f); lightStats.push_back(ols); } f.close(); }