Exemplo n.º 1
0
        public RenderStack(VERGEMap vmap, String rstring, Char delim)
        {
            int cur_pos, next_pos, len, layer_number;
            String str = rstring.Trim().ToUpper();
            String cur_token;
            RenderLayer cur_layer;
            Queue<RenderLayer> layer_queue = new Queue<RenderLayer>(); // Temporary loading queue
            map = vmap;

            cur_pos = 0;
            len = str.Length;
            while (cur_pos < len) {
                next_pos = str.IndexOf(delim, cur_pos);
                if (next_pos == -1) next_pos = len;
                cur_token = str.Substring(cur_pos, next_pos - cur_pos).Trim();
                //Console.WriteLine(cur_token);
                switch (cur_token) {
                    case "R": // rendering script layer (defaults to hook_render and fixed parallax)
                        cur_layer = new ScriptRenderLayer();
                        layer_queue.Enqueue(cur_layer);
                        break;
                    case "E": // entity layer
                        cur_layer = new EntityLayer();
                        layer_queue.Enqueue(cur_layer);
                        break;
                    default: // tile layer
                        try {
                            layer_number = Int32.Parse(cur_token);
                            if (layer_number <= 0) throw new Exception();
                        }
                        catch (Exception) { throw new MalformedRenderstringException(rstring); } // not a positive integer
                        cur_layer = map.tiles[layer_number - 1];
                        layer_queue.Enqueue(cur_layer);
                        break;
                }
                cur_pos = next_pos + 1;
            }

            // Collections are slow, so we'll shift the layers into a fixed array now that we've got them all.
            list = new RenderLayer[layer_queue.Count];
            for (int count = 0; count < list.Length; count++) {
                list[count] = layer_queue.Dequeue();
            }
        }
Exemplo n.º 2
0
 public void draw_UI(ScriptRenderLayer layer, Rectangle clipping_region)
 {
     //sg.mainMenu.Draw( this.sg );
     //sg.textbox.Draw();
 }
Exemplo n.º 3
0
 public void draw_UI(ScriptRenderLayer layer, Rectangle clipping_region)
 {
     Textbox.Draw();
 }
Exemplo n.º 4
0
 internal virtual void call_render_hook(ScriptRenderLayer layer, Rectangle clipping_region)
 {
     if (hook_render != null) hook_render(layer, clipping_region); // this is very wasteful!
 }