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

Function DrawVisEffect

Descent3/viseffect.cpp:1804–2011  ·  view source on GitHub ↗

Renders a vis effect

Source from the content-addressed store, hash-verified

1802
1803// Renders a vis effect
1804void DrawVisEffect(vis_effect *vis) {
1805 ASSERT(vis->type != VIS_NONE);
1806
1807 // First check to see if these are special types
1808
1809 if (vis->id == LIGHTNING_BOLT_INDEX || vis->id == GRAY_LIGHTNING_BOLT_INDEX) {
1810 DrawVisLightningBolt(vis);
1811 return;
1812 } else if (vis->id == MASSDRIVER_EFFECT_INDEX) {
1813 DrawVisMassDriverEffect(vis, false);
1814 return;
1815 } else if (vis->id == MERCBOSS_MASSDRIVER_EFFECT_INDEX) {
1816 DrawVisMassDriverEffect(vis, true);
1817 return;
1818 } else if (vis->id == BILLBOARD_SMOKETRAIL_INDEX) {
1819 DrawVisBillboardSmoketrail(vis);
1820 return;
1821 } else if (vis->id == THICK_LIGHTNING_INDEX) {
1822 DrawVisThickLightning(vis);
1823 return;
1824 } else if (vis->id == SINE_WAVE_INDEX) {
1825 DrawVisSineWave(vis);
1826 return;
1827 } else if (vis->id == BLAST_RING_INDEX) {
1828 DrawVisBlastRing(vis);
1829 return;
1830 } else if (vis->id == FADING_LINE_INDEX) {
1831 DrawVisFadingLine(vis);
1832 return;
1833 } else if (vis->id == SNOWFLAKE_INDEX) {
1834 DrawVisSnowflake(vis);
1835 return;
1836 } else if (vis->id == RAINDROP_INDEX || vis->id == PUDDLEDROP_INDEX) {
1837 DrawVisRainDrop(vis);
1838 return;
1839 } else if (vis->id == AXIS_BILLBOARD_INDEX) {
1840 DrawVisAxisBillboard(vis);
1841 return;
1842 }
1843
1844 float norm_time;
1845 float time_live = Gametime - vis->creation_time;
1846
1847 // This hack is needed for the demo system and Gamegauge, since it adjusts gametime during
1848 // the game there are times when this could be a negative number (which would be bad)
1849 if (time_live < 0)
1850 time_live = 0;
1851
1852 float size = vis->size;
1853
1854 // Bigger explosions for Katmai
1855 if (Katmai) {
1856 if (vis->id == BIG_EXPLOSION_INDEX || vis->id == MED_EXPLOSION_INDEX || vis->id == MED_EXPLOSION_INDEX2 ||
1857 vis->id == MED_EXPLOSION_INDEX3)
1858 size *= 1.8f;
1859 }
1860
1861 int visnum = vis - VisEffects;

Callers 3

RenderAllTerrainObjectsFunction · 0.85
PostRenderFunction · 0.85
RenderRoomObjectsFunction · 0.85

Calls 15

DrawVisLightningBoltFunction · 0.85
DrawVisMassDriverEffectFunction · 0.85
DrawVisThickLightningFunction · 0.85
DrawVisSineWaveFunction · 0.85
DrawVisBlastRingFunction · 0.85
DrawVisFadingLineFunction · 0.85
DrawVisSnowflakeFunction · 0.85
DrawVisRainDropFunction · 0.85
DrawVisAxisBillboardFunction · 0.85
GetTextureBitmapFunction · 0.85
GR_16_TO_COLORFunction · 0.85

Tested by

no test coverage detected