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

Function DrawPlayerRotatingBall

Descent3/renderobject.cpp:2034–2064  ·  view source on GitHub ↗

Draws a rotating ball around the player

Source from the content-addressed store, hash-verified

2032}
2033// Draws a rotating ball around the player
2034void DrawPlayerRotatingBall(object *obj) {
2035 ASSERT(obj->type == OBJ_PLAYER);
2036 if (Players[obj->id].num_balls < 1)
2037 return;
2038 static int first = 1;
2039 static int bm_handle;
2040 vector worldpos;
2041 rend_SetColorModel(CM_RGB);
2042 rend_SetLighting(LS_GOURAUD);
2043 rend_SetTextureType(TT_LINEAR);
2044 rend_SetAlphaType(AT_SATURATE_TEXTURE);
2045 rend_SetAlphaValue(.3 * 255);
2046 rend_SetZBufferWriteMask(0);
2047 if (first) {
2048 int texhandle = FindTextureName("WhiteGlowingBall");
2049 if (texhandle == -1)
2050 bm_handle = 0;
2051 else
2052 bm_handle = GetTextureBitmap(texhandle, 0);
2053 first = 0;
2054 }
2055 for (int i = 0; i < Players[obj->id].num_balls; i++) {
2056 PlayerGetBallPosition(&worldpos, obj->id, i);
2057 // Get color of balls
2058 ddgr_color color =
2059 GR_RGB(Players[obj->id].ball_r[i] * 255, Players[obj->id].ball_g[i] * 255, Players[obj->id].ball_b[i] * 255);
2060 g3_DrawBitmap(&worldpos, obj->size / 4, ((obj->size / 4) * bm_h(bm_handle, 0)) / bm_w(bm_handle, 0), bm_handle,
2061 color);
2062 }
2063 rend_SetZBufferWriteMask(1);
2064}
2065// Draws the 'typing message' icon indicator above an object
2066void DrawPlayerTypingIndicator(object *obj) {
2067 if (!(Game_mode & GM_MULTI))

Callers 1

RenderObjectFunction · 0.85

Calls 13

FindTextureNameFunction · 0.85
GetTextureBitmapFunction · 0.85
PlayerGetBallPositionFunction · 0.85
g3_DrawBitmapFunction · 0.85
bm_hFunction · 0.85
bm_wFunction · 0.85
rend_SetColorModelFunction · 0.50
rend_SetLightingFunction · 0.50
rend_SetTextureTypeFunction · 0.50
rend_SetAlphaTypeFunction · 0.50
rend_SetAlphaValueFunction · 0.50
rend_SetZBufferWriteMaskFunction · 0.50

Tested by

no test coverage detected