From 24bc7d8db7744589672b0b16b269e99160b64e32 Mon Sep 17 00:00:00 2001 From: Saracen Date: Sun, 6 Mar 2016 17:00:29 +0000 Subject: Fix 'FLAG_RECEIVE_SHADOWS' flag for GeometryInstances so that turning it off now correctly disables shadows from affecting the instance. --- servers/visual/rasterizer.h | 1 + servers/visual/visual_server_raster.cpp | 4 ++-- servers/visual/visual_server_raster.h | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'servers') diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 276758ea95..194df9596a 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -546,6 +546,7 @@ public: bool depth_scale :8; bool billboard :8; bool billboard_y :8; + bool receive_shadows : 8; }; diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 2ce0c9a360..6d293f0ce8 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -2734,7 +2734,7 @@ void VisualServerRaster::instance_geometry_set_flag(RID p_instance,InstanceFlags } break; case INSTANCE_FLAG_RECEIVE_SHADOWS: { - instance->receive_shadows=p_enabled; + instance->data.receive_shadows=p_enabled; } break; case INSTANCE_FLAG_DEPH_SCALE: { @@ -2786,7 +2786,7 @@ bool VisualServerRaster::instance_geometry_get_flag(RID p_instance,InstanceFlags } break; case INSTANCE_FLAG_RECEIVE_SHADOWS: { - return instance->receive_shadows; + return instance->data.receive_shadows; } break; case INSTANCE_FLAG_DEPH_SCALE: { diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 77d5780c5f..06501d1b81 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -169,7 +169,6 @@ class VisualServerRaster : public VisualServer { AABB transformed_aabb; uint32_t object_ID; bool visible; - bool receive_shadows; bool visible_in_all_rooms; uint32_t layer_mask; float draw_range_begin; @@ -300,7 +299,7 @@ class VisualServerRaster : public VisualServer { update=false; visible=true; data.cast_shadows=SHADOW_CASTING_SETTING_ON; - receive_shadows=true; + data.receive_shadows=true; data.depth_scale=false; data.billboard=false; data.billboard_y=false; -- cgit v1.2.3