private static GeoSet findAndPrepareGeoSet(string fname, string base_path) { GeoSet geoset = null; string name_fixed = fname.Replace(".anm", ".geo"); string true_path = Tools.getFilepathCaseInsensitive(base_path + name_fixed); FileStream fp; try { fp = File.Open(true_path, FileMode.Open); } catch (Exception) { Debug.LogError("Can't find .geo file" + fname); return(null); } geoset = new GeoSet(); if (true_path.StartsWith(base_path)) { geoset.geopath = true_path.Substring(base_path.Length); } else { throw new InvalidOperationException("True path is not a sub-path of base directory"); } geoset.geosetLoadHeader(fp); geoset.full_geo_path = true_path; fp.Close(); RuntimeData rd = RuntimeData.get(); rd.s_name_to_geoset[fname] = geoset; return(geoset); }
public bool LoadSceneData(string fname) { BinStore binfile = new BinStore(); string fixed_path = Tools.getFilepathCaseInsensitive(fname); if (!binfile.open(fixed_path, scenegraph_i0_2_requiredCrc)) { Debug.LogError("Failed to open original bin:" + fixed_path); return(false); } if (!loadFrom(binfile)) { Debug.LogError("Failed to load data from original bin:" + fixed_path); binfile.close(); return(false); } binfile.close(); return(true); }