Skip to content

Flipfuncpointers (take two)

toaster requested to merge flipfuncpointers-master into master

Minor optimisations surrounding R_DrawFlippedMaskedColumn.

  • Replace the texheight parameter provided directly to it with a previously existing (now renamed) global used for the same purpose, so that it can be used as an interchangeable function pointer with R_DrawMaskedColumn.
  • Using the above, optimise R_DrawVisSprite to call a function pointer in a tighter loop rather than check SC_VFLIP each time around.
  • SHORT macro can involve repeated operations; calculate once and put in memory for both RANGECHECK and papersprite.
  • Remove irrelevant range check (already covered by existing range check immediately above) from R_DrawFlippedMaskedColumn and R_DrawMaskedColumn.
  • "Warning: avoiding a crash in %s %d" is a terrible error message, and it chips away at the tightness of the loop just for something most people will never see printed. Replace with a PARANOIA I_Error in case someone actively wants to go hunting for its cause.

srb2win_flipfuncpointers.exe

Take two because I originally wrote this as !673 (closed) months ago, but accidentially did a bad merge while working on it which polluted its diff forever. This cherry pick is much cleaner, and can go directly into master.

Merge request reports