Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DEVILUTIONX_DISPLAY_TEXTURE_FORMAT #6556

Merged
merged 1 commit into from
Sep 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMake/Definitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ foreach(
REMAP_KEYBOARD_KEYS
DEVILUTIONX_DEFAULT_RESAMPLER
STREAM_ALL_AUDIO_MIN_FILE_SIZE
DEVILUTIONX_DISPLAY_TEXTURE_FORMAT
)
if(DEFINED ${def_name} AND NOT ${def_name} STREQUAL "")
list(APPEND DEVILUTIONX_DEFINITIONS ${def_name}=${${def_name}})
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ option(MACOSX_STANDALONE_APP_BUNDLE "Generate a portable app bundle to use on ot
cmake_dependent_option(DISABLE_TCP "Disable TCP multiplayer option" OFF "NOT NONET" ON)
cmake_dependent_option(DISABLE_ZERO_TIER "Disable ZeroTier multiplayer option" OFF "NOT NONET" ON)

# Graphics options
if(NOT USE_SDL1)
set(DEVILUTIONX_DISPLAY_TEXTURE_FORMAT "SDL_PIXELFORMAT_RGB888" CACHE STRING "Texture format for DevilutionX textures when using the GPU renderer")
mark_as_advanced(DEVILUTIONX_DISPLAY_TEXTURE_FORMAT)
endif()

# Sound options
option(NOSOUND "Disable sound support" OFF)
option(DEVILUTIONX_RESAMPLER_SPEEX "Build with Speex resampler" ON)
Expand Down
2 changes: 1 addition & 1 deletion Source/storm/storm_svid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ bool SVidPlayBegin(const char *filename, int flags)
if (renderer != nullptr) {
int renderWidth = static_cast<int>(SVidWidth);
int renderHeight = static_cast<int>(SVidHeight);
texture = SDLWrap::CreateTexture(renderer, SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_STREAMING, renderWidth, renderHeight);
texture = SDLWrap::CreateTexture(renderer, DEVILUTIONX_DISPLAY_TEXTURE_FORMAT, SDL_TEXTUREACCESS_STREAMING, renderWidth, renderHeight);
if (SDL_RenderSetLogicalSize(renderer, renderWidth, renderHeight) <= -1) {
ErrSdl();
}
Expand Down
2 changes: 1 addition & 1 deletion Source/utils/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void ReinitializeTexture()
auto quality = StrCat(static_cast<int>(*sgOptions.Graphics.scaleQuality));
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, quality.c_str());

texture = SDLWrap::CreateTexture(renderer, SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_STREAMING, gnScreenWidth, gnScreenHeight);
texture = SDLWrap::CreateTexture(renderer, DEVILUTIONX_DISPLAY_TEXTURE_FORMAT, SDL_TEXTUREACCESS_STREAMING, gnScreenWidth, gnScreenHeight);
}

void ReinitializeIntegerScale()
Expand Down