From 2472628ee18b0862dde308470d5b977d5ae99c39 Mon Sep 17 00:00:00 2001 From: johns <> Date: Mon, 29 Jan 2001 22:42:35 +0000 Subject: [PATCH] Little rearranging. --- src/video/video.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/video/video.cpp b/src/video/video.cpp index 35fc668a6..cc8b8afe3 100644 --- a/src/video/video.cpp +++ b/src/video/video.cpp @@ -9,11 +9,10 @@ // FreeCraft - A free fantasy real time strategy game engine // /**@name video.c - The universal video functions. */ -/* -** (c) Copyright 1999,2000 by Lutz Sammer -** -** $Id$ -*/ +// +// (c) Copyright 1999-2001 by Lutz Sammer +// +// $Id$ //@{ @@ -162,14 +161,13 @@ global void SetClipping(int left,int top,int right,int bottom) if( top>bottom ) { top^=bottom; bottom^=top; top^=bottom; } if( left<0 ) left=0; + else if( left>=VideoWidth ) left=VideoWidth-1; if( top<0 ) top=0; + else if( top>=VideoHeight ) top=VideoHeight-1; if( right<0 ) right=0; + else if( right>=VideoWidth ) right=VideoWidth-1; if( bottom<0 ) bottom=0; - - if( left>=VideoWidth ) left=VideoWidth-1; - if( right>=VideoWidth ) right=VideoWidth-1; - if( bottom>=VideoHeight ) bottom=VideoHeight-1; - if( top>=VideoHeight ) top=VideoHeight-1; + else if( bottom>=VideoHeight ) bottom=VideoHeight-1; ClipX1=left; ClipY1=top;