Revision 1280161

Go back to digest for 19th February 2012

Optimization in Games

Parker Coates committed changes in /trunk/KDE/kdegames/kpat:

Rewrite the state saving and restoring code to be diff based.

Previously, KPat stored the state of every single card for every state
in its undo/redo history. Since the vast majority of moves involve less
than 10 cards and a decent percentage involve only one, this approach
is obviously quite inefficient.

As of this commit, KPat now stores only the old and new states of each
card that has been altered since the last move. This is both more
processor and memory friendly, which is great, but it also opens the
door to creating a new saved game format that stores the entire game
history.

DIGEST:

File Changes

Modified 3 files
  • /trunk/KDE/kdegames/kpat
  •   /dealer.cpp
  •   /dealer.h
  •   /gamestate.h
3 files changed in total