MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Gfx_CheckTextureSize

Function Gfx_CheckTextureSize

src/_GraphicsBase.h:424–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424cc_bool Gfx_CheckTextureSize(int width, int height, cc_uint8 flags) {
425 int maxSize;
426 if (width > Gfx.MaxTexWidth) return false;
427 if (height > Gfx.MaxTexHeight) return false;
428
429 if (Gfx.MinTexWidth && width < Gfx.MinTexWidth) return false;
430 if (Gfx.MinTexHeight && height < Gfx.MinTexHeight) return false;
431
432 maxSize = Gfx.MaxTexSize;
433 // low resolution textures may support higher sizes (e.g. Nintendo 64)
434 if ((flags & TEXTURE_FLAG_LOWRES) && Gfx.MaxLowResTexSize)
435 maxSize = Gfx.MaxLowResTexSize;
436
437 return maxSize == 0 || (width * height <= maxSize);
438}
439
440GfxResourceID Gfx_CreateTexture(struct Bitmap* bmp, cc_uint8 flags, cc_bool mipmaps) {
441 return Gfx_CreateTexture2(bmp, bmp->width, flags, mipmaps);

Callers 3

Atlas_TryChangeFunction · 0.85
ApplySkinFunction · 0.85
Gfx_CreateTexture2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected