Cleanup Direct3D State

Reporter: RobertBColton  |  Status: closed  |  Last Modified: April 23, 2019, 08:41:25 AM

This pull request cleans up so much garbage I hardly know where to begin. The first thing I was looking at was the Direct3D9 and Direct3D11 light handling. For some reason, I copied over the garbage from the OpenGL1 system when adding lights to D3D. Since GM's lighting was originally based on Direct3D's, there was no need for any of this. The GL1 system was concerned with reapplying the lights when the projection matrix is changed due to lighting being computed in eyespace. I believe the origin of the GL1 stuff I copied was polygonz. Regardless, I started by dumping it from D3D9 and D3D11.

We were also missing a cache of the device lighting material that I added in #1530. So the bug was still occurring with the managed device since Project Mario resizing a window provokes a device reset. While I was in here, I decided to clean up a bunch of the cache code too and use simpler repetitions for restoring the cached device state.

>Codecov Report

Merging #1624 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1624   +/-   ##
  Coverage   18.73%   18.73%           
  Files         171      171           
  Lines       17018    17018           
  Hits         3188     3188           
  Misses      13830    13830

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe02cb2...ed1bd34. Read the comment docs.


Closing in favor of #1636 which solves these exact same problems in a better way.
Please sign in to post comments, or you can view this issue on GitHub.