Exemple #1
0
 public PakTextureInfo(string name, uint gbix, Bitmap bitmap, GvrDataFormat format = GvrDataFormat.Dxt1, NinjaSurfaceFlags flags = NinjaSurfaceFlags.Mipmapped)
 {
     Name         = name;
     GlobalIndex  = gbix;
     Image        = bitmap;
     DataFormat   = format;
     SurfaceFlags = flags;
     Mipmap       = (SurfaceFlags & NinjaSurfaceFlags.Mipmapped) != 0;
 }
Exemple #2
0
 public PAKInfEntry(byte[] data)
 {
     filename = new byte[28];
     Array.Copy(data, filename, 0x1C);
     globalindex   = BitConverter.ToUInt32(data, 0x1C);
     Type          = (GvrDataFormat)BitConverter.ToUInt32(data, 0x20);
     BitDepth      = BitConverter.ToUInt32(data, 0x24);
     PixelFormat   = (GvrDataFormat)BitConverter.ToUInt32(data, 0x28);
     nWidth        = BitConverter.ToUInt32(data, 0x2C);
     nHeight       = BitConverter.ToUInt32(data, 0x30);
     TextureSize   = BitConverter.ToUInt32(data, 0x34);
     fSurfaceFlags = (NinjaSurfaceFlags)BitConverter.ToUInt32(data, 0x38);
 }
Exemple #3
0
 public PakTextureInfo(TextureInfo tex)
 {
     Name        = tex.Name;
     GlobalIndex = tex.GlobalIndex;
     if (tex is GvrTextureInfo gvrt)
     {
         DataFormat = gvrt.DataFormat;
         if (gvrt.DataFormat == GvrDataFormat.Index4 || gvrt.DataFormat == GvrDataFormat.Index8)
         {
             SurfaceFlags |= NinjaSurfaceFlags.Palettized;
         }
     }
     else
     {
         DataFormat = GvrDataFormat.Dxt1;
     }
     Image  = tex.Image;
     Mipmap = tex.Mipmap;
     if (tex.Mipmap)
     {
         SurfaceFlags |= NinjaSurfaceFlags.Mipmapped;
     }
 }