Mercurial > MadButterfly
changeset 69:a6150b4e0667
Fix bug of newing linear & radial paints
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 13 Aug 2008 08:21:06 +0800 |
parents | 018546012798 |
children | 92cfabe22d6b |
files | tools/mb_c_header.m4 tools/mb_c_source.m4 |
diffstat | 2 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/mb_c_header.m4 Wed Aug 13 08:08:52 2008 +0800 +++ b/tools/mb_c_header.m4 Wed Aug 13 08:21:06 2008 +0800 @@ -40,7 +40,7 @@ $2[]dnl [}; -extern $1_t *$1_new(redraw_mant_t *rdman); +extern $1_t *$1_new(redraw_man_t *rdman); extern void $1_free($1_t *obj); #endif /* __$1_H_ */]
--- a/tools/mb_c_source.m4 Wed Aug 13 08:08:52 2008 +0800 +++ b/tools/mb_c_source.m4 Wed Aug 13 08:21:06 2008 +0800 @@ -43,7 +43,7 @@ divert[]]) define([S_ADD_LINEAR_PAINT],[ - obj->$1 = mb_linear_new(rdman, $2, $3, $4, $5); + obj->$1 = paint_linear_new(rdman, $2, $3, $4, $5); ifelse(COUNT($6),0,,[dnl stops = (grad_stop_t *)malloc(sizeof(grad_stop_t) * n_$1_stops); memcpy(stops, $1_stops, sizeof(grad_stop_t) * n_$1_stops); @@ -52,7 +52,7 @@ ]) define([S_ADD_RADIAL_PAINT],[ - obj->$1 = mb_radial_new(rdman, $2, $3, $4); + obj->$1 = paint_radial_new(rdman, $2, $3, $4); ifelse(COUNT($5),0,,[ stops = (grad_stop_t *)malloc(sizeof(grad_stop_t) * n_$1_stops); memcpy(stops, $1_stops, sizeof(grad_stop_t) * n_$1_stops); @@ -135,11 +135,11 @@ ]]); define([F_FILL_SHAPE],[[ - obj->$1->free(obj->$1); + obj->$1_fill->free(obj->$1_fill); ]]) define([F_STROKE_SHAPE],[[ - obj->$1->free(obj->$1); + obj->$1_stroke->free(obj->$1_stroke); ]]) define([CLEAR_VARS],[divert([-1]) @@ -159,13 +159,15 @@ define([MADBUTTERFLY],[dnl [#include <stdio.h> +#include <stdlib.h> +#include <string.h> #include "mb_types.h" #include "redraw_man.h" #include "shapes.h" #include "paint.h" #include "$1.h" -$1_t *$1_new(redraw_mant_t *rdman) { +$1_t *$1_new(redraw_man_t *rdman) { $1_t *obj; grad_stop_t *stops = NULL;]DECLARE_VARS $2[]dnl