Renders the mouse cursor
| 2087 | |
| 2088 | // Renders the mouse cursor |
| 2089 | void TelcomRenderMouse(void) { |
| 2090 | rend_SetOverlayType(OT_NONE); |
| 2091 | rend_SetLighting(LS_NONE); |
| 2092 | rend_SetColorModel(CM_MONO); |
| 2093 | rend_SetZBufferState(0); |
| 2094 | rend_SetAlphaType(AT_CONSTANT + AT_TEXTURE); |
| 2095 | rend_SetAlphaValue(255); |
| 2096 | |
| 2097 | if (TC_cursor > -1) { |
| 2098 | int mx, my; |
| 2099 | mx = Telcom_mouse_x; |
| 2100 | my = Telcom_mouse_y; |
| 2101 | |
| 2102 | float u0 = 0.0f, v0 = 0.0f, u1 = 1.0f, v1 = 1.0f; |
| 2103 | int cur_w = bm_w(TC_cursor, 0); |
| 2104 | int cur_h = bm_h(TC_cursor, 0); |
| 2105 | |
| 2106 | if (mx > (Game_window_w - cur_w)) |
| 2107 | u1 = ((float)(Game_window_w - mx)) / ((float)cur_w); |
| 2108 | if (my > (Game_window_h - cur_h)) |
| 2109 | v1 = ((float)(Game_window_h - my)) / ((float)cur_h); |
| 2110 | |
| 2111 | rend_DrawScaledBitmap(mx, my, mx + (int)((float)cur_w * u1), my + (int)((float)cur_h * v1), TC_cursor, u0, v0, u1, |
| 2112 | v1); |
| 2113 | } |
| 2114 | rend_SetZBufferState(1); |
| 2115 | } |
| 2116 | |
| 2117 | // Creates the static bitmap overlays |
| 2118 | void TelcomCreateStaticOverlays(void) { |
no test coverage detected