diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index 999c3bc02..514226680 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wiVersion // minor features, major updates const int minor = 14; // minor bug fixes, alterations, refactors, updates - const int revision = 0; + const int revision = 1; long GetVersion() diff --git a/WickedEngine/wiWidget.cpp b/WickedEngine/wiWidget.cpp index fe1610d8a..f145c5460 100644 --- a/WickedEngine/wiWidget.cpp +++ b/WickedEngine/wiWidget.cpp @@ -1602,6 +1602,8 @@ void wiColorPicker::Render(wiGUI* gui) static wiGraphicsTypes::GPUBuffer vb_preview; static wiGraphicsTypes::GraphicsPSO PSO; + static std::vector vertices_saturation(0); + static bool buffersComplete = false; if (!buffersComplete) { @@ -1610,30 +1612,21 @@ void wiColorPicker::Render(wiGUI* gui) HRESULT hr = S_OK; // saturation { - static std::vector vertices(0); - if (vb_saturation.IsValid() && !vertices.empty()) - { - vertices[0].col = hue_color; - wiRenderer::GetDevice()->UpdateBuffer(&vb_saturation, vertices.data(), threadID, vb_saturation.GetDesc().ByteWidth); - } - else - { - vertices.push_back({ XMFLOAT4(0,0,0,0),XMFLOAT4(1,0,0,1) }); // hue - vertices.push_back({ XMFLOAT4(0,0,0,0),XMFLOAT4(1,1,1,1) }); // white - vertices.push_back({ XMFLOAT4(0,0,0,0),XMFLOAT4(0,0,0,1) }); // black - wiMath::ConstructTriangleEquilateral(__colorpicker_radius_triangle, vertices[0].pos, vertices[1].pos, vertices[2].pos); + vertices_saturation.push_back({ XMFLOAT4(0,0,0,0),XMFLOAT4(1,0,0,1) }); // hue + vertices_saturation.push_back({ XMFLOAT4(0,0,0,0),XMFLOAT4(1,1,1,1) }); // white + vertices_saturation.push_back({ XMFLOAT4(0,0,0,0),XMFLOAT4(0,0,0,1) }); // black + wiMath::ConstructTriangleEquilateral(__colorpicker_radius_triangle, vertices_saturation[0].pos, vertices_saturation[1].pos, vertices_saturation[2].pos); - GPUBufferDesc desc; - desc.BindFlags = BIND_VERTEX_BUFFER; - desc.ByteWidth = (UINT)(vertices.size() * sizeof(Vertex)); - desc.CPUAccessFlags = CPU_ACCESS_WRITE; - desc.MiscFlags = 0; - desc.StructureByteStride = 0; - desc.Usage = USAGE_DYNAMIC; - SubresourceData data; - data.pSysMem = vertices.data(); - hr = wiRenderer::GetDevice()->CreateBuffer(&desc, &data, &vb_saturation); - } + GPUBufferDesc desc; + desc.BindFlags = BIND_VERTEX_BUFFER; + desc.ByteWidth = (UINT)(vertices_saturation.size() * sizeof(Vertex)); + desc.CPUAccessFlags = CPU_ACCESS_WRITE; + desc.MiscFlags = 0; + desc.StructureByteStride = 0; + desc.Usage = USAGE_DYNAMIC; + SubresourceData data; + data.pSysMem = vertices_saturation.data(); + hr = wiRenderer::GetDevice()->CreateBuffer(&desc, &data, &vb_saturation); } // hue { @@ -1735,6 +1728,12 @@ void wiColorPicker::Render(wiGUI* gui) // render saturation triangle { + if (vb_saturation.IsValid() && !vertices_saturation.empty()) + { + vertices_saturation[0].col = hue_color; + wiRenderer::GetDevice()->UpdateBuffer(&vb_saturation, vertices_saturation.data(), threadID, vb_saturation.GetDesc().ByteWidth); + } + cb.mTransform = XMMatrixTranspose( XMMatrixRotationZ(-angle) * XMMatrixTranslation(translation.x + __colorpicker_center, translation.y + __colorpicker_center, 0) * diff --git a/models/Emitter/flare.wimf b/models/Emitter/flare.wimf index d4fb0e6cc..02c831321 100644 Binary files a/models/Emitter/flare.wimf and b/models/Emitter/flare.wimf differ