mkmkme / OpenGTA

OpenGTA: copy of http://ogta.fifengine.de/ (forked from madebr/OpenGTA)

Home Page:http://ogta.fifengine.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dump*(fname) to become friend method

mkmkme opened this issue · comments

Currently Graphics24Bit::dumpClut and Font::dumpAs have two problems:

  1. Those are public functions that simply dump all information to the file, which is fine for test, but not great API-wise
  2. 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.