node-wad
Version:
A Doom WAD parser and writer.
22 lines (16 loc) • 542 B
text/coffeescript
class WLump
constructor: (, data, name) ->
= new Buffer(data)
= name.toString('ascii')
while .endsWith("\x00")
= .slice(0, -1)
# For console.dir purposes:
= .toString('utf-8')
getSize: =>
return .length
write: (bf) =>
if .length == 0
return
for i in [0...length - 1]
bf.writeUInt8(.slice(i, i + 1).readUInt8())
module.exports = WLump