From abe995d61281bbc18f57babc6cd02948a9e73295 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 1 Jun 2020 01:24:57 +1000 Subject: [PATCH] Remove the linear flag from some particle textures and adjust an off by 1 check (may introduce division by zero warnings), as per wrath-darkplaces --- cl_particles.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cl_particles.c b/cl_particles.c index e5d02e45..ba2c2ab6 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -2141,7 +2141,7 @@ static void R_InitParticleTexture (void) // we invert it again during the blendfunc to make it work... #ifndef DUMPPARTICLEFONT - decalskinframe = R_SkinFrame_LoadExternal("particles/particlefont.tga", TEXF_ALPHA | TEXF_FORCELINEAR | TEXF_RGBMULTIPLYBYALPHA, false, false); + decalskinframe = R_SkinFrame_LoadExternal("particles/particlefont.tga", TEXF_ALPHA | TEXF_RGBMULTIPLYBYALPHA, false, false); if (decalskinframe) { particlefonttexture = decalskinframe->base; @@ -2286,7 +2286,7 @@ static void R_InitParticleTexture (void) Image_WriteTGABGRA ("particles/particlefont.tga", PARTICLEFONTSIZE, PARTICLEFONTSIZE, particletexturedata); #endif - decalskinframe = R_SkinFrame_LoadInternalBGRA("particlefont", TEXF_ALPHA | TEXF_FORCELINEAR | TEXF_RGBMULTIPLYBYALPHA, particletexturedata, PARTICLEFONTSIZE, PARTICLEFONTSIZE, 0, 0, 0, false); + decalskinframe = R_SkinFrame_LoadInternalBGRA("particlefont", TEXF_ALPHA | TEXF_RGBMULTIPLYBYALPHA, particletexturedata, PARTICLEFONTSIZE, PARTICLEFONTSIZE, 0, 0, 0, false); particlefonttexture = decalskinframe->base; Mem_Free(particletexturedata); @@ -2298,14 +2298,14 @@ static void R_InitParticleTexture (void) { CL_Particle_PixelCoordsForTexnum(i, &basex, &basey, &w, &h); particletexture[i].texture = particlefonttexture; - particletexture[i].s1 = (basex + 1) / (float)particlefontwidth; - particletexture[i].t1 = (basey + 1) / (float)particlefontheight; - particletexture[i].s2 = (basex + w - 1) / (float)particlefontwidth; - particletexture[i].t2 = (basey + h - 1) / (float)particlefontheight; + particletexture[i].s1 = (basex + 0) / (float)particlefontwidth; + particletexture[i].t1 = (basey + 0) / (float)particlefontheight; + particletexture[i].s2 = (basex + w - 0) / (float)particlefontwidth; + particletexture[i].t2 = (basey + h - 0) / (float)particlefontheight; } #ifndef DUMPPARTICLEFONT - particletexture[tex_beam].texture = loadtextureimage(particletexturepool, "particles/nexbeam.tga", false, TEXF_ALPHA | TEXF_FORCELINEAR | TEXF_RGBMULTIPLYBYALPHA, true, vid.sRGB3D); + particletexture[tex_beam].texture = loadtextureimage(particletexturepool, "particles/nexbeam.tga", false, TEXF_ALPHA | TEXF_RGBMULTIPLYBYALPHA, true, vid.sRGB3D); if (!particletexture[tex_beam].texture) #endif { @@ -2328,7 +2328,7 @@ static void R_InitParticleTexture (void) #ifdef DUMPPARTICLEFONT Image_WriteTGABGRA ("particles/nexbeam.tga", 64, 64, &data2[0][0][0]); #endif - particletexture[tex_beam].texture = R_LoadTexture2D(particletexturepool, "nexbeam", 16, 64, &data2[0][0][0], TEXTYPE_BGRA, TEXF_ALPHA | TEXF_FORCELINEAR | TEXF_RGBMULTIPLYBYALPHA, -1, NULL); + particletexture[tex_beam].texture = R_LoadTexture2D(particletexturepool, "nexbeam", 16, 64, &data2[0][0][0], TEXTYPE_BGRA, TEXF_ALPHA | TEXF_RGBMULTIPLYBYALPHA, -1, NULL); } particletexture[tex_beam].s1 = 0; particletexture[tex_beam].t1 = 0; @@ -2388,7 +2388,7 @@ static void R_InitParticleTexture (void) Con_Printf("particles/particlefont.txt: texnum %i outside valid range (0 to %i)\n", i, MAX_PARTICLETEXTURES); continue; } - sf = R_SkinFrame_LoadExternal(texturename, TEXF_ALPHA | TEXF_FORCELINEAR | TEXF_RGBMULTIPLYBYALPHA, true, true); // note: this loads as sRGB if sRGB is active! + sf = R_SkinFrame_LoadExternal(texturename, TEXF_ALPHA | TEXF_RGBMULTIPLYBYALPHA, true, true); // note: this loads as sRGB if sRGB is active! particletexture[i].texture = sf->base; particletexture[i].s1 = s1; particletexture[i].t1 = t1; -- 2.39.2