idTech4.Renderer.idImageManager.SetNormalPalette C# (CSharp) Метод

SetNormalPalette() приватный Метод

private SetNormalPalette ( ) : void
Результат void
		private void SetNormalPalette()
		{
			idConsole.Warning("TODO: SetNormalPalette");
			/*int		i, j;
			idVec3	v;
			float	t;
			//byte temptable[768];
			byte	*temptable = compressedPalette;
			int		compressedToOriginal[16];

			// make an ad-hoc separable compression mapping scheme
			for ( i = 0 ; i < 8 ; i++ ) {
				float	f, y;

				f = ( i + 1 ) / 8.5;
				y = idMath::Sqrt( 1.0 - f * f );
				y = 1.0 - y;

				compressedToOriginal[7-i] = 127 - (int)( y * 127 + 0.5 );
				compressedToOriginal[8+i] = 128 + (int)( y * 127 + 0.5 );
			}

			for ( i = 0 ; i < 256 ; i++ ) {
				if ( i <= compressedToOriginal[0] ) {
					originalToCompressed[i] = 0;
				} else if ( i >= compressedToOriginal[15] ) {
					originalToCompressed[i] = 15;
				} else {
					for ( j = 0 ; j < 14 ; j++ ) {
						if ( i <= compressedToOriginal[j+1] ) {
							break;
						}
					}
					if ( i - compressedToOriginal[j] < compressedToOriginal[j+1] - i ) {
						originalToCompressed[i] = j;
					} else {
						originalToCompressed[i] = j + 1;
					}
				}
			}

		#if 0
			for ( i = 0; i < 16; i++ ) {
				for ( j = 0 ; j < 16 ; j++ ) {

					v[0] = ( i - 7.5 ) / 8;
					v[1] = ( j - 7.5 ) / 8;

					t = 1.0 - ( v[0]*v[0] + v[1]*v[1] );
					if ( t < 0 ) {
						t = 0;
					}
					v[2] = idMath::Sqrt( t );

					temptable[(i*16+j)*3+0] = 128 + floor( 127 * v[0] + 0.5 );
					temptable[(i*16+j)*3+1] = 128 + floor( 127 * v[1] );
					temptable[(i*16+j)*3+2] = 128 + floor( 127 * v[2] );
				}
			}
		#else
			for ( i = 0; i < 16; i++ ) {
				for ( j = 0 ; j < 16 ; j++ ) {

					v[0] = ( compressedToOriginal[i] - 127.5 ) / 128;
					v[1] = ( compressedToOriginal[j] - 127.5 ) / 128;

					t = 1.0 - ( v[0]*v[0] + v[1]*v[1] );
					if ( t < 0 ) {
						t = 0;
					}
					v[2] = idMath::Sqrt( t );

					temptable[(i*16+j)*3+0] = (byte)(128 + floor( 127 * v[0] + 0.5 ));
					temptable[(i*16+j)*3+1] = (byte)(128 + floor( 127 * v[1] ));
					temptable[(i*16+j)*3+2] = (byte)(128 + floor( 127 * v[2] ));
				}
			}
		#endif

			// color 255 will be the "nullnormal" color for no reflection
			temptable[255*3+0] =
			temptable[255*3+1] =
			temptable[255*3+2] = 128;

			if ( !glConfig.sharedTexturePaletteAvailable ) {
				return;
			}

			qglColorTableEXT( GL_SHARED_TEXTURE_PALETTE_EXT,
							   GL_RGB,
							   256,
							   GL_RGB,
							   GL_UNSIGNED_BYTE,
							   temptable );

			qglEnable( GL_SHARED_TEXTURE_PALETTE_EXT );*/
		}