MCPcopy Create free account
hub / github.com/DentonW/DevIL / ilPKCodecFactory_CreateDecoderFromFile

Function ilPKCodecFactory_CreateDecoderFromFile

DevIL/src-IL/src/il_wdp.cpp:286–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284
285
286ERR ilPKCodecFactory_CreateDecoderFromFile(PKImageDecode** ppDecoder)
287{
288 ERR err = WMP_errSuccess;
289
290 char *pExt = ".wdp"; // We are loading a WDP file, so we have to tell the library that with this extension.
291 PKIID* pIID = NULL;
292
293 struct WMPStream* pStream = NULL;
294 PKImageDecode* pDecoder = NULL;
295
296 // get decode PKIID
297 Call(GetImageDecodeIID(pExt, &pIID));
298
299 // create stream
300 Call(ilCreateWS_File(&pStream, NULL, "rb"));
301
302 // Create decoder
303 Call(PKCodecFactory_CreateCodec(pIID, ppDecoder));
304 pDecoder = *ppDecoder;
305
306 // attach stream to decoder
307 Call(pDecoder->Initialize(pDecoder, pStream));
308 pDecoder->fStreamOwner = !0;
309
310Cleanup:
311 return err;
312}
313
314
315ERR ilPKCreateFactory(PKFactory** ppFactory, U32 uVersion)

Callers 1

iLoadWdpInternalFunction · 0.85

Calls 2

ilCreateWS_FileFunction · 0.85
InitializeMethod · 0.80

Tested by

no test coverage detected