Draws a rotating ball around the player
| 2032 | } |
| 2033 | // Draws a rotating ball around the player |
| 2034 | void 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 |
| 2066 | void DrawPlayerTypingIndicator(object *obj) { |
| 2067 | if (!(Game_mode & GM_MULTI)) |
no test coverage detected