mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-07 18:04:47 +01:00
Merge remote-tracking branch 'origin/feat/switch-blades' into feat/renderers-cleanup
This commit is contained in:
@@ -108,7 +108,8 @@ opengl46_vaogeometrybank::replace_( gfx::geometry_handle const &Geometry ) {
|
||||
auto &chunkrecord = m_chunkrecords[ Geometry.chunk - 1 ];
|
||||
chunkrecord.is_good = false;
|
||||
// if the overall length of the chunk didn't change we can get away with reusing the old buffer...
|
||||
if( geometry_bank::chunk( Geometry ).vertices.size() != chunkrecord.vertex_count ) {
|
||||
if( ( geometry_bank::chunk( Geometry ).vertices.size() != chunkrecord.vertex_count )
|
||||
|| ( geometry_bank::chunk( Geometry ).userdata.empty() == chunkrecord.has_userdata ) ) {
|
||||
// ...but otherwise we'll need to allocate a new one
|
||||
// TBD: we could keep and reuse the old buffer also if the new chunk is smaller than the old one,
|
||||
// but it'd require some extra tracking and work to keep all chunks up to date; also wasting vram; may be not worth it?
|
||||
|
||||
@@ -2350,6 +2350,8 @@ if (!Global.gfx_skippipeline)
|
||||
bool opengl46_renderer::Render_reflections(viewport_config &vp)
|
||||
{
|
||||
if( Global.reflectiontune.update_interval == 0 ) { return false; }
|
||||
// the top view of the editor shows nothing the reflections would be seen on: the cube map stays as it was
|
||||
if( EditorModeFlag && Global.EditorOrtho ) { return false; }
|
||||
|
||||
if( m_environmentupdateface >= 6 ) {
|
||||
// no update in progress, check whether it's time for another one
|
||||
@@ -3132,6 +3134,12 @@ bool opengl46_renderer::Append(gfx::vertex_array &Vertices, gfx::userdata_array
|
||||
return m_geometry.append(Vertices, Userdata, Geometry);
|
||||
}
|
||||
|
||||
void opengl46_renderer::Erase(gfx::geometry_handle const &Geometry)
|
||||
{
|
||||
m_chunkspheres.erase(static_cast<std::uint64_t>(Geometry));
|
||||
m_geometry.erase(Geometry);
|
||||
}
|
||||
|
||||
// provides direct access to index data of specfied chunk
|
||||
gfx::index_array const & opengl46_renderer::Indices(gfx::geometry_handle const &Geometry) const
|
||||
{
|
||||
@@ -5391,6 +5399,13 @@ void opengl46_renderer::Update_Pick_Control()
|
||||
}
|
||||
}
|
||||
|
||||
void opengl46_renderer::Forget_Node(scene::basic_node const *Node)
|
||||
{
|
||||
if (m_picksceneryitem == Node)
|
||||
m_picksceneryitem = nullptr;
|
||||
std::replace_if(m_picksceneryitems.begin(), m_picksceneryitems.end(), [Node](scene::basic_node const *Item) { return Item == Node; }, nullptr);
|
||||
}
|
||||
|
||||
void opengl46_renderer::Update_Pick_Node()
|
||||
{
|
||||
if (!m_picking_node_pbo->is_busy())
|
||||
|
||||
@@ -89,6 +89,7 @@ class opengl46_renderer : public gfx_renderer, public gfx::scene_walk {
|
||||
bool Replace_Indexed(gfx::index_array &Indices, gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry) override;
|
||||
// adds supplied vertex data at the end of specified chunk
|
||||
bool Append(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type) override;
|
||||
void Erase( gfx::geometry_handle const &Geometry ) override;
|
||||
// provides direct access to index data of specfied chunk
|
||||
gfx::index_array const &
|
||||
Indices( gfx::geometry_handle const &Geometry ) const override;
|
||||
@@ -145,6 +146,8 @@ class opengl46_renderer : public gfx_renderer, public gfx::scene_walk {
|
||||
Pick_Control() const override { return m_pickcontrolitem; }
|
||||
scene::basic_node const *
|
||||
Pick_Node() const override { return m_picksceneryitem; }
|
||||
void
|
||||
Forget_Node( scene::basic_node const *Node ) override;
|
||||
glm::dvec3
|
||||
Mouse_Position() const override { return m_worldmousecoordinates; }
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user