|
From: Elias N. <eli...@us...> - 2004-03-27 12:06:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6869/src/java/org/lwjgl Modified Files: Display.java Log Message: Replaced asserts with proper runtime exceptions Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- Display.java 15 Feb 2004 21:45:03 -0000 1.40 +++ Display.java 27 Mar 2004 11:55:05 -0000 1.41 @@ -196,8 +196,10 @@ * @param contrast The contrast, larger than 0.0. */ public static void setDisplayConfiguration(float gamma, float brightness, float contrast) throws Exception { - assert brightness >= -1.0f && brightness <= 1.0f; - assert contrast >= 0.0f; + if (brightness < -1.0f || brightness > 1.0f) + throw new IllegalArgumentException("Invalid brightness value"); + if (contrast < 0.0f) + throw new IllegalArgumentException("Invalid contrast value"); int rampSize = getGammaRampLength(); if (rampSize == 0) { throw new Exception("Display configuration not supported"); |