refactor: Move FreeImage into separate project
PR Details
As the name suggests my PR separates FreeImage wrapper from TextureWrapper project just for sake of #2689 to prevent circular dependencies error. I've also changed namespace styling.
Types of changes
- [x] Docs change / refactoring / dependency upgrade
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [ ] My change requires a change to the documentation.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [x] I have built and run the editor to try this change out.
~~I'm not sure but seems like my new Stride.FreeImage package doesn't include the runtimes folder with freeimage.dll :( . If anyone has an idea what is wrong I would appreciate it~~
Pr is ready for review, I tested the changes using the JumpyJet project. No regression so far 😄
I did a quick rebuild with the following steps:
- git clean -xfd
- dotnet clean
- rebuild
And it seems to have broken the Test projects but I can confirm the GameStudio seems to run as expected.
[AssetCompiler] Exception in command [DdsMaskBC3] Stride.Assets.Textures.TextureConvertParameters: Stride.TextureConverter.TextureToolsException: Loading dds file D:/dev/GitControlledProjects/stride/sources/data/tests/SmallDdsMaskBC3.dds failed: E_FAIL
Im wondering if there is a reference to the new project missed for the tests somewhere?
Oh that's because my branch is not up-to-date. One moment please hah
@Doprez There you go
That seems to have fixed! Looks like everything is working on my end.
I did get a new crash but it seems unrelated to your changes but Ill log it here just in case:
Exception: ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.ThreadLocal`1[[Stride.Core.MicroThreading.MicroThread, Stride.Core.MicroThreading, Version=4.2.0.1, Culture=neutral, PublicKeyToken=null]]'.
at System.Threading.ThreadLocal`1.GetValueSlow()
at Stride.Core.MicroThreading.Scheduler.get_RunningMicroThread() in D:\dev\GitControlledProjects\stride\sources\core\Stride.Core.MicroThreading\Scheduler.cs:line 79
at Stride.Core.MicroThreading.MicroThreadSynchronizationContext.Post(SendOrPostCallback d, Object state) in D:\dev\GitControlledProjects\stride\sources\core\Stride.Core.MicroThreading\MicroThreadSynchronizationContext.cs:line 29
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(ContextCallback callback, Object state, Task& currentTask)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
Log: 1: BasicCameraController(0,0): []: Fatal: The asset BasicCameraController is missing or incorrectly indexed in the package. Please report this issue.
2: MyGameApp(0,0): []: Fatal: The asset MyGameApp is missing or incorrectly indexed in the package. Please report this issue.
It looks like a threading issue due to incorrectly disposed assets so I think you're fine for this PR, likely just an existing issue.
Okay, so my PR is now ready for review. I also used git mv to make my changes more transparent 😅
LGTM.
Just FYI git mv doesn't change in any way how files are renamed. It's just a nice wrapper that stages the file after renaming it.
Actually I had to move GetFormatParameters(...) method to avoid circular dependency issue for Stride.csproj project
The last change is failing the build. Is it necessary?
Looks like not necessarily, I have already rolled back the change
Hadn't noticed this one, thanks for the contribution @Jklawreszuk !