X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=r_lightning.c;h=bbffbef441122a8c5b52e3762e586901048d48fa;hb=83f8124af58307eae378846c9746b5d769673474;hp=addcece8e42b1684140a13a72c88db3a5ccc26af;hpb=149a19636b5fcea9d572d56267005d94747a1690;p=xonotic%2Fdarkplaces.git diff --git a/r_lightning.c b/r_lightning.c index addcece8..bbffbef4 100644 --- a/r_lightning.c +++ b/r_lightning.c @@ -21,9 +21,7 @@ static void r_lightningbeams_start(void) static void CL_Beams_SetupExternalTexture(void) { - if (Mod_LoadTextureFromQ3Shader(&cl_beams_externaltexture, "textures/particles/lightning", false, false, TEXF_ALPHA | TEXF_FORCELINEAR)) - cl_beams_externaltexture.basematerialflags = cl_beams_externaltexture.currentmaterialflags = MATERIALFLAG_WALL | MATERIALFLAG_ADD | MATERIALFLAG_BLENDED | MATERIALFLAG_NOCULLFACE; - else + if (Mod_LoadTextureFromQ3Shader(r_main_mempool, "r_lightning.c", &cl_beams_externaltexture, "textures/particles/lightning", false, false, TEXF_ALPHA | TEXF_FORCELINEAR, MATERIALFLAG_WALL | MATERIALFLAG_ADD | MATERIALFLAG_BLENDED | MATERIALFLAG_NOCULLFACE)) Cvar_SetValueQuick(&r_lightningbeam_qmbtexture, false); } @@ -76,8 +74,8 @@ static void CL_Beams_SetupBuiltinTexture(void) } } - skinframe = R_SkinFrame_LoadInternalBGRA("lightningbeam", TEXF_FORCELINEAR, data, texwidth, texheight, false); - Mod_LoadCustomMaterial(&cl_beams_builtintexture, "cl_beams_builtintexture", 0, MATERIALFLAG_WALL | MATERIALFLAG_ADD | MATERIALFLAG_BLENDED | MATERIALFLAG_NOCULLFACE, skinframe); + skinframe = R_SkinFrame_LoadInternalBGRA("lightningbeam", TEXF_FORCELINEAR, data, texwidth, texheight, 0, 0, 0, false); + Mod_LoadCustomMaterial(r_main_mempool, &cl_beams_builtintexture, "cl_beams_builtintexture", 0, MATERIALFLAG_WALL | MATERIALFLAG_ADD | MATERIALFLAG_BLENDED | MATERIALFLAG_NOCULLFACE | MATERIALFLAG_VERTEXCOLOR | MATERIALFLAG_ALPHAGEN_VERTEX, skinframe); Mem_Free(data); } @@ -183,7 +181,7 @@ void CL_Beam_AddPolygons(const beam_t *b) // the viewer) mod = &cl_meshentitymodels[MESH_PARTICLES]; - surf = Mod_Mesh_AddSurface(mod, r_lightningbeam_qmbtexture.integer ? &cl_beams_externaltexture : &cl_beams_builtintexture); + surf = Mod_Mesh_AddSurface(mod, r_lightningbeam_qmbtexture.integer ? &cl_beams_externaltexture : &cl_beams_builtintexture, false); // polygon 1 VectorM(r_lightningbeam_thickness.value, right, offset); CL_Beam_AddQuad(mod, surf, start, end, offset, t1, t2);