… | |
… | |
81 | } |
81 | } |
82 | |
82 | |
83 | int psiconv_parse_clipart_file(const psiconv_buffer buf,int lev, |
83 | int psiconv_parse_clipart_file(const psiconv_buffer buf,int lev, |
84 | psiconv_u32 off, psiconv_clipart_f *result) |
84 | psiconv_u32 off, psiconv_clipart_f *result) |
85 | { |
85 | { |
|
|
86 | int res=0; |
86 | (*result) = malloc(sizeof(**result)); |
87 | (*result) = malloc(sizeof(**result)); |
87 | return 0; |
88 | return 0; |
88 | } |
89 | } |
89 | |
90 | |
90 | int psiconv_parse_mbm_file(const psiconv_buffer buf,int lev, psiconv_u32 off, |
91 | int psiconv_parse_mbm_file(const psiconv_buffer buf,int lev, psiconv_u32 off, |
91 | psiconv_mbm_f *result) |
92 | psiconv_mbm_f *result) |
92 | { |
93 | { |
93 | int res=0; |
94 | int res=0; |
94 | int i; |
95 | int i; |
95 | psiconv_mbm_jumptable_section table; |
96 | psiconv_jumptable_section table; |
96 | psiconv_paint_data_section paint; |
97 | psiconv_paint_data_section paint; |
97 | psiconv_u32 *entry; |
98 | psiconv_u32 *entry; |
98 | psiconv_u32 sto; |
99 | psiconv_u32 sto; |
99 | |
100 | |
100 | psiconv_progress(lev+1,off,"Going to read a mbm file"); |
101 | psiconv_progress(lev+1,off,"Going to read a mbm file"); |
… | |
… | |
103 | psiconv_progress(lev+2,off,"Going to read the offset of the MBM jumptable"); |
104 | psiconv_progress(lev+2,off,"Going to read the offset of the MBM jumptable"); |
104 | sto = psiconv_read_u32(buf,lev+2,off); |
105 | sto = psiconv_read_u32(buf,lev+2,off); |
105 | psiconv_debug(lev+2,off,"Offset: %08x",sto); |
106 | psiconv_debug(lev+2,off,"Offset: %08x",sto); |
106 | |
107 | |
107 | psiconv_progress(lev+2,off,"Going to read the MBM jumptable"); |
108 | psiconv_progress(lev+2,off,"Going to read the MBM jumptable"); |
108 | res |= psiconv_parse_mbm_jumptable_section(buf,lev+2,sto, NULL,&table); |
109 | res |= psiconv_parse_jumptable_section(buf,lev+2,sto, NULL,&table); |
109 | |
110 | |
110 | psiconv_progress(lev+2,off,"Going to read the picture sections"); |
111 | psiconv_progress(lev+2,off,"Going to read the picture sections"); |
111 | (*result)->sections = psiconv_list_new(sizeof(*paint)); |
112 | (*result)->sections = psiconv_list_new(sizeof(*paint)); |
112 | for (i = 0; i < psiconv_list_length(table); i ++) { |
113 | for (i = 0; i < psiconv_list_length(table); i ++) { |
113 | entry = psiconv_list_get(table,i); |
114 | entry = psiconv_list_get(table,i); |
114 | psiconv_progress(lev+3,off,"Going to read picture section %i",i); |
115 | psiconv_progress(lev+3,off,"Going to read picture section %i",i); |
115 | psiconv_parse_paint_data_section(buf,lev+3,*entry,NULL,&paint); |
116 | psiconv_parse_paint_data_section(buf,lev+3,*entry,NULL,&paint); |
116 | psiconv_list_add((*result)->sections,paint); |
117 | psiconv_list_add((*result)->sections,paint); |
117 | } |
118 | } |
118 | |
119 | |
119 | psiconv_free_mbm_jumptable_section(table); |
120 | psiconv_free_jumptable_section(table); |
120 | psiconv_progress(lev+1,off,"End of mbm file"); |
121 | psiconv_progress(lev+1,off,"End of mbm file"); |
121 | return res; |
122 | return res; |
122 | } |
123 | } |
123 | |
124 | |
124 | int psiconv_parse_sketch_file(const psiconv_buffer buf,int lev, |
125 | int psiconv_parse_sketch_file(const psiconv_buffer buf,int lev, |