[Scummvm-git-logs] scummvm master -> bc38a0a08c3eb48f825213738aa03fa50dfd2552
sev-
sev at scummvm.org
Fri May 14 22:10:32 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
bc38a0a08c SLUDGE: Implement FADE transition
Commit: bc38a0a08c3eb48f825213738aa03fa50dfd2552
https://github.com/scummvm/scummvm/commit/bc38a0a08c3eb48f825213738aa03fa50dfd2552
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-05-15T00:10:01+02:00
Commit Message:
SLUDGE: Implement FADE transition
Changed paths:
engines/sludge/graphics.cpp
engines/sludge/graphics.h
engines/sludge/transition.cpp
diff --git a/engines/sludge/graphics.cpp b/engines/sludge/graphics.cpp
index f61304b5e7..127affb2ed 100644
--- a/engines/sludge/graphics.cpp
+++ b/engines/sludge/graphics.cpp
@@ -157,10 +157,11 @@ bool GraphicsManager::initGfx() {
}
void GraphicsManager::display() {
- g_system->copyRectToScreen((byte *)_renderSurface.getPixels(), _renderSurface.pitch, 0, 0, _renderSurface.w, _renderSurface.h);
- g_system->updateScreen();
if (_brightnessLevel < 255)
fixBrightness();
+
+ g_system->copyRectToScreen((byte *)_renderSurface.getPixels(), _renderSurface.pitch, 0, 0, _renderSurface.w, _renderSurface.h);
+ g_system->updateScreen();
}
void GraphicsManager::clear() {
diff --git a/engines/sludge/graphics.h b/engines/sludge/graphics.h
index d702b8c3a3..dcfdfbb50d 100644
--- a/engines/sludge/graphics.h
+++ b/engines/sludge/graphics.h
@@ -186,6 +186,8 @@ public:
void fixBrightness();
void resetRandW();
+ void transitionFader();
+
private:
SludgeEngine *_vm;
diff --git a/engines/sludge/transition.cpp b/engines/sludge/transition.cpp
index eb5376b71b..8e0b56d30d 100644
--- a/engines/sludge/transition.cpp
+++ b/engines/sludge/transition.cpp
@@ -41,27 +41,10 @@ void GraphicsManager::setBrightnessLevel(int brightnessLevel) {
unsigned lastFrom, lastTo;
-void transitionFader() {
-#if 0
- glEnable(GL_BLEND);
+void GraphicsManager::transitionFader() {
+ uint br = MIN<uint>(255, _brightnessLevel);
- 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
- };
-
- glUseProgram(shader.color);
-
- setPMVMatrix(shader.color);
- setPrimaryColor(0.0f, 0.0f, 0.0f, 1.0f - brightnessLevel / 255.f);
- drawQuad(shader.color, vertices, 0);
-
- glUseProgram(0);
-
- glDisable(GL_BLEND);
-#endif
+ blendColor(&_renderSurface, TS_ARGB(br, 255, 255, 255), Graphics::BLEND_MULTIPLY);
}
void transitionCrossFader() {
More information about the Scummvm-git-logs
mailing list