How to remove Leap support?
by yoko · in Torque 2D Beginner · 05/01/2016 (7:19 pm) · 4 replies
Hi,
This might no be a very useful question, however in my project no Leap device will be used and I don't think it's any use to put the Leap DLL along with my game just because T2D exe links against Leap lib and require the DLL present. But it seems the way to remove it is to modify and recompile the executable.
Currently everything in my dev environment is Win32 only, and I'm not a VS user, most things done via scripting only , may I ask a easier way to clean the Leap dependencies (to save a few bytes of runtime)?
Don't get me wrong, Leap Motion is cool, but nether me or my target audience may use it in current works yet.
This might no be a very useful question, however in my project no Leap device will be used and I don't think it's any use to put the Leap DLL along with my game just because T2D exe links against Leap lib and require the DLL present. But it seems the way to remove it is to modify and recompile the executable.
Currently everything in my dev environment is Win32 only, and I'm not a VS user, most things done via scripting only , may I ask a easier way to clean the Leap dependencies (to save a few bytes of runtime)?
Don't get me wrong, Leap Motion is cool, but nether me or my target audience may use it in current works yet.
About the author
#2
Although I'm not a C++ user, I managed to search and delete the dependencies of Leap, and the T2D 3.3 compiles successfully in VS2015, the resulting Torque2D.exe is slightly bigger(I think it's somehow related to optimization) but requires no Leap anymore.
I also deleted the Leap Toys in the module dir to remove the trace of Leap.
I'm not sure if the Leap device is still actively developed, but I may want one later.
05/03/2016 (11:29 pm)
Hi,Although I'm not a C++ user, I managed to search and delete the dependencies of Leap, and the T2D 3.3 compiles successfully in VS2015, the resulting Torque2D.exe is slightly bigger(I think it's somehow related to optimization) but requires no Leap anymore.
I also deleted the Leap Toys in the module dir to remove the trace of Leap.
I'm not sure if the Leap device is still actively developed, but I may want one later.
#3
05/04/2016 (5:44 am)
Guess that works then! I'll post the unified diff for conditional compilation this week anyway - it's actually a pretty minor change, only touching maybe 10 files and it adds like two lines per file (an #ifdef/#endif pair for a preprocessor define).
#4
If you proceed in order, the line numbers should line up:
In engine/source/input/actionMap.cc -
You could also replace #ifdef with #ifndef to make Leap Motion available by default and only removed when the preprocessor variable is defined - up to you. But this way you can turn it on or off when you like.
05/04/2016 (4:08 pm)
Okay - the "readily reversible" way is like so:If you proceed in order, the line numbers should line up:
In engine/source/input/actionMap.cc -
794 - #ifdef _USELEAPMOTION__ 805 - #endif // _USELEAPMOTION__ 1184 - #ifdef _USELEAPMOTION__ 1288 - #endif // _USELEAPMOTION__ 1824 - #ifdef _USELEAPMOTION__ 1828 - #endif // _USELEAPMOTION__In engine/source/input/actionMap.h -
169 - #ifdef _USELEAPMOTION__ 171 - #endif // _USELEAPMOTION__In engine/source/input/leapMotion/leapMotionConstants.h -
22 - #ifdef _USELEAPMOTION__ 36 - #endif // _USELEAPMOTION__In engine/source/input/leapMotion/leapMotionManager.cc -
22 - #ifdef _USELEAPMOTION__ 675 - #endif // _USELEAPMOTION__In engine/source/input/leapMotion/leapMotionUtil.cpp -
22 - #ifdef _USELEAPMOTION__ 110 - #endif // _USELEAPMOTION__In engine/source/input/leapMotion/leapMotionUtil.h -
22 - #ifdef _USELEAPMOTION__ 49 - #endif // _USELEAPMOTION__Now, to enable Leap Motion define _USELEAPMOTION__ in your project's preprocessor defines.
You could also replace #ifdef with #ifndef to make Leap Motion available by default and only removed when the preprocessor variable is defined - up to you. But this way you can turn it on or off when you like.
Torque Owner Richard Ranft
Roostertail Games