Beispiel #1
0
        public static void Load(string mapURL, int tesselationLevel, OnLoadError errorCallback)
        {
            byte[]       data;
            MemoryStream ms;
            string       file;

            if (tesselationLevel <= 0)
            {
                tesselationLevel = 5;
            }

            file = Config.q3bsp_base_folder + mapURL;

            data        = System.IO.File.ReadAllBytes(file);
            ms          = new MemoryStream(data);
            ms.Position = 0;

            AlethaApplication.incReqests();
            AlethaApplication.update_progress_bar(AlethaApplication.request_number, mapURL);

            q3bsp.onMessage(new MessageParams()
            {
                type    = "status",
                message = "Map downloaded, parsing level geometry..."
            });


            bsp_parser_ibsp_v46.Parse(new BinaryStreamReader(ms), tesselationLevel, (bsp_header_t header) => {
                q3bsp.onMessage(new MessageParams()
                {
                    type    = "status",
                    message = "Incompatible BSP version. " + header.company + " " + header.tag + " V." + header.version.ToString()
                });
            });
        }
Beispiel #2
0
        public static void load(String url, OnShadersParsed onload)
        {
            string responseText = System.IO.File.ReadAllText(url);

            AlethaApplication.incReqests();
            AlethaApplication.update_progress_bar(AlethaApplication.request_number, url);

            ShaderParser.parse(url, responseText, onload);

            //fetch(url, "text/plain").then((request)8
            //{
            //    q3shader.parse(url, request.responseText, onload);
            //});
        }