Loading

Paste #pb2s9ajwt

  1. diff --git a/src/mouse_mode.h b/src/mouse_mode.h
  2. index c621d1b..2c4428c 100644
  3. --- a/src/mouse_mode.h
  4. +++ b/src/mouse_mode.h
  5. @@ -260,11 +260,15 @@ struct VoxelRideData {
  6.         }
  7.  };
  8.  
  9. -/** %Tile data with ride voxel information. */
  10. +/**
  11. + * %Tile data with voxel information.
  12. + * @tparam VoxelContentData Data to keep for each voxel in the selector.
  13. + */
  14. +template <typename VoxelContentData>
  15.  struct VoxelTileData : public CursorTileData {
  16.         uint8 lowest;  ///< Lowest voxel in the stack that should be rendered.
  17.         uint8 highest; ///< Highest voxel in the stack that should be rendered.
  18. -       std::vector<VoxelRideData> ride_info; ///< Ride information of voxels VoxelTileData::lowest to VoxelTileData::highest (inclusive).
  19. +       std::vector<VoxelContentData> ride_info; ///< Information of voxels VoxelTileData::lowest to VoxelTileData::highest (inclusive).
  20.  
  21.         /** Initialize #VoxelTileData and #CursorTileData data members. */
  22.         void Init() override
  23. @@ -391,9 +395,9 @@ public:
  24.  typedef TileDataMouseMode<CursorTileData> CursorMouseMode; ///< Mouse mode displaying a cursor of some size at the ground.
  25.  
  26.  /** Mouse mode displaying a cursor and (part of) a ride. */
  27. -class RideMouseMode : public VoxelTileDataMouseMode<VoxelTileData> {
  28. +class RideMouseMode : public VoxelTileDataMouseMode<VoxelTileData<VoxelRideData>> {
  29.  public:
  30. -       RideMouseMode() : VoxelTileDataMouseMode<VoxelTileData>()
  31. +       RideMouseMode() : VoxelTileDataMouseMode<VoxelTileData<VoxelRideData>>()
  32.         {
  33.         }
  34.  
  35. @@ -406,7 +410,7 @@ public:
  36.                 uint32 index = this->GetTileIndex(voxel_pos.x, voxel_pos.y);
  37.                 if (index == INVALID_TILE_INDEX) return false;
  38.  
  39. -               const VoxelTileData &td = this->tile_data[index];
  40. +               const VoxelTileData<VoxelRideData> &td = this->tile_data[index];
  41.                 if (!td.cursor_enabled || voxel_pos.z < td.lowest || voxel_pos.z > td.highest) return false;
  42.  
  43.                 const VoxelRideData &vrd = td.ride_info[voxel_pos.z - td.lowest];
  44. @@ -423,7 +427,7 @@ public:
  45.          */
  46.         void SetRideData(const XYZPoint16 &pos, SmallRideInstance sri, uint16 instance_data)
  47.         {
  48. -               VoxelTileData &td = this->GetTileData(pos);
  49. +               VoxelTileData<VoxelRideData> &td = this->GetTileData(pos);
  50.                 if (!td.cursor_enabled) return;
  51.                 VoxelRideData &vrd = td.ride_info[pos.z - td.lowest];
  52.                 vrd.sri = sri;

Comments