kikito / love-loader Goto Github PK
View Code? Open in Web Editor NEWThreaded resource loading for LÖVE
Home Page: http://love2d.org
License: MIT License
Threaded resource loading for LÖVE
Home Page: http://love2d.org
License: MIT License
Please add the ability to load videos since Löve 0.10.0 supports them.
Im just gonna link to the forum thread because I have no idea what is going on
Is it possible to implement a fallback with no threads? I want to use it with punchdrunk and don't want to change my code.
Right now the library holds a lot of state in vars. I don't like that.
local loader = require 'love-loader'
local loader1 = loader.newLoader(finishedCallback, loadedCallback)
loader1:newImage( images, 'rabbit', 'path/to/rabbit.png')
loader1:newSource( sounds, 'iiiik', 'path/to/iiik.ogg')
loader1:newSource( sounds, 'music', 'path/to/music.ogg', 'stream')
This fixes two things:
We can probably use a single resource-loading thread for all the extra loaders (as opposed to one per loader); but we shall see.
Error: bad argument #1 to '?' (filename, File, or FileData expected)
Due to equal requestKey
in both font
and BMFont
kinds, they got same channel. That leads to situation, when resource is post-processed by wrong kind in getResourceFromThreadIfAvailable()
I get different results when the finishedCallback is called..
Sometimes I get this in the console.
first tween finished
image table: 0x02945188 left-hand-climber-hi
second tween finished
and sometimes this:
first tween finished
image table: 0x02945188 left-hand-climber-hi
second tween finished
second tween finished
Testprogram:
https://www.love2d.org/forums/download/file.php?id=9951
https://www.love2d.org/forums/viewtopic.php?f=5&t=77904&p=168404#p168318
https://www.love2d.org/forums/viewtopic.php?f=5&t=77904&p=168404#p168404
Force loading specific modules is not nice, I would expect that disabling the sound module from conf.lua
would make love-loader only load images, instead the sound module is loaded anyway because of the requires at the beginning, deleting these of course makes love-loader crash.
For a future version (maybe whenever this becomes stateless) love-loader should check for each needed module before even start loading.
This will useful in a stateless version so that only the needed loaders are loaded in each thread, for example if I want to load sounds in a thread and images in other then I would only require love.sound
in one and not in the other. Also helpful when I'm only using love-loader for images, for example.
Hi, using this lib for löve 11.1 gives this error
Thread Error
love-loader.lua:100 bad argument #2 to 'constructor' (string expected, got no value)
To be honest, I don't know whether to request it here or there (https://github.com/vrld/slam).
I tried to simply require slam in love-loader.lua but then it fails to load any audio.
Error: lib/love-loader.lua:205: lib/love-loader.lua:103: bad argument #1 to 'push' (boolean, number, string, love type, or flat table expected)
stack traceback:
lib/hump/gamestate.lua:89: in function <lib/hump/gamestate.lua:88>
[C]: in function 'assert'
lib/love-loader.lua:205: in function 'update'
states/LOAD.lua:10: in function 'update'
[string "boot.lua"]:461: in function <[string "boot.lua"]:433>
[C]: in function 'xpcall'
I tried to debug this but don't know how to get details since the error seems to happen within the thread.
Currently font loading (bitmap or otherwise) is not supported by the library. It would be nice if we could load fonts in a separate thread, along with everything else.
Hey, want to update this to work with 0.10?
https://github.com/kikito/love-loader/blob/master/love-loader.lua#L101
On my system (Windows 7 x86_64) the separator ends up being "" which does not seem to work. When I manually switch it to "/" it works fine.
Error: libs/loader/loader.lua:167: Could not open file libs\loader\loader.lua. Does not exist.
stack traceback:
libs/hump/gamestate.lua:81: in function <libs/hump/gamestate.lua:80>
[C]: in function 'newThread'
libs/loader/loader.lua:167: in function 'start'
gamestates/loading.lua:35: in function 'switch'
main.lua:13: in function 'load'
[string "boot.lua"]:407: in function <[string "boot.lua"]:399>
[C]: in function 'xpcall'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.