idTech4.Renderer.idImage.ActuallyLoadImage C# (CSharp) Метод

ActuallyLoadImage() публичный Метод

Absolutely every image goes through this path. On exit, the idImage will have a valid OpenGL texture number that can be bound.
public ActuallyLoadImage ( bool checkForPrecompressed, bool fromBackEnd ) : void
checkForPrecompressed bool
fromBackEnd bool
Результат void
		public void ActuallyLoadImage(bool checkForPrecompressed, bool fromBackEnd)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			// this is the ONLY place generatorFunction will ever be called
			if(_generator != null)
			{
				_generator(this);
				return;
			}
						 
			//
			// load the image from disk
			//
			if(_cubeFiles != Renderer.CubeFiles.TwoD)
			{
				idConsole.Warning("TODO: cube files");
				/*byte	*pics[6];

				// we don't check for pre-compressed cube images currently
				R_LoadCubeImages( imgName, cubeFiles, pics, &width, &timestamp );

				if ( pics[0] == NULL ) {
					common->Warning( "Couldn't load cube image: %s", imgName.c_str() );
					MakeDefault();
					return;
				}

				GenerateCubeImage( (const byte **)pics, width, filter, allowDownSize, depth );
				precompressedFile = false;

				for ( int i = 0 ; i < 6 ; i++ ) {
					if ( pics[i] ) {
						R_StaticFree( pics[i] );
					}
				}*/
			}
			else
			{
				_texture = idE.ImageManager.LoadImageProgram(this.Name, ref _timeStamp, ref _depth);
					   
				if(_texture == null)
				{
					idConsole.Warning("Couldn't load image: {0}", this.Name);
					MakeDefault();

					return;
				}

				_width = _texture.Width;
				_height = _texture.Height;
			}
		}