home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Editor / Classes / FractalTextureFactory.uc < prev    next >
Text File  |  2003-10-22  |  1KB  |  63 lines

  1. class FractalTextureFactory extends MaterialFactory;
  2.  
  3. var() Class<FractalTexture> Class;
  4. enum EResolution
  5. {
  6.     Pixels_1,
  7.     Pixels_2,
  8.     Pixels_4,
  9.     Pixels_8,
  10.     Pixels_16,
  11.     Pixels_32,
  12.     Pixels_64,
  13.     Pixels_128,
  14.     Pixels_256,
  15. };
  16. var() EResolution Width, Height;
  17.  
  18. function Material CreateMaterial( Object InOuter, string InPackage, string InGroup, string InName )
  19. {        
  20.     local int w, h;
  21.  
  22.     switch(Width)
  23.     {
  24.     case Pixels_1: w=1; break;
  25.     case Pixels_2: w=2; break;
  26.     case Pixels_4: w=4; break;
  27.     case Pixels_8: w=8; break;
  28.     case Pixels_16: w=16; break;
  29.     case Pixels_32: w=32; break;
  30.     case Pixels_64: w=64; break;
  31.     case Pixels_128: w=128; break;
  32.     case Pixels_256: w=256; break;
  33.     }
  34.  
  35.     switch(Height)
  36.     {
  37.     case Pixels_1: h=1; break;
  38.     case Pixels_2: h=2; break;
  39.     case Pixels_4: h=4; break;
  40.     case Pixels_8: h=8; break;
  41.     case Pixels_16: h=16; break;
  42.     case Pixels_32: h=32; break;
  43.     case Pixels_64: h=64; break;
  44.     case Pixels_128: h=128; break;
  45.     case Pixels_256: h=256; break;
  46.     }
  47.  
  48.     ConsoleCommand( "TEXTURE NEW NAME=\""$InName$"\" CLASS=\""$String(Class)$"\" GROUP=\""$InGroup$"\" PACKAGE=\""$InPackage$"\" USIZE="$string(w)$" VSIZE="$string(h) );
  49.  
  50.     if( InGroup == "" )
  51.         return Material( FindObject( InPackage$"."$InName, class'Material') );
  52.     else
  53.         return Material( FindObject( InPackage$"."$InGroup$"."$InName, class'Material') );
  54.  
  55. }
  56.  
  57. defaultproperties
  58. {
  59.     Description="Real-time Procedural Texture"
  60.     Class=WetTexture
  61.     Width=Pixels_256;
  62.     Height=Pixels_256;
  63. }