示例#1
0
 public void StopReceive()
 {
     Idle_Stop();
     GamePlay_Stop();
     Status_Stop();
     OsuModel = null;
 }
示例#2
0
 public FpsDxLayer(D2D.RenderTarget renderTarget, DxLoadObject settings, OsuModel osuModel) : base(renderTarget, settings, osuModel)
 {
     _whiteBrush = new D2D.SolidColorBrush(RenderTarget, new Mathe.RawColor4(1, 1, 1, 1));
     _textFormat = new DW.TextFormat(_factoryWrite, "Microsoft YaHei", 12);
     _bufferSw   = new Stopwatch();
     _bufferSw.Start();
 }
示例#3
0
 public void StartReceive()
 {
     OsuModel = new OsuModel();
     Status_Start();
     Idle_Start();
     GamePlay_Start();
 }
示例#4
0
        public BgDxLayer(D2D.RenderTarget renderTarget, DxLoadObject settings, OsuModel osuModel)
            : base(renderTarget, settings, osuModel)
        {
            _status = OsuModel.Status;
            string defName   = "default.png";
            string covName   = "cover.png";
            var    defBgPath = Path.Combine(OsuLivePlayerPlugin.GeneralConfig.WorkPath, defName);
            var    covBgPath = Path.Combine(OsuLivePlayerPlugin.GeneralConfig.WorkPath, covName);

            if (File.Exists(defBgPath))
            {
                _defaultBg = renderTarget.LoadBitmap(defBgPath);
            }
            else
            {
                LogUtil.LogError($"Can not find \"{defName}\"");
            }

            if (File.Exists(covBgPath))
            {
                _coverBg = renderTarget.LoadBitmap(covBgPath);
            }
            else
            {
                LogUtil.LogError($"Can not find \"{covName}\"");
            }

            var size = Settings.Render.WindowSize;

            _windowRect = new Mathe.RawRectangleF(0, 0, size.Width, size.Height);
        }
示例#5
0
        public TestLayer(D2D.RenderTarget renderTarget, DxLoadObject settings, OsuModel osuModel) : base(renderTarget, settings, osuModel)
        {
            string ok    = "影翔鼓舞 - Oriental Blossom";
            var    font  = new Gdip.Font("等线", 25, Gdip.FontStyle.Bold);
            var    brush = new Gdip.SolidBrush(Gdip.Color.White);

            D2D.Bitmap[] bmps = StringUtil.GetCharsBitmap(ok, font, brush).Select(renderTarget.LoadBitmap).ToArray();
            _titleObjs = new StringObject[ok.Length];
            for (var i = 0; i < _titleObjs.Length; i++)
            {
                _titleObjs[i] = new StringObject(RenderTarget, bmps[i], Origin.TopLeft, new Mathe.RawPoint(0, 0));
            }
        }
 public static void CreateDirectXForm(DxLoadObject obj, OsuModel osuModel)
 {
     try
     {
         if (_dxForm != null && !_dxForm.IsDisposed)
         {
             return;
         }
         _dxForm = new DxRenderForm(obj, osuModel);
         Task.Run(() => { Application.Run(_dxForm); });
     }
     catch (Exception e)
     {
         LogUtil.LogError(e.ToString());
     }
 }
        public SongInfoDxLayer(D2D.RenderTarget renderTarget, DxLoadObject settings, OsuModel osuModel)
            : base(renderTarget, settings, osuModel)
        {
            FileInfo eastInfo =
                new FileInfo(Path.Combine(OsuLivePlayerPlugin.GeneralConfig.WorkPath, "df-gokubutokaisho-w12.ttc"));
            FileInfo westInfo = new FileInfo(Path.Combine(OsuLivePlayerPlugin.GeneralConfig.WorkPath, "MOD20.ttf"));

            if (!eastInfo.Exists)
            {
                _easternF = new Gdip.FontFamily("等线");
            }
            else
            {
                PrivateFontCollection pfc = new PrivateFontCollection();
                pfc.AddFontFile(eastInfo.FullName);
                _easternF = pfc.Families[0];
                LogUtil.LogInfo($"Eastern family was {(_easternF != null ? "ok" : "not found")}");
            }

            if (!westInfo.Exists)
            {
                _westernF = new Gdip.FontFamily("等线");
            }
            else
            {
                PrivateFontCollection pfc = new PrivateFontCollection();
                pfc.AddFontFile(westInfo.FullName);
                _westernF = pfc.Families[0];
                LogUtil.LogInfo($"Western family was {(_westernF != null ? "ok" : "not found")}");
            }

            _eTFont = new Gdip.Font(_easternF, 25);
            _wTFont = new Gdip.Font(_westernF, 25);
            _eAFont = new Gdip.Font(_easternF, 20);
            _wAFont = new Gdip.Font(_westernF, 20);

            _wBrush = new Gdip.SolidBrush(Gdip.Color.White);
            _eBrush = new Gdip.SolidBrush(Gdip.Color.White);

            _status = OsuModel.Status;
        }
示例#8
0
        public DxRenderForm(DxLoadObject obj, OsuModel osuModel)
        {
            _obj      = obj;
            _osuModel = osuModel;

            // Window settings
            ClientSize      = obj.Render.WindowSize;
            FormBorderStyle = FormBorderStyle.FixedSingle;
            MaximizeBox     = false;
            StartPosition   = FormStartPosition.CenterScreen;
            //TopMost = true;
            // Render settings
            _useVsync = obj.Render.UseVsync;

            // Preference settings
            _preferUnicode = obj.Preference.PreferUnicode;

            // Events
            Load       += OnFormLoad;
            FormClosed += OnFormClosed;
        }
 public static void ReCreateDirectXForm(DxLoadObject obj, OsuModel osuModel)
 {
     CloseDirectXForm();
     CreateDirectXForm(obj, osuModel);
 }
示例#10
0
 protected Layer(RenderTarget renderTarget, DxLoadObject settings, OsuModel osuModel)
 {
     OsuModel     = osuModel;
     Settings     = settings;
     RenderTarget = renderTarget;
 }
示例#11
0
 protected DxLayer(RenderTarget renderTarget, DxLoadObject settings, OsuModel osuModel) : base(renderTarget, settings, osuModel)
 {
 }