Skip to content

Commit

Permalink
Turn off per-pixel lighting by default on low power systems
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCWills authored and AJenbo committed Mar 8, 2025
1 parent 47a1f98 commit 7d89c45
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CMake/Definitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ foreach(
DEFAULT_AUDIO_CHANNELS
DEFAULT_AUDIO_BUFFER_SIZE
DEFAULT_AUDIO_RESAMPLING_QUALITY
DEFAULT_PER_PIXEL_LIGHTING
SDL1_VIDEO_MODE_BPP
SDL1_VIDEO_MODE_FLAGS
SDL1_VIDEO_MODE_SVID_FLAGS
Expand Down
8 changes: 5 additions & 3 deletions CMake/platforms/n3ds.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ set(DEVILUTIONX_STATIC_LIBSODIUM ON)
set(DEVILUTIONX_STATIC_LIBFMT ON)
set(DISABLE_ZERO_TIER ON)
set(LIBMPQ_FILE_BUFFER_SIZE 32768)
set(USE_SDL1 ON)
set(PREFILL_PLAYER_NAME ON)
set(DEVILUTIONX_GAMEPAD_TYPE Nintendo)
set(NOEXIT ON)

# 3DS libraries and compile definitions
Expand All @@ -28,11 +25,13 @@ list(APPEND DEVILUTIONX_PLATFORM_COMPILE_DEFINITIONS __3DS__)
set(DEVILUTIONX_DISABLE_STRIP ON)

#SDL video mode parameters
set(USE_SDL1 ON)
set(SDL1_VIDEO_MODE_FLAGS SDL_DOUBLEBUF|SDL_HWSURFACE)
set(SDL1_FORCE_SVID_VIDEO_MODE ON)
set(SDL1_VIDEO_MODE_BPP 8)
set(DEFAULT_WIDTH 800)
set(DEFAULT_HEIGHT 480)
set(DEFAULT_PER_PIXEL_LIGHTING false)

#Deploy assets to romfs
set(DEVILUTIONX_ASSETS_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/romfs")
Expand Down Expand Up @@ -62,3 +61,6 @@ set(JOY_BUTTON_BACK 7)
set(JOY_BUTTON_START 0)
set(JOY_BUTTON_TRIGGERLEFT 8)
set(JOY_BUTTON_TRIGGERRIGHT 9)
#Additional gamepad related options
set(DEVILUTIONX_GAMEPAD_TYPE Nintendo)
set(PREFILL_PLAYER_NAME ON)
5 changes: 4 additions & 1 deletion Source/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ namespace devilution {
#ifndef DEFAULT_AUDIO_RESAMPLING_QUALITY
#define DEFAULT_AUDIO_RESAMPLING_QUALITY 3
#endif
#ifndef DEFAULT_PER_PIXEL_LIGHTING
#define DEFAULT_PER_PIXEL_LIGHTING true
#endif

namespace {

Expand Down Expand Up @@ -674,7 +677,7 @@ GraphicsOptions::GraphicsOptions()
})
, brightness("Brightness Correction", OptionEntryFlags::Invisible, "Brightness Correction", "Brightness correction level.", 0)
, zoom("Zoom", OptionEntryFlags::None, N_("Zoom"), N_("Zoom on when enabled."), false)
, perPixelLighting("Per-pixel Lighting", OptionEntryFlags::None, N_("Per-pixel Lighting"), N_("Subtile lighting for smoother light gradients."), true)
, perPixelLighting("Per-pixel Lighting", OptionEntryFlags::None, N_("Per-pixel Lighting"), N_("Subtile lighting for smoother light gradients."), DEFAULT_PER_PIXEL_LIGHTING)
, colorCycling("Color Cycling", OptionEntryFlags::None, N_("Color Cycling"), N_("Color cycling effect used for water, lava, and acid animation."), true)
, alternateNestArt("Alternate nest art", OptionEntryFlags::OnlyHellfire | OptionEntryFlags::CantChangeInGame, N_("Alternate nest art"), N_("The game will use an alternative palette for Hellfire’s nest tileset."), false)
#if SDL_VERSION_ATLEAST(2, 0, 0)
Expand Down

0 comments on commit 7d89c45

Please sign in to comment.