But I think it would be better from encapsulation perspective if the line in hw_drawinfo.cpp would be
- Code: Select all • Expand view
applySSAO = mCurrentPortal->AllowSSAO();
while the line in hw_portal.cpp be
- Code: Select all • Expand view
bool HWSkyboxPortal::AllowSSAO() { return !!(Level->flags3 & LEVEL3_SKYBOXAO); } // [MK] sector skyboxes don't allow SSAO by default
Right now you made the global "all portals" code check for "AllowSSAO()" from any portal subclass, but if it says no, you decide to ignore that if the skybox flag is on.
It would "feel more right" if the skybox subclass specifically returned true/false in response to the flag, and the main render code let each subclass decide for itself.
Would be future-proof for hypothetical other portal subclass which might want to control SSAO in response to a different flag or whatever other reason.
That said I'm not sure if Level is accessible in the latter file (or can be made accessible without problems)?