MCPcopy Create free account
hub / github.com/JACoders/OpenJK / CIN_AddTextCrawl

Function CIN_AddTextCrawl

code/client/cl_cin.cpp:1604–1681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1602#define TC_DELAY 9000
1603#define TC_STOPTIME 81000
1604static void CIN_AddTextCrawl()
1605{
1606 refdef_t refdef;
1607 polyVert_t verts[4];
1608
1609 // Set up refdef
1610 memset( &refdef, 0, sizeof( refdef ));
1611
1612 refdef.rdflags = RDF_NOWORLDMODEL;
1613 AxisClear( refdef.viewaxis );
1614
1615 refdef.fov_x = 130;
1616 refdef.fov_y = 130;
1617
1618 refdef.x = 0;
1619 refdef.y = -50;
1620 refdef.width = cls.glconfig.vidWidth;
1621 refdef.height = cls.glconfig.vidHeight * 2; // deliberately extend off the bottom of the screen
1622
1623 // use to set shaderTime for scrolling shaders
1624 refdef.time = 0;
1625
1626 // Set up the poly verts
1627 float fadeDown = 1.0;
1628 if (cls.realtime-CL_iPlaybackStartTime >= (TC_STOPTIME-2500))
1629 {
1630 fadeDown = (TC_STOPTIME - (cls.realtime-CL_iPlaybackStartTime))/ 2480.0f;
1631 if (fadeDown < 0)
1632 {
1633 fadeDown = 0;
1634 }
1635 if (fadeDown > 1)
1636 {
1637 fadeDown = 1;
1638 }
1639 }
1640 for ( int i = 0; i < 4; i++ )
1641 {
1642 verts[i].modulate[0] = 255*fadeDown; // gold color?
1643 verts[i].modulate[1] = 235*fadeDown;
1644 verts[i].modulate[2] = 127*fadeDown;
1645 verts[i].modulate[3] = 255*fadeDown;
1646 }
1647
1648 VectorScaleM( verts[2].modulate, 0.1f, verts[2].modulate ); // darken at the top??
1649 VectorScaleM( verts[3].modulate, 0.1f, verts[3].modulate );
1650
1651#define TIMEOFFSET +(cls.realtime-CL_iPlaybackStartTime-TC_DELAY)*0.000015f -1
1652 VectorSet( verts[0].xyz, TC_PLANE_NEAR, -TC_PLANE_WIDTH, TC_PLANE_TOP );
1653 verts[0].st[0] = 1;
1654 verts[0].st[1] = 1 TIMEOFFSET;
1655
1656 VectorSet( verts[1].xyz, TC_PLANE_NEAR, TC_PLANE_WIDTH, TC_PLANE_TOP );
1657 verts[1].st[0] = 0;
1658 verts[1].st[1] = 1 TIMEOFFSET;
1659
1660 VectorSet( verts[2].xyz, TC_PLANE_FAR, TC_PLANE_WIDTH, TC_PLANE_BOTTOM );
1661 verts[2].st[0] = 0;

Callers 1

SCR_DrawCinematicFunction · 0.85

Calls 5

AxisClearFunction · 0.85
VectorSetFunction · 0.85
RoQShutdownFunction · 0.70
SCR_StopCinematicFunction · 0.70
AddPolyToSceneMethod · 0.45

Tested by

no test coverage detected