Skip to content

Instantly share code, notes, and snippets.

@michicc
Created March 8, 2021 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michicc/81e1a54901af5837fcb1ddb61aeb886e to your computer and use it in GitHub Desktop.
Save michicc/81e1a54901af5837fcb1ddb61aeb886e to your computer and use it in GitHub Desktop.
diff --git a/src/video/cocoa/cocoa_ogl.mm b/src/video/cocoa/cocoa_ogl.mm
index 7410918fa..8d02428e0 100644
--- a/src/video/cocoa/cocoa_ogl.mm
+++ b/src/video/cocoa/cocoa_ogl.mm
@@ -214,6 +214,8 @@ const char *VideoDriver_CocoaOpenGL::Start(const StringList &param)
this->UpdateVideoModes();
MarkWholeScreenDirty();
+ this->is_game_threaded = !GetDriverParamBool(param, "no_threads") && !GetDriverParamBool(param, "no_thread");
+
return nullptr;
}
diff --git a/src/video/opengl.cpp b/src/video/opengl.cpp
index e2638961e..64ea02cf2 100644
--- a/src/video/opengl.cpp
+++ b/src/video/opengl.cpp
@@ -1036,14 +1036,16 @@ void OpenGLBackend::DrawMouseCursor()
_cur_dpi = &_screen;
for (uint i = 0; i < _cursor.sprite_count; ++i) {
SpriteID sprite = _cursor.sprite_seq[i].sprite;
- const Sprite *spr = GetSprite(sprite, ST_NORMAL);
-
- /* PopulateCursorCache() should have put the sprite in the cache. */
- assert(this->cursor_cache.Contains(sprite));
- this->RenderOglSprite((OpenGLSprite *)this->cursor_cache.Get(sprite)->data, _cursor.sprite_seq[i].pal,
- _cursor.pos.x + _cursor.sprite_pos[i].x + UnScaleByZoom(spr->x_offs, ZOOM_LVL_GUI),
- _cursor.pos.y + _cursor.sprite_pos[i].y + UnScaleByZoom(spr->y_offs, ZOOM_LVL_GUI),
- ZOOM_LVL_GUI);
+
+ /* Sprites are cached by PopulateCursorCache(). */
+ if (this->cursor_cache.Contains(sprite)) {
+ const Sprite *spr = GetSprite(sprite, ST_NORMAL);
+
+ this->RenderOglSprite((OpenGLSprite *)this->cursor_cache.Get(sprite)->data, _cursor.sprite_seq[i].pal,
+ _cursor.pos.x + _cursor.sprite_pos[i].x + UnScaleByZoom(spr->x_offs, ZOOM_LVL_GUI),
+ _cursor.pos.y + _cursor.sprite_pos[i].y + UnScaleByZoom(spr->y_offs, ZOOM_LVL_GUI),
+ ZOOM_LVL_GUI);
+ }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment