Skip to content

Commit

Permalink
Remove the linear flag from some particle textures and adjust an off …
Browse files Browse the repository at this point in the history
…by 1 check (may introduce division by zero warnings), as per wrath-darkplaces
  • Loading branch information
MarioSMB committed May 31, 2020
1 parent d3deefd commit abe995d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cl_particles.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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
{
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit abe995d

Please sign in to comment.