| 103 | } |
| 104 | |
| 105 | void PlaceholderObject::Draw() { |
| 106 | if (g_debug_runtime_disable_placeholder_object_draw) { |
| 107 | return; |
| 108 | } |
| 109 | |
| 110 | if (!scenegraph_->map_editor->IsTypeEnabled(_placeholder_object) || |
| 111 | scenegraph_->map_editor->state_ == MapEditor::kInGame || |
| 112 | !visible_ || |
| 113 | Graphics::Instance()->media_mode() || |
| 114 | ActiveCameras::Instance()->Get()->GetFlags() == Camera::kPreviewCamera) { |
| 115 | if (title_debug_string_id != -1) { |
| 116 | DebugDraw::Instance()->SetVisible(title_debug_string_id, false); |
| 117 | } |
| 118 | } else { |
| 119 | if (title_debug_string_id != -1) { |
| 120 | DebugDraw::Instance()->SetVisible(title_debug_string_id, true); |
| 121 | } |
| 122 | |
| 123 | bool old_shadow_cache_dirty = shadow_cache_dirty; |
| 124 | for (auto& preview_object : preview_objects_) { |
| 125 | preview_object->SetTransformationMatrix(GetTransform()); |
| 126 | preview_object->ReceiveObjectMessage(OBJECT_MSG::DRAW); |
| 127 | } |
| 128 | shadow_cache_dirty = old_shadow_cache_dirty; // We don't want to update static shadow maps just because we moved this preview object |
| 129 | |
| 130 | if (ActiveCameras::Get()->GetFlags() == Camera::kEditorCamera) { |
| 131 | if (billboard_texture_ref_.valid()) { |
| 132 | DebugDraw::Instance()->AddBillboard(billboard_texture_ref_->GetTextureRef(), GetTranslation(), GetScale()[0], vec4(1.0f), kStraight, _delete_on_draw); |
| 133 | } |
| 134 | DrawEditorLabel(); |
| 135 | } else { |
| 136 | ClearEditorLabel(); |
| 137 | } |
| 138 | |
| 139 | if (connect_id_ != -1) { |
| 140 | Object* obj = scenegraph_->GetObjectFromID(connect_id_); |
| 141 | if (obj) { |
| 142 | DebugDraw::Instance()->AddLine(GetTranslation(), obj->GetTranslation(), vec4(1.0f, 1.0f, 1.0f, 0.5f), _delete_on_draw); |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | void PlaceholderObject::GetDesc(EntityDescription& desc) const { |
| 149 | Object::GetDesc(desc); |
nothing calls this directly
no test coverage detected