4 //INFO: I only care about \n and \0 and the col if in wrapped mode
5 vector( string pText, vector pLast ) Util_GetEndOfLine =
12 lChar = substring( pText, pLast_x, 1 );
14 // newline -> the current char isnt valid
16 // the next valid is char can only be after the \n
17 pLast_y = pLast_x + 1;
20 } else if( lChar == "" ) {
30 vector( string pText, vector pLast, float pWrapLength ) Util_GetEndOfWrappedLine =
36 lChar = substring( pText, pLast_x, 1 );
38 // newline -> the current char isnt valid
41 // the next valid char can only be after the \n
42 pLast_y = pLast_x + 2;
44 } else if( lChar == "" ) {
50 if( !--pWrapLength ) {
51 // the current char is one too much
60 string( float pValue, float pStep ) Util_FloatToClampedText =
63 local float lClampedStep;
64 local float lInverseClamped;
65 lClampedStep = pStep - floor( pStep );
66 if( lClampedStep == 0.0 )
67 return ftos( pValue );
68 // get the integer length
69 lLen = strlen( ftos( floor( pValue ) ) );
70 // Example data: 0.1 -> 10 - 1 = 9; 0.9 -> 1.^1 - 0.1 = 1.0^1 ; 0.01 -> 100 - 1 = 99 ; 0.09 -> 11.^1 - 0.1 = 10.0^1
71 lInverseClamped = 1.0 / lClampedStep - 0.1;
72 // add the fraction length and 1 for the .
73 lLen += strlen( ftos( floor( lInverseClamped ) ) ) + 1;
74 return substring( ftos( pValue + 0.0001 ), 0, lLen );