mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
C Export: Remove temporary canvas and directly use the rendered one for export
This commit is contained in:
parent
dfb8fec0c9
commit
e41b8f740b
@ -22,10 +22,6 @@
|
||||
var height = this.piskelController.getHeight();
|
||||
var frameCount = this.piskelController.getFrameCount();
|
||||
|
||||
// Create a background canvas that will be filled with the transparent color before each render.
|
||||
var background = pskl.utils.CanvasUtils.createCanvas(width, height);
|
||||
var context = background.getContext('2d');
|
||||
|
||||
// Useful defines for C routines
|
||||
var frameStr = '#include <stdint.h>\n\n';
|
||||
frameStr += '#define ' + cName.toUpperCase() + '_FRAME_COUNT ' + this.piskelController.getFrameCount() + '\n';
|
||||
@ -39,7 +35,7 @@
|
||||
|
||||
for (var i = 0 ; i < frameCount ; i++) {
|
||||
var render = this.piskelController.renderFrameAt(i, true);
|
||||
context.drawImage(render, 0, 0, width, height);
|
||||
var context = render.getContext('2d');
|
||||
var imgd = context.getImageData(0, 0, width, height);
|
||||
var pix = imgd.data;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user