OpenRA/OpenRA — pull request #5406 by RoosterDragon (2014-05-23 09:23:46+00:00)
Title: Changed HardwarePalette.ApplyModifiers to be more efficient.

It will no longer copy the dictionaries or palettes every time, saving significantly on allocations.
Non modifiable palettes are copied to the buffer when they are added, rather than having to be done repeatedly in ApplyModifiers.
The palettesModified flag tracks if the current texture represents unmodified palettes. If it does and no modifications are made then it doesn't have to update the texture at all and can bail early. This is often the case because the paletteMods sequence is usually empty.