Draws a snowflake
| 1141 | |
| 1142 | // Draws a snowflake |
| 1143 | void DrawVisSnowflake(vis_effect *vis) { |
| 1144 | float norm_time; |
| 1145 | float time_live = Gametime - vis->creation_time; |
| 1146 | float size = vis->size; |
| 1147 | |
| 1148 | int visnum = vis - VisEffects; |
| 1149 | int bm_handle; |
| 1150 | fireball *fb = &Fireballs[vis->id]; |
| 1151 | |
| 1152 | norm_time = time_live / vis->lifetime; |
| 1153 | |
| 1154 | if (norm_time >= 1) |
| 1155 | norm_time = .99999f; // don't go over! |
| 1156 | |
| 1157 | // size*=(1-(norm_time/2)); |
| 1158 | |
| 1159 | bm_handle = fb->bm_handle; |
| 1160 | |
| 1161 | float val; |
| 1162 | |
| 1163 | val = 1.0 - (norm_time); |
| 1164 | |
| 1165 | rend_SetAlphaValue(val * .6 * 255); |
| 1166 | rend_SetOverlayType(OT_NONE); |
| 1167 | // rend_SetWrapType (WT_CLAMP); |
| 1168 | rend_SetLighting(LS_NONE); |
| 1169 | // rend_SetZBufferState (0); |
| 1170 | rend_SetAlphaType(AT_SATURATE_TEXTURE); |
| 1171 | |
| 1172 | ddgr_color color = GR_16_TO_COLOR(vis->lighting_color); |
| 1173 | g3_DrawBitmap(&vis->pos, size, (size * bm_h(bm_handle, 0)) / bm_w(bm_handle, 0), bm_handle, color); |
| 1174 | |
| 1175 | // rend_SetZBufferState (1); |
| 1176 | // rend_SetWrapType (WT_WRAP); |
| 1177 | } |
| 1178 | |
| 1179 | // Draws a lighting bolt from one area to another |
| 1180 | // Velocity.x is how much randomness goes into drawing |
no test coverage detected