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

Function ilTexImage_

DevIL/src-IL/src/il_devil.cpp:133–166  ·  view source on GitHub ↗

Internal version of ilTexImage.

Source from the content-addressed store, hash-verified

131
132// Internal version of ilTexImage.
133ILAPI ILboolean ILAPIENTRY ilTexImage_(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data)
134{
135 if (Image == NULL) {
136 ilSetError(IL_ILLEGAL_OPERATION);
137 return IL_FALSE;
138 }
139
140 ////
141
142 // Not sure if we should be getting rid of the palette...
143 if (Image->Pal.Palette && Image->Pal.PalSize && Image->Pal.PalType != IL_PAL_NONE) {
144 ifree(Image->Pal.Palette);
145 }
146
147 ilCloseImage(Image->Mipmaps);
148 ilCloseImage(Image->Next);
149 ilCloseImage(Image->Faces);
150 ilCloseImage(Image->Layers);
151
152 if (Image->AnimList) ifree(Image->AnimList);
153 if (Image->Profile) ifree(Image->Profile);
154 if (Image->DxtcData) ifree(Image->DxtcData);
155 if (Image->Data) ifree(Image->Data);
156
157 ////
158
159 //@TODO: Also check against format?
160 /*if (Width == 0 || Height == 0 || Depth == 0 || Bpp == 0) {
161 ilSetError(IL_INVALID_PARAM);
162 return IL_FALSE;
163 }*/
164
165 return ilInitImage(Image, Width, Height, Depth, Bpp, Format, Type, Data);
166}
167
168
169//! Changes the current bound image to use these new dimensions (current data is destroyed, but mips, faces, layers and arrays are retained).

Callers 1

ILAPIENTRY ilTexImageFunction · 0.85

Calls 3

ilSetErrorFunction · 0.85
ilCloseImageFunction · 0.85
ilInitImageFunction · 0.85

Tested by

no test coverage detected