Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion engine/includes/components/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ENGINE_EXPORT Component : public Object {

bool hasTag(const TString &tag);
bool hasTagByHash(uint32_t hash);
const std::vector<uint32_t> &tags() const;
std::vector<uint32_t> &tags();

virtual void composeComponent();

Expand Down
1 change: 1 addition & 0 deletions engine/includes/components/scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ENGINE_EXPORT Scene : public Object {
public:
Scene();
Scene(const Scene &origin);
~Scene();

World *world() const;

Expand Down
2 changes: 1 addition & 1 deletion engine/src/components/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ bool Component::hasTagByHash(uint32_t hash) {
/*!
Returns list of component tags.
*/
const std::vector<uint32_t> &Component::tags() const {
std::vector<uint32_t> &Component::tags() {
return m_tags;
}
/*!
Expand Down
12 changes: 12 additions & 0 deletions engine/src/components/scene.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "components/scene.h"

#include "components/world.h"
#include "components/component.h"

/*!
\class Scene
Expand All @@ -21,6 +22,17 @@ Scene::Scene(const Scene &origin) :
m_modified(origin.m_modified) {

}

Scene::~Scene() {
for(auto &group : m_groups) {
for(auto it : group.second) {
Component *component = dynamic_cast<Component *>(it);
if(component) {
component->tags().clear();
}
}
}
}
/*!
Returns the World to which the scene belongs.
*/
Expand Down
9 changes: 6 additions & 3 deletions engine/src/components/transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,12 @@ void Transform::setParent(Object *parent, int32_t position, bool force) {
}
Object::setParent(parent, 0, force);

Actor *p = dynamic_cast<Actor *>(actor()->parent());
if(p) {
setParentTransform(p->transform(), true);
Actor *actor = Transform::actor();
if(actor) {
Actor *p = dynamic_cast<Actor *>(actor->parent());
if(p) {
setParentTransform(p->transform(), true);
}
}
}
/*!
Expand Down
2 changes: 1 addition & 1 deletion worldeditor/bin/editor/materials/gizmo.shader
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void main(void) {
proj.y = 1.0 - proj.y;
#endif
float depth = getLinearDepth(texture(depthMap, proj).x, nearClipPlane(), farClipPlane());
rgb = _color;//(depth >= _vertex.z) ? _color : vec4(_color.xyz, _color.w * 0.25);
rgb = (depth >= _vertex.z) ? _color : vec4(_color.xyz, _color.w * 0.1);
}
]]></fragment>
<vertex><![CDATA[
Expand Down
5 changes: 2 additions & 3 deletions worldeditor/src/screens/scenecomposer/objectcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ void ObjectController::onDrop(QDropEvent *event) {
for(TString &str : list) {
if(!str.isEmpty()) {
if(mgr->assetTypeName(str) == Map::metaClass()->name()) {
emit dropMap((ProjectSettings::instance()->contentPath() + "/" + str).data(), (event->keyboardModifiers() & Qt::ControlModifier));
emit dropMap(str.data(), (event->keyboardModifiers() & Qt::ControlModifier));
return;
}
}
Expand Down Expand Up @@ -606,9 +606,8 @@ void ObjectController::onDragEnter(QDragEnterEvent *event) {

StringList list = TString(event->mimeData()->data(gMimeContent)).split(";");
AssetManager *mgr = AssetManager::instance();
for(TString str : list) {
for(TString &str : list) {
if(!str.isEmpty()) {
str = ProjectSettings::instance()->contentPath() + "/" + str;
TString type = mgr->assetTypeName(str);
if(type != Map::metaClass()->name()) {
Actor *actor = mgr->createActor(str);
Expand Down
Loading