X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=curves.c;h=ba7e129ab6d8b41774147bd074e9d58e91d06584;hb=f8515f8060b9024dfb15c18648f49050485e9bd5;hp=894683815db222e07be9490c9b4784fca6782595;hpb=0619dfeb4e6713b3cc9c0ab1585e29234a9b4aa3;p=xonotic%2Fdarkplaces.git diff --git a/curves.c b/curves.c index 89468381..ba7e129a 100644 --- a/curves.c +++ b/curves.c @@ -140,14 +140,14 @@ static int Q3PatchTesselation(float largestsquared3xcurvearea, float tolerance) { float f; // f is actually a squared 2x curve area... so the formula had to be adjusted to give roughly the same subdivisions - f = pow(largestsquared3xcurvearea / 64.0, 0.25) / tolerance; + f = pow(largestsquared3xcurvearea / 64.0f, 0.25f) / tolerance; //if(f < 0.25) // VERY flat patches if(f < 0.0001) // TOTALLY flat patches return 0; else if(f < 2) return 1; else - return (int) floor(log(f) / log(2)) + 1; + return (int) floor(log(f) / log(2.0f)) + 1; // this is always at least 2 // maps [0.25..0.5[ to -1 (actually, 1 is returned) // maps [0.5..1[ to 0 (actually, 1 is returned)