dump*(fname) to become friend method
mkmkme opened this issue · comments
Currently Graphics24Bit::dumpClut
and Font::dumpAs
have two problems:
- Those are public functions that simply dump all information to the file, which is fine for test, but not great API-wise
- Those functions are the only reason to include SDL-specific stuff in those source files. The tests using those already include SDL, no need to do that in these files.
To resolve that, just declare those functions as friend
functions for the corresponding classes. It is still an anti-pattern, but it will definitely be nicer from the API perspective and code readability.