Merge branch 'master' into jgrpp

# Conflicts:
#	src/lang/french.txt
#	src/network/network_udp.cpp
This commit is contained in:
Jonathan G Rennison
2021-04-12 22:59:30 +01:00
23 changed files with 174 additions and 81 deletions

View File

@@ -510,7 +510,7 @@ OpenGLBackend::~OpenGLBackend()
_glDeleteBuffers(1, &this->anim_pbo);
}
if (_glDeleteTextures != nullptr) {
ClearCursorCache();
this->InternalClearCursorCache();
OpenGLSprite::Destroy();
_glDeleteTextures(1, &this->vid_texture);
@@ -1082,12 +1082,7 @@ void OpenGLBackend::PopulateCursorCache()
this->clear_cursor_cache = false;
this->last_sprite_pal = (PaletteID)-1;
Sprite *sp;
while ((sp = this->cursor_cache.Pop()) != nullptr) {
OpenGLSprite *sprite = (OpenGLSprite *)sp->data;
sprite->~OpenGLSprite();
free(sp);
}
this->InternalClearCursorCache();
}
this->cursor_pos = _cursor.pos;
@@ -1113,6 +1108,19 @@ void OpenGLBackend::PopulateCursorCache()
/**
* Clear all cached cursor sprites.
*/
void OpenGLBackend::InternalClearCursorCache()
{
Sprite *sp;
while ((sp = this->cursor_cache.Pop()) != nullptr) {
OpenGLSprite *sprite = (OpenGLSprite *)sp->data;
sprite->~OpenGLSprite();
free(sp);
}
}
/**
* Queue a request for cursor cache clear.
*/
void OpenGLBackend::ClearCursorCache()
{
/* If the game loop is threaded, this function might be called

View File

@@ -77,6 +77,8 @@ private:
const char *Init();
bool InitShaders();
void InternalClearCursorCache();
void RenderOglSprite(OpenGLSprite *gl_sprite, PaletteID pal, int x, int y, ZoomLevel zoom);
public:

View File

@@ -20,7 +20,7 @@
/** The SDL video driver. */
class VideoDriver_SDL_Base : public VideoDriver {
public:
VideoDriver_SDL_Base() : sdl_window(nullptr) {}
VideoDriver_SDL_Base() : sdl_window(nullptr), buffer_locked(false) {}
const char *Start(const StringList &param) override;

View File

@@ -41,7 +41,7 @@ class VideoDriver : public Driver {
const uint DEFAULT_WINDOW_HEIGHT = 480u; ///< Default window height.
public:
VideoDriver() : is_game_threaded(true), change_blitter(nullptr) {}
VideoDriver() : fast_forward_key_pressed(false), fast_forward_via_key(false), is_game_threaded(true), change_blitter(nullptr) {}
/**
* Mark a particular area dirty.

View File

@@ -21,7 +21,7 @@
/** Base class for Windows video drivers. */
class VideoDriver_Win32Base : public VideoDriver {
public:
VideoDriver_Win32Base() : main_wnd(nullptr), fullscreen(false) {}
VideoDriver_Win32Base() : main_wnd(nullptr), fullscreen(false), buffer_locked(false) {}
void Stop() override;