Skip to content

Commit

Permalink
[Editor] - Integrated new file system
Browse files Browse the repository at this point in the history
- Integrated new file system so the editor will compile and remove dependency on old file system code.
- Clean up.
  • Loading branch information
Tape-Worm committed Jan 4, 2025
1 parent 8623a96 commit 6c6dd25
Show file tree
Hide file tree
Showing 126 changed files with 2,440 additions and 2,902 deletions.
78 changes: 39 additions & 39 deletions Examples/ExamplesCommon/FormMain.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.Core/Example002/formMain.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.Core/Example003/formMain.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.Core/Example003/formSplash.resx

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions Examples/Gorgon.Editor/Gorgon.Editor.FileSystem/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
using Gorgon.Graphics;
using Gorgon.Graphics.Core;
using Gorgon.IO;
using Gorgon.IO.Providers;
using Gorgon.IO.FileSystem;
using Gorgon.IO.FileSystem.Providers;
using Gorgon.PlugIns;
using Gorgon.Renderers;
using Gorgon.Timing;
Expand All @@ -57,7 +58,7 @@ static class Program
// The loader used to read content from the editor file system.
private static IGorgonContentLoader _contentLoader;
// The file system for the editor.
private static IGorgonFileSystemV3 _fileSystem;
private static IGorgonFileSystem _fileSystem;
// The sprite to draw on the screen.
private static GorgonSprite _dudeBro;
private static GorgonSprite _dudeBroReflect;
Expand All @@ -74,7 +75,7 @@ static class Program
/// Function to load the Gorgon pack file provider plugin.
/// </summary>
/// <returns>The file system provider.</returns>
private static IGorgonFileSystemProviderV3 LoadGorPackProvider()
private static IGorgonFileSystemProvider LoadGorPackProvider()
{
// The Gorgon packed file provider plug-in dll.
const string gorPackDll = "Gorgon.FileSystem.GorPack.dll";
Expand All @@ -84,7 +85,7 @@ private static IGorgonFileSystemProviderV3 LoadGorPackProvider()
// Like the zip file example, we'll just create the plugin infrastructure, grab the provider object
// and get rid of the plugin stuff since we won't need it again.
_assemblyCache = new GorgonMefPlugInCache(GorgonApplication.Log);
IGorgonFileSystemProviderFactoryV3 factory = new GorgonFileSystemProviderFactoryV3(_assemblyCache);
IGorgonFileSystemProviderFactory factory = new GorgonFileSystemProviderFactory(_assemblyCache);

return factory.CreateProvider(Path.Combine(GorgonExample.GetPlugInPath().FullName, gorPackDll), gorPackPlugInName);
}
Expand Down Expand Up @@ -141,11 +142,11 @@ private static async Task InitializeAsync(FormMain window)
window.UpdateStatus("Loading plugins...");

// Load in the plug-in that will allow us to read a packed file system.
IGorgonFileSystemProviderV3 provider = await Task.Run(LoadGorPackProvider);
IGorgonFileSystemProvider provider = await Task.Run(LoadGorPackProvider);

// Load the file system.
_fileSystem = new GorgonFileSystemV3(provider);
_fileSystem.Mount(Path.Combine(GorgonExample.GetResourcePath("FileSystems").FullName, "Gorgon.Editor.FileSystem.gorPack"));
_fileSystem = new GorgonFileSystem();
_fileSystem.Mount(Path.Combine(GorgonExample.GetResourcePath("FileSystems").FullName, "Gorgon.Editor.FileSystem.gorPack"), provider: provider);

window.UpdateStatus("Initializing graphics...");
IReadOnlyList<IGorgonVideoAdapterInfo> videoDevices = await Task.Run(() => GorgonGraphics.EnumerateAdapters(log: GorgonApplication.Log));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
using Gorgon.Graphics.Imaging;
using Gorgon.Graphics.Imaging.GdiPlus;
using Gorgon.IO;
using Gorgon.IO.FileSystem;
using Microsoft.IO;

