Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Source code organisation
- - By Günther [de] Date 2009-05-21 22:32
At the moment, the engine source code is split into four directories: engine/src, engine/inc, standard/src, standard/inc. There is not much, if any, logic left in that organisation. The main difference is that C++ classes in the latter half tend to have "Std" in their name, despite not being standard in any way. Most of the plattform abstraction code and some helper functions are in the second half, and most dependencies are only from "engine" to "standard", so it helps a little with maintenance. But other plattform abstractions and important helper functions are in engine. And engine is getting too big.

Has anybody a suggestion on a new prefix for classnames? Std is just stupid. (And no namespaces, please, they just make grepping harder.)

I think we need to further split the code. I can think of these categories: plattform abstraction, helper/library functions, GUI code, network, game logic, and scripting. To make these categories useful, a category should not depend on categories which depend on the category. This means that there is a limit to splitting, my list is probably already too long.

And do we still need those "inc" and "src" directories? They are useful if being in "inc" means that third party code will have access to the files, but we are not writing a library here, and having the header and corresponding source code right next to each other is more convenient.
Reply
Parent - By Carli [de] Date 2009-05-22 08:32
i think we should at first include the used Std-Sources into the engine and remove Standard-Project (as i did it in my C::B-Port)
then we could sort the files into the following categorys:
-common/helpers
-abstract graphics GL/DX implementations
-abstract Windows/Linux/Mac implementations
-GUI
-Network
-Loading
-Game
-Scripts

please copy this list and change what you would do on an other way

>And do we still need those "inc" and "src" directories?


no
Parent - - By Günther [de] Date 2009-08-03 21:28
I made a quick pass through all files and put them in the categories I mentioned. If some other engine developers could take a look at it and correct any mistakes, I'll move the files later. Afterwards, we can begin to enforce the separations. http://wiki.openclonk.org/w/SourceCodeReorganization
Reply
Parent - - By Günther [de] Date 2009-08-07 20:11
I implemented this and pushed it here: http://bitbucket.org/guenther/openclonk/changeset/7c7271801523/
If nobody objects, I'll push it to hg.openclonk.org soon.
Reply
Parent - - By Newton [es] Date 2009-08-07 20:47
I appreciate this :-) - even though I can't say so much to that because I don't know my way around in the source.
Parent - By Günther [de] Date 2009-08-07 21:26 Edited 2009-08-07 21:29
Well, if you still don't know your way around the source after this patch, it either doesn't help or isn't enough in that regard...

It's still a worthwhile thing to do though, because we can start to enforce internal boundaries in the source, which will improve interface design and make maintenance easier.
Reply
Parent - By Günther [de] Date 2009-08-10 17:20
Done. (Though I redid the commit because the rename information was lost. Mercurial really should not depend on those if it's going to loose it by a simple transplant.)
Reply
Up Topic Development / Developer's Corner / Source code organisation

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill