Added libary providing basic compatibility for bitwise operations with love on desktop #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
love 11.5 on desktop is using luajit 2.1 which has builtin support for bitwise operations. Lua 5.1., which is currently used for building love.js, does not.
The following worked with love on desktop but not with love.js:
Of course one could simply implement the bitwise operations in pure lua, but that would be suboptimal performance-wise, compared to the C version anyway.
Using the MIT-licenced module from https://bitop.luajit.org/ makes it possible to use the same (efficient) lua-code on desktop as well as web.
The easiest (but probably not the prettiest) way to include this was to add the
bit.cfile directly to the lua-5.1-sources.Using the modified megasource i managed to build a version of love.js that supports the "bit"-module.
Note that I have very limited knowledge of C/C++ and absolutely no knowledge of cmake. So I'm not sure if this PR can, or even should be merged like this.