From ba59c1c5b01b7d2eabfe78a60723336886ad786f Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 13 Oct 2008 13:43:03 +0000 Subject: [PATCH] clamp shadow rect git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2997 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/rendercubes.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/src/rendercubes.cpp b/source/src/rendercubes.cpp index fae99fad..49997f17 100644 --- a/source/src/rendercubes.cpp +++ b/source/src/rendercubes.cpp @@ -452,6 +452,11 @@ static void rendershadow_flatdelta(int x, int y, float h1, float h2, float h3, f void rendershadow(int x, int y, int xs, int ys) { + x = max(x, 0); + y = max(y, 0); + xs = min(xs, ssize-1); + ys = min(ys, ssize-1); + resetshadowverts(); #define df(x) s->floor-(x->vdelta/4.0f)