Search found 779 matches

by Boolsheet
Fri Nov 22, 2013 3:03 pm
Forum: Support and Development
Topic: is it possible for a thread to use love.filesystem?
Replies: 8
Views: 3501

Re: is it possible for a thread to use love.filesystem?

Well, then provide your code or some testcase so we can test it ourselves. If you only say "it doesn't work" then my answer to that is "works for me". Also, as a general warning: assume nothing is thread-safe (unless stated otherwise). While PhsysicsFS might have been built threa...
by Boolsheet
Thu Nov 21, 2013 1:08 pm
Forum: Support and Development
Topic: Weird filtering issue
Replies: 3
Views: 2330

Re: Weird filtering issue

It actually has to do with the blend mode, but it's not a mistake. It's just how the alpha blend mode works. To get the expected blending you would have to prepare your image for premultiplied blending. That means multiplying the red, green, and blue channel with the alpha channel and then drawing t...
by Boolsheet
Thu Nov 21, 2013 12:53 pm
Forum: Support and Development
Topic: randomseed
Replies: 15
Views: 6425

Re: randomseed

The beauty of the C runtime library is that everyone has its own implementation. Here's the assembly from the MS VC++ 2010 x86 runtime library. mov eax,dword ptr [ecx+14h] imul eax,eax,343FDh add eax,269EC3h mov dword ptr [ecx+14h],eax shr eax,10h and eax,7FFFh ret Which is indeed very similar to AN...
by Boolsheet
Wed Nov 20, 2013 7:57 pm
Forum: Support and Development
Topic: Cannot create file.
Replies: 7
Views: 5625

Re: Cannot create file.

EDIT: I made this to see what would happen. Path to main file is on my USB, then doesn't that mean I should have the files be created on that said USB? Because it creates them in the Notepad++ directory (dozens of files just.. there... lol) The Lua IO is relative to the working directory if you don...
by Boolsheet
Wed Nov 20, 2013 6:18 pm
Forum: Support and Development
Topic: randomseed
Replies: 15
Views: 6425

Re: randomseed

It's not incorrect. It's meant to warm up the generator. Depending on the algorithm behind math.randomseed and math.random, the first random value may be very closely related to the seed. This can trip you up if you expect an actual random first number and instead get slowly increasing numbers becau...
by Boolsheet
Wed Nov 20, 2013 2:12 pm
Forum: Support and Development
Topic: Cannot create file.
Replies: 7
Views: 5625

Re: Cannot create file.

Yep. You can now check in love.load or the global arg table what $(CURRENT_DIRECTORY) expanded into.

Code: Select all

function love.load(args)
	local path_to_game = args[1]
end
This will be the path and file name of a love archive if you start it from that.
by Boolsheet
Wed Nov 20, 2013 1:29 pm
Forum: Support and Development
Topic: audio out of memory
Replies: 1
Views: 1400

Re: audio out of memory

You call [wiki]love.graphics.newImage[/wiki] every frame. The note on the wiki page warns of this. You create so many images that you run out of memory. They do eventually get collected, but doing it every frame is too much for the somewhat lenient garbage collector and the limit is reached pretty q...
by Boolsheet
Wed Nov 20, 2013 8:53 am
Forum: Support and Development
Topic: Cannot create file.
Replies: 7
Views: 5625

Re: Cannot create file.

Probably in the Notepad++ directory then. The working directory can be anywhere. LÖVE provides you this fabulous function [wiki]love.filesystem.getWorkingDirectory[/wiki] to find out where it is. Note that it will most likely return an absolute path and in platform-specific notation. Oh, and for a &...
by Boolsheet
Tue Nov 19, 2013 10:21 pm
Forum: Support and Development
Topic: Cannot create file.
Replies: 7
Views: 5625

Re: Cannot create file.

Works for me. Did you check if io.open or file:write return error messages? It's common in Lua that the second return value is an error message when the first return value is nil. Do you know the concept of the working directory? That's where the file will end up. On Windows for example, the shortcu...
by Boolsheet
Sun Nov 17, 2013 6:46 pm
Forum: Support and Development
Topic: EXE size.
Replies: 1
Views: 1816

Re: EXE size.

The Windows PE loader is smart enough to only load the things it knows and needs into memory. The appended zip archive is garbage to it and it will be ignored.