Draws the red sphere around a player indicating invulnerability
| 2000 | } |
| 2001 | // Draws the red sphere around a player indicating invulnerability |
| 2002 | void DrawPlayerInvulSphere(object *obj) { |
| 2003 | // if (!(Game_mode & GM_MULTI)) |
| 2004 | // return; // only in multiplayer |
| 2005 | |
| 2006 | ASSERT(obj->type == OBJ_PLAYER); |
| 2007 | if (Viewer_object == obj) |
| 2008 | return; // don't do me |
| 2009 | if (!(Players[obj->id].flags & PLAYER_FLAGS_INVULNERABLE)) |
| 2010 | return; |
| 2011 | if (Players[obj->id].invul_magnitude < .05) |
| 2012 | return; |
| 2013 | |
| 2014 | int bm_handle = Fireballs[INVUL_HIT_INDEX].bm_handle; |
| 2015 | // Figure out the position and orientation to draw this |
| 2016 | vector hit_pos = obj->pos + (Players[obj->id].invul_vector * obj->size); |
| 2017 | vector norm_vec = Players[obj->id].invul_vector; |
| 2018 | // Check to see that we're ok with the length of the vector |
| 2019 | float mag = vm_GetMagnitudeFast(&norm_vec); |
| 2020 | if (mag < 1) |
| 2021 | return; |
| 2022 | norm_vec /= mag; |
| 2023 | |
| 2024 | // Now draw! |
| 2025 | rend_SetAlphaType(AT_SATURATE_TEXTURE); |
| 2026 | rend_SetZBufferWriteMask(0); |
| 2027 | rend_SetAlphaValue(.6 * Players[obj->id].invul_magnitude * 255); |
| 2028 | rend_SetOverlayType(OT_NONE); |
| 2029 | rend_SetLighting(LS_NONE); |
| 2030 | g3_DrawPlanarRotatedBitmap(&hit_pos, &norm_vec, 0, 3, 3, bm_handle); |
| 2031 | rend_SetZBufferWriteMask(1); |
| 2032 | } |
| 2033 | // Draws a rotating ball around the player |
| 2034 | void DrawPlayerRotatingBall(object *obj) { |
| 2035 | ASSERT(obj->type == OBJ_PLAYER); |
no test coverage detected