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

Function DrawSmolderingObject

Descent3/fireball.cpp:2427–2466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2425 return (choices[pick]);
2426}
2427void DrawSmolderingObject(object *obj) {
2428 vector veca;
2429 angvec angs;
2430 vector world_verts[4];
2431 g3Point pnts[4], *pntlist[4];
2432 if (!Viewer_object)
2433 return;
2434 vm_ExtractAnglesFromMatrix(&angs, &Viewer_object->orient);
2435 veca.x = FixCos(angs.h);
2436 veca.z = FixSin(angs.h);
2437 veca.y = 0;
2438 world_verts[0] = obj->pos - (veca * 10);
2439 world_verts[1] = obj->pos + (veca * 10);
2440 world_verts[2] = obj->pos + (veca * 10);
2441 world_verts[3] = obj->pos - (veca * 10);
2442 world_verts[0].y += obj->ctype.blast_info.max_size;
2443 world_verts[1].y += obj->ctype.blast_info.max_size;
2444 for (int i = 0; i < 4; i++) {
2445 g3_RotatePoint(&pnts[i], &world_verts[i]);
2446 pnts[i].p3_flags |= PF_UV;
2447 pntlist[i] = &pnts[i];
2448 }
2449 pnts[0].p3_u = 0;
2450 pnts[0].p3_v = 0;
2451 pnts[1].p3_u = 1;
2452 pnts[1].p3_v = 0;
2453 pnts[2].p3_u = 1;
2454 pnts[2].p3_v = 1;
2455 pnts[3].p3_u = 0;
2456 pnts[3].p3_v = 1;
2457 rend_SetTextureType(TT_LINEAR);
2458 rend_SetLighting(LS_NONE);
2459 rend_SetOverlayType(OT_NONE);
2460 rend_SetAlphaType(AT_CONSTANT + AT_TEXTURE);
2461 rend_SetAlphaValue(.4 * 255);
2462
2463 vclip *vc = &GameVClips[Fireballs[obj->id].bm_handle];
2464 int bm_handle = vc->frames[3];
2465 g3_DrawPoly(4, pntlist, bm_handle);
2466}
2467// Creates end points that simulate lightning
2468void CreateLightningRodPositions(vector *src, vector *dest, vector *world_vecs, int num_segments, float rand_mag,
2469 bool do_flat) {

Callers 1

DrawFireballObjectFunction · 0.85

Calls 10

g3_RotatePointFunction · 0.85
g3_DrawPolyFunction · 0.85
FixCosFunction · 0.50
FixSinFunction · 0.50
rend_SetTextureTypeFunction · 0.50
rend_SetLightingFunction · 0.50
rend_SetOverlayTypeFunction · 0.50
rend_SetAlphaTypeFunction · 0.50
rend_SetAlphaValueFunction · 0.50

Tested by

no test coverage detected