Esempio n. 1
0
        public void DrawRegions(WorldRenderer wr, IInputHandler inputHandler)
        {
            renderer.BeginFrame(scrollPosition, Zoom);
            if (wr != null)
            {
                wr.Draw();
            }

            using (new PerfSample("render_widgets"))
            {
                Ui.Draw();
                var cursorName     = Ui.Root.GetCursorOuter(Viewport.LastMousePos) ?? "default";
                var cursorSequence = CursorProvider.GetCursorSequence(cursorName);
                var cursorSprite   = cursorSequence.GetSprite((int)cursorFrame);

                renderer.SpriteRenderer.DrawSprite(cursorSprite,
                                                   Viewport.LastMousePos - cursorSequence.Hotspot,
                                                   Game.modData.Palette.GetPaletteIndex(cursorSequence.Palette),
                                                   cursorSprite.size);
            }

            using (new PerfSample("render_flip"))
            {
                renderer.EndFrame(inputHandler);
            }
        }
Esempio n. 2
0
        public void DrawRegions(WorldRenderer wr, IInputHandler inputHandler)
        {
            renderer.BeginFrame(scrollPosition, Zoom);
            if (wr != null)
            {
                wr.Draw();
            }

            using (new PerfSample("render_widgets"))
            {
                Ui.Draw();
                var cursorName = Ui.Root.GetCursorOuter(Viewport.LastMousePos) ?? "default";
                CursorProvider.DrawCursor(renderer, cursorName, Viewport.LastMousePos, (int)cursorFrame);
            }

            using (new PerfSample("render_flip"))
            {
                renderer.EndFrame(inputHandler);
            }
        }