10
9
void citycar_writer_t::write_obj(FILE* fp, obj_node_t& parent, tabfileobj_t& obj)
12
stadtauto_besch_t besch;
15
13
obj_node_t node(this, 10, &parent);
17
besch.gewichtung = obj.get_int("distributionweight", 1);
19
besch.intro_date = obj.get_int("intro_year", DEFAULT_INTRO_DATE) * 12;
20
besch.intro_date += obj.get_int("intro_month", 1) - 1;
22
besch.obsolete_date = obj.get_int("retire_year", DEFAULT_RETIRE_DATE) * 12;
23
besch.obsolete_date += obj.get_int("retire_month", 1) - 1;
25
besch.geschw = obj.get_int("speed", 80) * 16;
15
uint16 const gewichtung = obj.get_int("distributionweight", 1);
17
uint16 const intro_date =
18
obj.get_int("intro_year", DEFAULT_INTRO_DATE) * 12 +
19
obj.get_int("intro_month", 1) - 1;
21
uint16 const obsolete_date =
22
obj.get_int("retire_year", DEFAULT_RETIRE_DATE) * 12 +
23
obj.get_int("retire_month", 1) - 1;
25
uint16 const geschw = obj.get_int("speed", 80) * 16;
27
27
// new version with intro and obsolete dates
28
node.write_uint16(fp, 0x8002, 0); // version information
29
node.write_uint16(fp, (uint16) besch.gewichtung, 2);
30
node.write_uint16(fp, (uint16) besch.geschw, 4);
31
node.write_uint16(fp, besch.intro_date, 6);
32
node.write_uint16(fp, besch.obsolete_date, 8);
28
node.write_uint16(fp, 0x8002, 0); // version information
29
node.write_uint16(fp, gewichtung, 2);
30
node.write_uint16(fp, geschw, 4);
31
node.write_uint16(fp, intro_date, 6);
32
node.write_uint16(fp, obsolete_date, 8);
34
34
write_head(fp, node, obj);