From 8a9415b88e91331904aa04b28df7d9a716b42293 Mon Sep 17 00:00:00 2001 From: Danilo Date: Wed, 13 Nov 2024 14:23:27 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=B5es=20em=20BlendState?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/xna-dx/implementations.hpp | 4 +++- includes/xna/graphics/blendstate.hpp | 2 -- sources/framework-dx/blendstate.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/xna-dx/implementations.hpp b/includes/xna-dx/implementations.hpp index 2bf9f36..ff89487 100644 --- a/includes/xna-dx/implementations.hpp +++ b/includes/xna-dx/implementations.hpp @@ -17,7 +17,9 @@ namespace xna { D3D11_BLEND_DESC Description{}; float BlendFactor[4]{ 1.0F, 1.0F, 1.0F, 1.0F }; UINT SampleMask{ 0xffffffff }; - comptr BlendState; + comptr BlendState; + + static constexpr int MAX_RENDER_TARGETS = 8; }; struct SpriteFont::PlatformImplementation { diff --git a/includes/xna/graphics/blendstate.hpp b/includes/xna/graphics/blendstate.hpp index bd5415c..751e93b 100644 --- a/includes/xna/graphics/blendstate.hpp +++ b/includes/xna/graphics/blendstate.hpp @@ -169,8 +169,6 @@ namespace xna { //that is blending source and destination data using alpha while assuming the color data contains no alpha information. static std::unique_ptr NonPremultiplied(); }; - - using PBlendState = std::shared_ptr; } #endif \ No newline at end of file diff --git a/sources/framework-dx/blendstate.cpp b/sources/framework-dx/blendstate.cpp index e48064f..794a675 100644 --- a/sources/framework-dx/blendstate.cpp +++ b/sources/framework-dx/blendstate.cpp @@ -142,7 +142,7 @@ namespace xna { } void BlendState::RenderTargets(BlendRenderTarget const* value, size_t size) { - for (size_t i = 0; i < size && i < 8; ++i) { + for (size_t i = 0; i < size && i < Implementation->MAX_RENDER_TARGETS; ++i) { Implementation->Description.RenderTarget[i].BlendEnable = value[i].Enabled; Implementation->Description.RenderTarget[i].SrcBlend = DxHelpers::BlendToDx(value[i].Source); Implementation->Description.RenderTarget[i].DestBlend = DxHelpers::BlendToDx(value[i].Destination);