From 97e65a2a35c1fa6dddece5d5fef51ec5c06435f5 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Fri, 13 Nov 2009 10:35:43 -0800 Subject: Make sure texture coordinates and angles don't get too big, since eventually we'll hit some limit in the driver and things start to look weird. --- res/raw/clouds.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/res/raw/clouds.rs b/res/raw/clouds.rs index a468cfb..2d867e9 100644 --- a/res/raw/clouds.rs +++ b/res/raw/clouds.rs @@ -94,6 +94,12 @@ void drawClouds(float* ident) { xshift[4] += 0.00127f; } + // Make sure the texture coordinates don't continuously increase + for(i = 0; i < 5; i++) { + while (xshift[i] >= 1.f) { + xshift[i] -= 1.f; + } + } if (State->mRotate != 0) { rotation[0] += 0.10; rotation[1] += 0.102f; @@ -101,6 +107,13 @@ void drawClouds(float* ident) { rotation[3] += 0.114f; rotation[4] += 0.123f; } + + // Make sure the rotation angles don't continuously increase + for(i = 0; i < 5; i++) { + while (rotation[i] >= 360.f) { + rotation[i] -= 360.f; + } + } } int premul(int rgb, int a) { -- cgit v1.2.3