Posted by: omega
Date posted: Jan 14 2004 User Rating: 4 out of 5.0 | Number of views: 2142 Number of comments: 0 | Description: This snippet gives you some simple code to utilize the client side decal clearing function to wipe all decals from the map for a round reset, or whatever. |
In FLFD I have created a command to clear decals (which is also called at round reset). It's really simple, I'm providing it here because we've often received questions about this.
This command is declared in input.cpp, it's the best place for it IMO, and you can still call it from elsewhere in the client simply by calling the function directly.
| | #include "r_efx.h"
void IN_ClearDecals(void) { for ( int x = 0; x < (int)CVAR_GET_FLOAT( "r_decals" ); x++ ) gEngfuncs.pEfxAPI->R_DecalRemoveAll ( x ); }
|
notes: r_decals is the client's actual allocated decals, eg: there are two decal cvars!! This one is usually overlooked. It defaults to 4096, so thats why the command looks for it, incase the client changes it. If the client changes this cvar to a lower value before decals are cleared, any decals with indices > that value won't be removed, so it's something you should consider. |
|
User Comments
No User Comments
You must register to post a comment. If you have already registered, you must login.
|