Search found 29 matches

by coffeecat
Wed Feb 28, 2018 5:32 am
Forum: Support and Development
Topic: Equivalent to Gamemaker's sign() function?
Replies: 49
Views: 23297

Re: Equivalent to Gamemaker's sign() function?

Generally speaking, doing optimization in Lua could be harder than in C. It's harder to control or predict the performance of a piece of Lua code, since the gap between Lua and hardware instructions is larger. The performance may depend on the version of LuaJIT, some random state in the runtime envi...
by coffeecat
Tue Feb 27, 2018 10:37 am
Forum: Support and Development
Topic: Referencing object functions?
Replies: 12
Views: 6970

Re: Referencing object functions?

I'm not sure why you need Body_getPosition, but if you only need a semantically equivalent function, you can use a simple wrapper:

Code: Select all

local function Body_getPosition(body)
  return body:getPosition()
end
by coffeecat
Tue Feb 27, 2018 10:07 am
Forum: Support and Development
Topic: Equivalent to Gamemaker's sign() function?
Replies: 49
Views: 23297

Re: Equivalent to Gamemaker's sign() function?

raidho36, thanks for sharing your new ideas. Please note that we can't get a double multiply function that works with both double precision and 80-bit extended precision. The minimum positive representable number in 80-bit extended precision is approximately 3.65×10^−4951, and the maximum finite rep...
by coffeecat
Wed Feb 21, 2018 6:44 am
Forum: Support and Development
Topic: I know Lua - New to Löve
Replies: 2
Views: 2421

Re: I know Lua - New to Löve

You might be interested in https://github.com/love2d-community/love-api . Note that there's a list of "Projects using the LÖVE-API"
by coffeecat
Sat Feb 17, 2018 1:18 am
Forum: Support and Development
Topic: Ternary operator for just two possibilities?
Replies: 9
Views: 5909

Re: Ternary operator for just two possibilities?

I mean you can use meta-programming to get a new syntax like "variable = newvalue ifeq oldvalue". It's definitely a tradeoff to take, as you'll be introducing meta-programming into your project, and that comes with a cost. I personally am using Moonscript (for room scripts only), and don't...
by coffeecat
Sat Feb 17, 2018 1:07 am
Forum: Support and Development
Topic: luajit - attempt to index global 'love' (a nil value)
Replies: 18
Views: 9550

Re: luajit - attempt to index global 'love' (a nil value)

love must use LuaJIT 2.1 on iOS and Android, in order to support 64 bit devices. It uses LuaJIT 2.0 on desktops but you can swap it out for the 2.1 beta if you want. luajit 2.1 bytecode that works with 64 bit ARM is incompatible with 2.1 bytecode that works with 32 bit, as far as I know. The page y...
by coffeecat
Fri Feb 16, 2018 12:08 pm
Forum: Support and Development
Topic: Enumerate files outside of root / save directory, recursively
Replies: 22
Views: 14296

Re: Enumerate files outside of root / save directory, recursively

It probably is. Is there a liblove.so.0 on your system?
Yes. There's also a "liblove.so.0.0.0". I am using NixOS.
by coffeecat
Fri Feb 16, 2018 12:04 pm
Forum: Support and Development
Topic: Enumerate files outside of root / save directory, recursively
Replies: 22
Views: 14296

Re: Enumerate files outside of root / save directory, recursively

I would need to ffi.load('liblove.so.0'). There is no liblove.so.
Just for your information, I have a liblove.so on my system. This is probably Linux distribution-dependent.

Thanks for the explanation.
by coffeecat
Fri Feb 16, 2018 11:47 am
Forum: Support and Development
Topic: Enumerate files outside of root / save directory, recursively
Replies: 22
Views: 14296

Re: Enumerate files outside of root / save directory, recursively

Oops, sorry. It doesn't work because it can't find the liblove.so. This can be fixed by using ffi.load("path/to/liblove.so"), or add the path to liblove.so in LD_LIBRARY_PATH. Now I think a conditional as suggested by grump is the best way to do this. The best thing would be that Löve can ...
by coffeecat
Fri Feb 16, 2018 3:43 am
Forum: Support and Development
Topic: luajit - attempt to index global 'love' (a nil value)
Replies: 18
Views: 9550

Re: luajit - attempt to index global 'love' (a nil value)

Bytecode as generated by LuaJIT string.dump() is portable: The generated bytecode is portable and can be loaded on any architecture that LuaJIT supports, independent of word size or endianess. However the bytecode compatibility versions must match. If you always bundle the LuaJIT library with your g...