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

Function DrawVisSnowflake

Descent3/viseffect.cpp:1143–1177  ·  view source on GitHub ↗

Draws a snowflake

Source from the content-addressed store, hash-verified

1141
1142// Draws a snowflake
1143void 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

Callers 1

DrawVisEffectFunction · 0.85

Calls 8

GR_16_TO_COLORFunction · 0.85
g3_DrawBitmapFunction · 0.85
bm_hFunction · 0.85
bm_wFunction · 0.85
rend_SetAlphaValueFunction · 0.50
rend_SetOverlayTypeFunction · 0.50
rend_SetLightingFunction · 0.50
rend_SetAlphaTypeFunction · 0.50

Tested by

no test coverage detected