-
Notifications
You must be signed in to change notification settings - Fork 161
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
Reimplement fade effects outside of GraphicsDriver classes #2223
Reimplement fade effects outside of GraphicsDriver classes #2223
Conversation
99ee717
to
febcf10
Compare
This specifically has and additional benefit of reducing the amount of things in the graphics driver - say a new graphic driver is written for Metal, Vulkan, or for an accelerated SDL renderer, this is one less thing to implement. |
febcf10
to
4404360
Compare
While testing this found and fixed several cases in the "render target" feature which was introduced for GUI in 3.6.0. These should be applied to 3.6.1 regardless of this pr. |
dc2d6ba
to
fcbc19d
Compare
A note to self, following need to be changed:
|
c9cde61
to
a57d593
Compare
In general, this is done and may be tested (I will convert from draft when 3.6.1 is fixed in a separate release branch). Had to do some changes to OpenGL and Direct3D classes, necessary for implementing rendering whole game on a any arbitrary texture. That also simplified code in few places. For example, I removed "native-res buffer" creation and deletion from D3D/OGL driver classes and replaced that with a common DDB object, because there's a function for creating a texture for rendering on it since 3.6.0. |
949d521
to
765fb7d
Compare
765fb7d
to
00d470e
Compare
Reimplemented each effect in screen.cpp, with a set of screen_effect_*() functions as transition "interface". Bring them to certain level of consistency in how they render and update frame. Removed FadeIn(), FadeOut() and BoxOutEffect() methods from IGraphicsDriver, and respective implementations. Removed redundant callbacks from gfx drivers. Mark GameState.no_hicolor_fadein flag as deprecated, as it's purely an optimization, and should perhaps be a part of engine config rather than a part of script API.
Use existing DDB class to work with native render target.
00d470e
to
17aedd6
Compare
This is for #1349 (one of the preliminary steps), but also a proper thing to do.
Targets ags3, but I may redo in ags4 too. In theory it would be nice to have #1349 done in ags3, because that impacts Emscripten performance (according to @ericoporto ), but completing it will take a while. This is just a first step.
If done for ags3, I'd postpone merging this until after 3.6.1 is released anyway, for safety.
In this PR:
PS. Reimplementing transition effects is done as one big commit, but these functions are purely graphic animation which has no effect on game logic (sans setting
screen_is_faded_out
flag), so I think it's okay to do in a batch.