-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renderer refactoring - Renderables #3286
Conversation
This change makes the cache pretty upset :( |
@chrisforbes : for the uninformed, explain? On Wed, May 15, 2013 at 2:51 PM, Chris Forbes notifications@github.comwrote:
|
@cjshmyr: He means that putting a pile of virtual function calls in the hot path of the renderer wasn't the smartest idea performance wise... |
The Red Alert Destroyer and Cruiser turrets are mis-aligned. |
Red Alert Flak Truk turret is also mis-aligned. |
Thanks for the report @Mailaender. Sounds like custom turret offsets are busted in general. |
Animations (via Actor.CenterPosition) now understand Altitude, so there is potential for mis-positioned animations if any existing altitude hacks were missed.
Now uses world coordinates and properly displays cargo at all facings.
Updated to fix the turret offset issue. |
👍 but I'd like @cjshmyr to take a look as well. |
👍 |
One glitch remaining: turrets are rendered on top of the RA weapon factory while they are spawning inside. |
Whoops, that was introduced by the turret offset fix. Fixed in f7aca32. |
One minor rendering regression left: aircraft shadows are not drawn over regular buildings. They just vanish which looks slightly glitchy. Repair bay and heli pad work however. |
Could you also please move the flak truk turret a little more towards the front again. It seems to be just few pixels, but I noticed the difference and the gap looks strange. |
Fixed. The flak truck turret was mispositioned by only 1px when facing south. |
The flak truk turret is rendered on top of the weapon factory and there are rendering glitches with boats, their turrets and naval production buildings also in regard to rendering order. |
Fixed. These edge cases are a PITA, but I'd rather solve them now than later. |
Renderer refactoring - Renderables
I noticed that those edge cases exist in RA2.exe as shadows of trees are not properly rendered upon walls etc. and I also get SHP overlay glitches in Tiberian Sun with explosions so it seems we are already better than the original in this regard. Good work. 👍 |
This streamlines the creation and drawing of Renderables, dropping a lot of accumlated cruft and adding support for alternative renderable types in the future (voxels, laser zaps, range circles).
Renderables have been generalized from additional Sprite state to an interface describing "something that can draw itself", positioned using world coordinates.
I've tested that the common cases display properly, but I there may be edge cases i've missed - resulting in offset sprites or incorrect draw orders.