public static void Initialize() { if (Processor.Architecture == ProcessorArchitecture.X64) { SquishInterface_64.SquishInitialize(); } else if (Processor.IsFeaturePresent(ProcessorFeature.SSE2)) { SquishInterface_32_SSE2.SquishInitialize(); } else { SquishInterface_32.SquishInitialize(); } }
private static unsafe void CallDecompressImage(byte[] rgba, int width, int height, byte[] blocks, int flags, ProgressFn progressFn) { fixed(byte *pRGBA = rgba) { fixed(byte *pBlocks = blocks) { if (Processor.Architecture == ProcessorArchitecture.X64) { SquishInterface_64.SquishDecompressImage(pRGBA, width, height, pBlocks, flags, progressFn); } else if (Processor.IsFeaturePresent(ProcessorFeature.SSE2)) { SquishInterface_32_SSE2.SquishDecompressImage(pRGBA, width, height, pBlocks, flags, progressFn); } else { SquishInterface_32.SquishDecompressImage(pRGBA, width, height, pBlocks, flags, progressFn); } } } GC.KeepAlive(progressFn); }