コード例 #1
0
ファイル: SceneGraph.cs プロジェクト: nemerle/Seccu
        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);
        }
コード例 #2
0
ファイル: RuntimeData.cs プロジェクト: nemerle/Seccu
        bool read_data_to(string directory_path, string storage, SceneModifiers target, uint CRC)
        {
            BinStore bin_store = new BinStore();

            if (!bin_store.open(directory_path + storage, CRC))
            {
                Debug.Log("failure");
                Debug.LogWarning("Couldn't load " + storage + " from " + directory_path);
                Debug.LogWarning("Using piggtool, ensure that bin.pigg has been extracted to ./data/");
                return(false);
            }

            bool res = target.loadFrom(bin_store);

            bin_store.close();

            if (!res)
            {
                Debug.Log("Reading " + directory_path + " " + storage + " ... failure");
                Debug.LogWarning("Couldn't load " + directory_path + " " + storage + ": wrong file format?");
            }

            return(res);
        }