SLUDGE: Implement Crossfade transition

This completes all the transition modes
This commit is contained in:
Eugene Sandulenko 2021-05-16 18:44:55 +02:00
parent 4af234930d
commit 7d5788836d
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 6 additions and 36 deletions

View File

@ -192,6 +192,7 @@ public:
void transitionTV();
void transitionBlinds();
void transitionSnapshotBox();
void transitionCrossFader();
private:
SludgeEngine *_vm;

View File

@ -48,43 +48,12 @@ void GraphicsManager::transitionFader() {
blendColor(&_renderSurface, TS_ARGB(br, 255, 255, 255), Graphics::BLEND_MULTIPLY);
}
void transitionCrossFader() {
#if 0
if (! snapshotTextureName) return;
void GraphicsManager::transitionCrossFader() {
if (!_snapshotSurface.getPixels())
return;
glBindTexture(GL_TEXTURE_2D, snapshotTextureName);
glEnable(GL_BLEND);
const GLfloat vertices[] = {
0.f, (GLfloat)winHeight, 0.f,
(GLfloat)winWidth, (GLfloat)winHeight, 0.f,
0.f, 0.f, 0.f,
(GLfloat)winWidth, 0.f, 0.f
};
const GLfloat texCoords[] = {
0.0f, snapTexH,
snapTexW, snapTexH,
0.0f, 0.0f,
snapTexW, 0.0f
};
glUseProgram(shader.texture);
setPMVMatrix(shader.texture);
glUniform1i(glGetUniformLocation(shader.texture, "modulateColor"), 1);
setPrimaryColor(1.0f, 1.0f, 1.0f, 1.0f - brightnessLevel / 255.f);
drawQuad(shader.texture, vertices, 1, texCoords);
glUniform1i(glGetUniformLocation(shader.texture, "modulateColor"), 0);
glUseProgram(0);
glDisable(GL_BLEND);
#endif
Graphics::TransparentSurface tmp(_snapshotSurface, false);
tmp.blit(_renderSurface, 0, 0, Graphics::FLIP_NONE, nullptr, TS_ARGB(255 - _brightnessLevel, 0xff, 0xff, 0xff));
}
void GraphicsManager::transitionSnapshotBox() {