love-loader icon indicating copy to clipboard operation
love-loader copied to clipboard

The lib should be stateless

Open kikito opened this issue 11 years ago • 4 comments

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:

  • State is moved outside of the library and into the user's env (where it should be INMHO)
  • You can have several loaders (for example one loader per level)
  • It's possible that we even don't need 'start' if we do it right.

We can probably use a single resource-loading thread for all the extra loaders (as opposed to one per loader); but we shall see.

kikito avatar Jan 13 '14 22:01 kikito

I have no time to dedicate to this project so I have decided to declare it unmaintained and close all open issues.

kikito avatar Mar 11 '18 23:03 kikito

reopened and never talked in again

ghost avatar May 11 '22 10:05 ghost

it worked!?!!?!?!!1!1!?

ghost avatar May 11 '22 10:05 ghost

I think my reopening of this was more aspirational than anything. Otherwise there would be a corresponding PR. But it's been many years so your guess is as good as mine at this point.

TannerRogalsky avatar May 11 '22 10:05 TannerRogalsky