MCPcopy Create free account
hub / github.com/DentonW/DevIL / ILAPIENTRY ilRegisterNumFaces

Function ILAPIENTRY ilRegisterNumFaces

DevIL/src-IL/src/il_register.cpp:268–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266
267
268ILboolean ILAPIENTRY ilRegisterNumFaces(ILuint Num)
269{
270 ILimage *Next, *Prev;
271
272 ilBindImage(ilGetCurName()); // Make sure the current image is actually bound.
273 ilCloseImage(iCurImage->Faces); // Close any current mipmaps.
274
275 iCurImage->Faces = NULL;
276 if (Num == 0) // Just gets rid of all the mipmaps.
277 return IL_TRUE;
278
279 iCurImage->Faces = ilNewImage(1, 1, 1, 1, 1);
280 if (iCurImage->Faces == NULL)
281 return IL_FALSE;
282 Next = iCurImage->Faces;
283 Num--;
284
285 while (Num) {
286 Next->Faces = ilNewImage(1, 1, 1, 1, 1);
287 if (Next->Faces == NULL) {
288 // Clean up before we error out.
289 Prev = iCurImage->Faces;
290 while (Prev) {
291 Next = Prev->Faces;
292 ilCloseImage(Prev);
293 Prev = Next;
294 }
295 return IL_FALSE;
296 }
297 Next = Next->Faces;
298 Num--;
299 }
300
301 return IL_TRUE;
302}
303
304
305ILboolean ILAPIENTRY ilRegisterMipNum(ILuint Num)

Callers

nothing calls this directly

Calls 2

ilGetCurNameFunction · 0.85
ilCloseImageFunction · 0.85

Tested by

no test coverage detected