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

Function TelcomRenderScanline

Descent3/TelCom.cpp:2008–2043  ·  view source on GitHub ↗

Renders the scanline to be drawn

Source from the content-addressed store, hash-verified

2006
2007// Renders the scanline to be drawn
2008void TelcomRenderScanline(void) {
2009 if (scanline_handle <= BAD_BITMAP_HANDLE)
2010 return;
2011
2012 rend_SetAlphaType(AT_SATURATE_TEXTURE_VERTEX);
2013 rend_SetAlphaValue(120);
2014 rend_SetLighting(LS_NONE);
2015 rend_SetColorModel(CM_MONO);
2016 rend_SetOverlayType(OT_NONE);
2017 rend_SetFiltering(0);
2018 rend_SetWrapType(WT_CLAMP);
2019
2020 int x, end_x, start_x;
2021 float alphas[4];
2022 alphas[0] = 0;
2023 alphas[1] = 0;
2024 alphas[2] = 0.05f;
2025 alphas[3] = 0.05f;
2026
2027 start_x = Telcom_system.Monitor_coords[MONITOR_MAIN].left;
2028 end_x = start_x + Telcom_system.Monitor_coords[MONITOR_MAIN].right - Telcom_system.Monitor_coords[MONITOR_MAIN].left;
2029
2030 float end_time = timer_GetTime();
2031
2032 while (end_time > scanline_nexttime) {
2033 for (x = start_x; x < end_x; x += 32)
2034 rend_DrawScaledBitmap(x, scanliney, x + 32, scanliney + 16, scanline_handle, 0, 0, 1, 1, -1, alphas);
2035 scanliney++;
2036 scanline_nexttime += scanline_speed;
2037 }
2038
2039 if (scanliney > Telcom_system.Monitor_coords[MONITOR_MAIN].bottom)
2040 scanliney = Telcom_system.Monitor_coords[MONITOR_MAIN].top - 32;
2041
2042 rend_SetFiltering(1);
2043}
2044
2045// Creates the scanline
2046void TelcomCreateScanLine(void) {

Callers 1

TelcomRenderOverlaysFunction · 0.85

Calls 8

rend_SetAlphaTypeFunction · 0.50
rend_SetAlphaValueFunction · 0.50
rend_SetLightingFunction · 0.50
rend_SetColorModelFunction · 0.50
rend_SetOverlayTypeFunction · 0.50
rend_SetFilteringFunction · 0.50
rend_SetWrapTypeFunction · 0.50
rend_DrawScaledBitmapFunction · 0.50

Tested by

no test coverage detected