00001 #include <stdio.h> 00002 #include <stdlib.h> 00003 #include <string.h> 00004 #include <mb_types.h> 00005 #include <mb_redraw_man.h> 00006 #include <mb_shapes.h> 00007 #include <mb_paint.h> 00008 #include "bullet.h" 00009 00010 bullet_t *bullet_new(redraw_man_t *rdman, coord_t *parent_coord) { 00011 bullet_t *obj; 00012 grad_stop_t *stops = NULL; 00013 00014 obj = (bullet_t *)malloc(sizeof(bullet_t)); 00015 if(obj == NULL) return NULL; 00016 obj->rdman = rdman; 00017 00018 obj->root_coord = rdman_coord_new(rdman, parent_coord); 00019 00020 obj->layer1 = rdman_coord_new(rdman, obj->root_coord); 00021 00022 obj->rect2533 = rdman_shape_rect_new(rdman, 3.908779, 3.551790, 2.218812, 5.673447, 0.000000, 0.000000); 00023 rdman_add_shape(rdman, obj->rect2533, obj->layer1); 00024 obj->rect2533_fill = rdman_paint_color_new(rdman, 0.200000, 0.200000, 0.200000, 1.000000); 00025 rdman_paint_fill(rdman, obj->rect2533_fill, obj->rect2533); 00026 obj->rect2533_stroke = rdman_paint_color_new(rdman, 0.301961, 0.301961, 0.301961, 1.000000); 00027 rdman_paint_stroke(rdman, obj->rect2533_stroke, obj->rect2533); 00028 obj->rect2533->stroke_width = 0.620182; 00029 00030 obj->path2535_coord = rdman_coord_new(rdman, obj->layer1); 00031 obj->path2535_coord->matrix[0] = 0.381358; 00032 obj->path2535_coord->matrix[3] = 0.000000; 00033 obj->path2535_coord->matrix[1] = 0.000000; 00034 obj->path2535_coord->matrix[4] = 0.373597; 00035 obj->path2535_coord->matrix[2] = 1.922766; 00036 obj->path2535_coord->matrix[5] = 2.306617; 00037 rdman_coord_changed(rdman, obj->path2535_coord); 00038 00039 obj->path2535 = rdman_shape_path_new(rdman, "M 12.467532,3.6363635 L 3.7620995,3.5542224 L 8.1859521,-3.9438328 L 12.467532,3.6363635 z"); 00040 rdman_add_shape(rdman, obj->path2535, obj->path2535_coord); 00041 obj->path2535_fill = rdman_paint_color_new(rdman, 0.200000, 0.200000, 0.200000, 1.000000); 00042 rdman_paint_fill(rdman, obj->path2535_fill, obj->path2535); 00043 obj->path2535_stroke = rdman_paint_color_new(rdman, 0.301961, 0.301961, 0.301961, 1.000000); 00044 rdman_paint_stroke(rdman, obj->path2535_stroke, obj->path2535); 00045 obj->path2535->stroke_width = 1.543000; 00046 00047 return obj; 00048 } 00049 00050 void bullet_free(bullet_t *obj) { 00051 grad_stop_t *stops = NULL; 00052 redraw_man_t *rdman; 00053 00054 rdman = obj->rdman; 00055 00056 rdman_paint_free(rdman, obj->path2535_stroke); 00057 00058 rdman_paint_free(rdman, obj->path2535_fill); 00059 00060 rdman_shape_free(rdman, obj->path2535); 00061 00062 rdman_paint_free(rdman, obj->rect2533_stroke); 00063 00064 rdman_paint_free(rdman, obj->rect2533_fill); 00065 00066 rdman_shape_free(rdman, obj->rect2533); 00067 00068 rdman_coord_subtree_free(rdman, obj->root_coord); 00069 free(obj); 00070 }