Page 14 of 91

Re: "Questions that don't deserve their own thread" thread

Posted: Thu Sep 04, 2014 4:15 pm
by Whatthefuck
slime wrote:
Whatthefuck wrote:Is there any way to load .lua files in threads? I tried doing require "filename", but it errors out in the thread.
You have to require love.filesystem (and any other love modules you might want to use) in the thread's code.
See the [wiki]love.thread[/wiki] wiki page.
Yeah, I figured that out after I posted. :[

Also, are there any other FFI library versions of LOVE stuff like that FFI ImageData library?

Re: "Questions that don't deserve their own thread" thread

Posted: Thu Sep 04, 2014 5:44 pm
by slime
Whatthefuck wrote:Also, are there any other FFI library versions of LOVE stuff like that FFI ImageData library?
From the same Github repository: https://github.com/slime73/love-snippet ... ta-ffi.lua

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Sep 05, 2014 4:35 am
by Whatthefuck
Interesting. Is it possible to write FFI versions of thr spritebatch library? If it is, what would I need to do?

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Sep 05, 2014 5:00 am
by slime
It's not (without modifying LÖVE's source), and you generally shouldn't need that kind of micro-optimization for spritebatches. If you're considering it, it might be a sign that you're trying to optimize down a misleading path or you're using the wrong sort of algorithm or tool for your end goal.

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Sep 05, 2014 1:55 pm
by Whatthefuck
slime wrote:It's not (without modifying LÖVE's source), and you generally shouldn't need that kind of micro-optimization for spritebatches. If you're considering it, it might be a sign that you're trying to optimize down a misleading path or you're using the wrong sort of algorithm or tool for your end goal.
Nah, my usage of spritebatches is fine, I was just wondering since every little bit would be of use.

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Sep 05, 2014 2:11 pm
by Plu
Honestly, if every little bit matters, you should probably build it in C. It'll earn you a lot more speed than anything else would :)

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Sep 05, 2014 7:04 pm
by Whatthefuck
Plu wrote:Honestly, if every little bit matters, you should probably build it in C. It'll earn you a lot more speed than anything else would :)
With the current speed (930 fps on my end), it's not necessary. x)
The reason why I am asking whether there are any other FFI version libraries, is that even though what I currently have is optimized really nicely, I wouldn't mind further adding something that'd make it even faster.

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Sep 05, 2014 10:00 pm
by Zilarrezko
I have another question, this time I hope it will be more easy to understand. But In LuaSocket I'd like for others to be able to connect to me, because I have my server on my computer. How would I do this? I haven't tested it, but I put my IP... like my actual IP that isn't an IPv4 addess (192.yadda.yaddayadda etc..).

Edit: sorry, let me make clear I put my IP in the [insert udp object here]:setpeername(address, port) as address, the #1 parameter.

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Sep 05, 2014 10:49 pm
by DaedalusYoung
192.168.0.0 is the ip address for your router. You can only connect to other computers on the home network with this. You will need to open and/or forward the appropriate port in your router's configuration if you want the internet to be able to connect to your computer. Additionally, you may need to disable the firewall on the same port.

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Sep 06, 2014 3:41 am
by Zilarrezko
DaedalusYoung wrote:192.168.0.0 is the ip address for your router. You can only connect to other computers on the home network with this. You will need to open and/or forward the appropriate port in your router's configuration if you want the internet to be able to connect to your computer. Additionally, you may need to disable the firewall on the same port.
Okay so, I use the 192.168? yadda yadda? or use the one i've been using... which is the one you get from this site. But I know how to portforward, that's not hard. Is there a recommended port to forward? or shall I just choose my own?