texmemlist | Pointer for texture memory list |
One example is the function to forcibly change Mipmap size for display. However, only sizes larger than 8 can be displayed (1, 2, 4 cannot be displayed). If the original value is changed to texinfo below, return to the original value when texture is released. As this sample case has not been changed (it has been copied), there is no effect in the original values. void njSetTextureMipmapSize( NJS_TEXMEMLIST *texmemlist, Uint32 Size ) { NJS_TEXMEMLIST tml; /* Check Mipmap texture */ if(texmemlist->texinfo.texsurface.fSurfaceFlags & NJD_SURFACEFLAGS_MIPMAPED){ /* Decide if the size of the texture is larger than the specified size */ if(texmemlist->texinfo.texsurface.nWidth >= Size){ /* Set the size */ tml.texinfo.texsurface.nWidth = Size; tml.texinfo.texsurface.nHeight = Size; /* Calculate texture size The true size is not necessary */ tml.texinfo.texsurface.TextureSize = njCalcTextureSize(Size,Size,tml.texinfo.texsurface.Type >> 16); /* Set PixelFormat */ tml.texinfo.texsurface.PixelFormat = texmemlist->texinfo.texsurface.PixelFormat; /* Set offset */ tml.texinfo.texsurface.pSurface = (Uint32*)((Uint32)texmemlist->texinfo.texsurface.pSurface); /* Set surface flags */ tml.texinfo.texsurface.fSurfaceFlags = texmemlist->texinfo.texsurface.fSurfaceFlags; /* Set texture parameters texparambuffer, tspparambuffer */ njSetTextureParam(&tml); /* Copy */ texmemlist->texparambuffer = tml.texparambuffer; texmemlist->tspparambuffer = tml.tspparambuffer; } } }