MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / set

Method set

Engine/source/gfx/gfxTextureArray.cpp:19–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19void GFXTextureArray::set(U32 width, U32 height, U32 size, GFXFormat format, U32 mipLevels)
20{
21 if (mipLevels == 0 && width == height && isPow2(width))
22 {
23 mipLevels = mLog2(static_cast<F32>(width)) + 1;
24 }
25 if (
26 mWidth == width &&
27 mHeight == height &&
28 mArraySize == size &&
29 mFormat == format &&
30 mMipLevels == mipLevels
31 )
32 {
33 return;
34 }
35
36 Release();
37
38 mWidth = width;
39 mHeight = height;
40 mArraySize = size;
41 mFormat = format;
42 mIsCompressed = ImageUtil::isCompressedFormat(mFormat);
43 mMipLevels = getMax(mipLevels, static_cast<U32>(1));
44
45 mTextures.setSize(size);
46
47 init();
48}
49
50bool GFXTextureArray::fromTextureArray(const Vector<GFXTexHandle>& textureArray, U32 capacity)
51{

Callers

nothing calls this directly

Calls 6

isPow2Function · 0.85
mLog2Function · 0.85
isCompressedFormatFunction · 0.85
getMaxFunction · 0.85
initFunction · 0.50
setSizeMethod · 0.45

Tested by

no test coverage detected