summaryrefslogtreecommitdiff
path: root/src/environment.h
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-08-05 22:29:47 +0200
committerest31 <MTest31@outlook.com>2015-09-19 20:57:07 +0200
commit9c635f28ac2b103bf7196e47947bf64673c13393 (patch)
treeefdde722915c72c54f982144e7a1714897e517e4 /src/environment.h
parentfe994946b7fabdb6f3cc7d11ec6ee1a27f7f5c20 (diff)
downloadminetest-9c635f28ac2b103bf7196e47947bf64673c13393.tar.gz
minetest-9c635f28ac2b103bf7196e47947bf64673c13393.tar.bz2
minetest-9c635f28ac2b103bf7196e47947bf64673c13393.zip
Little optimization on getAdded/Removed activeobjects per player loop.
Use std::queue instead of std::set, we don't need such a heavy container. Don't convert position to int to convert it back to float in the next function.
Diffstat (limited to 'src/environment.h')
-rw-r--r--src/environment.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/environment.h b/src/environment.h
index 22840a9fc..41295abf2 100644
--- a/src/environment.h
+++ b/src/environment.h
@@ -265,19 +265,19 @@ public:
Find out what new objects have been added to
inside a radius around a position
*/
- void getAddedActiveObjects(v3s16 pos, s16 radius,
+ void getAddedActiveObjects(Player *player, s16 radius,
s16 player_radius,
std::set<u16> &current_objects,
- std::set<u16> &added_objects);
+ std::queue<u16> &added_objects);
/*
Find out what new objects have been removed from
inside a radius around a position
*/
- void getRemovedActiveObjects(v3s16 pos, s16 radius,
+ void getRemovedActiveObjects(Player* player, s16 radius,
s16 player_radius,
std::set<u16> &current_objects,
- std::set<u16> &removed_objects);
+ std::queue<u16> &removed_objects);
/*
Get the next message emitted by some active object.