OpenDingux / gmenu2x

A menu system for embedded devices, originally developed for the GP2X
http://mtorromeo.github.com/gmenu2x/
GNU General Public License v2.0
15 stars 25 forks source link

Improve and fix caching of text surfaces #5

Closed glebm closed 4 years ago

glebm commented 4 years ago
  1. Fixes text caching for links.
  2. Implements text caching for section titles.
  3. Cleanups to make this easier.
pcercuei commented 4 years ago

The changes look OK, but you cram several unrelated things inside one big commit without a description. This does not only "invalidate text surfaces on font change". Please try to separate the various atomic improvements into their own commits, it will be much easier for us to review the PR. Thanks!

glebm commented 4 years ago

@pcercuei This PR is only 130 lines, it shouldn't be difficult to review at all. I'd rather spend my time on something more impactful.

Explanation of related changes:

  1. initFont and Font changed so that we may know when the font has actually changed (this way we don't renderer if a skin changed but the font didn't).

  2. Link constructor had undefined behaviour (not initializing rect.x and rect.y), redundantly created surfaces. Cleaned it up while I was at it.

pcercuei commented 4 years ago

If you do several changes then just have several commits. Don't put everything into a big one.

And put the explanation in the commit messages.

glebm commented 4 years ago

Done

pcercuei commented 4 years ago

Looks much better, thanks.

Please sign all the commits so that I can merge them.

glebm commented 4 years ago

Done