/ld27

To get this branch, use:
bzr branch /bzr/ld27

« back to all changes in this revision

Viewing changes to zoetrope/core/cached.lua

  • Committer: Josh C
  • Date: 2014-07-03 14:41:57 UTC
  • Revision ID: josh@9ix.org-20140703144157-xydxt62xzcdq6bdk
cluke009 zoetrope + my spritebatch changes

Show diffs side-by-side

added added

removed removed

99
99
 
100
100
                local realPath = self:_absolutePath(path)
101
101
 
102
 
                if not self._library.sound[realPath] then
103
 
                        if length == 'short' then
 
102
                if length == 'short' then
 
103
                        if not self._library.sound[realPath] then
104
104
                                self._library.sound[realPath] = love.sound.newSoundData(realPath)
105
 
                        elseif length == 'long' then
106
 
                                self._library.sound[realPath] = love.sound.newDecoder(realPath)
107
 
                        else
108
 
                                error('length must be either "short" or "long"')
109
105
                        end
 
106
 
 
107
                        return self._library.sound[path]
 
108
                elseif length == 'long' then
 
109
                        return love.sound.newDecoder(realPath)
 
110
                else
 
111
                        error('length must be either "short" or "long"')
110
112
                end
111
 
 
112
 
                return self._library.sound[path]
113
113
        end,
114
114
 
115
115
        -- Method: font