Renders the scanline to be drawn
| 2006 | |
| 2007 | // Renders the scanline to be drawn |
| 2008 | void 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 |
| 2046 | void TelcomCreateScanLine(void) { |
no test coverage detected