Esempio n. 1
0
 public static void LoadModels()
 {
     Bosh       = LoadGraphic(GameResources.bosh);
     BoshDead   = LoadGraphic(GameResources.boshdead);
     Arm        = LoadGraphic(GameResources.arm);
     Leg        = LoadGraphic(GameResources.leg);
     Sled       = LoadGraphic(GameResources.sled);
     BrokenSled = LoadGraphic(GameResources.brokensled);
 }
Esempio n. 2
0
 private static Drawing.VBO LoadGraphic(byte[] graphics)
 {
     using (var s = new System.IO.MemoryStream(graphics))
         using (var sr = new System.IO.StreamReader(s, System.Text.Encoding.ASCII))
         {
             var svg = NGraphics.Graphic.LoadSvg(sr);
             var vbo = new Drawing.VBO(false, true);
             vbo.Texture = linerider.Drawing.StaticRenderer.CircleTex;
             foreach (var c in svg.Children)
             {
                 if (c is NGraphics.Path)
                 {
                     linerider.Drawing.GameRenderer.canvas.DrawPath((NGraphics.Path)c, vbo);
                 }
                 else
                 {
                     throw new System.Exception("Unsupported SVG");
                 }
             }
             svg.Size.Height /= 2;
             svg.Size.Width  /= 2;
             return(vbo);
         }
 }