Mercurial > MadButterfly
diff src/mbaf/mbobject.c @ 922:152bc503dc99
Conditional compile for sh_text in mbaf
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Wed, 27 Oct 2010 00:41:25 +0800 |
parents | 586e50f82c1f |
children |
line wrap: on
line diff
--- a/src/mbaf/mbobject.c Tue Oct 26 21:58:12 2010 +0800 +++ b/src/mbaf/mbobject.c Wed Oct 27 00:41:25 2010 +0800 @@ -2,6 +2,7 @@ // vim: sw=4:ts=8:sts=4 #include "mb_types.h" #include "mb_obj.h" +#include "mb_config.h" void mb_obj_set_pos(mb_obj_t *obj, co_aix x, co_aix y) @@ -9,8 +10,10 @@ if (MBO_TYPE(obj) == MBO_COORD) { coord_x(((coord_t *) obj)) = x; coord_y(((coord_t *) obj)) = y; +#ifdef SH_TEXT } else if (MBO_TYPE(obj) == MBO_TEXT) { sh_text_set_pos((shape_t *) obj, x, y); +#endif } else { return; } @@ -22,8 +25,10 @@ if (MBO_TYPE(obj) == MBO_COORD) { *x = coord_x((coord_t *) obj); *y = coord_y((coord_t *) obj); +#ifdef SH_TEXT } else if (MBO_TYPE(obj) == MBO_TEXT) { sh_text_get_pos((shape_t *) obj, x, y); +#endif } else { return; } @@ -39,13 +44,17 @@ FOR_COORD_MEMBERS(g, geo) { shape = geo_get_shape(geo); +#ifdef SH_TEXT if(shape->obj.obj_type == MBO_TEXT) { sh_text_set_text(shape, text); return; } +#endif } +#ifdef SH_TEXT } else if (MBO_TYPE(obj) == MBO_TEXT) { sh_text_set_text((shape_t *) obj,text); +#endif } else { return; } @@ -62,13 +71,17 @@ FOR_COORD_MEMBERS(g, geo) { shape = geo_get_shape(geo); +#ifdef SH_TEXT if(shape->obj.obj_type == MBO_TEXT) { sh_text_get_text(shape, text,size); return; } +#endif } +#ifdef SH_TEXT } else if (MBO_TYPE(obj) == MBO_TEXT) { sh_text_get_text((shape_t *) obj,text,size); +#endif } else { *text = 0; return;