diff --git a/src/hwr2/resource_management.cpp b/src/hwr2/resource_management.cpp index b16c366d0..7d1fb37e2 100644 --- a/src/hwr2/resource_management.cpp +++ b/src/hwr2/resource_management.cpp @@ -32,6 +32,7 @@ void PaletteManager::update(Rhi& rhi, Handle ctx) palette_ = rhi.create_texture({TextureFormat::kRGBA, kPaletteSize, 1, TextureWrapMode::kClamp, TextureWrapMode::kClamp}); } +#if 0 if (!lighttable_) { lighttable_ = rhi.create_texture({TextureFormat::kLuminance, kPaletteSize, kLighttableRows, TextureWrapMode::kClamp, TextureWrapMode::kClamp}); @@ -41,6 +42,7 @@ void PaletteManager::update(Rhi& rhi, Handle ctx) { encore_lighttable_ = rhi.create_texture({TextureFormat::kLuminance, kPaletteSize, kLighttableRows, TextureWrapMode::kClamp, TextureWrapMode::kClamp}); } +#endif if (!default_colormap_) { @@ -57,6 +59,7 @@ void PaletteManager::update(Rhi& rhi, Handle ctx) rhi.update_texture(ctx, palette_, {0, 0, kPaletteSize, 1}, PixelFormat::kRGBA8, tcb::as_bytes(tcb::span(palette_32))); } +#if 0 // Lighttables { if (colormaps != nullptr) @@ -65,12 +68,15 @@ void PaletteManager::update(Rhi& rhi, Handle ctx) rhi.update_texture(ctx, lighttable_, {0, 0, kPaletteSize, kLighttableRows}, PixelFormat::kR8, colormap_bytes); } + // FIXME: This is broken, encoremap should not be used directly. + // Instead, use colormaps + COLORMAP_REMAPOFFSET. See R_ReInitColormaps. if (encoremap != nullptr) { tcb::span encoremap_bytes = tcb::as_bytes(tcb::span(encoremap, kPaletteSize * kLighttableRows)); rhi.update_texture(ctx, encore_lighttable_, {0, 0, kPaletteSize, kLighttableRows}, PixelFormat::kR8, encoremap_bytes); } } +#endif // Default colormap { diff --git a/src/hwr2/resource_management.hpp b/src/hwr2/resource_management.hpp index 8c9adffc0..153b0b1d8 100644 --- a/src/hwr2/resource_management.hpp +++ b/src/hwr2/resource_management.hpp @@ -20,8 +20,10 @@ namespace srb2::hwr2 class PaletteManager { rhi::Handle palette_; +#if 0 rhi::Handle lighttable_; rhi::Handle encore_lighttable_; +#endif rhi::Handle default_colormap_; std::unordered_map> colormaps_; @@ -36,8 +38,10 @@ public: PaletteManager& operator=(PaletteManager&&); rhi::Handle palette() const noexcept { return palette_; } +#if 0 rhi::Handle lighttable() const noexcept { return lighttable_; } rhi::Handle encore_lighttable() const noexcept { return encore_lighttable_; } +#endif rhi::Handle default_colormap() const noexcept { return default_colormap_; } void update(rhi::Rhi& rhi, rhi::Handle ctx);