scummvm/scummvm — pull request #192 by fingolfin (2012-02-22 21:36:49+00:00)
Title: Split common/util.h

This pull requests moves several things out of common/util.h to four new pairs of header/source files. One of the motivations for this is to reduce header interdependencies. To illustrate this, I took a look at the .deps/*.d files, to see how many files are being compiled, and how many of them depend on a certain header. Here are the numbers I got:
* total number of source files being compiled on my system: 1481
* files including common/scummsys.h: 1479
* files including common/util.h: 1363
* files including common/language.h: 1097
* files including common/platform.h: 1091
* files including common/rendermode.h: 243
* files including common/gui_options.h: 80

I hope that this alone is a good justification for this pull request. The clean logical separation of mostly unrelated features being another. Actually, one could now go further and argue that some of these should be moved from common/ to, say, engines/; this would be easy as a next step, if so desired.

Also note that gui_options is badly under-documented; this should be addressed, but that's beyond the scope of this change. Moreover, I think it is kinda badly named; "GameCapabilities" or "GameFeatures" might have been a better name. Ah well, maybe that's just me :).

Finally, note that the numbers for language.h and platform.h could probably be reduced further, but in order to keep the change small, I added includes for both of these files to engines/engine.h. If this pullrequest is accepted, I might work on refining this further.