Skip to content

Commit

Permalink
Merge pull request #758 from ab9rf/canon
Browse files Browse the repository at this point in the history
canonicalize `world::map_extras`
  • Loading branch information
myk002 authored May 19, 2024
2 parents 7979fec + 8e975eb commit 4192a6e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 36 deletions.
8 changes: 4 additions & 4 deletions df.map.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@
<flag-bit name='has_river_low'/>
</bitfield-type>

<bitfield-type type-name='z_level_flags'>
<flag-bit name='update'/>
<flag-bit name='can_stop'/>
<flag-bit name='update_twice'/>
<bitfield-type type-name='z_level_flags'> bay12: TEMP_BLOCK_FLAG_*
<flag-bit name='update'/> bay12: ADJUSTMENTS
<flag-bit name='can_stop'/> bay12: REMOVE_ADJUSTMENTS_FLAGS
<flag-bit name='update_twice'/> bay12: STOP_REMOVE_ADJUSTMENTS_FLAG
</bitfield-type>

<enum-type type-name='tile_liquid_flow_dir' base-type='uint16_t'>
Expand Down
63 changes: 31 additions & 32 deletions df.world.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1206,75 +1206,74 @@
<int16_t name='building_height'/>
<enum name='selected_direction' base-type='int8_t' type-name='screw_pump_direction'/>

<compound name='map'>
<compound name='map' comment='not a compound in bay12'>
52cdc
<stl-vector name='map_blocks' pointer-type='map_block'/>
<stl-vector name='map_blocks' pointer-type='map_block' comment='bay12: block; bay12 type: blockst'/>
<pointer name='block_index' is-array='true'>
<pointer is-array='true'>
<pointer is-array='true'>
<pointer type-name='map_block'/>
<pointer type-name='map_block' comment='bay12 type: blockst'/>
</pointer>
</pointer>
</pointer>

<stl-vector name='map_block_columns' pointer-type='map_block_column'/>
<pointer name='column_index' is-array='true'>
<stl-vector name='map_block_columns' pointer-type='map_block_column' comment='bay12: block_columnl bay12 type: block_colummst'/>
<pointer name='column_index' is-array='true' comment='bay12: block_column_index'>
<pointer is-array='true'>
<pointer type-name='map_block_column'/>
<pointer type-name='map_block_column' comment='bay12 type: block_columnst'/>
</pointer>
</pointer>

<int32_t name='x_count_block'/>
<int32_t name='y_count_block'/>
<int32_t name='z_count_block'/>
<int32_t name='x_count'/>
<int32_t name='y_count'/>
<int32_t name='z_count'/>
<int32_t name='region_x'/>
<int32_t name='region_y'/>
<int32_t name='region_z'/>
<static-array name='distance_lookup' count='53'>
<int32_t name='x_count_block' comment='bay12: blockx'/>
<int32_t name='y_count_block' comment='bay12: blocky'/>
<int32_t name='z_count_block' comment='bay12: blockz'/>
<int32_t name='x_count' comment='bay12: dimx'/>
<int32_t name='y_count' comment='bay12: dimy'/>
<int32_t name='z_count' comment='bay12: dimz'/>
<int32_t name='region_x' comment='bay12: mmcorner_x'/>
<int32_t name='region_y' comment='bay12: mmcorner_y'/>
<int32_t name='region_z' comment='bay12: mmcorner_z'/>
<static-array name='distance_lookup' count='53' comment='bay12: lightrad'>
<static-array count='53' type-name='int16_t'
comment='Appears to be precomputed rounded integer distances'/>
</static-array>
</compound>

TODO: why did the alignment actually change here?

<compound name='profession_skills'>
<static-array name='primary' index-enum='profession' since='v0.40.01'>
<compound name='profession_skills' comment='not a compound in bay12'>
<static-array name='primary' index-enum='profession' since='v0.40.01' comment='bay12: u_skill_pick'>
<stl-vector type-name='job_skill'/>
</static-array>
<static-array name='secondary' index-enum='profession' since='v0.40.01'>
<static-array name='secondary' index-enum='profession' since='v0.40.01' comment='bay12: u_mskill_pick'>
<stl-vector type-name='job_skill'/>
</static-array>
</compound>

<compound name='math'>
<static-array name='approx' count='40' since='v0.40.01' comment='10 * cosine/sine of the index in units of 1/40 of a circle, rounded towards 0'>
<compound name='math' comment='not a compound in bay12'>
<static-array name='approx' count='40' since='v0.40.01' comment='bay12: precalc_vision_arc; 10 * cosine/sine of the index in units of 1/40 of a circle, rounded towards 0'>
<int32_t name='cos'/>
<int32_t name='sin'/>
</static-array>
<static-array name='cos' count='181' type-name='d-float' since='v0.40.01' comment='100 * cosine of the index in degrees'/>
<static-array name='hypot' count='11' since='v0.40.01' comment='square root of the sum of the squares of the indices'>
<static-array name='cos' count='181' type-name='d-float' since='v0.40.01' comment='bay12: precalc_vision_dot; 100 * cosine of the index in degrees'/>
<static-array name='hypot' count='11' since='v0.40.01' comment='bay12: precalc_vision_sqrt; square root of the sum of the squares of the indices'>
<static-array count='11' type-name='d-float'/>
</static-array>
</compound>

<compound name='map_extras'>
<uint8_t name='rotation'/>
<compound name='map_extras' comment='not a compound in bay12'>
<uint8_t name='rotation' comment='bay12: levelorientation'/>

<pointer type-name='z_level_flags' name='z_level_flags'
is-array='true' since='v0.34.05'/>
is-array='true' since='v0.34.05' comment='bay12: temp_block_layer_flag'/>

<stl-vector name='unk_v40_3a' pointer-type='block_square_event_spoorst' since='v0.40.01'/>
<stl-vector name='unk_v40_3b' type-name='int16_t' since='v0.40.01'/>
<stl-vector name='unk_v40_3c' type-name='int16_t' since='v0.40.01'/>
<stl-vector name='unk_v40_3d' type-name='int16_t' since='v0.40.01'/>
<stl-vector name='inactive_spoor_bse' pointer-type='block_square_event_spoorst' since='v0.40.01'/>
<stl-vector name='inactive_spoor_bse_abs_smm_x' type-name='int16_t' since='v0.40.01'/>
<stl-vector name='inactive_spoor_bse_abs_smm_y' type-name='int16_t' since='v0.40.01'/>
<stl-vector name='inactive_spoor_bse_abs_smm_z' type-name='int16_t' since='v0.40.01'/>
</compound>

-- bay12: local_region
<pointer name='world_data' type-name='world_data'/>
<pointer name='world_data' type-name='world_data' comment='bay12: local_region; bay12 type: regionst'/>

<compound name='worldgen_status'>
<enum base-type='int16_t' name='state'>
Expand Down

0 comments on commit 4192a6e

Please sign in to comment.