Skip to content

Commit

Permalink
Re-create render context when "ignore_texture_filter" setting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dorkster committed Sep 3, 2018
1 parent 7f555da commit 15bddf0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Flare v1.08 (WIP)
Engine fixes:

* Fixed sdl_hardware renderer not clearing top/bottom for tall windows.
* Re-create render context when "ignore_texture_filter" setting changes.



Expand Down
1 change: 1 addition & 0 deletions src/RenderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ RenderDevice::RenderDevice()
, hwsurface(false)
, vsync(false)
, texture_filter(false)
, ignore_texture_filter(false)
, min_screen(640, 480)
, is_initialized(false)
, reload_graphics(false)
Expand Down
1 change: 1 addition & 0 deletions src/RenderDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class RenderDevice {
bool hwsurface;
bool vsync;
bool texture_filter;
bool ignore_texture_filter;
Point min_screen;

bool is_initialized;
Expand Down
7 changes: 6 additions & 1 deletion src/SDLHardwareRenderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ SDLHardwareRenderDevice::SDLHardwareRenderDevice()
}

int SDLHardwareRenderDevice::createContextInternal() {
bool settings_changed = (fullscreen != settings->fullscreen || hwsurface != settings->hwsurface || vsync != settings->vsync || texture_filter != settings->texture_filter);
bool settings_changed = (fullscreen != settings->fullscreen ||
hwsurface != settings->hwsurface ||
vsync != settings->vsync ||
texture_filter != settings->texture_filter ||
ignore_texture_filter != eset->resolutions.ignore_texture_filter);

Uint32 w_flags = 0;
Uint32 r_flags = 0;
Expand Down Expand Up @@ -204,6 +208,7 @@ int SDLHardwareRenderDevice::createContextInternal() {
hwsurface = settings->hwsurface;
vsync = settings->vsync;
texture_filter = settings->texture_filter;
ignore_texture_filter = eset->resolutions.ignore_texture_filter;
is_initialized = true;

Utils::logInfo("RenderDevice: Fullscreen=%d, Hardware surfaces=%d, Vsync=%d, Texture Filter=%d", fullscreen, hwsurface, vsync, texture_filter);
Expand Down
7 changes: 6 additions & 1 deletion src/SDLSoftwareRenderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ SDLSoftwareRenderDevice::SDLSoftwareRenderDevice()
}

int SDLSoftwareRenderDevice::createContextInternal() {
bool settings_changed = (fullscreen != settings->fullscreen || hwsurface != settings->hwsurface || vsync != settings->vsync || texture_filter != settings->texture_filter);
bool settings_changed = (fullscreen != settings->fullscreen ||
hwsurface != settings->hwsurface ||
vsync != settings->vsync ||
texture_filter != settings->texture_filter ||
ignore_texture_filter != eset->resolutions.ignore_texture_filter);

Uint32 w_flags = 0;
Uint32 r_flags = 0;
Expand Down Expand Up @@ -240,6 +244,7 @@ int SDLSoftwareRenderDevice::createContextInternal() {
hwsurface = settings->hwsurface;
vsync = settings->vsync;
texture_filter = settings->texture_filter;
ignore_texture_filter = eset->resolutions.ignore_texture_filter;
is_initialized = true;

Utils::logInfo("RenderDevice: Fullscreen=%d, Hardware surfaces=%d, Vsync=%d, Texture Filter=%d", fullscreen, hwsurface, vsync, texture_filter);
Expand Down
2 changes: 1 addition & 1 deletion src/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FLARE. If not, see https://www.gnu.org/licenses/

#include <SDL.h>

Version VersionInfo::ENGINE(1, 7, 1);
Version VersionInfo::ENGINE(1, 7, 2);
Version VersionInfo::MIN(0, 0, 0);
Version VersionInfo::MAX(USHRT_MAX, USHRT_MAX, USHRT_MAX);

Expand Down

0 comments on commit 15bddf0

Please sign in to comment.