projects
/
laserbrain_demo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
91c5d07
)
picking up exhibits works again with the slot mechanism
author
John Tsiombikas
<nuclear@member.fsf.org>
Wed, 17 Jan 2018 14:42:03 +0000
(16:42 +0200)
committer
John Tsiombikas
<nuclear@member.fsf.org>
Wed, 17 Jan 2018 14:42:03 +0000
(16:42 +0200)
src/app.cc
patch
|
blob
|
history
diff --git
a/src/app.cc
b/src/app.cc
index
8865012
..
d4b516e
100644
(file)
--- a/
src/app.cc
+++ b/
src/app.cc
@@
-648,17
+648,19
@@
void app_mouse_button(int bn, bool pressed, int x, int y)
} else {
if(exsel_grab_mouse) {
// cancel grab on mouse release
} else {
if(exsel_grab_mouse) {
// cancel grab on mouse release
- debug_log("releasing...\n");
Exhibit *ex = exsel_grab_mouse.ex;
Vec3 pos = exslot_mouse.node.get_position();
Exhibit *ex = exsel_grab_mouse.ex;
Vec3 pos = exslot_mouse.node.get_position();
- debug_log("release location: %g %g %g\n", pos.x, pos.y, pos.z);
- ExhibitSlot *slot = exman->nearest_empty_slot(pos);
+ debug_log("releasing at %g %g %g ...\n", pos.x, pos.y, pos.z);
+
+ exslot_mouse.detach_exhibit();
+
+ ExhibitSlot *slot = exman->nearest_empty_slot(pos, 100);
if(!slot) {
if(!slot) {
- debug_log("no nearby slot\n");
+ debug_log("no empty slot nearby\n");
if(ex->prev_slot && ex->prev_slot->empty()) {
slot = ex->prev_slot;
if(ex->prev_slot && ex->prev_slot->empty()) {
slot = ex->prev_slot;
- debug_log("previous slot available though\n");
+ debug_log("using previous slot");
}
}
}
}