In order to add a texture in the FitzQuake texture manager, you use the TexMgr_LoadImage function.revelator wrote:Btw baker, how would i go about loading an image via texmgr with no data width heigth and only the texture name ?
im toying with adding tenebraes particel lexer and decals to quakespasm.
You have to be very clear ...
1) who owns the texture? Does the map own it (cleared with map change)? Does a model own it? (cleared when models are flushed?) FitzQuake-derived engines can gamedir change, this means flushing all the models.
2) the manner of which it can be reloaded (reload from file? reload from memory?)
3) The type of file (rgba vs Quake palette).
4) Texture processing attributes. Is it an alpha texture? Does it picmip? Is it gl_nearest (like HUD elements that never go linear filtering)?
Code: Select all
gl.gltexture = TexMgr_LoadImage (NULL /*owner*/, path /*this is the name to display when listing the textures*/, dat->width, dat->height, SRC_INDEXED /*means quake palette*/, dat->data, path /* this is the reload path, NULL for load from memory*/,
sizeof(int)*2, TEXPREF_ALPHA | TEXPREF_PAD | TEXPREF_NOPICMIP); //johnfitz -- TexMgr
It is very structured.
Note: Spike added decals to Quakespasm in Quakespasm Spiked.