MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / DrawMouseCursor

Method DrawMouseCursor

src/video/opengl.cpp:1071–1088  ·  view source on GitHub ↗

* Draw mouse cursor on screen. */

Source from the content-addressed store, hash-verified

1069 * Draw mouse cursor on screen.
1070 */
1071void OpenGLBackend::DrawMouseCursor()
1072{
1073 if (!this->cursor_in_window) return;
1074
1075 /* Draw cursor on screen */
1076 _cur_dpi = &_screen;
1077 for (const auto &cs : this->cursor_sprites) {
1078 /* Sprites are cached by PopulateCursorCache(). */
1079 if (this->cursor_cache.Contains(cs.image.sprite)) {
1080 const OpenGLSprite *spr = this->cursor_cache.Get(cs.image.sprite).get();
1081
1082 this->RenderOglSprite(spr, cs.image.pal,
1083 this->cursor_pos.x + cs.pos.x + UnScaleByZoom(spr->x_offs, _gui_zoom),
1084 this->cursor_pos.y + cs.pos.y + UnScaleByZoom(spr->y_offs, _gui_zoom),
1085 _gui_zoom);
1086 }
1087 }
1088}
1089
1090class OpenGLSpriteAllocator : public SpriteAllocator {
1091public:

Callers 2

PaintMethod · 0.80
PaintMethod · 0.80

Calls 5

RenderOglSpriteMethod · 0.95
UnScaleByZoomFunction · 0.85
ContainsMethod · 0.45
getMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected