diff options
| author | SushiTee <weichel.sascha@xxx.xx> | 2011-07-12 05:26:52 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-07-15 00:39:37 +0200 |
| commit | a3fec2f9f384f82ec631bbfc43bce456b20a2e0e (patch) | |
| tree | 727d599cb0ea141c79e59f871a6b48816aeab93e | |
| parent | 5058ec732febfafd7eb9819df19072ed863dfed8 (diff) | |
| download | zcatch-a3fec2f9f384f82ec631bbfc43bce456b20a2e0e.tar.gz zcatch-a3fec2f9f384f82ec631bbfc43bce456b20a2e0e.zip | |
fixed clipping on some machines
| -rw-r--r-- | src/engine/client/graphics.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/engine/client/graphics.cpp b/src/engine/client/graphics.cpp index 76fd3400..d1f0b8a8 100644 --- a/src/engine/client/graphics.cpp +++ b/src/engine/client/graphics.cpp @@ -179,7 +179,16 @@ CGraphics_OpenGL::CGraphics_OpenGL() void CGraphics_OpenGL::ClipEnable(int x, int y, int w, int h) { - //if(no_gfx) return; + if(x < 0) + w += x; + if(y < 0) + h += y; + + x = clamp(x, 0, ScreenWidth()); + y = clamp(y, 0, ScreenHeight()); + w = clamp(w, 0, ScreenWidth()-x); + h = clamp(h, 0, ScreenHeight()-y); + glScissor(x, ScreenHeight()-(y+h), w, h); glEnable(GL_SCISSOR_TEST); } |