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

Function TelcomRenderMouse

Descent3/TelCom.cpp:2089–2115  ·  view source on GitHub ↗

Renders the mouse cursor

Source from the content-addressed store, hash-verified

2087
2088// Renders the mouse cursor
2089void 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
2118void TelcomCreateStaticOverlays(void) {

Callers 1

TelcomRenderScreenFunction · 0.85

Calls 9

bm_wFunction · 0.85
bm_hFunction · 0.85
rend_SetOverlayTypeFunction · 0.50
rend_SetLightingFunction · 0.50
rend_SetColorModelFunction · 0.50
rend_SetZBufferStateFunction · 0.50
rend_SetAlphaTypeFunction · 0.50
rend_SetAlphaValueFunction · 0.50
rend_DrawScaledBitmapFunction · 0.50

Tested by

no test coverage detected