-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/check required files #490
Conversation
tbh I need to think this a bit more through. This is a step into the right direction, but this would have to be duplicated several times for other data files. And; on top of that I don't want the wiring between data files and the resource required become tightly coupled (like now). Me thinking out loud This way we can construct several So, we end up with having one The data container gets filled by some kind of construction mechanism (can now be hard-coded, but later it will be read from a This way we decouple loading from a Now, resources should be 'found' by some unique key, and that key can be an ID (
We don't need to build this whole "read resource definitions from a file" thing yet, but knowing I want to go there (for #78 ) it is good to have this abstraction somewhere. (even though we might still construct this 'resource definition' in code). So, what does this come down to? A single So somewhere in
obviously, adding a resource must check that the ID is unique. Within
And when we want to use this, we would have to have a layer that can deal with these
When we do this, we have only a few places left where we are tightly coupled to Allegro, and that is on resource loading and drawing (which are relatively easy to replace then). We could even add other file sources (ie Hope this makes sense? Wonder what you guys think (@pbomta , @Akatsuki57 ) |
If I can thinking out loud ... Yes and no.
Yes, total separation of data and program is a very good thing and I will modify my work on this PR to comply. The current code is very dependent as you point out. It's work to decouple it and it's a great thing to take on that challenge.
No, platform abstraction is not a good thing. One of the reasons I put forward is that the philosophy of the platform changes, depending on the platform. SDL2 brings the writing of textures to the GPU. If it's not to use this feature, you might as well do nothing because its whole point is to gain performance. For exemple !!! Not to do. If we have to rewrite d2tm with openGL, it will even be easy because SDL2 is very close to OpenGL but if we had to redo it in Vulkan for example, everything would have to be reviewed because Vulkan does not think like SDL2 at all and OpenGL. I'm also not saying that you absolutely have to use all the features of the target library, but at least everything that gives it its flavor, which compromises the abstraction. |
Still aloud:
|
I am not experienced with SDL2 or OpenGL, but I can't imagine having one layer of indirection to be that much of a problem? Just to be clear, I would still use direct access to all kinds of SDL objects for instance. So a |
ah yes SOLID practices; we are already working with them; unfortunately 15-18 year old me didn't when I started D2TM :D |
- as that is what it does (it validates if certain files are present) - also print out feedback when files cannot be found
- cosmetic, formatting, naming - removed unused code - moved logic to extract values into section; let calling code retrieve section first and from there retrieve properties
Need instructions for "data/gfxaudio.dat"