namespace Gorgon.Examples;
Expand Down Expand Up @@ -295,7 +296,7 @@ protected override void OnRegisterSearchKeywords<T>(ISearchService<T> searchServ
/// The <paramref name="scratchArea" /> parameter is the file system where temporary files to store transitory information for the plug-in is stored. This file system is destroyed when the
/// application or plug-in is shut down, and is not stored with the project.
/// </remarks>
protected async override Task<IEditorContent> OnOpenContentAsync(IContentFile file, IContentFileManager fileManager, IGorgonFileSystemWriterV3<Stream> scratchArea, IUndoService undoService)
protected async override Task<IEditorContent> OnOpenContentAsync(IContentFile file, IContentFileManager fileManager, IGorgonFileSystem scratchArea, IUndoService undoService)
{
// This is the method that actually does all the work of setting up the content for editing.
//
Expand Down

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.FileSystem/BZipFileSystemOPower/Form.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.FileSystem/FolderFileSystemOPower/Form.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.FileSystem/MultiSource/Form.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.FileSystem/Writing/Form.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.Graphics/CodecPlugIn/Form.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.Graphics/GlassCube/Form.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.Graphics/Images/Form.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.Graphics/SobelComputeEngine/Form.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.Input/InputDevices/Form.resx

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions Examples/Gorgon.Input/XInput/Form.resx

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions Examples/Gorgon.Renderers.2D/Depth/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
using Gorgon.Graphics;
using Gorgon.Graphics.Core;
using Gorgon.IO;
using Gorgon.IO.Providers;
using Gorgon.IO.FileSystem;
using Gorgon.IO.FileSystem.Providers;
using Gorgon.PlugIns;
using Gorgon.Renderers;
using Gorgon.Timing;
Expand Down Expand Up @@ -367,9 +368,9 @@ private static async Task InitializeAsync(FormMain window)
_assemblyCache = new GorgonMefPlugInCache(GorgonApplication.Log);

// Load the file system containing our application data (sprites, images, etc...)
IGorgonFileSystemProviderFactoryV3 providerFactory = new GorgonFileSystemProviderFactoryV3(_assemblyCache, GorgonApplication.Log);
IGorgonFileSystemProviderV3 provider = providerFactory.CreateProvider(Path.Combine(GorgonExample.GetPlugInPath().FullName, "Gorgon.FileSystem.GorPack.dll"), "Gorgon.IO.GorPack.GorPackProvider");
IGorgonFileSystemV3 fileSystem = new GorgonFileSystemV3(provider, GorgonApplication.Log);
IGorgonFileSystemProviderFactory providerFactory = new GorgonFileSystemProviderFactory(_assemblyCache, GorgonApplication.Log);
IGorgonFileSystemProvider provider = providerFactory.CreateProvider(Path.Combine(GorgonExample.GetPlugInPath().FullName, "Gorgon.FileSystem.GorPack.dll"), "Gorgon.IO.GorPack.GorPackProvider");
IGorgonFileSystem fileSystem = new GorgonFileSystem(GorgonApplication.Log);

// We can load the editor file system directly.
// This is handy for switching a production environment where your data may be stored
Expand All @@ -378,11 +379,11 @@ private static async Task InitializeAsync(FormMain window)
// fileSystem.Mount(@"D:\unpak\scratch\DeepAsAPuddle.gorPack\fs\");

// For now though, we'll load the packed file.
fileSystem.Mount(Path.Combine(GorgonExample.GetResourcePath(@"FileSystems").FullName, "Depth.gorPack"));
fileSystem.Mount(Path.Combine(GorgonExample.GetResourcePath(@"FileSystems").FullName, "Depth.gorPack"), provider: provider);

// Get our sprites. These make up the frames of animation for our Guy.
// If and when there's an animation editor, we'll only need to create a single sprite and load the animation.
IGorgonVirtualFileV3[] spriteFiles = fileSystem.FindFiles("/Sprites/", "*", true).ToArray();
IGorgonVirtualFile[] spriteFiles = fileSystem.FindFiles("/Sprites/", "*", true).ToArray();

_textureCache = new GorgonTextureCache<GorgonTexture2D>(_graphics);

Expand All @@ -393,7 +394,7 @@ private static async Task InitializeAsync(FormMain window)

for (int i = 0; i < spriteFiles.Length; i++)
{
IGorgonVirtualFileV3 file = spriteFiles[i];
IGorgonVirtualFile file = spriteFiles[i];
GorgonSprite sprite = await loader.LoadSpriteAsync(file.FullPath);

// At super duper resolution, the example graphics would be really hard to see, so we'll scale them up.
Expand Down
Loading

0 comments on commit 6c6dd25

Please sign in to comment.