aboutsummaryrefslogtreecommitdiff
path: root/src/canvas.c
diff options
context:
space:
mode:
authorKrow Savcik <krow@savcik.xyz>2024-07-31 13:35:43 +0300
committerKrow Savcik <krow@savcik.xyz>2024-07-31 13:35:43 +0300
commit35fdfc1eb9be244e37002380de6c3ac650648cab (patch)
tree5475e2dd495c3fc5b1d1861893175b88a42f3de2 /src/canvas.c
parent1c1c5fa9b1094e96e6eea8abc163949e2277e151 (diff)
feature: improved the export function to include frames into considerationHEADmaster
Diffstat (limited to 'src/canvas.c')
-rw-r--r--src/canvas.c38
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 */