Skip to content

Commit

Permalink
Merge pull request #386 from peppy/general-fixes
Browse files Browse the repository at this point in the history
Framework updates.
  • Loading branch information
peppy authored Feb 23, 2017
2 parents f812641 + f153879 commit 5076ff7
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 34 deletions.
2 changes: 1 addition & 1 deletion osu-framework
Submodule osu-framework updated 73 files
+2 −2 SampleGame/Program.cs
+1 −1 SampleGame/SampleGame.cs
+2 −2 osu.Framework.Desktop/Input/GameWindowTextInput.cs
+1 −1 osu.Framework.Desktop/Input/Handlers/Keyboard/OpenTKKeyboardHandler.cs
+1 −1 osu.Framework.Desktop/Input/Handlers/Mouse/OpenTKMouseHandler.cs
+2 −2 osu.Framework.Desktop/Platform/DesktopGameHost.cs
+122 −7 osu.Framework.Desktop/Platform/DesktopGameWindow.cs
+1 −1 osu.Framework.Desktop/Platform/DesktopStorage.cs
+1 −1 osu.Framework.Desktop/Platform/TcpIpcProvider.cs
+2 −2 osu.Framework.VisualTests/Benchmark.cs
+1 −1 osu.Framework.VisualTests/Program.cs
+1 −1 osu.Framework.VisualTests/Tests/TestCaseAutosize.cs
+2 −2 osu.Framework.VisualTests/Tests/TestCaseOnlineTextures.cs
+71 −1 osu.Framework.VisualTests/Tests/TestCaseTextBox.cs
+1 −1 osu.Framework.VisualTests/VisualTestGame.cs
+4 −2 osu.Framework/Allocation/DependencyContainer.cs
+2 −1 osu.Framework/Allocation/InvokeOnDisposal.cs
+2 −1 osu.Framework/Audio/AudioComponent.cs
+1 −1 osu.Framework/Audio/AudioManager.cs
+6 −3 osu.Framework/Audio/Sample/SampleChannel.cs
+5 −3 osu.Framework/Audio/Track/Track.cs
+2 −2 osu.Framework/Audio/Track/TrackBass.cs
+4 −2 osu.Framework/Audio/Track/TrackManager.cs
+3 −3 osu.Framework/Caching/Cached.cs
+2 −1 osu.Framework/Configuration/BindableDouble.cs
+2 −1 osu.Framework/Configuration/BindableInt.cs
+2 −1 osu.Framework/Configuration/BindableLong.cs
+21 −37 osu.Framework/Configuration/BindableNumber.cs
+2 −2 osu.Framework/Configuration/ConfigManager.cs
+8 −4 osu.Framework/Configuration/FrameworkConfigManager.cs
+12 −0 osu.Framework/Configuration/WindowMode.cs
+2 −2 osu.Framework/DebugUtils/ThreadSafety.cs
+2 −1 osu.Framework/Extensions/Color4Extensions/Color4Extensions.cs
+22 −18 osu.Framework/Game.cs
+1 −1 osu.Framework/Graphics/Batches/VertexBatch.cs
+6 −5 osu.Framework/Graphics/Colour/ColourInfo.cs
+3 −2 osu.Framework/Graphics/Containers/BufferedContainer.cs
+1 −1 osu.Framework/Graphics/Containers/CircularContainer.cs
+17 −22 osu.Framework/Graphics/Containers/Container.cs
+13 −8 osu.Framework/Graphics/Containers/Container_AutoSize.cs
+11 −3 osu.Framework/Graphics/Containers/ScrollContainer.cs
+75 −0 osu.Framework/Graphics/Containers/TabbableContainer.cs
+2 −2 osu.Framework/Graphics/DrawInfo.cs
+80 −56 osu.Framework/Graphics/Drawable.cs
+2 −1 osu.Framework/Graphics/Drawable_Interaction.cs
+24 −57 osu.Framework/Graphics/Drawable_TransformationHelpers.cs
+4 −2 osu.Framework/Graphics/OpenGL/Buffers/VertexBuffer.cs
+8 −8 osu.Framework/Graphics/OpenGL/GLWrapper.cs
+21 −31 osu.Framework/Graphics/OpenGL/Textures/TextureGLSingle.cs
+6 −4 osu.Framework/Graphics/OpenGL/Textures/TextureGLSub.cs
+1 −1 osu.Framework/Graphics/Performance/FrameStatisticsDisplay.cs
+2 −1 osu.Framework/Graphics/Shaders/Shader.cs
+2 −2 osu.Framework/Graphics/Shaders/ShaderPart.cs
+3 −4 osu.Framework/Graphics/Sprites/Sprite.cs
+4 −11 osu.Framework/Graphics/Textures/Texture.cs
+3 −5 osu.Framework/Graphics/UserInterface/TextBox.cs
+1 −1 osu.Framework/Graphics/Visualisation/DrawVisualiser.cs
+6 −5 osu.Framework/IO/AsyncBufferStream.cs
+0 −1 osu.Framework/IO/File/FileSafety.cs
+5 −6 osu.Framework/IO/Network/WebRequest.cs
+1 −1 osu.Framework/Input/Handlers/InputHandler.cs
+1 −1 osu.Framework/Input/InputManager.cs
+2 −2 osu.Framework/Input/UserInputManager.cs
+3 −3 osu.Framework/Lists/SortedList.cs
+4 −2 osu.Framework/MathUtils/Interpolation.cs
+56 −29 osu.Framework/Platform/GameHost.cs
+8 −11 osu.Framework/Platform/GameWindow.cs
+2 −2 osu.Framework/Platform/Storage.cs
+6 −4 osu.Framework/Screens/Screen.cs
+2 −2 osu.Framework/Screens/Testing/TestBrowser.cs
+1 −1 osu.Framework/Statistics/FrameStatistics.cs
+1 −1 osu.Framework/Timing/ThrottledFrameClock.cs
+7 −5 osu.Framework/osu.Framework.csproj
2 changes: 1 addition & 1 deletion osu.Desktop.VisualTests/Benchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Benchmark : OsuGameBase
private double timePerTest = 200;

