| 1098 | }; |
| 1099 | |
| 1100 | void OpenGLBackend::PopulateCursorCache() |
| 1101 | { |
| 1102 | if (this->clear_cursor_cache) { |
| 1103 | /* We have a pending cursor cache clear to do first. */ |
| 1104 | this->clear_cursor_cache = false; |
| 1105 | this->last_sprite_pal = (PaletteID)-1; |
| 1106 | |
| 1107 | this->InternalClearCursorCache(); |
| 1108 | } |
| 1109 | |
| 1110 | this->cursor_pos = _cursor.pos; |
| 1111 | this->cursor_in_window = _cursor.in_window; |
| 1112 | |
| 1113 | this->cursor_sprites.clear(); |
| 1114 | for (const auto &sc : _cursor.sprites) { |
| 1115 | this->cursor_sprites.emplace_back(sc); |
| 1116 | |
| 1117 | if (!this->cursor_cache.Contains(sc.image.sprite)) { |
| 1118 | OpenGLSpriteAllocator allocator(this->cursor_cache, sc.image.sprite); |
| 1119 | GetRawSprite(sc.image.sprite, SpriteType::Normal, &allocator, this); |
| 1120 | } |
| 1121 | } |
| 1122 | } |
| 1123 | |
| 1124 | /** |
| 1125 | * Clear all cached cursor sprites. |
no test coverage detected