MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / d3d_GetNumOfBits

Function d3d_GetNumOfBits

legacy/renderer/Direct3D.cpp:510–518  ·  view source on GitHub ↗

Returns the number of bits used in a mask

Source from the content-addressed store, hash-verified

508
509// Returns the number of bits used in a mask
510WORD d3d_GetNumOfBits(DWORD dwMask) {
511 WORD wBits = 0;
512 while (dwMask) {
513 dwMask = dwMask & (dwMask - 1);
514 wBits++;
515 }
516
517 return wBits;
518}
519
520int d3d_GetTexClass(int handle, int map_type) {
521 int w, tex_class;

Callers 1

d3d_TextureCacheInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected