Making editors is a pain. I have a list of thousands of items I'd rather do than this - yet I made myself a promise to drag at least one full featured editor tool over the finish line. There are few reasons for that:
- I believe I have quite useful engine, it was my pet project all these years, it went through many transformations and stages - and solid tool is something like a goal I'd like to do with it, to make it something better than "just a framework".
- I'm very patient person, and I believe also hard working one. Throughout the years my goal is to make a game on my own engine (note, I've made games with other engines and I've used my engine for multiple non-game projects so far -> it eventually branched to be a full-featured commercial project in past few years). I've made few attempts but mostly was stopped by lacking such tool - that would allow me to build scenes and levels, in an easy way.
- And the most important one ... I consider tools one of the hardest part in making any larger project, so it is something like a challenge for me.
Anyways so much for motivation, the tool is progressing well - it can be used to assemble scene so far, various entities (like light or materials) can have their properties (components) modified, with full undo/redo system of course. And so the next big part was ahead of me - asset loading and dynamic reloading. So here are the results:
Engine editor and texture editor before my work on the texture.
And then I worked on the texture:
And after I used my highly professional programmer-art skills to modify the texture! All credits for GameDev.net logo go to its author!
Yes, it's working. The whole system needs a bit of cleanup - but in short this is how it works:
- All textures are managed by Manager<Texture> class instance, this one is defined in Editor class
- There is a thread waiting for change on hard drive with ReadDirectoryChangesW
- Upon change in directory (or subdirectories), DirectoryTree class instance is notified. It updates view in bottom left (which is just a directory-file structure for watched directory and subdirectories), and also for modified/new files creates or reloads records in Manager<Texture> class instance (on Editor level)
- The trick is, reloading the records can only be done while they're not in use (so some clever synchronization needs to be done)
I might write out some interesting information or even short article on this. Implementing it was quite a pain, but it's finally done. Now short cleanup - and towards the next one on my editor todo list!
Thanks for reading & see you around!