Browse Source

Made a few tweaks to make texture uploading work properly in headless mode

console
Nico de Poel 5 years ago
parent
commit
3da2d4ba59
  1. 3
      Assets/Scripts/Modules/RenderModule.cs
  2. 4
      engine/Quake/gl_texmgr.c

3
Assets/Scripts/Modules/RenderModule.cs

@ -108,6 +108,9 @@ public partial class RenderModule
{
Debug.Log($"Texture '{texture.name}' with dimensions {texture.width}x{texture.height}, data size = {data.Length} bytes");
if (texture.width == 0 || texture.height == 0)
return false;
if (texNum == 0)
{
// Assign a new texture number

4
engine/Quake/gl_texmgr.c

@ -1023,6 +1023,8 @@ static void TexMgr_LoadImage32 (gltexture_t *glt, unsigned *data)
glt->height = TexMgr_Pad(glt->height);
}
UQ_GL_UploadTexture(glt, data);
// mipmap down
picmip = (glt->flags & TEXPREF_NOPICMIP) ? 0 : q_max((int)gl_picmip.value, 0);
mipwidth = TexMgr_SafeTextureSize (glt->width >> picmip);
@ -1071,8 +1073,6 @@ static void TexMgr_LoadImage32 (gltexture_t *glt, unsigned *data)
// set filter modes
TexMgr_SetFilterModes (glt);
UQ_GL_UploadTexture(glt, data);
}
/*

Loading…
Cancel
Save