diff options
Diffstat (limited to 'test/fixtures/sprites')
-rw-r--r-- | test/fixtures/sprites/atlas_reference.bin | bin | 0 -> 8137 bytes | |||
-rw-r--r-- | test/fixtures/sprites/atlas_reference.png | bin | 0 -> 9109 bytes | |||
-rw-r--r-- | test/fixtures/sprites/bright.bin | bin | 0 -> 68824 bytes | |||
-rw-r--r-- | test/fixtures/sprites/convert_sprite.js | 19 |
4 files changed, 19 insertions, 0 deletions
diff --git a/test/fixtures/sprites/atlas_reference.bin b/test/fixtures/sprites/atlas_reference.bin Binary files differnew file mode 100644 index 0000000000..57eb28bd93 --- /dev/null +++ b/test/fixtures/sprites/atlas_reference.bin diff --git a/test/fixtures/sprites/atlas_reference.png b/test/fixtures/sprites/atlas_reference.png Binary files differnew file mode 100644 index 0000000000..86fad30983 --- /dev/null +++ b/test/fixtures/sprites/atlas_reference.png diff --git a/test/fixtures/sprites/bright.bin b/test/fixtures/sprites/bright.bin Binary files differnew file mode 100644 index 0000000000..3aee130074 --- /dev/null +++ b/test/fixtures/sprites/bright.bin diff --git a/test/fixtures/sprites/convert_sprite.js b/test/fixtures/sprites/convert_sprite.js new file mode 100644 index 0000000000..ba4ff5c29f --- /dev/null +++ b/test/fixtures/sprites/convert_sprite.js @@ -0,0 +1,19 @@ +// Converts a PNG image to a custom "image format" that has a uint32_t width/height prefix and then +// raw RGBA data. We can't use the built-in PNG reading routines because they are reading +// premultiplied images by default. + +var fs = require('fs'); +var zlib = require('zlib'); +var PNG = require('png-js'); +var png = PNG.load('styles/sprites/bright.png'); +png.decodePixels(function(data) { + var result = new Buffer(8 + data.length); + result.writeUInt32BE(png.width, 0); + result.writeUInt32BE(png.height, 4); + data.copy(result, 8); + + zlib.deflate(result, function(err, data) { + if (err) throw err; + fs.writeFileSync('test/fixtures/sprites/bright.bin', data); + }); +}); |