diff options
Diffstat (limited to 'src/canvas.c')
-rw-r--r-- | src/canvas.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/canvas.c b/src/canvas.c index 21c9096..b5b3d8d 100644 --- a/src/canvas.c +++ b/src/canvas.c @@ -23,7 +23,6 @@ typedef struct Layer Layer; static uint8 canvas_add_cells(Canvas *, uint); static uint canvas_fill_bfs(Canvas *, int, int, uint, uint); -static uint canvas_blend_color(uint, uint); static void canvas_point_redraw(Canvas *, long int, long int); static void canvas_set_proj_path(Canvas *, const char *); static void action_do(Canvas *); @@ -494,41 +493,6 @@ canvas_save(Canvas *c, const char *path, short int s) } uint8 -canvas_export_png(Canvas *c, const char *path, void *ren) -{ -/* TODO: check path */ - SDL_Surface *surf; - /* SDL_Texture *tex; */ - SDL_Rect dest; - int i, j, k, ret = 0; - dest.x = dest.y = 0; - dest.w = c->w; - dest.h = c->h; - - - surf = SDL_CreateRGBSurfaceWithFormat( 0, c->w, c->h, 32, SDL_PIXELFORMAT_RGBA8888); - ret = ret || (surf == NULL); - - SDL_LockSurface(surf); - -/* TODO: Assuming bad stuff (pixel size) */ - for (j = 0; j < c->h; j++) { - for (k = 0; k < c->w; k++) { - canvas_point_redraw(c, k, j); - ((unsigned int *)surf->pixels)[COORD(k,j)] = c->pres_pix[COORD(k, j)]; - } - } - - SDL_UnlockSurface(surf); - ret = ret || (IMG_SavePNG(surf, path) == -1); - SDL_FreeSurface(surf); - - if (ret) - fprintf(stderr, "%s:%d:canvas_export_png: Error while exporting\n", __FILE__, __LINE__); - return ret; -} - -uint8 canvas_add_layer(Canvas *c, uint pos) { int i, j; @@ -755,7 +719,7 @@ canvas_fill_bfs(Canvas *c, int x, int y, uint oldcol, uint newcol) return c->temp_cnt; } -static uint +uint canvas_blend_color(uint a, uint b) { /* TODO: do actual blending */ |