@@ -2474,45 +2474,6 @@ static void R_CreateDefaultImage()
24742474 tr.defaultImage = R_CreateImage ( " _default" , ( const byte ** ) &dataPtr, DEFAULT_SIZE, DEFAULT_SIZE, 1 , imageParams );
24752475}
24762476
2477- static void R_CreateRandomNormalsImage ()
2478- {
2479- int x, y;
2480- byte data[ DEFAULT_SIZE ][ DEFAULT_SIZE ][ 4 ];
2481- // the default image will be a box, to allow you to see the mapping coordinates
2482- memset (data, 32 , sizeof (data));
2483-
2484- byte *ptr = &data[0 ][0 ][0 ];
2485- byte *dataPtr = &data[0 ][0 ][0 ];
2486-
2487- for ( y = 0 ; y < DEFAULT_SIZE; y++ )
2488- {
2489- for ( x = 0 ; x < DEFAULT_SIZE; x++ )
2490- {
2491- vec3_t n;
2492- float r, angle;
2493-
2494- r = random ();
2495- angle = 2 .0f * M_PI * r; // / 360.0f;
2496-
2497- VectorSet ( n, cosf ( angle ), sinf ( angle ), r );
2498- VectorNormalize ( n );
2499-
2500- ptr[ 0 ] = ( byte )( 128 + 127 * n[ 0 ] );
2501- ptr[ 1 ] = ( byte )( 128 + 127 * n[ 1 ] );
2502- ptr[ 2 ] = ( byte )( 128 + 127 * n[ 2 ] );
2503- ptr[ 3 ] = 255 ;
2504- ptr += 4 ;
2505- }
2506- }
2507-
2508- imageParams_t imageParams = {};
2509- imageParams.bits = IF_NOPICMIP;
2510- imageParams.filterType = filterType_t::FT_DEFAULT;
2511- imageParams.wrapType = wrapTypeEnum_t::WT_REPEAT;
2512-
2513- tr.randomNormalsImage = R_CreateImage ( " _randomNormals" , ( const byte ** ) &dataPtr, DEFAULT_SIZE, DEFAULT_SIZE, 1 , imageParams );
2514- }
2515-
25162477static void R_CreateContrastRenderFBOImage ()
25172478{
25182479 if ( !glConfig2.bloom )
@@ -2749,12 +2710,10 @@ R_CreateBuiltinImages
27492710*/
27502711void R_CreateBuiltinImages ()
27512712{
2752- int x, y ;
2713+ int x;
27532714 byte data[ DEFAULT_SIZE ][ DEFAULT_SIZE ][ 4 ];
27542715 byte *dataPtr = &data[0 ][0 ][0 ];
27552716 byte *out;
2756- float s, value;
2757- byte intensity;
27582717
27592718 R_CreateDefaultImage ();
27602719
@@ -2819,30 +2778,6 @@ void R_CreateBuiltinImages()
28192778 image = R_CreateImage ( " _cinematic" , ( const byte ** ) &dataPtr, 1 , 1 , 1 , imageParams );
28202779 }
28212780
2822- out = &data[ 0 ][ 0 ][ 0 ];
2823-
2824- for ( y = 0 ; y < DEFAULT_SIZE; y++ )
2825- {
2826- for ( x = 0 ; x < DEFAULT_SIZE; x++, out += 4 )
2827- {
2828- s = ( ( ( float ) x + 0 .5f ) * ( 2 .0f / DEFAULT_SIZE ) - 1 .0f );
2829-
2830- s = Q_fabs ( s ) - ( 1 .0f / DEFAULT_SIZE );
2831-
2832- value = 1 .0f - ( s * 2 .0f ) + ( s * s );
2833-
2834- intensity = ClampByte ( Q_ftol ( value * 255 .0f ) );
2835-
2836- out[ 0 ] = intensity;
2837- out[ 1 ] = intensity;
2838- out[ 2 ] = intensity;
2839- out[ 3 ] = intensity;
2840- }
2841- }
2842-
2843- tr.quadraticImage = R_CreateImage ( " _quadratic" , ( const byte ** ) &dataPtr, DEFAULT_SIZE, DEFAULT_SIZE, 1 , imageParams );
2844-
2845- R_CreateRandomNormalsImage ();
28462781 R_CreateFogImage ();
28472782 R_CreateContrastRenderFBOImage ();
28482783 R_CreateBloomRenderFBOImages ();
0 commit comments