Browse files

Fixed ambient lightings along with shake effects.

An unlit border could be seen before.
  • Loading branch information...
1 parent 0320929 commit 82843de9c4a2d2dd37c2a85c397e53c4c6c06b6a Yohann Ferreira committed Dec 21, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/engine/effect_supervisor.cpp
View
7 src/engine/effect_supervisor.cpp
@@ -318,8 +318,8 @@ void EffectSupervisor::DrawEffects()
VideoManager->SetCoordSys(0.0f, VIDEO_STANDARD_RES_WIDTH, 0.0f, VIDEO_STANDARD_RES_HEIGHT);
float width = _ambient_overlay_img.GetWidth();
float height = _ambient_overlay_img.GetHeight();
- for(float x = _info.overlay.x_shift; x <= 1024.0f; x = x + width) {
- for(float y = _info.overlay.y_shift; y <= 768.0f; y = y + height) {
+ for(float x = _info.overlay.x_shift; x <= VIDEO_STANDARD_RES_WIDTH; x = x + width) {
+ for(float y = _info.overlay.y_shift; y <= VIDEO_STANDARD_RES_HEIGHT; y = y + height) {
VideoManager->Move(x, y);
_ambient_overlay_img.Draw();
}
@@ -331,7 +331,8 @@ void EffectSupervisor::DrawEffects()
if(_info.light.active) {
VideoManager->PushState();
VideoManager->SetDrawFlags(VIDEO_X_LEFT, VIDEO_Y_BOTTOM, 0);
- VideoManager->SetCoordSys(0.0f, 1.0f, 0.0f, 1.0f);
+ // We use a margin to avoid making the shake effects show unlit parts
+ VideoManager->SetCoordSys(0.1f, 0.9f, 0.1f, 0.9f);
VideoManager->Move(0.0f, 0.0f);
_light_overlay_img.Draw();
VideoManager->PopState();

0 comments on commit 82843de

Please sign in to comment.