mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
SLUDGE: Implement Crossfade transition
This completes all the transition modes
This commit is contained in:
parent
4af234930d
commit
7d5788836d
@ -192,6 +192,7 @@ public:
|
||||
void transitionTV();
|
||||
void transitionBlinds();
|
||||
void transitionSnapshotBox();
|
||||
void transitionCrossFader();
|
||||
|
||||
private:
|
||||
SludgeEngine *_vm;
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user