Skip to content
Snippets Groups Projects

Colormap code cleanup

Merged Monster Iestyn requested to merge colormap-code-cleanup into master

If anyone ever looked into the code that is used to create colormaps from linedef type 606, they'll know that there are in fact two functions that do mostly the same thing: R_CreateColormap, which is called first for each sidedef with the colormap special, and then R_CreateColormap2 which is called afterwards via R_MakeColormaps and redoes everything the first function did (with the addition of some extra stuff needed for software mode).

It turns out R_CreateColormap2 (and therefore R_MakeColormaps as well) is entirely unnecessary! I have therefore removed said function(s), and adding anything exclusive to it to R_CreateColormap.

This should hopefully make the colormap generation code a lot saner for SRB2 coders to understand now. Hopefully there should be no visible difference in either software or OpenGL, I've not found any myself from the tests I made.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Contributor

    +1, straightforward, makes sense how it's set up and accessed. I didn't see how the delayed R_CreateColormap2 makes a difference, so this is well.

    One suggestion, and this is non-blocking, is to move the extra_colormap->rgba parsing from P_LoadRawSideDefs2 to R_CreateColormap. Doesn't matter to me either way, though. I'm just doing that myself for a more extensive colormap overhaul. Probably doesn't matter for the goal of removing R_CreateColormap2.

  • Contributor

    I had noticed this in the past actually. The code changes look sensible and I never saw a difference between those functions other than the one not doing something, in the past anyway.

  • Monster Iestyn mentioned in commit 1199a5f9

    mentioned in commit 1199a5f9

Please register or sign in to reply
Loading