Exemplo n.º 1
0
 public void Load()
 {
     if (demConverter == null)
     {
         demConverter = new DemConverter();
     }
     if (tdmp32to8 == null)
     {
         tdmp32to8 = new TDmp32To8Converter();
     }
     if (tdmp32to16 == null)
     {
         tdmp32to16 = new TDmp32To16Converter();
     }
     if (tdmp32to12 == null)
     {
         tdmp32to12 = new TDmp32To12Converter();
     }
     if (tdmplod16 == null) 
     {
         tdmplod16 = new TDmpLodGen();
     }
     if (texClrCalc == null) 
     {
         texClrCalc = new TextureColorCalculator();
     }
     if (imgRmg == null)
     {
         imgRmg = new ImageRemerger();
     } 
     if (dmpMerger == null)
     {
         dmpMerger = new TDmpMerger();
     }
     if (dmpResizer == null)
     {
         dmpResizer = new TDmpResizer();
     }
     if (dmpBlur == null)
     {
         dmpBlur = new TDmpBlur();
     }
     if (dmpNormal == null) 
     {
         dmpNormal = new TDmpNormalMapper();
     }
     ConverterManager.Instance.Register(tdmplod16);
     ConverterManager.Instance.Register(demConverter);
     ConverterManager.Instance.Register(tdmp32to8);
     ConverterManager.Instance.Register(tdmp32to16);
     ConverterManager.Instance.Register(texClrCalc);
     ConverterManager.Instance.Register(imgRmg);
     ConverterManager.Instance.Register(dmpMerger);
     ConverterManager.Instance.Register(dmpResizer);
     ConverterManager.Instance.Register(dmpBlur);
     ConverterManager.Instance.Register(tdmp32to12);
     ConverterManager.Instance.Register(dmpNormal);
 }
Exemplo n.º 2
0
 public void Load()
 {
     if (demConverter == null)
     {
         demConverter = new DemConverter();
     }
     if (tdmp32to8 == null)
     {
         tdmp32to8 = new TDmp32To8Converter();
     }
     if (tdmp32to16 == null)
     {
         tdmp32to16 = new TDmp32To16Converter();
     }
     if (tdmp32to12 == null)
     {
         tdmp32to12 = new TDmp32To12Converter();
     }
     if (tdmplod16 == null)
     {
         tdmplod16 = new TDmpLodGen();
     }
     if (texClrCalc == null)
     {
         texClrCalc = new TextureColorCalculator();
     }
     if (imgRmg == null)
     {
         imgRmg = new ImageRemerger();
     }
     if (dmpMerger == null)
     {
         dmpMerger = new TDmpMerger();
     }
     if (dmpResizer == null)
     {
         dmpResizer = new TDmpResizer();
     }
     if (dmpBlur == null)
     {
         dmpBlur = new TDmpBlur();
     }
     if (dmpNormal == null)
     {
         dmpNormal = new TDmpNormalMapper();
     }
     ConverterManager.Instance.Register(tdmplod16);
     ConverterManager.Instance.Register(demConverter);
     ConverterManager.Instance.Register(tdmp32to8);
     ConverterManager.Instance.Register(tdmp32to16);
     ConverterManager.Instance.Register(texClrCalc);
     ConverterManager.Instance.Register(imgRmg);
     ConverterManager.Instance.Register(dmpMerger);
     ConverterManager.Instance.Register(dmpResizer);
     ConverterManager.Instance.Register(dmpBlur);
     ConverterManager.Instance.Register(tdmp32to12);
     ConverterManager.Instance.Register(dmpNormal);
 }
Exemplo n.º 3
0
        public override void Convert(ResourceLocation source, ResourceLocation dest)
        {
            TDMPIO src = new TDMPIO();

            src.Load(source);

            float[] rsd = TDmpLodGen.Resize(src.Data, src.Width, src.Height, ResizeSize, ResizeSize);

            TDMPIO dst = new TDMPIO();

            dst.Width     = ResizeSize;
            dst.Height    = ResizeSize;
            dst.Bits      = src.Bits;
            dst.Xllcorner = src.Xllcorner;
            dst.Yllcorner = src.Yllcorner;
            dst.XSpan     = src.XSpan;
            dst.YSpan     = src.YSpan;

            dst.Data = rsd;
            dst.Save(dest.GetStream);
        }