[BackgroundDependencyLoader]
private void load(BaseGame game)
private void load(Framework.Game game)
{
Host.MaximumDrawHz = int.MaxValue;
Host.MaximumUpdateHz = int.MaxValue;
Expand Down
2 changes: 1 addition & 1 deletion osu.Desktop.VisualTests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Main(string[] args)
{
bool benchmark = args.Length > 0 && args[0] == @"-benchmark";

using (BasicGameHost host = Host.GetSuitableHost(@"osu"))
using (GameHost host = Host.GetSuitableHost(@"osu"))
{
Ruleset.Register(new OsuRuleset());
Ruleset.Register(new TaikoRuleset());
Expand Down
2 changes: 1 addition & 1 deletion osu.Desktop/OsuGameDesktop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected override void LoadComplete()
};
}

public override void SetHost(BasicGameHost host)
public override void SetHost(GameHost host)
{
base.SetHost(host);
var desktopWindow = host.Window as DesktopGameWindow;
Expand Down
8 changes: 1 addition & 7 deletions osu.Desktop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@

using System;
using System.IO;
using System.Linq;
using System.Threading;
using osu.Desktop.Beatmaps.IO;
using osu.Framework;
using osu.Framework.Desktop;
using osu.Framework.Desktop.Platform;
using osu.Framework.Platform;
using osu.Game;
using osu.Game.IPC;
using osu.Game.Modes;
using osu.Game.Modes.Catch;
Expand Down Expand Up @@ -51,8 +46,7 @@ public static int Main(string[] args)
Ruleset.Register(new ManiaRuleset());
Ruleset.Register(new CatchRuleset());

BaseGame osu = new OsuGameDesktop(args);
host.Add(osu);
host.Add(new OsuGameDesktop(args));
host.Run();
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void TestImportOverIPC()
}
}

