1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 11:52:40 +01:00

Merge pull request #470 from husho/patch-1

Fade fix
This commit is contained in:
darkf 2018-06-03 18:11:36 -05:00 committed by GitHub
commit 070f58809e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -407,7 +407,7 @@ void GameRenderer::renderWorld(GameWorld* world, const ViewCamera& camera,
}
float fadeTimer = world->getGameTime() - world->state->fadeStart;
if ((fadeTimer < world->state->fadeTime || !world->state->fadeOut) && !world->isPaused()) {
if ((fadeTimer <= world->state->fadeTime || !world->state->fadeOut) && !world->isPaused()) {
/// @todo rewrite this render code to use renderer class
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glUseProgram(ssRectProgram);
@ -423,7 +423,7 @@ void GameRenderer::renderWorld(GameWorld* world, const ViewCamera& camera,
glBindTexture(GL_TEXTURE_2D, 0);
}
float fadeFrac = 0.f;
float fadeFrac = 1.f;
if (world->state->fadeTime > 0.f) {
fadeFrac = std::min(fadeTimer / world->state->fadeTime, 1.f);
}