A game framework written with osu! in mind.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Apply line formatting changes in line with osu inspections

+485 -8
+3
osu-framework.sln.DotSettings
··· 230 230 <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTLINE_TYPE_PARAMETER_CONSTRAINS/@EntryValue">True</s:Boolean> 231 231 <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTLINE_TYPE_PARAMETER_LIST/@EntryValue">True</s:Boolean> 232 232 <s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue">NEXT_LINE</s:String> 233 + <s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_BEFORE_BLOCK_STATEMENTS/@EntryValue">1</s:Int64> 234 + <s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_BEFORE_CASE/@EntryValue">1</s:Int64> 233 235 <s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INITIALIZER_BRACES/@EntryValue">NEXT_LINE</s:String> 234 236 <s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64> 235 237 <s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64> ··· 268 270 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MD/@EntryIndexedValue">MD5</s:String> 269 271 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NS/@EntryIndexedValue">NS</s:String> 270 272 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=OS/@EntryIndexedValue">OS</s:String> 273 + <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PM/@EntryIndexedValue">PM</s:String> 271 274 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RGB/@EntryIndexedValue">RGB</s:String> 272 275 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RNG/@EntryIndexedValue">RNG</s:String> 273 276 <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SHA/@EntryIndexedValue">SHA</s:String>
+2
osu.Framework.Tests/Clocks/InterpolatingClockTest.cs
··· 34 34 35 35 // test with test clock not elapsing 36 36 double lastValue = interpolating.CurrentTime; 37 + 37 38 for (int i = 0; i < 100; i++) 38 39 { 39 40 interpolating.ProcessFrame(); ··· 48 49 49 50 // test with test clock elapsing 50 51 lastValue = interpolating.CurrentTime; 52 + 51 53 for (int i = 0; i < 100; i++) 52 54 { 53 55 source.CurrentTime += 50;
+1
osu.Framework.Tests/IO/TestDesktopStorage.cs
··· 14 14 public void TestRelativePaths() 15 15 { 16 16 var guid = new Guid().ToString(); 17 + 17 18 using (var storage = new TemporaryNativeStorage(guid)) 18 19 { 19 20 var basePath = storage.GetFullPath(string.Empty);
+4
osu.Framework.Tests/IO/TestWebRequest.cs
··· 96 96 List<long> startTimes = new List<long>(); 97 97 98 98 List<Task> running = new List<Task>(); 99 + 99 100 for (int i = 0; i < request_count; i++) 100 101 { 101 102 var request = new DelayedWebRequest ··· 354 355 Assert.DoesNotThrow(request.Perform); 355 356 356 357 var events = request.GetType().GetEvents(BindingFlags.Instance | BindingFlags.Public); 358 + 357 359 foreach (var e in events) 358 360 { 359 361 var field = request.GetType().GetField(e.Name, BindingFlags.Instance | BindingFlags.Public); ··· 368 370 public void TestUnbindOnDispose([Values(true, false)] bool async) 369 371 { 370 372 WebRequest request; 373 + 371 374 using (request = new JsonWebRequest<HttpBinGetResponse>($"{default_protocol}://{host}/get") 372 375 { 373 376 Method = HttpMethod.Get, ··· 383 386 } 384 387 385 388 var events = request.GetType().GetEvents(BindingFlags.Instance | BindingFlags.Public); 389 + 386 390 foreach (var e in events) 387 391 { 388 392 var field = request.GetType().GetField(e.Name, BindingFlags.Instance | BindingFlags.Public);
+1
osu.Framework.Tests/Lists/TestArrayExtensions.cs
··· 123 123 public void TestNonSquareJaggedWithNullRowsToRectangular() 124 124 { 125 125 var jagged = new int[10][]; 126 + 126 127 for (int i = 1; i < 10; i += 2) 127 128 { 128 129 if (i % 2 == 1)
+3
osu.Framework.Tests/Lists/TestWeakList.cs
··· 48 48 var list = new WeakList<object> { obj, obj2, obj3 }; 49 49 50 50 int count = 0; 51 + 51 52 foreach (var item in list) 52 53 { 53 54 if (count == 1) ··· 68 69 var list = new WeakList<object> { obj, obj2, obj3 }; 69 70 70 71 int count = 0; 72 + 71 73 foreach (var item in list) 72 74 { 73 75 if (count == 0) ··· 90 92 GC.WaitForPendingFinalizers(); 91 93 92 94 int index = 0; 95 + 93 96 foreach (var obj in list) 94 97 { 95 98 if (alive[index] != obj)
+3
osu.Framework.Tests/Localisation/LocalisationTest.cs
··· 191 191 { 192 192 default: 193 193 return LOCALISABLE_STRING_EN; 194 + 194 195 case "ja": 195 196 return LOCALISABLE_STRING_JA; 197 + 196 198 case "ja-JP": 197 199 return LOCALISABLE_STRING_JA_JP; 198 200 } ··· 202 204 { 203 205 default: 204 206 return LOCALISABLE_FORMAT_STRING_EN; 207 + 205 208 case "ja": 206 209 return LOCALISABLE_FORMAT_STRING_JA; 207 210 }
+1
osu.Framework.Tests/Threading/AsyncDisposalQueueTest.cs
··· 25 25 objects.ForEach(AsyncDisposalQueue.Enqueue); 26 26 27 27 int attempts = 1000; 28 + 28 29 while (!objects.All(o => o.IsDisposed)) 29 30 { 30 31 if (attempts-- == 0)
+4
osu.Framework.Tests/Visual/Containers/TestSceneCompositeMutability.cs
··· 51 51 case LoadState.Loading when thread != TestThread.Load: 52 52 container.LoadingEvent.Set(); 53 53 break; 54 + 54 55 // Special case for the load thread: possibly active during the ready state, but the ready event is handled in the switch below 55 56 case LoadState.Ready when thread == TestThread.Load: 56 57 container.LoadingEvent.Set(); 57 58 stateToWaitFor = LoadState.Loading; // We'll never reach the ready state before the switch below 58 59 break; 60 + 59 61 case LoadState.Ready: 60 62 container.LoadingEvent.Set(); 61 63 container.ReadyEvent.Set(); 62 64 break; 65 + 63 66 case LoadState.Loaded: 64 67 container.LoadingEvent.Set(); 65 68 container.ReadyEvent.Set(); ··· 96 99 AddStep("bind event", () => container.OnLoading += tryThrow); 97 100 AddStep("set loading", () => container.LoadingEvent.Set()); 98 101 break; 102 + 99 103 case LoadState.Ready: 100 104 AddStep("bind event", () => container.OnReady += tryThrow); 101 105 AddStep("set loading", () => container.ReadyEvent.Set());
+3 -8
osu.Framework.Tests/Visual/Containers/TestSceneContainerState.cs
··· 140 140 { 141 141 bool unbound = false; 142 142 143 - var drawableA = new Sprite().With(d => 144 - { 145 - d.OnUnbindAllBindables += () => unbound = true; 146 - }); 143 + var drawableA = new Sprite().With(d => { d.OnUnbindAllBindables += () => unbound = true; }); 147 144 148 145 var container = new Container { Children = new[] { drawableA } }; 149 146 ··· 159 156 { 160 157 bool disposed = false; 161 158 162 - var drawableA = new Sprite().With(d => 163 - { 164 - d.OnDispose += () => disposed = true; 165 - }); 159 + var drawableA = new Sprite().With(d => { d.OnDispose += () => disposed = true; }); 166 160 167 161 var container = new Container { Children = new[] { drawableA } }; 168 162 ··· 174 168 175 169 // Disposal happens asynchronously 176 170 int iterations = 20; 171 + 177 172 while (iterations-- > 0) 178 173 { 179 174 if (disposed)
+5
osu.Framework.Tests/Visual/Containers/TestSceneCoordinateSpaces.cs
··· 47 47 h.CreateMarkerAt(1f); 48 48 h.CreateMarkerAt(1.1f); 49 49 break; 50 + 50 51 case 1: 51 52 h.RelativeChildSize = new Vector2(150, 1); 52 53 h.CreateMarkerAt(0); ··· 56 57 h.CreateMarkerAt(200); 57 58 h.CreateMarkerAt(250); 58 59 break; 60 + 59 61 case 2: 60 62 h.RelativeChildOffset = new Vector2(50, 0); 61 63 h.RelativeChildSize = new Vector2(150, 1); ··· 66 68 h.CreateMarkerAt(200); 67 69 h.CreateMarkerAt(250); 68 70 break; 71 + 69 72 case 3: 70 73 h.RelativeChildOffset = new Vector2(150, 0); 71 74 h.RelativeChildSize = new Vector2(-200, 1); ··· 76 79 h.CreateMarkerAt(200); 77 80 h.CreateMarkerAt(250); 78 81 break; 82 + 79 83 case 4: 80 84 h.RelativeChildOffset = new Vector2(0, 0); 81 85 h.RelativeChildSize = new Vector2(300, 1); ··· 86 90 h.CreateMarkerAt(200); 87 91 h.CreateMarkerAt(250); 88 92 break; 93 + 89 94 case 5: 90 95 h.RelativeChildOffset = new Vector2(-250, 0); 91 96 h.RelativeChildSize = new Vector2(500, 1);
+5
osu.Framework.Tests/Visual/Containers/TestSceneLifetimeManagementContainer.cs
··· 42 42 AddAssert($"{numAlive} alive children", () => 43 43 { 44 44 int num = 0; 45 + 45 46 foreach (var child in container.InternalChildren) 46 47 { 47 48 num += child.IsAlive ? 1 : 0; ··· 190 191 { 191 192 l = rng.Next(5); 192 193 r = rng.Next(5); 194 + 193 195 if (l > r) 194 196 { 195 197 var l1 = l; ··· 252 254 }); 253 255 254 256 int count = 1; 257 + 255 258 for (int i = 0; i < 1000; i++) 256 259 { 257 260 switch (rng.Next(3)) ··· 269 272 } 270 273 271 274 break; 275 + 272 276 case 1: 273 277 AddStep("Change lifetime", changeLifetime); 274 278 break; 279 + 275 280 case 2: 276 281 AddStep("Change time", changeTime); 277 282 break;
+13
osu.Framework.Tests/Visual/Containers/TestSceneSizing.cs
··· 193 193 194 194 box.OnUpdate += delegate { box.Rotation += 0.05f; }; 195 195 break; 196 + 196 197 case 1: 197 198 testContainer.Add(box = new InfofulBoxAutoSize 198 199 { ··· 224 225 Colour = Color4.Blue, 225 226 }); 226 227 break; 228 + 227 229 case 2: 228 230 testContainer.Add(box = new InfofulBoxAutoSize 229 231 { ··· 255 257 Colour = Color4.SeaGreen, 256 258 }); 257 259 break; 260 + 258 261 case 3: 259 262 testContainer.Add(box = new InfofulBox 260 263 { ··· 288 291 Colour = Color4.SeaGreen, 289 292 }); 290 293 break; 294 + 291 295 case 4: 292 296 testContainer.Add(box = new InfofulBoxAutoSize 293 297 { ··· 320 324 Anchor = Anchor.CentreLeft 321 325 }); 322 326 break; 327 + 323 328 case 5: 324 329 testContainer.Add(box = new InfofulBoxAutoSize 325 330 { ··· 353 358 Anchor = Anchor.CentreLeft 354 359 }); 355 360 break; 361 + 356 362 case 6: 357 363 testContainer.Add(box = new InfofulBoxAutoSize 358 364 { ··· 377 383 Colour = Color4.OrangeRed, 378 384 }); 379 385 break; 386 + 380 387 case 7: 381 388 Container shrinkContainer; 382 389 Container<Drawable> boxes; ··· 1183 1190 if (Chameleon && (int)Time.Current / 1000 != lastSwitch) 1184 1191 { 1185 1192 lastSwitch = (int)Time.Current / 1000; 1193 + 1186 1194 switch (lastSwitch % 6) 1187 1195 { 1188 1196 case 0: 1189 1197 Anchor = (Anchor)((int)Anchor + 1); 1190 1198 Origin = (Anchor)((int)Origin + 1); 1191 1199 break; 1200 + 1192 1201 case 1: 1193 1202 this.MoveTo(new Vector2(0, 0), 800, Easing.Out); 1194 1203 break; 1204 + 1195 1205 case 2: 1196 1206 this.MoveTo(new Vector2(200, 0), 800, Easing.Out); 1197 1207 break; 1208 + 1198 1209 case 3: 1199 1210 this.MoveTo(new Vector2(200, 200), 800, Easing.Out); 1200 1211 break; 1212 + 1201 1213 case 4: 1202 1214 this.MoveTo(new Vector2(0, 200), 800, Easing.Out); 1203 1215 break; 1216 + 1204 1217 case 5: 1205 1218 this.MoveTo(new Vector2(0, 0), 800, Easing.Out); 1206 1219 break;
+1
osu.Framework.Tests/Visual/Drawables/TestSceneProxyDrawables.cs
··· 412 412 RelativeSizeAxes = Axes.Both; 413 413 414 414 original = proxy.Original; 415 + 415 416 while (original != (original = original.Original)) 416 417 { 417 418 }
+1
osu.Framework.Tests/Visual/Drawables/TestSceneTransformRewinding.cs
··· 406 406 maxTimeText.Text = wrapping.MaxTime.ToString("n0"); 407 407 maxTimeText.Colour = time > wrapping.MaxTime ? Color4.Gray : wrapping.Time.Elapsed > 0 ? Color4.Blue : Color4.Red; 408 408 minTimeText.Colour = time < wrapping.MinTime ? Color4.Gray : content.Time.Elapsed > 0 ? Color4.Blue : Color4.Red; 409 + 409 410 if (displayedTransforms == null || !ExaminableDrawable.Transforms.SequenceEqual(displayedTransforms)) 410 411 { 411 412 transforms.Clear();
+1
osu.Framework.Tests/Visual/Input/TestSceneInputResampler.cs
··· 145 145 { 146 146 NumRaw++; 147 147 bool foundOne = false; 148 + 148 149 foreach (Vector2 relevant in InputResampler.AddPosition(pos)) 149 150 { 150 151 AddVertex(relevant);
+2
osu.Framework.Tests/Visual/Input/TestSceneKeyBindings.cs
··· 103 103 104 104 Assert.AreEqual(count.OnPressedCount, testButton.OnPressedCount, $"{testButton.Concurrency} {testButton.Action} OnPressedCount"); 105 105 Assert.AreEqual(count.OnReleasedCount, testButton.OnReleasedCount, $"{testButton.Concurrency} {testButton.Action} OnReleasedCount"); 106 + 106 107 if (testButton is ScrollTestButton scrollTestButton && scrollEntry != null) 107 108 { 108 109 Assert.AreEqual(count.OnScrollCount, scrollTestButton.OnScrollCount, $"{testButton.Concurrency} {testButton.Action} OnScrollCount"); ··· 155 156 toggleKey(key); 156 157 foreach (var button in pressedMouseButtons.ToArray()) 157 158 toggleMouseButton(button); 159 + 158 160 foreach (var mode in new[] { none, noneExact, noneModifiers, unique, all }) 159 161 { 160 162 foreach (var action in Enum.GetValues(typeof(TestAction)).Cast<TestAction>())
+2
osu.Framework.Tests/Visual/Input/TestSceneMouseStates.cs
··· 460 460 case MouseMoveEvent mouseMove: 461 461 LastDelta = mouseMove.ScreenSpaceMousePosition - mouseMove.ScreenSpaceLastMousePosition; 462 462 break; 463 + 463 464 case ScrollEvent scroll: 464 465 LastScrollDelta = scroll.ScrollDelta; 465 466 break; ··· 489 490 base.Update(); 490 491 491 492 var inputManager = GetContainingInputManager(); 493 + 492 494 if (inputManager != null) 493 495 { 494 496 var state = inputManager.CurrentState;
+8
osu.Framework.Tests/Visual/Layout/TestSceneFillFlowContainer.cs
··· 266 266 case 0: 267 267 child.Origin = Anchor.TopLeft; 268 268 break; 269 + 269 270 case 1: 270 271 child.Origin = Anchor.TopCentre; 271 272 break; 273 + 272 274 case 2: 273 275 child.Origin = Anchor.TopRight; 274 276 break; 277 + 275 278 case 3: 276 279 child.Origin = Anchor.CentreLeft; 277 280 break; 281 + 278 282 case 4: 279 283 child.Origin = Anchor.Centre; 280 284 break; 285 + 281 286 case 5: 282 287 child.Origin = Anchor.CentreRight; 283 288 break; 289 + 284 290 case 6: 285 291 child.Origin = Anchor.BottomLeft; 286 292 break; 293 + 287 294 case 7: 288 295 child.Origin = Anchor.BottomCentre; 289 296 break; 297 + 290 298 case 8: 291 299 child.Origin = Anchor.BottomRight; 292 300 break;
+1
osu.Framework.Tests/Visual/Sprites/TestSceneSpriteIcon.cs
··· 49 49 }); 50 50 51 51 var weights = typeof(FontAwesome).GetNestedTypes(); 52 + 52 53 foreach (var w in weights) 53 54 { 54 55 flow.Add(new SpriteText
+1
osu.Framework.Tests/Visual/Sprites/TestSceneSpriteTextScenarios.cs
··· 295 295 { 296 296 default: 297 297 return LOCALISABLE_STRING_EN; 298 + 298 299 case "ja": 299 300 return LOCALISABLE_STRING_JA; 300 301 }
+1
osu.Framework.Tests/Visual/Sprites/TestSceneVideoSprite.cs
··· 67 67 if (videoSprite != null) 68 68 { 69 69 var newSecond = (int)(videoSprite.PlaybackPosition / 1000.0); 70 + 70 71 if (newSecond != currentSecond) 71 72 { 72 73 currentSecond = newSecond;
+15
osu.Framework.Tests/Visual/UserInterface/TestSceneCircularProgress.cs
··· 35 35 var image = new Image<Rgba32>(width, 1); 36 36 37 37 gradientTextureHorizontal = new Texture(width, 1, true); 38 + 38 39 for (int i = 0; i < width; ++i) 39 40 { 40 41 float brightness = (float)i / (width - 1); ··· 46 47 image = new Image<Rgba32>(width, 1); 47 48 48 49 gradientTextureVertical = new Texture(1, width, true); 50 + 49 51 for (int i = 0; i < width; ++i) 50 52 { 51 53 float brightness = (float)i / (width - 1); ··· 57 59 image = new Image<Rgba32>(width, width); 58 60 59 61 gradientTextureBoth = new Texture(width, width, true); 62 + 60 63 for (int i = 0; i < width; ++i) 61 64 { 62 65 for (int j = 0; j < width; ++j) ··· 108 111 protected override void Update() 109 112 { 110 113 base.Update(); 114 + 111 115 switch (rotateMode) 112 116 { 113 117 case 0: 114 118 clock.Current.Value = Time.Current % (period * 2) / period - 1; 115 119 break; 120 + 116 121 case 1: 117 122 clock.Current.Value = Time.Current % period / period; 118 123 break; 124 + 119 125 case 2: 120 126 clock.Current.Value = Time.Current % period / period - 1; 121 127 break; 128 + 122 129 case 3: 123 130 clock.Current.Value = Time.Current % transition_period / transition_period / 5 - 0.1f; 124 131 break; 132 + 125 133 case 4: 126 134 clock.Current.Value = (Time.Current % transition_period / transition_period / 5 - 0.1f + 2) % 2 - 1; 127 135 break; ··· 135 143 case 0: 136 144 clock.Texture = Texture.WhitePixel; 137 145 break; 146 + 138 147 case 1: 139 148 clock.Texture = gradientTextureHorizontal; 140 149 break; 150 + 141 151 case 2: 142 152 clock.Texture = gradientTextureVertical; 143 153 break; 154 + 144 155 case 3: 145 156 clock.Texture = gradientTextureBoth; 146 157 break; ··· 154 165 case 0: 155 166 clock.Colour = new Color4(255, 255, 255, 255); 156 167 break; 168 + 157 169 case 1: 158 170 clock.Colour = new Color4(255, 128, 128, 255); 159 171 break; 172 + 160 173 case 2: 161 174 clock.Colour = new ColourInfo 162 175 { ··· 166 179 BottomRight = new Color4(128, 255, 128, 255), 167 180 }; 168 181 break; 182 + 169 183 case 3: 170 184 clock.Colour = new ColourInfo 171 185 { ··· 175 189 BottomRight = new Color4(128, 255, 128, 255), 176 190 }; 177 191 break; 192 + 178 193 case 4: 179 194 clock.Colour = new ColourInfo 180 195 {
+4
osu.Framework.Tests/Visual/UserInterface/TestSceneCountingText.cs
··· 62 62 default: 63 63 case CountType.AsDouble: 64 64 return value.ToString(CultureInfo.InvariantCulture); 65 + 65 66 case CountType.AsInteger: 66 67 return ((int)value).ToString(); 68 + 67 69 case CountType.AsIntegerCeiling: 68 70 return ((int)Math.Ceiling(value)).ToString(); 71 + 69 72 case CountType.AsDouble2: 70 73 return Math.Round(value, 2).ToString(CultureInfo.InvariantCulture); 74 + 71 75 case CountType.AsDouble4: 72 76 return Math.Round(value, 4).ToString(CultureInfo.InvariantCulture); 73 77 }
+1
osu.Framework.Tests/Visual/UserInterface/TestSceneDrawablePath.cs
··· 147 147 protected override bool OnDrag(DragEvent e) 148 148 { 149 149 Vector2 pos = e.MousePosition; 150 + 150 151 if ((pos - oldPos).Length > 10) 151 152 { 152 153 AddVertex(pos);
+3
osu.Framework.Tests/Visual/UserInterface/TestSceneNestedMenus.cs
··· 181 181 AddAssert("Check closed", () => 182 182 { 183 183 int currentSubMenu = 3; 184 + 184 185 while (true) 185 186 { 186 187 var subMenu = menus.GetSubMenu(currentSubMenu); ··· 217 218 AddAssert("Check closed", () => 218 219 { 219 220 int currentSubMenu = 3; 221 + 220 222 while (true) 221 223 { 222 224 var subMenu = menus.GetSubMenu(currentSubMenu); ··· 464 466 public Menu GetSubMenu(int index) 465 467 { 466 468 var currentMenu = menu; 469 + 467 470 for (int i = 0; i < index; i++) 468 471 { 469 472 if (currentMenu == null)
+1
osu.Framework.Tests/Visual/UserInterface/TestSceneRigidBody.cs
··· 80 80 for (int i = 0; i < n; i++) 81 81 { 82 82 RigidBodyContainer<Drawable> d; 83 + 83 84 do 84 85 { 85 86 d = generate();
+1
osu.Framework.Tests/Visual/UserInterface/TestSceneScreenStack.cs
··· 444 444 AddStep("Setup screens", () => 445 445 { 446 446 screens = new List<TestScreen>(); 447 + 447 448 for (int i = 0; i < 5; i++) 448 449 { 449 450 var screen = new TestScreen();
+1
osu.Framework.Tests/Visual/UserInterface/TestSceneTooltip.cs
··· 44 44 testContainer.Clear(); 45 45 46 46 CursorContainer cursor = null; 47 + 47 48 if (!cursorlessTooltip) 48 49 { 49 50 cursor = new RectangleCursorContainer();
+3
osu.Framework/Allocation/BackgroundDependencyLoaderAttribute.cs
··· 45 45 { 46 46 case 0: 47 47 return (_, __) => { }; 48 + 48 49 case 1: 49 50 var method = loaderMethods[0]; 50 51 ··· 68 69 case OperationCanceledException _: 69 70 // This activator is cancelled - propagate the cancellation as-is (it will be handled silently) 70 71 throw exc.InnerException; 72 + 71 73 case DependencyInjectionException die: 72 74 // A nested activator has failed (multiple Invoke() calls) - propagate the original error 73 75 throw die; ··· 77 79 throw new DependencyInjectionException { DispatchInfo = ExceptionDispatchInfo.Capture(exc.InnerException) }; 78 80 } 79 81 }; 82 + 80 83 default: 81 84 throw new MultipleDependencyLoaderMethodsException(type); 82 85 }
+1
osu.Framework/Allocation/CachedAttribute.cs
··· 103 103 throw new AccessModifierNotAllowedForCachedValueException(AccessModifier.None, pi); 104 104 105 105 var setMethod = pi.SetMethod; 106 + 106 107 if (setMethod != null) 107 108 { 108 109 var modifier = setMethod.GetAccessModifier();
+1
osu.Framework/Allocation/CachedModelDependencyContainer.cs
··· 108 108 case PropertyInfo pi: 109 109 action(((IBindable)pi.GetValue(targetShadowModel), (IBindable)pi.GetValue(target))); 110 110 break; 111 + 111 112 case FieldInfo fi: 112 113 action(((IBindable)fi.GetValue(targetShadowModel), (IBindable)fi.GetValue(target))); 113 114 break;
+1
osu.Framework/Allocation/ObjectHandle.cs
··· 67 67 try 68 68 { 69 69 var value = handle.Target; 70 + 70 71 if (value is T) 71 72 { 72 73 target = (T)value;
+2
osu.Framework/Allocation/ResolvedAttribute.cs
··· 73 73 var activators = new List<Action<object, IReadOnlyDependencyContainer>>(); 74 74 75 75 var properties = type.GetProperties(activator_flags).Where(f => f.GetCustomAttribute<ResolvedAttribute>() != null); 76 + 76 77 foreach (var property in properties) 77 78 { 78 79 if (!property.CanWrite) ··· 85 86 var attribute = property.GetCustomAttribute<ResolvedAttribute>(); 86 87 87 88 var cacheInfo = new CacheInfo(attribute.Name); 89 + 88 90 if (attribute.Parent != null) 89 91 { 90 92 // When a parent type exists, infer the property name if one is not provided
+2
osu.Framework/Allocation/TripleBuffer.cs
··· 55 55 56 56 buffers[write].FrameId = Interlocked.Increment(ref currentFrame); 57 57 return buffers[write]; 58 + 58 59 case UsageType.Read: 59 60 if (lastWrite < 0) return null; 60 61 ··· 78 79 lock (buffers) 79 80 buffers[read].Usage = UsageType.None; 80 81 break; 82 + 81 83 case UsageType.Write: 82 84 lock (buffers) 83 85 {
+4
osu.Framework/Audio/AudioManager.cs
··· 207 207 newDevice = audioDevices.Find(df => df.IsDefault).Name; 208 208 209 209 bool oldDeviceValid = Bass.CurrentDevice >= 0; 210 + 210 211 if (oldDeviceValid) 211 212 { 212 213 DeviceInfo oldDeviceInfo = Bass.GetDeviceInfo(Bass.CurrentDevice); ··· 318 319 { 319 320 // use default device 320 321 var device = Bass.GetDeviceInfo(Bass.CurrentDevice); 322 + 321 323 if (!device.IsDefault && !setAudioDevice()) 322 324 { 323 325 if (!device.IsEnabled || !setAudioDevice(device.Name)) ··· 337 339 { 338 340 // use whatever is the preferred device 339 341 var device = Bass.GetDeviceInfo(Bass.CurrentDevice); 342 + 340 343 if (device.Name == AudioDevice.Value) 341 344 { 342 345 if (!device.IsEnabled && !setAudioDevice()) ··· 354 357 else 355 358 { 356 359 var preferredDevice = getAllDevices().SingleOrDefault(d => d.Name == AudioDevice.Value); 360 + 357 361 if (preferredDevice.Name == AudioDevice.Value && preferredDevice.IsEnabled) 358 362 setAudioDevice(preferredDevice.Name); 359 363 else if (!device.IsEnabled && !setAudioDevice())
+1
osu.Framework/Audio/Sample/SampleStore.cs
··· 33 33 lock (sampleCache) 34 34 { 35 35 SampleChannel channel = null; 36 + 36 37 if (!sampleCache.TryGetValue(name, out Sample sample)) 37 38 { 38 39 byte[] data = store.Get(name);
+3
osu.Framework/Audio/Track/Waveform.cs
··· 113 113 // Channels are interleaved in the sample data (data[0] -> channel0, data[1] -> channel1, data[2] -> channel0, etc) 114 114 // samplesPerPoint assumes this interleaving behaviour 115 115 var point = new WaveformPoint(info.Channels); 116 + 116 117 for (int j = i; j < i + samplesPerPoint; j += info.Channels) 117 118 { 118 119 // Find the maximum amplitude for each channel in the point ··· 135 136 float[] bins = new float[fft_bins]; 136 137 int currentPoint = 0; 137 138 long currentByte = 0; 139 + 138 140 while (length > 0) 139 141 { 140 142 length = Bass.ChannelGetData(decodeStream, bins, (int)fft_samples); ··· 217 219 218 220 var point = new WaveformPoint(channels); 219 221 float totalWeight = 0; 222 + 220 223 for (int j = startIndex; j < endIndex; j++) 221 224 { 222 225 if (j < 0 || j >= points.Count) continue;
+1
osu.Framework/Bindables/AggregateBindable.cs
··· 56 56 lock (sourceMapping) 57 57 { 58 58 var weak = findExistingWeak(bindable); 59 + 59 60 if (weak != null) 60 61 { 61 62 sourceMapping[weak].UnbindAll();
+2
osu.Framework/Bindables/Bindable.cs
··· 209 209 case T t: 210 210 Value = t; 211 211 break; 212 + 212 213 case string s: 213 214 var underlyingType = Nullable.GetUnderlyingType(typeof(T)) ?? typeof(T); 214 215 ··· 217 218 else 218 219 Value = (T)Convert.ChangeType(s, underlyingType, CultureInfo.InvariantCulture); 219 220 break; 221 + 220 222 default: 221 223 throw new ArgumentException($@"Could not parse provided {input.GetType()} ({input}) to {typeof(T)}."); 222 224 }
+2
osu.Framework/Bindables/BindableList.cs
··· 350 350 case null: 351 351 Clear(); 352 352 break; 353 + 353 354 case IEnumerable<T> enumerable: 354 355 Clear(); 355 356 AddRange(enumerable); 356 357 break; 358 + 357 359 default: 358 360 throw new ArgumentException($@"Could not parse provided {input.GetType()} ({input}) to {typeof(T)}."); 359 361 }
+1
osu.Framework/Bindables/BindableMarginPadding.cs
··· 80 80 Right = float.Parse(split[3], CultureInfo.InvariantCulture), 81 81 }; 82 82 break; 83 + 83 84 default: 84 85 base.Parse(input); 85 86 break;
+19
osu.Framework/Bindables/BindableNumber.cs
··· 228 228 case TypeCode.UInt64: 229 229 case TypeCode.Int64: 230 230 return true; 231 + 231 232 default: 232 233 return false; 233 234 } ··· 245 246 246 247 byteBindable.Value = Convert.ToByte(val); 247 248 break; 249 + 248 250 case TypeCode.SByte: 249 251 var sbyteBindable = this as BindableNumber<sbyte>; 250 252 if (sbyteBindable == null) throw new ArgumentNullException(nameof(sbyteBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 251 253 252 254 sbyteBindable.Value = Convert.ToSByte(val); 253 255 break; 256 + 254 257 case TypeCode.UInt16: 255 258 var ushortBindable = this as BindableNumber<ushort>; 256 259 if (ushortBindable == null) throw new ArgumentNullException(nameof(ushortBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 257 260 258 261 ushortBindable.Value = Convert.ToUInt16(val); 259 262 break; 263 + 260 264 case TypeCode.Int16: 261 265 var shortBindable = this as BindableNumber<short>; 262 266 if (shortBindable == null) throw new ArgumentNullException(nameof(shortBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 263 267 264 268 shortBindable.Value = Convert.ToInt16(val); 265 269 break; 270 + 266 271 case TypeCode.UInt32: 267 272 var uintBindable = this as BindableNumber<uint>; 268 273 if (uintBindable == null) throw new ArgumentNullException(nameof(uintBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 269 274 270 275 uintBindable.Value = Convert.ToUInt32(val); 271 276 break; 277 + 272 278 case TypeCode.Int32: 273 279 var intBindable = this as BindableNumber<int>; 274 280 if (intBindable == null) throw new ArgumentNullException(nameof(intBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 275 281 276 282 intBindable.Value = Convert.ToInt32(val); 277 283 break; 284 + 278 285 case TypeCode.UInt64: 279 286 var ulongBindable = this as BindableNumber<ulong>; 280 287 if (ulongBindable == null) throw new ArgumentNullException(nameof(ulongBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 281 288 282 289 ulongBindable.Value = Convert.ToUInt64(val); 283 290 break; 291 + 284 292 case TypeCode.Int64: 285 293 var longBindable = this as BindableNumber<long>; 286 294 if (longBindable == null) throw new ArgumentNullException(nameof(longBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 287 295 288 296 longBindable.Value = Convert.ToInt64(val); 289 297 break; 298 + 290 299 case TypeCode.Single: 291 300 var floatBindable = this as BindableNumber<float>; 292 301 if (floatBindable == null) throw new ArgumentNullException(nameof(floatBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 293 302 294 303 floatBindable.Value = Convert.ToSingle(val); 295 304 break; 305 + 296 306 case TypeCode.Double: 297 307 var doubleBindable = this as BindableNumber<double>; 298 308 if (doubleBindable == null) throw new ArgumentNullException(nameof(doubleBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); ··· 313 323 314 324 byteBindable.Value += Convert.ToByte(val); 315 325 break; 326 + 316 327 case TypeCode.SByte: 317 328 var sbyteBindable = this as BindableNumber<sbyte>; 318 329 if (sbyteBindable == null) throw new ArgumentNullException(nameof(sbyteBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 319 330 320 331 sbyteBindable.Value += Convert.ToSByte(val); 321 332 break; 333 + 322 334 case TypeCode.UInt16: 323 335 var ushortBindable = this as BindableNumber<ushort>; 324 336 if (ushortBindable == null) throw new ArgumentNullException(nameof(ushortBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 325 337 326 338 ushortBindable.Value += Convert.ToUInt16(val); 327 339 break; 340 + 328 341 case TypeCode.Int16: 329 342 var shortBindable = this as BindableNumber<short>; 330 343 if (shortBindable == null) throw new ArgumentNullException(nameof(shortBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 331 344 332 345 shortBindable.Value += Convert.ToInt16(val); 333 346 break; 347 + 334 348 case TypeCode.UInt32: 335 349 var uintBindable = this as BindableNumber<uint>; 336 350 if (uintBindable == null) throw new ArgumentNullException(nameof(uintBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 337 351 338 352 uintBindable.Value += Convert.ToUInt32(val); 339 353 break; 354 + 340 355 case TypeCode.Int32: 341 356 var intBindable = this as BindableNumber<int>; 342 357 if (intBindable == null) throw new ArgumentNullException(nameof(intBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 343 358 344 359 intBindable.Value += Convert.ToInt32(val); 345 360 break; 361 + 346 362 case TypeCode.UInt64: 347 363 var ulongBindable = this as BindableNumber<ulong>; 348 364 if (ulongBindable == null) throw new ArgumentNullException(nameof(ulongBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 349 365 350 366 ulongBindable.Value += Convert.ToUInt64(val); 351 367 break; 368 + 352 369 case TypeCode.Int64: 353 370 var longBindable = this as BindableNumber<long>; 354 371 if (longBindable == null) throw new ArgumentNullException(nameof(longBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 355 372 356 373 longBindable.Value += Convert.ToInt64(val); 357 374 break; 375 + 358 376 case TypeCode.Single: 359 377 var floatBindable = this as BindableNumber<float>; 360 378 if (floatBindable == null) throw new ArgumentNullException(nameof(floatBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}."); 361 379 362 380 floatBindable.Value += Convert.ToSingle(val); 363 381 break; 382 + 364 383 case TypeCode.Double: 365 384 var doubleBindable = this as BindableNumber<double>; 366 385 if (doubleBindable == null) throw new ArgumentNullException(nameof(doubleBindable), $"Generic type {typeof(T)} does not match actual bindable type {GetType()}.");
+1
osu.Framework/Bindables/BindableSize.cs
··· 60 60 61 61 Value = new Size(int.Parse(split[0]), int.Parse(split[1])); 62 62 break; 63 + 63 64 default: 64 65 base.Parse(input); 65 66 break;
+2
osu.Framework/Extensions/ExtensionMethods.cs
··· 103 103 return null; 104 104 105 105 var jagged = new T[rectangular.GetLength(0)][]; 106 + 106 107 for (int r = 0; r < rectangular.GetLength(0); r++) 107 108 { 108 109 jagged[r] = new T[rectangular.GetLength(1)]; ··· 130 131 var cols = rows == 0 ? 0 : jagged.Max(c => c?.Length ?? 0); 131 132 132 133 var rectangular = new T[rows, cols]; 134 + 133 135 for (int r = 0; r < rows; r++) 134 136 for (int c = 0; c < cols; c++) 135 137 {
+2
osu.Framework/Graphics/Animations/Animation.cs
··· 129 129 if (IsPlaying && frameData.Count > 0) 130 130 { 131 131 currentFrameTime += Time.Elapsed; 132 + 132 133 while (currentFrameTime > frameData[currentFrameIndex].Duration) 133 134 { 134 135 currentFrameTime -= frameData[currentFrameIndex].Duration; 135 136 ++currentFrameIndex; 137 + 136 138 if (currentFrameIndex >= frameData.Count) 137 139 { 138 140 if (Repeat)
+1
osu.Framework/Graphics/Audio/WaveformGraph.cs
··· 293 293 ); 294 294 } 295 295 break; 296 + 296 297 case 1: 297 298 { 298 299 quadToDraw = new Quad(
+6
osu.Framework/Graphics/BlendingInfo.cs
··· 27 27 SourceAlpha = BlendingFactorSrc.One; 28 28 DestinationAlpha = BlendingFactorDest.One; 29 29 break; 30 + 30 31 case BlendingMode.Additive: 31 32 Source = BlendingFactorSrc.SrcAlpha; 32 33 Destination = BlendingFactorDest.One; 33 34 SourceAlpha = BlendingFactorSrc.One; 34 35 DestinationAlpha = BlendingFactorDest.One; 35 36 break; 37 + 36 38 default: 37 39 Source = BlendingFactorSrc.One; 38 40 Destination = BlendingFactorDest.Zero; ··· 53 55 case BlendingEquation.Inherit: 54 56 case BlendingEquation.Add: 55 57 return BlendEquationMode.FuncAdd; 58 + 56 59 case BlendingEquation.Min: 57 60 return BlendEquationMode.Min; 61 + 58 62 case BlendingEquation.Max: 59 63 return BlendEquationMode.Max; 64 + 60 65 case BlendingEquation.Subtract: 61 66 return BlendEquationMode.FuncSubtract; 67 + 62 68 case BlendingEquation.ReverseSubtract: 63 69 return BlendEquationMode.FuncReverseSubtract; 64 70 }
+1
osu.Framework/Graphics/Containers/BufferedContainer_DrawNode.cs
··· 227 227 currentFrameBufferIndex = originalIndex; 228 228 229 229 Vector2 frameBufferSize = new Vector2((float)Math.Ceiling(screenSpaceDrawRectangle.Width), (float)Math.Ceiling(screenSpaceDrawRectangle.Height)); 230 + 230 231 if (RequiresRedraw) 231 232 { 232 233 sharedData.DrawVersion = updateVersion;
+6
osu.Framework/Graphics/Containers/CompositeDrawable.cs
··· 418 418 return false; 419 419 420 420 internalChildren.RemoveAt(index); 421 + 421 422 if (drawable.IsAlive) 422 423 { 423 424 aliveInternalChildren.Remove(drawable); ··· 563 564 { 564 565 case LoadState.NotLoaded: 565 566 break; 567 + 566 568 case LoadState.Loading: 567 569 if (Thread.CurrentThread != LoadThread) 568 570 throw new InvalidThreadForChildMutationException(LoadState, "not on the load thread"); 569 571 570 572 break; 573 + 571 574 case LoadState.Ready: 572 575 // Allow mutating from the load thread since parenting containers may still be in the loading state 573 576 if (Thread.CurrentThread != LoadThread && !ThreadSafety.IsUpdateThread) 574 577 throw new InvalidThreadForChildMutationException(LoadState, "not on the load or update threads"); 575 578 576 579 break; 580 + 577 581 case LoadState.Loaded: 578 582 if (!ThreadSafety.IsUpdateThread) 579 583 throw new InvalidThreadForChildMutationException(LoadState, "not on the update thread"); ··· 985 989 private static void addFromComposite(ulong frame, int treeIndex, bool forceNewDrawNode, ref int j, CompositeDrawable parentComposite, List<DrawNode> target) 986 990 { 987 991 SortedList<Drawable> children = parentComposite.aliveInternalChildren; 992 + 988 993 for (int i = 0; i < children.Count; ++i) 989 994 { 990 995 Drawable drawable = children[i]; ··· 995 1000 continue; 996 1001 997 1002 CompositeDrawable composite = drawable as CompositeDrawable; 1003 + 998 1004 if (composite?.CanBeFlattened == true) 999 1005 { 1000 1006 if (!composite.IsMaskedAway)
+1
osu.Framework/Graphics/Containers/CompositeDrawable_DrawNode.cs
··· 174 174 base.Draw(vertexAction); 175 175 176 176 drawEdgeEffect(); 177 + 177 178 if (maskingInfo != null) 178 179 { 179 180 MaskingInfo info = maskingInfo.Value;
+5
osu.Framework/Graphics/Containers/CustomizableTextContainer.cs
··· 87 87 var sprites = new List<Drawable>(); 88 88 int index = 0; 89 89 string str = line.Text; 90 + 90 91 while (index < str.Length) 91 92 { 92 93 Drawable placeholderDrawable = null; ··· 96 97 nextPlaceholderIndex = str.IndexOf(unescaped_left, nextPlaceholderIndex + 2, StringComparison.Ordinal); 97 98 98 99 string strPiece = null; 100 + 99 101 if (nextPlaceholderIndex != -1) 100 102 { 101 103 int placeholderEnd = str.IndexOf(unescaped_right, nextPlaceholderIndex, StringComparison.Ordinal); ··· 110 112 string placeholderName = placeholderStr; 111 113 string paramStr = ""; 112 114 int parensOpen = placeholderStr.IndexOf('('); 115 + 113 116 if (parensOpen != -1) 114 117 { 115 118 placeholderName = placeholderStr.Substring(0, parensOpen).Trim(); ··· 132 135 else 133 136 { 134 137 object[] args; 138 + 135 139 if (string.IsNullOrWhiteSpace(paramStr)) 136 140 { 137 141 args = Array.Empty<object>(); ··· 140 144 { 141 145 string[] argStrs = paramStr.Split(','); 142 146 args = new object[argStrs.Length]; 147 + 143 148 for (int i = 0; i < argStrs.Length; ++i) 144 149 { 145 150 if (!int.TryParse(argStrs[i], out int argVal))
+8
osu.Framework/Graphics/Containers/FillFlowContainer.cs
··· 97 97 protected override IEnumerable<Vector2> ComputeLayoutPositions() 98 98 { 99 99 var max = MaximumSize; 100 + 100 101 if (max == Vector2.Zero) 101 102 { 102 103 var s = ChildSize; ··· 128 129 129 130 // First pass, computing initial flow positions 130 131 Vector2 size = Vector2.Zero; 132 + 131 133 for (int i = 0; i < children.Length; ++i) 132 134 { 133 135 Drawable c = children[i]; ··· 138 140 { 139 141 case FillDirection.Full: 140 142 return Axes.Both; 143 + 141 144 case FillDirection.Horizontal: 142 145 return Axes.X; 146 + 143 147 case FillDirection.Vertical: 144 148 return Axes.Y; 149 + 145 150 default: 146 151 throw new ArgumentException($"{direction.ToString()} is not defined"); 147 152 } ··· 192 197 rowIndices[i] = rowOffsetsToMiddle.Count - 1; 193 198 194 199 Vector2 stride = Vector2.Zero; 200 + 195 201 if (i < children.Length - 1) 196 202 { 197 203 // Compute stride. Note, that the stride depends on the origins of the drawables ··· 230 236 + $"Consider using multiple instances of {nameof(FillFlowContainer)} if this is intentional."); 231 237 232 238 break; 239 + 233 240 case FillDirection.Horizontal: 234 241 if (c.RelativeAnchorPosition.X != ourRelativeAnchor.X) 235 242 throw new InvalidOperationException( ··· 237 244 + $"Consider using multiple instances of {nameof(FillFlowContainer)} if this is intentional."); 238 245 239 246 break; 247 + 240 248 default: 241 249 if (c.RelativeAnchorPosition != ourRelativeAnchor) 242 250 throw new InvalidOperationException(
+1
osu.Framework/Graphics/Containers/FlowContainer.cs
··· 164 164 var positions = ComputeLayoutPositions().ToArray(); 165 165 166 166 int i = 0; 167 + 167 168 foreach (var d in FlowingChildren) 168 169 { 169 170 if (i > positions.Length)
+5
osu.Framework/Graphics/Containers/GridContainer.cs
··· 153 153 154 154 // Create the new cell containers and add content 155 155 cells = new CellContainer[requiredRows, requiredColumns]; 156 + 156 157 for (int r = 0; r < cellRows; r++) 157 158 for (int c = 0; c < cellColumns; c++) 158 159 { ··· 234 235 { 235 236 default: 236 237 throw new InvalidOperationException($"Unsupported dimension: {dimension.Mode}."); 238 + 237 239 case GridSizeMode.Distributed: 238 240 break; 241 + 239 242 case GridSizeMode.Relative: 240 243 sizes[i] = dimension.Size * spanLength; 241 244 break; 245 + 242 246 case GridSizeMode.Absolute: 243 247 sizes[i] = dimension.Size; 244 248 break; 249 + 245 250 case GridSizeMode.AutoSize: 246 251 float size = 0; 247 252
+6
osu.Framework/Graphics/Containers/LifetimeManagementContainer.cs
··· 69 69 } 70 70 71 71 bool aliveChildrenChanged = false; 72 + 72 73 if (newState == LifetimeState.Current) 73 74 { 74 75 MakeChildAlive(child); ··· 92 93 private void enqueueEvents(Drawable child, LifetimeState oldState, LifetimeState newState) 93 94 { 94 95 Debug.Assert(oldState != newState); 96 + 95 97 switch (oldState) 96 98 { 97 99 case LifetimeState.Future: ··· 99 101 if (newState == LifetimeState.Past) 100 102 eventQueue.Enqueue(new LifetimeBoundaryCrossedEvent(child, LifetimeBoundaryKind.End, LifetimeBoundaryCrossingDirection.Forward)); 101 103 break; 104 + 102 105 case LifetimeState.Current: 103 106 eventQueue.Enqueue(newState == LifetimeState.Past 104 107 ? new LifetimeBoundaryCrossedEvent(child, LifetimeBoundaryKind.End, LifetimeBoundaryCrossingDirection.Forward) 105 108 : new LifetimeBoundaryCrossedEvent(child, LifetimeBoundaryKind.Start, LifetimeBoundaryCrossingDirection.Backward)); 106 109 break; 110 + 107 111 case LifetimeState.Past: 108 112 eventQueue.Enqueue(new LifetimeBoundaryCrossedEvent(child, LifetimeBoundaryKind.End, LifetimeBoundaryCrossingDirection.Backward)); 109 113 if (newState == LifetimeState.Future) ··· 198 202 { 199 203 case LifetimeState.Future: 200 204 return futureChildren; 205 + 201 206 case LifetimeState.Past: 202 207 return pastChildren; 208 + 203 209 default: 204 210 return null; 205 211 }
+10
osu.Framework/Graphics/Containers/Markdown/MarkdownContainer.cs
··· 153 153 case ThematicBreakBlock thematicBlock: 154 154 container.Add(CreateSeparator(thematicBlock)); 155 155 break; 156 + 156 157 case HeadingBlock headingBlock: 157 158 container.Add(CreateHeading(headingBlock)); 158 159 break; 160 + 159 161 case ParagraphBlock paragraphBlock: 160 162 container.Add(CreateParagraph(paragraphBlock, level)); 161 163 break; 164 + 162 165 case QuoteBlock quoteBlock: 163 166 container.Add(CreateQuoteBlock(quoteBlock)); 164 167 break; 168 + 165 169 case FencedCodeBlock fencedCodeBlock: 166 170 container.Add(CreateFencedCodeBlock(fencedCodeBlock)); 167 171 break; 172 + 168 173 case Table table: 169 174 container.Add(CreateTable(table)); 170 175 break; 176 + 171 177 case ListBlock listBlock: 172 178 var childContainer = CreateList(listBlock); 173 179 container.Add(childContainer); 174 180 foreach (var single in listBlock) 175 181 AddMarkdownComponent(single, childContainer, level + 1); 176 182 break; 183 + 177 184 case ListItemBlock listItemBlock: 178 185 foreach (var single in listItemBlock) 179 186 AddMarkdownComponent(single, container, level); 180 187 break; 188 + 181 189 case HtmlBlock _: 182 190 // HTML is not supported 183 191 break; 192 + 184 193 case LinkReferenceDefinitionGroup _: 185 194 // Link reference doesn't need to be displayed. 186 195 break; 196 + 187 197 default: 188 198 container.Add(CreateNotImplemented(markdownObject)); 189 199 break;
+4
osu.Framework/Graphics/Containers/Markdown/MarkdownHeading.cs
··· 48 48 { 49 49 case 1: 50 50 return 2.7f; 51 + 51 52 case 2: 52 53 return 2; 54 + 53 55 case 3: 54 56 return 1.5f; 57 + 55 58 case 4: 56 59 return 1.3f; 60 + 57 61 default: 58 62 return 1; 59 63 }
+2
osu.Framework/Graphics/Containers/Markdown/MarkdownTableCell.cs
··· 65 65 case TableColumnAlign.Center: 66 66 textFlow.TextAnchor = Anchor.Centre; 67 67 break; 68 + 68 69 case TableColumnAlign.Right: 69 70 textFlow.TextAnchor = Anchor.CentreRight; 70 71 break; 72 + 71 73 default: 72 74 textFlow.TextAnchor = Anchor.CentreLeft; 73 75 break;
+8
osu.Framework/Graphics/Containers/Markdown/MarkdownTextFlowContainer.cs
··· 68 68 addEmphasis(text, emphases); 69 69 70 70 break; 71 + 71 72 case LinkInline linkInline: 72 73 { 73 74 if (!linkInline.IsImage) ··· 82 83 } 83 84 84 85 break; 86 + 85 87 case CodeInline codeInline: 86 88 AddCodeInLine(codeInline); 87 89 break; 90 + 88 91 case LinkInline linkInline when linkInline.IsImage: 89 92 AddImage(linkInline); 90 93 break; 94 + 91 95 case HtmlInline _: 92 96 case HtmlEntityInline _: 93 97 // Handled by the next literal 94 98 break; 99 + 95 100 case LineBreakInline lineBreak: 96 101 if (lineBreak.IsHard) 97 102 NewParagraph(); 98 103 else 99 104 NewLine(); 100 105 break; 106 + 101 107 case ContainerInline innerContainer: 102 108 AddInlineText(innerContainer); 103 109 break; 110 + 104 111 default: 105 112 AddNotImplementedInlineText(single); 106 113 break; ··· 139 146 case "_": 140 147 hasItalic = true; 141 148 break; 149 + 142 150 case "**": 143 151 case "__": 144 152 hasBold = true;
+3
osu.Framework/Graphics/Containers/ScrollContainer.cs
··· 263 263 case Key.PageUp: 264 264 ScrollTo(target - displayableContent); 265 265 return true; 266 + 266 267 case Key.PageDown: 267 268 ScrollTo(target + displayableContent); 268 269 return true; ··· 634 635 case PlatformActionType.LineStart: 635 636 ScrollToStart(); 636 637 return true; 638 + 637 639 case PlatformActionType.LineEnd: 638 640 ScrollToEnd(); 639 641 return true; 642 + 640 643 default: 641 644 return false; 642 645 }
+2
osu.Framework/Graphics/Containers/TabbableContainer.cs
··· 53 53 stack.Push(target); 54 54 55 55 bool started = false; 56 + 56 57 while (stack.Count > 0) 57 58 { 58 59 var drawable = stack.Pop(); ··· 66 67 { 67 68 var newChildren = composite.InternalChildren.ToList(); 68 69 int bound = reverse ? newChildren.Count : 0; 70 + 69 71 if (!started) 70 72 { 71 73 // Find self, to know starting point
+4
osu.Framework/Graphics/Containers/TextFlowContainer.cs
··· 275 275 { 276 276 bool first = true; 277 277 var sprites = new List<Drawable>(); 278 + 278 279 foreach (string l in line.Text.Split('\n')) 279 280 { 280 281 if (!first) 281 282 { 282 283 Drawable lastChild = Children.LastOrDefault(); 284 + 283 285 if (lastChild != null) 284 286 { 285 287 var newLine = new NewLineContainer(newLineIsParagraph); ··· 332 334 { 333 335 var childrenByLine = new List<List<Drawable>>(); 334 336 var curLine = new List<Drawable>(); 337 + 335 338 foreach (var c in Children) 336 339 { 337 340 c.Anchor = TextAnchor; ··· 361 364 362 365 bool isFirstLine = true; 363 366 float lastLineHeight = 0f; 367 + 364 368 foreach (var line in childrenByLine) 365 369 { 366 370 bool isFirstChild = true;
+1
osu.Framework/Graphics/Containers/VisibilityContainer.cs
··· 56 56 case Visibility.Hidden: 57 57 PopOut(); 58 58 break; 59 + 59 60 case Visibility.Visible: 60 61 PopIn(); 61 62 break;
+1
osu.Framework/Graphics/Cursor/ContextMenuContainer.cs
··· 80 80 relativeCursorPosition = ToSpaceOfOtherDrawable(menu.Position, menuTarget); 81 81 menu.Open(); 82 82 return true; 83 + 83 84 default: 84 85 menu.Close(); 85 86 return false;
+1
osu.Framework/Graphics/Cursor/CursorEffectContainer.cs
··· 53 53 // We keep track of all drawables we found while traversing the parent chain upwards. 54 54 newChildDrawables.Clear(); 55 55 newChildDrawables.Add(candidate); 56 + 56 57 // When we encounter a drawable we already encountered before, then there is no need 57 58 // to keep going upward, since we already recorded it previously. At that point we know 58 59 // the drawables we found are in fact children of ours.
+3
osu.Framework/Graphics/Cursor/TooltipContainer.cs
··· 140 140 base.Update(); 141 141 142 142 IHasTooltip target = findTooltipTarget(); 143 + 143 144 if (target != null && target != currentlyDisplayed) 144 145 { 145 146 currentlyDisplayed = target; ··· 178 179 return hasValidTooltip(draggedTarget) ? draggedTarget : null; 179 180 180 181 IHasTooltip targetCandidate = FindTargets().Find(t => t.TooltipText != null); 182 + 181 183 // check this first - if we find no target candidate we still want to clear the recorded positions and update the lastCandidate. 182 184 if (targetCandidate != lastCandidate) 183 185 { ··· 191 193 double appearDelay = (targetCandidate as IHasAppearDelay)?.AppearDelay ?? AppearDelay; 192 194 // Always keep 10 positions at equally-sized time intervals that add up to AppearDelay. 193 195 double positionRecordInterval = appearDelay / 10; 196 + 194 197 if (Time.Current - lastRecordedPositionTime >= positionRecordInterval) 195 198 { 196 199 lastRecordedPositionTime = Time.Current;
+24
osu.Framework/Graphics/Drawable.cs
··· 592 592 get 593 593 { 594 594 Vector2 offset = Vector2.Zero; 595 + 595 596 if (Parent != null && RelativePositionAxes != Axes.None) 596 597 { 597 598 offset = Parent.RelativeChildOffset; ··· 844 845 private void updateBypassAutoSizeAxes() 845 846 { 846 847 var value = RelativePositionAxes | RelativeSizeAxes | bypassAutoSizeAdditionalAxes; 848 + 847 849 if (bypassAutoSizeAxes != value) 848 850 { 849 851 var changedAxes = bypassAutoSizeAxes ^ value; ··· 1406 1408 protected InputManager GetContainingInputManager() 1407 1409 { 1408 1410 Drawable search = Parent; 1411 + 1409 1412 while (search != null) 1410 1413 { 1411 1414 if (search is InputManager test) return test; ··· 1717 1720 internal virtual DrawNode GenerateDrawNodeSubtree(ulong frame, int treeIndex, bool forceNewDrawNode) 1718 1721 { 1719 1722 DrawNode node = drawNodes[treeIndex]; 1723 + 1720 1724 if (node == null || forceNewDrawNode) 1721 1725 { 1722 1726 drawNodes[treeIndex] = node = CreateDrawNode(); ··· 1836 1840 { 1837 1841 case MouseMoveEvent mouseMove: 1838 1842 return OnMouseMove(mouseMove); 1843 + 1839 1844 case HoverEvent hover: 1840 1845 return OnHover(hover); 1846 + 1841 1847 case HoverLostEvent hoverLost: 1842 1848 OnHoverLost(hoverLost); 1843 1849 return false; 1850 + 1844 1851 case MouseDownEvent mouseDown: 1845 1852 return OnMouseDown(mouseDown); 1853 + 1846 1854 case MouseUpEvent mouseUp: 1847 1855 return OnMouseUp(mouseUp); 1856 + 1848 1857 case ClickEvent click: 1849 1858 return OnClick(click); 1859 + 1850 1860 case DoubleClickEvent doubleClick: 1851 1861 return OnDoubleClick(doubleClick); 1862 + 1852 1863 case DragStartEvent dragStart: 1853 1864 return OnDragStart(dragStart); 1865 + 1854 1866 case DragEvent drag: 1855 1867 return OnDrag(drag); 1868 + 1856 1869 case DragEndEvent dragEnd: 1857 1870 return OnDragEnd(dragEnd); 1871 + 1858 1872 case ScrollEvent scroll: 1859 1873 return OnScroll(scroll); 1874 + 1860 1875 case FocusEvent focus: 1861 1876 OnFocus(focus); 1862 1877 return false; 1878 + 1863 1879 case FocusLostEvent focusLost: 1864 1880 OnFocusLost(focusLost); 1865 1881 return false; 1882 + 1866 1883 case KeyDownEvent keyDown: 1867 1884 return OnKeyDown(keyDown); 1885 + 1868 1886 case KeyUpEvent keyUp: 1869 1887 return OnKeyUp(keyUp); 1888 + 1870 1889 case JoystickPressEvent joystickPress: 1871 1890 return OnJoystickPress(joystickPress); 1891 + 1872 1892 case JoystickReleaseEvent joystickRelease: 1873 1893 return OnJoystickRelease(joystickRelease); 1894 + 1874 1895 default: 1875 1896 return false; 1876 1897 } ··· 2007 2028 private static bool get(Drawable drawable, ConcurrentDictionary<Type, bool> cache, bool positional) 2008 2029 { 2009 2030 var type = drawable.GetType(); 2031 + 2010 2032 if (!cache.TryGetValue(type, out var value)) 2011 2033 { 2012 2034 value = compute(type, positional); ··· 2019 2041 private static bool compute(Type type, bool positional) 2020 2042 { 2021 2043 var inputMethods = positional ? positional_input_methods : non_positional_input_methods; 2044 + 2022 2045 foreach (var inputMethod in inputMethods) 2023 2046 { 2024 2047 // check for any input method overrides which are at a higher level than drawable. ··· 2031 2054 } 2032 2055 2033 2056 var inputInterfaces = positional ? positional_input_interfaces : non_positional_input_interfaces; 2057 + 2034 2058 foreach (var inputInterface in inputInterfaces) 2035 2059 { 2036 2060 // check if this type implements any interface which requires a drawable to handle input.
+1
osu.Framework/Graphics/OpenGL/Buffers/FrameBuffer.cs
··· 110 110 public void Bind() 111 111 { 112 112 GLWrapper.BindFrameBuffer(frameBuffer); 113 + 113 114 foreach (var r in attachedRenderBuffers) 114 115 { 115 116 r.Size = Size;
+1
osu.Framework/Graphics/OpenGL/Buffers/QuadVertexBuffer.cs
··· 34 34 base.Initialise(); 35 35 36 36 int amountIndices = amountQuads * 6; 37 + 37 38 if (amountIndices > QuadIndexData.MaxAmountIndices) 38 39 { 39 40 ushort[] indices = new ushort[amountIndices];
+2
osu.Framework/Graphics/OpenGL/Buffers/RenderBuffer.cs
··· 93 93 case RenderbufferInternalFormat.DepthComponent16: 94 94 GL.FramebufferRenderbuffer(FramebufferTarget.Framebuffer, FramebufferAttachment.DepthAttachment, RenderbufferTarget.Renderbuffer, info.RenderBufferID); 95 95 break; 96 + 96 97 case RenderbufferInternalFormat.Rgb565: 97 98 case RenderbufferInternalFormat.Rgb5A1: 98 99 case RenderbufferInternalFormat.Rgba4: 99 100 GL.FramebufferRenderbuffer(FramebufferTarget.Framebuffer, FramebufferAttachment.ColorAttachment0, RenderbufferTarget.Renderbuffer, info.RenderBufferID); 100 101 break; 102 + 101 103 case RenderbufferInternalFormat.StencilIndex8: 102 104 GL.FramebufferRenderbuffer(FramebufferTarget.Framebuffer, FramebufferAttachment.DepthAttachment, RenderbufferTarget.Renderbuffer, info.RenderBufferID); 103 105 break;
+9
osu.Framework/Graphics/OpenGL/GLWrapper.cs
··· 440 440 GlobalPropertyManager.Set(GlobalProperty.CornerRadius, maskingInfo.CornerRadius); 441 441 442 442 GlobalPropertyManager.Set(GlobalProperty.BorderThickness, maskingInfo.BorderThickness / maskingInfo.BlendRange); 443 + 443 444 if (maskingInfo.BorderThickness > 0) 444 445 { 445 446 GlobalPropertyManager.Set(GlobalProperty.BorderColour, new Vector4( ··· 672 673 case IUniformWithValue<bool> b: 673 674 GL.Uniform1(uniform.Location, b.GetValue() ? 1 : 0); 674 675 break; 676 + 675 677 case IUniformWithValue<int> i: 676 678 GL.Uniform1(uniform.Location, i.GetValue()); 677 679 break; 680 + 678 681 case IUniformWithValue<float> f: 679 682 GL.Uniform1(uniform.Location, f.GetValue()); 680 683 break; 684 + 681 685 case IUniformWithValue<Vector2> v2: 682 686 GL.Uniform2(uniform.Location, ref v2.GetValueByRef()); 683 687 break; 688 + 684 689 case IUniformWithValue<Vector3> v3: 685 690 GL.Uniform3(uniform.Location, ref v3.GetValueByRef()); 686 691 break; 692 + 687 693 case IUniformWithValue<Vector4> v4: 688 694 GL.Uniform4(uniform.Location, ref v4.GetValueByRef()); 689 695 break; 696 + 690 697 case IUniformWithValue<Matrix2> m2: 691 698 GL.UniformMatrix2(uniform.Location, false, ref m2.GetValueByRef()); 692 699 break; 700 + 693 701 case IUniformWithValue<Matrix3> m3: 694 702 GL.UniformMatrix3(uniform.Location, false, ref m3.GetValueByRef()); 695 703 break; 704 + 696 705 case IUniformWithValue<Matrix4> m4: 697 706 GL.UniformMatrix4(uniform.Location, false, ref m4.GetValueByRef()); 698 707 break;
+14
osu.Framework/Graphics/Performance/FrameStatisticsDisplay.cs
··· 81 81 labelText.Origin = Anchor.CentreRight; 82 82 labelText.Rotation = 0; 83 83 break; 84 + 84 85 case FrameStatisticsMode.Full: 85 86 mainContainer.AutoSizeAxes = Axes.None; 86 87 mainContainer.Size = new Vector2(WIDTH, HEIGHT); ··· 312 313 case Key.ControlLeft: 313 314 Expanded = true; 314 315 break; 316 + 315 317 case Key.ShiftLeft: 316 318 Running = false; 317 319 break; ··· 327 329 case Key.ControlLeft: 328 330 Expanded = false; 329 331 break; 332 + 330 333 case Key.ShiftLeft: 331 334 Running = true; 332 335 break; ··· 403 406 { 404 407 default: 405 408 return Color4.YellowGreen; 409 + 406 410 case PerformanceCollectionType.SwapBuffer: 407 411 return Color4.Red; 408 412 #if DEBUG ··· 411 415 #endif 412 416 case PerformanceCollectionType.Sleep: 413 417 return Color4.DarkBlue; 418 + 414 419 case PerformanceCollectionType.Scheduler: 415 420 return Color4.HotPink; 421 + 416 422 case PerformanceCollectionType.WndProc: 417 423 return Color4.GhostWhite; 424 + 418 425 case PerformanceCollectionType.GLReset: 419 426 return Color4.Cyan; 420 427 } ··· 428 435 { 429 436 default: 430 437 return Color4.BlueViolet; 438 + 431 439 case 1: 432 440 return Color4.YellowGreen; 441 + 433 442 case 2: 434 443 return Color4.HotPink; 444 + 435 445 case 3: 436 446 return Color4.Red; 447 + 437 448 case 4: 438 449 return Color4.Cyan; 450 + 439 451 case 5: 440 452 return Color4.Yellow; 453 + 441 454 case 6: 442 455 return Color4.SkyBlue; 443 456 } ··· 466 479 bool acceptableRange = (float)currentHeight / HEIGHT > 1 - monitor.FrameAimTime / visible_ms_range; 467 480 468 481 float brightnessAdjust = 1; 482 + 469 483 if (!frameTimeType.HasValue) 470 484 { 471 485 int step = amountSteps / HEIGHT;
+1
osu.Framework/Graphics/Performance/PerformanceOverlay.cs
··· 31 31 case FrameStatisticsMode.None: 32 32 this.FadeOut(100); 33 33 break; 34 + 34 35 case FrameStatisticsMode.Minimal: 35 36 case FrameStatisticsMode.Full: 36 37 this.FadeIn(100);
+11
osu.Framework/Graphics/Shaders/Shader.cs
··· 47 47 return; 48 48 49 49 programID = GL.CreateProgram(); 50 + 50 51 foreach (ShaderPart p in parts) 51 52 { 52 53 if (!p.Compiled) p.Compile(); ··· 63 64 64 65 Log.AppendLine(string.Format(ShaderPart.BOUNDARY, name)); 65 66 Log.AppendLine($"Linked: {linkResult == 1}"); 67 + 66 68 if (linkResult == 0) 67 69 { 68 70 Log.AppendLine("Log:"); ··· 95 97 } 96 98 97 99 IUniform uniform; 100 + 98 101 switch (type) 99 102 { 100 103 case ActiveUniformType.Bool: 101 104 uniform = createUniform<bool>(uniformName); 102 105 break; 106 + 103 107 case ActiveUniformType.Float: 104 108 uniform = createUniform<float>(uniformName); 105 109 break; 110 + 106 111 case ActiveUniformType.Int: 107 112 uniform = createUniform<int>(uniformName); 108 113 break; 114 + 109 115 case ActiveUniformType.FloatMat3: 110 116 uniform = createUniform<Matrix3>(uniformName); 111 117 break; 118 + 112 119 case ActiveUniformType.FloatMat4: 113 120 uniform = createUniform<Matrix4>(uniformName); 114 121 break; 122 + 115 123 case ActiveUniformType.FloatVec2: 116 124 uniform = createUniform<Vector2>(uniformName); 117 125 break; 126 + 118 127 case ActiveUniformType.FloatVec3: 119 128 uniform = createUniform<Vector3>(uniformName); 120 129 break; 130 + 121 131 case ActiveUniformType.FloatVec4: 122 132 uniform = createUniform<Vector4>(uniformName); 123 133 break; 134 + 124 135 default: 125 136 continue; 126 137 }
+1
osu.Framework/Graphics/Shaders/ShaderManager.cs
··· 31 31 { 32 32 case ShaderType.FragmentShader: 33 33 return @".fs"; 34 + 34 35 case ShaderType.VertexShader: 35 36 return @".vs"; 36 37 }
+3
osu.Framework/Graphics/Shaders/ShaderPart.cs
··· 76 76 } 77 77 78 78 Match includeMatch = includeRegex.Match(line); 79 + 79 80 if (includeMatch.Success) 80 81 { 81 82 string includeName = includeMatch.Groups[1].Value.Trim(); ··· 93 94 if (Type == ShaderType.VertexShader || Type == ShaderType.VertexShaderArb) 94 95 { 95 96 Match inputMatch = shaderInputRegex.Match(line); 97 + 96 98 if (inputMatch.Success) 97 99 { 98 100 ShaderInputs.Add(new ShaderInputInfo ··· 130 132 string compileLog = GL.GetShaderInfoLog(this); 131 133 Log.AppendLine(string.Format('\t' + BOUNDARY, Name)); 132 134 Log.AppendLine($"\tCompiled: {Compiled}"); 135 + 133 136 if (!Compiled) 134 137 { 135 138 Log.AppendLine("\tLog:");
+1
osu.Framework/Graphics/Textures/TextureAtlas.cs
··· 85 85 Vector2I res = new Vector2I(0, currentY); 86 86 87 87 int maxY = currentY; 88 + 88 89 foreach (RectangleI bounds in subTextureBounds) 89 90 { 90 91 // +1 is required to prevent aliasing issues with sub-pixel positions while drawing. Bordering edged of other textures can show without it.
+1
osu.Framework/Graphics/TransformableExtensions.cs
··· 318 318 { 319 319 case Direction.Horizontal: 320 320 return drawable.MoveToX(destination, duration, easing); 321 + 321 322 case Direction.Vertical: 322 323 return drawable.MoveToY(destination, duration, easing); 323 324 }
+2
osu.Framework/Graphics/Transforms/TransformCustom.cs
··· 74 74 private static Accessor findAccessor(Type type, string propertyOrFieldName) 75 75 { 76 76 PropertyInfo property = type.GetProperty(propertyOrFieldName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); 77 + 77 78 if (property != null) 78 79 { 79 80 if (property.PropertyType != typeof(TValue)) ··· 101 102 } 102 103 103 104 FieldInfo field = type.GetField(propertyOrFieldName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); 105 + 104 106 if (field != null) 105 107 { 106 108 if (field.FieldType != typeof(TValue))
+2
osu.Framework/Graphics/Transforms/TransformSequence.cs
··· 335 335 throw new InvalidOperationException($"Can not perform {nameof(Loop)} on an endless {nameof(TransformSequence<T>)}."); 336 336 337 337 var iterDuration = endTime - startTime + pause; 338 + 338 339 foreach (var t in transforms) 339 340 { 340 341 Action tmpOnAbort = t.OnAbort; ··· 347 348 // inserted in the correct order such that none of them trigger abortions on 348 349 // each other due to instant re-sorting upon adding. 349 350 double currentTransformTime = t.TargetTransformable.Time.Current; 351 + 350 352 while (t.EndTime <= currentTransformTime) 351 353 { 352 354 t.StartTime += iterDuration;
+2
osu.Framework/Graphics/Transforms/Transformable.cs
··· 274 274 return; 275 275 276 276 Transform[] toAbort; 277 + 277 278 if (targetMember == null) 278 279 { 279 280 toAbort = transformsLazy.Value.Where(t => t.StartTime >= time).ToArray(); ··· 438 439 for (int i = insertionIndex + 1; i < transforms.Count; ++i) 439 440 { 440 441 var t = transforms[i]; 442 + 441 443 if (t.TargetMember == transform.TargetMember) 442 444 { 443 445 transforms.RemoveAt(i--);
+1
osu.Framework/Graphics/UserInterface/CircularProgressDrawNode.cs
··· 101 101 // dir is used so negative angles result in negative angularOffset. 102 102 float angularOffset = dir * Math.Min(i * step, dir * angle); 103 103 float normalisedOffset = angularOffset / MathHelper.TwoPi; 104 + 104 105 if (dir < 0) 105 106 { 106 107 normalisedOffset += 1.0f;
+3
osu.Framework/Graphics/UserInterface/Dropdown.cs
··· 155 155 { 156 156 case MenuItem i: 157 157 return i.Text.Value; 158 + 158 159 case IHasText t: 159 160 return t.Text; 161 + 160 162 case Enum e: 161 163 return e.GetDescription(); 164 + 162 165 default: 163 166 return item?.ToString() ?? "null"; 164 167 }
+3
osu.Framework/Graphics/UserInterface/Menu.cs
··· 114 114 case Direction.Horizontal: 115 115 ItemsContainer.AutoSizeAxes = Axes.X; 116 116 break; 117 + 117 118 case Direction.Vertical: 118 119 ItemsContainer.AutoSizeAxes = Axes.Y; 119 120 break; ··· 236 237 case MenuState.Closed: 237 238 AnimateClose(); 238 239 break; 240 + 239 241 case MenuState.Open: 240 242 AnimateOpen(); 241 243 if (!TopLevelMenu) ··· 446 448 case MenuState.Closed: 447 449 selectedItem.State = MenuItemState.NotSelected; 448 450 break; 451 + 449 452 case MenuState.Open: 450 453 selectedItem.State = MenuItemState.Selected; 451 454 break;
+2
osu.Framework/Graphics/UserInterface/SliderBar.cs
··· 159 159 currentNumberInstantaneous.Add(step); 160 160 onUserChange(currentNumberInstantaneous.Value); 161 161 return true; 162 + 162 163 case Key.Left: 163 164 currentNumberInstantaneous.Add(-step); 164 165 onUserChange(currentNumberInstantaneous.Value); 165 166 return true; 167 + 166 168 default: 167 169 return false; 168 170 }
+4
osu.Framework/Graphics/UserInterface/TextBox.cs
··· 293 293 pos = Parent.ToSpaceOfOtherDrawable(pos, TextFlow); 294 294 295 295 int i = 0; 296 + 296 297 foreach (Drawable d in TextFlow.Children) 297 298 { 298 299 if (d.DrawPosition.X + d.DrawSize.X / 2 > pos.X) ··· 536 537 foreach (char c in addText) 537 538 { 538 539 var ch = addCharacter(c); 540 + 539 541 if (ch == null) 540 542 { 541 543 notifyInputError(); ··· 704 706 case Key.Escape: 705 707 KillFocus(); 706 708 return true; 709 + 707 710 case Key.KeypadEnter: 708 711 case Key.Enter: 709 712 Commit(); ··· 957 960 for (int i = matchCount; i < s.Length; i++) 958 961 { 959 962 Drawable dr = addCharacter(s[i]); 963 + 960 964 if (dr != null) 961 965 { 962 966 dr.Colour = Color4.Aqua;
+10
osu.Framework/Graphics/Video/VideoDecoder.cs
··· 214 214 case StdIo.SEEK_CUR: 215 215 videoStream.Seek(offset, SeekOrigin.Current); 216 216 break; 217 + 217 218 case StdIo.SEEK_END: 218 219 videoStream.Seek(offset, SeekOrigin.End); 219 220 break; 221 + 220 222 case StdIo.SEEK_SET: 221 223 videoStream.Seek(offset, SeekOrigin.Begin); 222 224 break; 225 + 223 226 case ffmpeg.AVSEEK_SIZE: 224 227 return videoStream.Length; 228 + 225 229 default: 226 230 return -1; 227 231 } ··· 248 252 throw new Exception("Could not find stream info."); 249 253 250 254 var nStreams = formatContext->nb_streams; 255 + 251 256 for (var i = 0; i < nStreams; ++i) 252 257 { 253 258 stream = formatContext->streams[i]; 254 259 255 260 codecParams = *stream->codecpar; 261 + 256 262 if (codecParams.codec_type == AVMediaType.AVMEDIA_TYPE_VIDEO) 257 263 { 258 264 timeBaseInSeconds = stream->time_base.GetValue(); ··· 306 312 if (readFrameResult >= 0) 307 313 { 308 314 state = DecoderState.Running; 315 + 309 316 if (packet->stream_index == stream->index) 310 317 { 311 318 if (ffmpeg.avcodec_send_packet(stream->codec, packet) < 0) 312 319 throw new Exception("Error sending packet."); 313 320 314 321 var result = ffmpeg.avcodec_receive_frame(stream->codec, frame); 322 + 315 323 if (result == 0) 316 324 { 317 325 var frameTime = (frame->best_effort_timestamp - stream->start_time) * timeBaseInSeconds * 1000; 326 + 318 327 if (!skipOutputUntilTime.HasValue || skipOutputUntilTime.Value < frameTime) 319 328 { 320 329 skipOutputUntilTime = null; 321 330 322 331 SwsContext* swsCtx = null; 332 + 323 333 try 324 334 { 325 335 swsCtx = ffmpeg.sws_getContext(codecParams.width, codecParams.height, (AVPixelFormat)frame->format, codecParams.width, codecParams.height, AVPixelFormat.AV_PIX_FMT_RGBA, 0, null, null, null);
+1
osu.Framework/Graphics/Video/VideoSprite.cs
··· 112 112 startTime = Clock.CurrentTime; 113 113 114 114 var nextFrame = availableFrames.Count > 0 ? availableFrames.Peek() : null; 115 + 115 116 if (nextFrame != null) 116 117 { 117 118 bool tooFarBehind = Math.Abs(PlaybackPosition - nextFrame.Time) > lenience_before_seek &&
+2
osu.Framework/Graphics/Visualisation/DrawVisualiser.cs
··· 44 44 Drawable lastHighlight = highlightedTarget?.Target; 45 45 46 46 var parent = Target?.Parent; 47 + 47 48 if (parent != null) 48 49 { 49 50 var lastVisualiser = targetVisualiser; ··· 58 59 if (lastHighlight != null) 59 60 { 60 61 VisualisedDrawable visualised = targetVisualiser.FindVisualisedDrawable(lastHighlight); 62 + 61 63 if (visualised != null) 62 64 { 63 65 propertyDisplay.State = Visibility.Visible;
+4
osu.Framework/Graphics/Visualisation/LogOverlay.cs
··· 212 212 { 213 213 case LoggingTarget.Runtime: 214 214 return Color4.YellowGreen; 215 + 215 216 case LoggingTarget.Network: 216 217 return Color4.BlueViolet; 218 + 217 219 case LoggingTarget.Performance: 218 220 return Color4.HotPink; 221 + 219 222 case LoggingTarget.Information: 220 223 return Color4.CadetBlue; 224 + 221 225 default: 222 226 return Color4.Cyan; 223 227 }
+2
osu.Framework/Graphics/Visualisation/PropertyDisplay.cs
··· 84 84 public PropertyItem(MemberInfo info, IDrawable d) 85 85 { 86 86 Type type; 87 + 87 88 switch (info.MemberType) 88 89 { 89 90 case MemberTypes.Property: ··· 164 165 private void updateValue() 165 166 { 166 167 object value; 168 + 167 169 try 168 170 { 169 171 value = getValue() ?? "<null>";
+1
osu.Framework/Graphics/Visualisation/TreeContainer.cs
··· 52 52 case TreeContainerStatus.Offscreen: 53 53 this.Delay(500).FadeTo(0.7f, 300); 54 54 break; 55 + 55 56 case TreeContainerStatus.Onscreen: 56 57 this.FadeIn(300, Easing.OutQuint); 57 58 break;
+1
osu.Framework/Graphics/Visualisation/VisualisedDrawable.cs
··· 335 335 private void updateSpecifics() 336 336 { 337 337 Vector2 posInTree = ToSpaceOfOtherDrawable(Vector2.Zero, tree); 338 + 338 339 if (posInTree.Y < -previewBox.DrawHeight || posInTree.Y > tree.Height) 339 340 { 340 341 text.Text = string.Empty;
+3
osu.Framework/Host.cs
··· 24 24 { 25 25 case RuntimeInfo.Platform.MacOsx: 26 26 return new MacOSGameHost(gameName, bindIPC, toolkitOptions, portableInstallation); 27 + 27 28 case RuntimeInfo.Platform.Linux: 28 29 return new LinuxGameHost(gameName, bindIPC, toolkitOptions, portableInstallation); 30 + 29 31 case RuntimeInfo.Platform.Windows: 30 32 return new WindowsGameHost(gameName, bindIPC, toolkitOptions, portableInstallation); 33 + 31 34 default: 32 35 throw new InvalidOperationException($"Could not find a suitable host for the selected operating system ({Enum.GetName(typeof(RuntimeInfo.Platform), RuntimeInfo.OS)})."); 33 36 }
+4
osu.Framework/IO/AsyncBufferStream.cs
··· 76 76 return; 77 77 78 78 int last = -1; 79 + 79 80 while (!isLoaded && !isClosed) 80 81 { 81 82 cancellationToken.Token.ThrowIfCancellationRequested(); 82 83 83 84 int curr = nextBlockToLoad; 85 + 84 86 if (curr < 0) 85 87 { 86 88 Thread.Sleep(1); ··· 211 213 case SeekOrigin.Begin: 212 214 Position = offset; 213 215 break; 216 + 214 217 case SeekOrigin.Current: 215 218 Position += offset; 216 219 break; 220 + 217 221 case SeekOrigin.End: 218 222 Position = data.Length + offset; 219 223 break;
+7
osu.Framework/IO/File/FileSafety.cs
··· 131 131 } 132 132 133 133 string deathLocation = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 134 + 134 135 try 135 136 { 136 137 System.IO.File.Move(filename, deathLocation); ··· 231 232 } 232 233 233 234 bool didExist = Directory.Exists(newDirectory); 235 + 234 236 if (!didExist) 235 237 { 236 238 DirectoryInfo newDirectoryInfo = Directory.CreateDirectory(newDirectory); 239 + 237 240 try 238 241 { 239 242 if (new DirectoryInfo(oldDirectory).Attributes.HasFlag(FileAttributes.Hidden)) ··· 249 252 string newFile = Path.Combine(newDirectory, Path.GetFileName(file)); 250 253 251 254 bool didMove = FileMove(file, newFile, didExist); 255 + 252 256 if (!didMove) 253 257 { 254 258 try ··· 297 301 return string.Empty; 298 302 299 303 char[] converted = new char[(encoded.Length + 1) / 2]; 304 + 300 305 fixed (byte* bytePtr = encoded) 301 306 fixed (char* stringPtr = converted) 302 307 { 303 308 byte* stringBytes = (byte*)stringPtr; 304 309 byte* stringEnd = (byte*)stringPtr + converted.Length * 2; 305 310 byte* bytePtr2 = bytePtr; 311 + 306 312 do 307 313 { 308 314 *stringBytes = *bytePtr2++; ··· 344 350 public static void CreateBackup(string filename) 345 351 { 346 352 string backupFilename = filename + @"." + DateTime.Now.Ticks + @".bak"; 353 + 347 354 if (System.IO.File.Exists(filename) && !System.IO.File.Exists(backupFilename)) 348 355 { 349 356 Debug.Print(@"Backup created: " + backupFilename);
+4
osu.Framework/IO/Network/UrlEncoding.cs
··· 52 52 { 53 53 int num = 0; 54 54 int num2 = 0; 55 + 55 56 for (int i = 0; i < count; i++) 56 57 { 57 58 char ch = (char)bytes[offset + i]; 59 + 58 60 if (paramEncode && ch == ' ') 59 61 { 60 62 num++; ··· 72 74 73 75 byte[] buffer = new byte[count + num2 * 2]; 74 76 int num4 = 0; 77 + 75 78 for (int j = 0; j < count; j++) 76 79 { 77 80 byte num6 = bytes[offset + j]; 78 81 char ch2 = (char)num6; 82 + 79 83 if (IsSafe(ch2)) 80 84 { 81 85 buffer[num4++] = num6;
+2
osu.Framework/IO/Network/WebRequest.cs
··· 230 230 private async Task internalPerform() 231 231 { 232 232 var url = Url; 233 + 233 234 if (!AllowInsecureRequests && !url.StartsWith(@"https://")) 234 235 { 235 236 logger.Add($"Insecure request was automatically converted to https ({Url})"); ··· 459 460 { 460 461 // in the case we fail a request, spitting out the response in the log is quite helpful. 461 462 ResponseStream.Seek(0, SeekOrigin.Begin); 463 + 462 464 using (StreamReader r = new StreamReader(ResponseStream, new UTF8Encoding(false, true), true, 1024, true)) 463 465 { 464 466 try
+2
osu.Framework/IO/Stores/FontStore.cs
··· 43 43 case FontStore fs: 44 44 nestedFontStores.Add(fs); 45 45 return; 46 + 46 47 case GlyphStore gs: 47 48 glyphStores.Add(gs); 48 49 queueLoad(gs); ··· 85 86 case FontStore fs: 86 87 nestedFontStores.Remove(fs); 87 88 return; 89 + 88 90 case GlyphStore gs: 89 91 glyphStores.Remove(gs); 90 92 break;
+1
osu.Framework/Input/Bindings/KeyBindingContainer.cs
··· 102 102 protected override bool Handle(UIEvent e) 103 103 { 104 104 var state = e.CurrentState; 105 + 105 106 switch (e) 106 107 { 107 108 case MouseDownEvent mouseDown:
+51
osu.Framework/Input/Bindings/KeyCombination.cs
··· 119 119 { 120 120 case InputKey.None: 121 121 return string.Empty; 122 + 122 123 case InputKey.Shift: 123 124 return "Shift"; 125 + 124 126 case InputKey.Control: 125 127 return "Ctrl"; 128 + 126 129 case InputKey.Alt: 127 130 return "Alt"; 131 + 128 132 case InputKey.Super: 129 133 return "Win"; 134 + 130 135 case InputKey.Escape: 131 136 return "Esc"; 137 + 132 138 case InputKey.BackSpace: 133 139 return "Backsp"; 140 + 134 141 case InputKey.Insert: 135 142 return "Ins"; 143 + 136 144 case InputKey.Delete: 137 145 return "Del"; 146 + 138 147 case InputKey.PageUp: 139 148 return "Pgup"; 149 + 140 150 case InputKey.PageDown: 141 151 return "Pgdn"; 152 + 142 153 case InputKey.CapsLock: 143 154 return "Caps"; 155 + 144 156 case InputKey.Number0: 145 157 case InputKey.Keypad0: 146 158 return "0"; 159 + 147 160 case InputKey.Number1: 148 161 case InputKey.Keypad1: 149 162 return "1"; 163 + 150 164 case InputKey.Number2: 151 165 case InputKey.Keypad2: 152 166 return "2"; 167 + 153 168 case InputKey.Number3: 154 169 case InputKey.Keypad3: 155 170 return "3"; 171 + 156 172 case InputKey.Number4: 157 173 case InputKey.Keypad4: 158 174 return "4"; 175 + 159 176 case InputKey.Number5: 160 177 case InputKey.Keypad5: 161 178 return "5"; 179 + 162 180 case InputKey.Number6: 163 181 case InputKey.Keypad6: 164 182 return "6"; 183 + 165 184 case InputKey.Number7: 166 185 case InputKey.Keypad7: 167 186 return "7"; 187 + 168 188 case InputKey.Number8: 169 189 case InputKey.Keypad8: 170 190 return "8"; 191 + 171 192 case InputKey.Number9: 172 193 case InputKey.Keypad9: 173 194 return "9"; 195 + 174 196 case InputKey.Tilde: 175 197 return "~"; 198 + 176 199 case InputKey.Minus: 177 200 return "-"; 201 + 178 202 case InputKey.Plus: 179 203 return "+"; 204 + 180 205 case InputKey.BracketLeft: 181 206 return "("; 207 + 182 208 case InputKey.BracketRight: 183 209 return ")"; 210 + 184 211 case InputKey.Semicolon: 185 212 return ";"; 213 + 186 214 case InputKey.Quote: 187 215 return "\""; 216 + 188 217 case InputKey.Comma: 189 218 return ","; 219 + 190 220 case InputKey.Period: 191 221 return "."; 222 + 192 223 case InputKey.Slash: 193 224 return "/"; 225 + 194 226 case InputKey.BackSlash: 195 227 case InputKey.NonUSBackSlash: 196 228 return "\\"; 229 + 197 230 case InputKey.MouseLeft: 198 231 return "M1"; 232 + 199 233 case InputKey.MouseMiddle: 200 234 return "M3"; 235 + 201 236 case InputKey.MouseRight: 202 237 return "M2"; 238 + 203 239 case InputKey.MouseButton1: 204 240 return "M4"; 241 + 205 242 case InputKey.MouseButton2: 206 243 return "M5"; 244 + 207 245 case InputKey.MouseButton3: 208 246 return "M6"; 247 + 209 248 case InputKey.MouseButton4: 210 249 return "M7"; 250 + 211 251 case InputKey.MouseButton5: 212 252 return "M8"; 253 + 213 254 case InputKey.MouseButton6: 214 255 return "M9"; 256 + 215 257 case InputKey.MouseButton7: 216 258 return "M10"; 259 + 217 260 case InputKey.MouseButton8: 218 261 return "M11"; 262 + 219 263 case InputKey.MouseButton9: 220 264 return "M12"; 265 + 221 266 case InputKey.MouseWheelDown: 222 267 return "Wheel Down"; 268 + 223 269 case InputKey.MouseWheelUp: 224 270 return "Wheel Up"; 271 + 225 272 default: 226 273 return key.ToString(); 227 274 } ··· 233 280 { 234 281 case Key.RShift: 235 282 return InputKey.Shift; 283 + 236 284 case Key.RAlt: 237 285 return InputKey.Alt; 286 + 238 287 case Key.RControl: 239 288 return InputKey.Control; 289 + 240 290 case Key.RWin: 241 291 return InputKey.Super; 242 292 } ··· 304 354 if (!keys.Contains(iKey)) 305 355 keys.Add(iKey); 306 356 break; 357 + 307 358 default: 308 359 keys.Add(iKey); 309 360 break;
+1
osu.Framework/Input/CustomInputManager.cs
··· 20 20 if (!handler.Initialize(Host)) return; 21 21 22 22 int index = inputHandlers.BinarySearch(handler, new InputHandlerComparer()); 23 + 23 24 if (index < 0) 24 25 { 25 26 index = ~index;
+1
osu.Framework/Input/Handlers/Joystick/OsuTKJoystickHandler.cs
··· 80 80 for (int index = 0; index < rawStates.Count; index++) 81 81 { 82 82 var rawState = rawStates[index]; 83 + 83 84 if (index < devices.Count) 84 85 { 85 86 devices[index].UpdateRawState(rawState);
+2
osu.Framework/Input/Handlers/Mouse/OsuTKMouseHandlerBase.cs
··· 36 36 else 37 37 { 38 38 var delta = state.Position - lastState.Position; 39 + 39 40 if (delta != Vector2.Zero) 40 41 { 41 42 PendingInputs.Enqueue(new MousePositionRelativeInput { Delta = delta }); ··· 46 47 if (lastState != null && state.WasActive) 47 48 { 48 49 var scrollDelta = state.Scroll - lastState.Scroll; 50 + 49 51 if (scrollDelta != Vector2.Zero) 50 52 { 51 53 PendingInputs.Enqueue(new MouseScrollRelativeInput { Delta = scrollDelta, IsPrecise = state.HasPreciseScroll });
+8
osu.Framework/Input/InputManager.cs
··· 141 141 { 142 142 case MouseButton.Left: 143 143 return new MouseLeftButtonEventManager(button); 144 + 144 145 default: 145 146 return new MouseMinorButtonEventManager(button); 146 147 } ··· 260 261 if (!(keyboardRepeatKey is Key key)) return; 261 262 262 263 keyboardRepeatTime -= Time.Elapsed; 264 + 263 265 while (keyboardRepeatTime < 0) 264 266 { 265 267 handleKeyDown(state, key, true); ··· 358 360 } 359 361 360 362 d.IsHovered = true; 363 + 361 364 if (d.TriggerEvent(new HoverEvent(state))) 362 365 { 363 366 hoverHandledDrawable = d; ··· 430 433 case MousePositionChangeEvent mousePositionChange: 431 434 HandleMousePositionChange(mousePositionChange); 432 435 return; 436 + 433 437 case MouseScrollChangeEvent mouseScrollChange: 434 438 HandleMouseScrollChange(mouseScrollChange); 435 439 return; 440 + 436 441 case ButtonStateChangeEvent<MouseButton> mouseButtonStateChange: 437 442 HandleMouseButtonStateChange(mouseButtonStateChange); 438 443 return; 444 + 439 445 case ButtonStateChangeEvent<Key> keyboardKeyStateChange: 440 446 HandleKeyboardKeyStateChange(keyboardKeyStateChange); 441 447 return; 448 + 442 449 case ButtonStateChangeEvent<JoystickButton> joystickButtonStateChange: 443 450 HandleJoystickButtonStateChange(joystickButtonStateChange); 444 451 return; ··· 518 525 { 519 526 //ensure we are visible 520 527 CompositeDrawable d = FocusedDrawable.Parent; 528 + 521 529 while (d != null) 522 530 { 523 531 if (!d.IsPresent || !d.IsAlive)
+1
osu.Framework/Input/MouseButtonEventManager.cs
··· 171 171 172 172 // only drawables up to the one that handled mouse down should handle mouse up 173 173 MouseDownInputQueue = positionalInputQueue; 174 + 174 175 if (handledBy != null) 175 176 { 176 177 var count = MouseDownInputQueue.IndexOf(handledBy) + 1;
+1
osu.Framework/Input/StateChanges/ButtonInput.cs
··· 65 65 public void Apply(InputState state, IInputStateChangeHandler handler) 66 66 { 67 67 var buttonStates = GetButtonStates(state); 68 + 68 69 foreach (var entry in Entries) 69 70 { 70 71 if (buttonStates.SetPressed(entry.Button, entry.IsPressed))
+1
osu.Framework/Input/StateChanges/MousePositionAbsoluteInput.cs
··· 24 24 public void Apply(InputState state, IInputStateChangeHandler handler) 25 25 { 26 26 var mouse = state.Mouse; 27 + 27 28 if (!mouse.IsPositionValid || mouse.Position != Position) 28 29 { 29 30 var lastPosition = mouse.IsPositionValid ? mouse.Position : Position;
+1
osu.Framework/Input/StateChanges/MousePositionRelativeInput.cs
··· 22 22 public void Apply(InputState state, IInputStateChangeHandler handler) 23 23 { 24 24 var mouse = state.Mouse; 25 + 25 26 if (mouse.IsPositionValid && Delta != Vector2.Zero) 26 27 { 27 28 var lastPosition = mouse.Position;
+1
osu.Framework/Input/StateChanges/MouseScrollRelativeInput.cs
··· 26 26 public void Apply(InputState state, IInputStateChangeHandler handler) 27 27 { 28 28 var mouse = state.Mouse; 29 + 29 30 if (Delta != Vector2.Zero) 30 31 { 31 32 var lastScroll = mouse.Scroll;
+1
osu.Framework/Logging/Logger.cs
··· 204 204 lock (static_sync_lock) 205 205 { 206 206 var nameLower = name.ToLower(); 207 + 207 208 if (!static_loggers.TryGetValue(nameLower, out Logger l)) 208 209 { 209 210 static_loggers[nameLower] = l = Enum.TryParse(name, true, out LoggingTarget target) ? new Logger(target) : new Logger(name);
+23
osu.Framework/MathUtils/Interpolation.cs
··· 73 73 { 74 74 int n = points.Length; 75 75 double[] w = new double[n]; 76 + 76 77 for (int i = 0; i < n; i++) 77 78 { 78 79 w[i] = 1; ··· 257 258 case Easing.In: 258 259 case Easing.InQuad: 259 260 return time * time; 261 + 260 262 case Easing.Out: 261 263 case Easing.OutQuad: 262 264 return time * (2 - time); 265 + 263 266 case Easing.InOutQuad: 264 267 if (time < .5) return time * time * 2; 265 268 ··· 267 270 268 271 case Easing.InCubic: 269 272 return time * time * time; 273 + 270 274 case Easing.OutCubic: 271 275 return --time * time * time + 1; 276 + 272 277 case Easing.InOutCubic: 273 278 if (time < .5) return time * time * time * 4; 274 279 ··· 276 281 277 282 case Easing.InQuart: 278 283 return time * time * time * time; 284 + 279 285 case Easing.OutQuart: 280 286 return 1 - --time * time * time * time; 287 + 281 288 case Easing.InOutQuart: 282 289 if (time < .5) return time * time * time * time * 8; 283 290 ··· 285 292 286 293 case Easing.InQuint: 287 294 return time * time * time * time * time; 295 + 288 296 case Easing.OutQuint: 289 297 return --time * time * time * time * time + 1; 298 + 290 299 case Easing.InOutQuint: 291 300 if (time < .5) return time * time * time * time * time * 16; 292 301 ··· 294 303 295 304 case Easing.InSine: 296 305 return 1 - Math.Cos(time * Math.PI * .5); 306 + 297 307 case Easing.OutSine: 298 308 return Math.Sin(time * Math.PI * .5); 309 + 299 310 case Easing.InOutSine: 300 311 return .5 - .5 * Math.Cos(Math.PI * time); 301 312 302 313 case Easing.InExpo: 303 314 return Math.Pow(2, 10 * (time - 1)); 315 + 304 316 case Easing.OutExpo: 305 317 return -Math.Pow(2, -10 * time) + 1; 318 + 306 319 case Easing.InOutExpo: 307 320 if (time < .5) return .5 * Math.Pow(2, 20 * time - 10); 308 321 ··· 310 323 311 324 case Easing.InCirc: 312 325 return 1 - Math.Sqrt(1 - time * time); 326 + 313 327 case Easing.OutCirc: 314 328 return Math.Sqrt(1 - --time * time); 329 + 315 330 case Easing.InOutCirc: 316 331 if ((time *= 2) < 1) return .5 - .5 * Math.Sqrt(1 - time * time); 317 332 ··· 319 334 320 335 case Easing.InElastic: 321 336 return -Math.Pow(2, -10 + 10 * time) * Math.Sin((1 - elastic_const2 - time) * elastic_const); 337 + 322 338 case Easing.OutElastic: 323 339 return Math.Pow(2, -10 * time) * Math.Sin((time - elastic_const2) * elastic_const) + 1; 340 + 324 341 case Easing.OutElasticHalf: 325 342 return Math.Pow(2, -10 * time) * Math.Sin((.5 * time - elastic_const2) * elastic_const) + 1; 343 + 326 344 case Easing.OutElasticQuarter: 327 345 return Math.Pow(2, -10 * time) * Math.Sin((.25 * time - elastic_const2) * elastic_const) + 1; 346 + 328 347 case Easing.InOutElastic: 329 348 if ((time *= 2) < 1) 330 349 return -.5 * Math.Pow(2, -10 + 10 * time) * Math.Sin((1 - elastic_const2 * 1.5 - time) * elastic_const / 1.5); ··· 333 352 334 353 case Easing.InBack: 335 354 return time * time * ((back_const + 1) * time - back_const); 355 + 336 356 case Easing.OutBack: 337 357 return --time * time * ((back_const + 1) * time + back_const) + 1; 358 + 338 359 case Easing.InOutBack: 339 360 if ((time *= 2) < 1) return .5 * time * time * ((back_const2 + 1) * time - back_const2); 340 361 ··· 350 371 return 1 - (7.5625 * (time -= 2.25 * bounce_const) * time + .9375); 351 372 352 373 return 1 - (7.5625 * (time -= 2.625 * bounce_const) * time + .984375); 374 + 353 375 case Easing.OutBounce: 354 376 if (time < bounce_const) 355 377 return 7.5625 * time * time; ··· 359 381 return 7.5625 * (time -= 2.25 * bounce_const) * time + .9375; 360 382 361 383 return 7.5625 * (time -= 2.625 * bounce_const) * time + .984375; 384 + 362 385 case Easing.InOutBounce: 363 386 if (time < .5) return .5 - .5 * ApplyEasing(Easing.OutBounce, 1 - time * 2); 364 387
+4
osu.Framework/MathUtils/PathApproximator.cs
··· 52 52 while (toFlatten.Count > 0) 53 53 { 54 54 Vector2[] parent = toFlatten.Pop(); 55 + 55 56 if (bezierIsFlatEnough(parent)) 56 57 { 57 58 // If the control points we currently operate on are sufficiently "flat", we use ··· 155 156 // AC B lies. 156 157 Vector2 orthoAtoC = c - a; 157 158 orthoAtoC = new Vector2(orthoAtoC.Y, -orthoAtoC.X); 159 + 158 160 if (Vector2.Dot(orthoAtoC, b - a) < 0) 159 161 { 160 162 dir = -dir; ··· 211 213 212 214 float minX = controlPoints[0].X; 213 215 float maxX = controlPoints[0].X; 216 + 214 217 for (int i = 1; i < controlPoints.Length; i++) 215 218 { 216 219 minX = Math.Min(minX, controlPoints[i].X); ··· 293 296 l[count + i] = r[i + 1]; 294 297 295 298 output.Add(controlPoints[0]); 299 + 296 300 for (int i = 1; i < count - 1; ++i) 297 301 { 298 302 int index = 2 * i;
+3
osu.Framework/Physics/RigidBodyContainer.cs
··· 127 127 float usableLength = Math.Max(length - 2 * cornerRadius, 0); 128 128 129 129 Vector2 normal = (b - a).PerpendicularRight.Normalized(); 130 + 130 131 for (int j = 0; j < amount_side_steps; ++j) 131 132 { 132 133 Vertices.Add(a + dir * (cornerRadius + j * usableLength / (amount_side_steps - 1))); ··· 135 136 } 136 137 137 138 const int amount_corner_steps = 10; 139 + 138 140 if (cornerRadius > 0) 139 141 { 140 142 // Rounded corners ··· 207 209 return false; 208 210 209 211 bool didCollide = false; 212 + 210 213 for (int i = 0; i < Vertices.Count; ++i) 211 214 { 212 215 if (other.BodyContains(Vector2Extensions.Transform(Vertices[i], SimulationToScreenSpace)))
+4
osu.Framework/Platform/DesktopGameWindow.cs
··· 176 176 case Input.ConfineMouseMode.Fullscreen: 177 177 confine = WindowMode.Value != Configuration.WindowMode.Windowed; 178 178 break; 179 + 179 180 case Input.ConfineMouseMode.Always: 180 181 confine = true; 181 182 break; ··· 202 203 try 203 204 { 204 205 inWindowModeTransition = true; 206 + 205 207 switch (newMode) 206 208 { 207 209 case Configuration.WindowMode.Fullscreen: ··· 210 212 211 213 WindowState = WindowState.Fullscreen; 212 214 break; 215 + 213 216 case Configuration.WindowMode.Borderless: 214 217 if (lastFullscreenDisplay != null) 215 218 RestoreResolution(lastFullscreenDisplay); ··· 222 225 ClientSize = new Size(currentDisplay.Bounds.Width + 1, currentDisplay.Bounds.Height + 1); 223 226 Location = currentDisplay.Bounds.Location; 224 227 break; 228 + 225 229 case Configuration.WindowMode.Windowed: 226 230 if (lastFullscreenDisplay != null) 227 231 RestoreResolution(lastFullscreenDisplay);
+5
osu.Framework/Platform/GameHost.cs
··· 552 552 h.Dispose(); 553 553 554 554 AvailableInputHandlers = CreateAvailableInputHandlers(); 555 + 555 556 foreach (var handler in AvailableInputHandlers) 556 557 { 557 558 if (!handler.Initialize(this)) ··· 693 694 drawLimiter = int.MaxValue; 694 695 updateLimiter *= 2; 695 696 break; 697 + 696 698 case FrameSync.Limit2x: 697 699 drawLimiter *= 2; 698 700 updateLimiter *= 2; 699 701 break; 702 + 700 703 case FrameSync.Limit4x: 701 704 drawLimiter *= 4; 702 705 updateLimiter *= 4; 703 706 break; 707 + 704 708 case FrameSync.Limit8x: 705 709 drawLimiter *= 8; 706 710 updateLimiter *= 8; 707 711 break; 712 + 708 713 case FrameSync.Unlimited: 709 714 drawLimiter = updateLimiter = int.MaxValue; 710 715 break;
+2
osu.Framework/Platform/GameWindow.cs
··· 249 249 case Configuration.WindowMode.Windowed: 250 250 currentValue = Configuration.WindowMode.Borderless; 251 251 break; 252 + 252 253 case Configuration.WindowMode.Borderless: 253 254 currentValue = Configuration.WindowMode.Fullscreen; 254 255 break; 256 + 255 257 case Configuration.WindowMode.Fullscreen: 256 258 currentValue = Configuration.WindowMode.Windowed; 257 259 break;
+1
osu.Framework/Platform/Linux/Native/Library.cs
··· 22 22 public static void Load(string library, LoadFlags flags) 23 23 { 24 24 var paths = (string)AppContext.GetData("NATIVE_DLL_SEARCH_DIRECTORIES"); 25 + 25 26 foreach (var path in paths.Split(':')) 26 27 { 27 28 if (dlopen(Path.Combine(path, library), flags) != IntPtr.Zero)
+1
osu.Framework/Platform/MacOS/MacOSGameWindow.cs
··· 130 130 { 131 131 // update the window mode if we have an update queued 132 132 WindowMode? mode = pendingWindowMode; 133 + 133 134 if (mode.HasValue) 134 135 { 135 136 pendingWindowMode = null;
+1
osu.Framework/Platform/NativeStorage.cs
··· 79 79 if (!File.Exists(path)) return null; 80 80 81 81 return File.Open(path, FileMode.Open, access, FileShare.Read); 82 + 82 83 default: 83 84 return File.Open(path, mode, access); 84 85 }
+3
osu.Framework/Platform/TcpIpcProvider.cs
··· 25 25 public bool Bind() 26 26 { 27 27 listener = new TcpListener(IPAddress.Loopback, ipc_port); 28 + 28 29 try 29 30 { 30 31 listener.Start(); ··· 45 46 public async Task StartAsync() 46 47 { 47 48 var token = cancelListener.Token; 49 + 48 50 try 49 51 { 50 52 while (!token.IsCancellationRequested) ··· 101 103 using (var client = new TcpClient()) 102 104 { 103 105 await client.ConnectAsync(IPAddress.Loopback, ipc_port); 106 + 104 107 using (var stream = client.GetStream()) 105 108 { 106 109 var str = JsonConvert.SerializeObject(message, Formatting.None);
+1
osu.Framework/Platform/Windows/Native/IconGroup.cs
··· 83 83 { 84 84 int requested = Math.Min(width, height); 85 85 int closest = -1; 86 + 86 87 for (int i = 0; i < iconDir.Count; i++) 87 88 { 88 89 var entry = iconDir.Entries[i];
+1
osu.Framework/RuntimeInfo.cs
··· 51 51 if (OS == Platform.Windows) 52 52 { 53 53 IntPtr hModule = GetModuleHandle(@"ntdll.dll"); 54 + 54 55 if (hModule == IntPtr.Zero) 55 56 IsWine = false; 56 57 else
+4
osu.Framework/Screens/IScreen.cs
··· 94 94 case null: 95 95 onFail?.Invoke(); 96 96 return; 97 + 97 98 case ScreenStack stack: 98 99 onRoot(stack); 99 100 break; 101 + 100 102 default: 101 103 runOnRoot(current.Parent, onRoot, onFail); 102 104 break; ··· 112 114 return onFail.Invoke(); 113 115 114 116 return default; 117 + 115 118 case ScreenStack stack: 116 119 return onRoot(stack); 120 + 117 121 default: 118 122 return runOnRoot(current.Parent, onRoot, onFail); 119 123 }
+1
osu.Framework/Statistics/PerformanceMonitor.cs
··· 120 120 for (int i = 0; i < lastAmountGarbageCollects.Length; ++i) 121 121 { 122 122 int amountCollections = GC.CollectionCount(i); 123 + 123 124 if (lastAmountGarbageCollects[i] != amountCollections) 124 125 { 125 126 lastAmountGarbageCollects[i] = amountCollections;
+2
osu.Framework/Testing/DrawFrameRecordingContainer.cs
··· 41 41 currentFrame.Value = currentFrame.MaxValue = 0; 42 42 43 43 return base.GenerateDrawNodeSubtree(frame, treeIndex, forceNewDrawNode); 44 + 44 45 case RecordState.Recording: 45 46 var node = base.GenerateDrawNodeSubtree(frame, treeIndex, true); 46 47 ··· 50 51 currentFrame.Value = currentFrame.MaxValue = recordedFrames.Count - 1; 51 52 52 53 return node; 54 + 53 55 case RecordState.Stopped: 54 56 return recordedFrames[currentFrame.Value]; 55 57 }
+2
osu.Framework/Testing/Drawables/Sections/ToolbarRecordSection.cs
··· 109 109 recordButton.Text = "record"; 110 110 playbackControls.Hide(); 111 111 break; 112 + 112 113 case RecordState.Recording: 113 114 recordButton.Text = "stop"; 114 115 playbackControls.Hide(); 115 116 break; 117 + 116 118 case RecordState.Stopped: 117 119 recordButton.Text = "reset"; 118 120 playbackControls.Show();
+1
osu.Framework/Testing/Drawables/TestSceneButton.cs
··· 83 83 text.AddText(TestScene.RemovePrefix(test.Name)); 84 84 85 85 var description = test.GetCustomAttribute<DescriptionAttribute>()?.Description; 86 + 86 87 if (description != null) 87 88 { 88 89 text.NewLine();
+2
osu.Framework/Testing/Input/ManualInputManager.cs
··· 177 177 case MouseButton.Left: 178 178 left.FadeIn(); 179 179 break; 180 + 180 181 case MouseButton.Right: 181 182 right.FadeIn(); 182 183 break; ··· 193 194 case MouseButton.Left: 194 195 left.FadeOut(500); 195 196 break; 197 + 196 198 case MouseButton.Right: 197 199 right.FadeOut(500); 198 200 break;
+3
osu.Framework/Testing/TestBrowser.cs
··· 236 236 backgroundCompiler.CompilationStarted += compileStarted; 237 237 backgroundCompiler.CompilationFinished += compileFinished; 238 238 backgroundCompiler.CompilationFailed += compileFailed; 239 + 239 240 try 240 241 { 241 242 backgroundCompiler.Start(); ··· 353 354 if (leftContainer.Width == 0) toggleTestList(); 354 355 GetContainingInputManager().ChangeFocus(searchTextBox); 355 356 return true; 357 + 356 358 case TestBrowserAction.Reload: 357 359 LoadTest(CurrentTest.GetType()); 358 360 return true; 361 + 359 362 case TestBrowserAction.ToggleTestList: 360 363 toggleTestList(); 361 364 return true;
+1
osu.Framework/Testing/TestScene.cs
··· 46 46 throw new InvalidCastException($"The test runner must be a {nameof(Game)}."); 47 47 48 48 runTask = Task.Factory.StartNew(() => host.Run(game), TaskCreationOptions.LongRunning); 49 + 49 50 while (!game.IsLoaded) 50 51 { 51 52 checkForErrors();