private OsuGameBase loadOsu(BasicGameHost host)
private OsuGameBase loadOsu(GameHost host)
{
var osu = new OsuGameBase();
host.Add(osu);
Expand Down
6 changes: 3 additions & 3 deletions osu.Game/Beatmaps/IO/ArchiveReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ public abstract class ArchiveReader : IDisposable, IResourceStore<byte[]>
{
private class Reader
{
public Func<BasicStorage, string, bool> Test { get; set; }
public Func<Storage, string, bool> Test { get; set; }
public Type Type { get; set; }
}

private static List<Reader> readers { get; } = new List<Reader>();

public static ArchiveReader GetReader(BasicStorage storage, string path)
public static ArchiveReader GetReader(Storage storage, string path)
{
foreach (var reader in readers)
{
Expand All @@ -30,7 +30,7 @@ public static ArchiveReader GetReader(BasicStorage storage, string path)
throw new IOException(@"Unknown file format");
}

protected static void AddReader<T>(Func<BasicStorage, string, bool> test) where T : ArchiveReader
protected static void AddReader<T>(Func<Storage, string, bool> test) where T : ArchiveReader
{
readers.Add(new Reader { Test = test, Type = typeof(T) });
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Configuration/OsuConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ protected override void InitialiseDefaults()
public string GetUnicodeString(string nonunicode, string unicode)
=> Get<bool>(OsuConfig.ShowUnicode) ? unicode ?? nonunicode : nonunicode ?? unicode;

public OsuConfigManager(BasicStorage storage) : base(storage)
public OsuConfigManager(Storage storage) : base(storage)
{
}
}
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Database/BeatmapDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ namespace osu.Game.Database
public class BeatmapDatabase
{
private SQLiteConnection connection { get; set; }
private BasicStorage storage;
private Storage storage;
public event Action<BeatmapSetInfo> BeatmapSetAdded;

private BeatmapImporter ipc;

public BeatmapDatabase(BasicStorage storage, BasicGameHost importHost = null)
public BeatmapDatabase(Storage storage, GameHost importHost = null)
{
this.storage = storage;

Expand Down
2 changes: 1 addition & 1 deletion osu.Game/IPC/BeatmapImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class BeatmapImporter
private IpcChannel<BeatmapImportMessage> channel;
private BeatmapDatabase beatmaps;

public BeatmapImporter(BasicGameHost host, BeatmapDatabase beatmaps = null)
public BeatmapImporter(GameHost host, BeatmapDatabase beatmaps = null)
{
this.beatmaps = beatmaps;

Expand Down
4 changes: 2 additions & 2 deletions osu.Game/OsuGameBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace osu.Game
{
public class OsuGameBase : BaseGame, IOnlineComponent
public class OsuGameBase : Framework.Game, IOnlineComponent
{
protected OsuConfigManager LocalConfig;

Expand Down Expand Up @@ -101,7 +101,7 @@ protected override void LoadComplete()
});
}

public override void SetHost(BasicGameHost host)
public override void SetHost(GameHost host)
{
if (LocalConfig == null)
LocalConfig = new OsuConfigManager(host.Storage);
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Overlays/MusicController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class MusicController : FocusedOverlayContainer
private Bindable<bool> preferUnicode;
private WorkingBeatmap current;
private BeatmapDatabase beatmaps;
private BaseGame game;
private Framework.Game game;

private Container dragContainer;

Expand Down Expand Up @@ -322,7 +322,7 @@ private void play(BeatmapInfo info, bool isNext)
updateDisplay(current, isNext ? TransformDirection.Next : TransformDirection.Prev);
}

protected override void PerformLoad(BaseGame game)
protected override void PerformLoad(Framework.Game game)
{
this.game = game;
base.PerformLoad(game);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class UpdateOptions : OptionsSubsection
protected override string Header => "Updates";

[BackgroundDependencyLoader]
private void load(BasicStorage storage, OsuConfigManager config)
private void load(Storage storage, OsuConfigManager config)
{
Children = new Drawable[]
{
Expand Down
6 changes: 3 additions & 3 deletions osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ private void load(FrameworkConfigManager config)
Children = new Drawable[]
{
new OptionLabel { Text = "Resolution: TODO dropdown" },
new OsuCheckbox
new OptionEnumDropDown<WindowMode>
{
LabelText = "Fullscreen mode",
Bindable = config.GetBindable<bool>(FrameworkConfig.Fullscreen),
LabelText = "Screen mode",
Bindable = config.GetBindable<WindowMode>(FrameworkConfig.WindowMode),
},
new OsuCheckbox
{
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Screens/BackgroundScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
return false;
}

BaseGame game;
Framework.Game game;

[BackgroundDependencyLoader]
private void load(BaseGame game)
private void load(Framework.Game game)
{
this.game = game;
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace osu.Game.Screens.Backgrounds
public class BackgroundScreenDefault : BackgroundScreen
{
[BackgroundDependencyLoader]
private void load(BaseGame game)
private void load(Framework.Game game)
{
Add(new Background(@"Backgrounds/bg1"));
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/PlayerInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace osu.Game.Screens.Play
{
class PlayerInputManager : UserInputManager
{
public PlayerInputManager(BasicGameHost host)
public PlayerInputManager(GameHost host)
: base(host)
{
}
Expand Down
6 changes: 3 additions & 3 deletions osu.Game/Screens/Select/PlaySongSelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class PlaySongSelect : OsuScreen
FilterControl filter;

[BackgroundDependencyLoader(permitNulls: true)]
private void load(BeatmapDatabase beatmaps, AudioManager audio, BaseGame game,
private void load(BeatmapDatabase beatmaps, AudioManager audio, Framework.Game game,
OsuGame osuGame, OsuColour colours)
{
const float carousel_width = 640;
Expand Down Expand Up @@ -317,7 +317,7 @@ private void ensurePlayingSelected(bool preview = false)
}
}

private void addBeatmapSet(BeatmapSetInfo beatmapSet, BaseGame game, bool select = false)
private void addBeatmapSet(BeatmapSetInfo beatmapSet, Framework.Game game, bool select = false)
{
beatmapSet = database.GetWithChildren<BeatmapSetInfo>(beatmapSet.ID);
beatmapSet.Beatmaps.ForEach(b =>
Expand Down Expand Up @@ -357,7 +357,7 @@ private void addBeatmapSet(BeatmapSetInfo beatmapSet, BaseGame game, bool select
}));
}

private void addBeatmapSets(BaseGame game, CancellationToken token)
private void addBeatmapSets(Framework.Game game, CancellationToken token)
{
foreach (var beatmapSet in database.Query<BeatmapSetInfo>())
{
Expand Down

0 comments on commit 5076ff7

Please sign in to comment.