Skip to content

Commit

Permalink
Move interface destructors interfaces to implementation (#1059)
Browse files Browse the repository at this point in the history
Move the implementation of the virtual destructors from their own cpp file into the cpp of the implementation.
#1042
  • Loading branch information
chreden authored Nov 28, 2022
1 parent baec97e commit 5a1211b
Show file tree
Hide file tree
Showing 116 changed files with 211 additions and 657 deletions.
8 changes: 0 additions & 8 deletions trlevel/ILevel.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions trlevel/Level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

namespace trlevel
{
ILevel::~ILevel()
{
}

namespace
{
const float PiMul2 = 6.283185307179586476925286766559f;
Expand Down
1 change: 0 additions & 1 deletion trlevel/trlevel.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="Decrypter.cpp" />
<ClCompile Include="ILevel.cpp" />
<ClCompile Include="Level.cpp" />
<ClCompile Include="LevelVersion.cpp" />
<ClCompile Include="stdafx.cpp">
Expand Down
1 change: 0 additions & 1 deletion trlevel/trlevel.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<ClInclude Include="Decrypter.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="ILevel.cpp" />
<ClCompile Include="Level.cpp" />
<ClCompile Include="trtypes.cpp" />
<ClCompile Include="LevelVersion.cpp" />
Expand Down
4 changes: 4 additions & 0 deletions trview.app/Camera/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ namespace trview
}
}

ICamera::~ICamera()
{
}

Camera::Camera(const Size& size)
: _view_size(size), _forward(Vector3::Forward), _up(Vector3::Down), _position(Vector3::Zero)
{
Expand Down
8 changes: 0 additions & 8 deletions trview.app/Camera/ICamera.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions trview.app/Elements/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ namespace trview
}
}

IEntity::~IEntity()
{
}

Entity::Entity(const IMesh::Source& mesh_source, const trlevel::ILevel& level, const trlevel::tr2_entity& entity, const IMeshStorage& mesh_storage, uint32_t index, bool is_pickup)
: Entity(mesh_source, mesh_storage, level, entity.Room, index, entity.TypeID, entity.position(), entity.Angle, entity.Intensity2, is_pickup)
{
Expand Down
8 changes: 0 additions & 8 deletions trview.app/Elements/IEntity.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions trview.app/Elements/ILevel.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions trview.app/Elements/IRoom.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions trview.app/Elements/IStaticMesh.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions trview.app/Elements/ITypeNameLookup.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions trview.app/Elements/Level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ using namespace DirectX::SimpleMath;

namespace trview
{
ILevel::~ILevel()
{
}

Level::Level(const std::shared_ptr<graphics::IDevice>& device,
const std::shared_ptr<graphics::IShaderStorage>& shader_storage,
std::unique_ptr<trlevel::ILevel> level,
Expand Down
4 changes: 4 additions & 0 deletions trview.app/Elements/Room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ namespace trview
}
}

IRoom::~IRoom()
{
}

Room::Room(const IMesh::Source& mesh_source,
const trlevel::ILevel& level,
const trlevel::tr3_room& room,
Expand Down
4 changes: 4 additions & 0 deletions trview.app/Elements/StaticMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ namespace trview
{
using namespace DirectX::SimpleMath;

IStaticMesh::~IStaticMesh()
{
}

StaticMesh::StaticMesh(const trlevel::tr3_room_staticmesh& static_mesh, const trlevel::tr_staticmesh& level_static_mesh, const std::shared_ptr<IMesh>& mesh, const std::shared_ptr<IMesh>& bounding_mesh)
: _mesh(mesh),
_visibility_min(level_static_mesh.VisibilityBox.MinX, level_static_mesh.VisibilityBox.MinY, level_static_mesh.VisibilityBox.MinZ),
Expand Down
4 changes: 4 additions & 0 deletions trview.app/Elements/TypeNameLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ namespace trview
}
}

ITypeNameLookup::~ITypeNameLookup()
{
}

TypeNameLookup::TypeNameLookup(const std::string& type_name_json)
{
auto json = nlohmann::json::parse(type_name_json.begin(), type_name_json.end());
Expand Down
8 changes: 0 additions & 8 deletions trview.app/Geometry/IPicking.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions trview.app/Geometry/ITransparencyBuffer.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions trview.app/Geometry/Picking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ using namespace DirectX::SimpleMath;

namespace trview
{
IPicking::~IPicking()
{
}

Picking::Picking(const Window& window)
: _window(window)
{
Expand Down
4 changes: 4 additions & 0 deletions trview.app/Geometry/TransparencyBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ using namespace DirectX::SimpleMath;

namespace trview
{
ITransparencyBuffer::~ITransparencyBuffer()
{
}

TransparencyBuffer::TransparencyBuffer(const std::shared_ptr<graphics::IDevice>& device)
: _device(device), _untextured(create_texture(*device, Colour::White))
{
Expand Down
8 changes: 0 additions & 8 deletions trview.app/Graphics/ILevelTextureStorage.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions trview.app/Graphics/IMeshStorage.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions trview.app/Graphics/ISectorHighlight.cpp

This file was deleted.

9 changes: 0 additions & 9 deletions trview.app/Graphics/ISelectionRenderer.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions trview.app/Graphics/ITextureStorage.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions trview.app/Graphics/LevelTextureStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

namespace trview
{
ILevelTextureStorage::~ILevelTextureStorage()
{
}

LevelTextureStorage::LevelTextureStorage(const std::shared_ptr<graphics::IDevice>& device, std::unique_ptr<ITextureStorage> texture_storage, const trlevel::ILevel& level)
: _texture_storage(std::move(texture_storage)), _version(level.get_version())
{
Expand Down
4 changes: 4 additions & 0 deletions trview.app/Graphics/MeshStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace trview
{
IMeshStorage::~IMeshStorage()
{
}

MeshStorage::MeshStorage(const IMesh::Source& mesh_source, const trlevel::ILevel& level, const ILevelTextureStorage& texture_storage)
{
const uint32_t pointers = level.num_mesh_pointers();
Expand Down
4 changes: 4 additions & 0 deletions trview.app/Graphics/SectorHighlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ namespace trview
const Color Highlight_Colour{ 1, 1, 0 };
}

ISectorHighlight::~ISectorHighlight()
{
}

SectorHighlight::SectorHighlight(const IMesh::Source& mesh_source)
: _mesh_source(mesh_source)
{
Expand Down
4 changes: 4 additions & 0 deletions trview.app/Graphics/SelectionRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ namespace trview
};
}

ISelectionRenderer::~ISelectionRenderer()
{
}

SelectionRenderer::SelectionRenderer(const std::shared_ptr<graphics::IDevice>& device, const std::shared_ptr<graphics::IShaderStorage>& shader_storage, std::unique_ptr<ITransparencyBuffer> transparency, const graphics::IRenderTarget::SizeSource& render_target_source)
: _device(device), _transparency(std::move(transparency)), _render_target_source(render_target_source)
{
Expand Down
4 changes: 4 additions & 0 deletions trview.app/Graphics/TextureStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

namespace trview
{
ITextureStorage::~ITextureStorage()
{
}

TextureStorage::TextureStorage(const std::shared_ptr<graphics::IDevice>& device)
: _device(device)
{
Expand Down
8 changes: 0 additions & 8 deletions trview.app/Menus/IUpdateChecker.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions trview.app/Menus/UpdateChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ namespace trview
const DWORD id_update_available = 30000;
}

IUpdateChecker::~IUpdateChecker()
{
}

UpdateChecker::UpdateChecker(const Window& window)
: MessageHandler(window)
{
Expand Down
4 changes: 4 additions & 0 deletions trview.app/Routing/Actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

namespace trview
{
IActions::~IActions()
{
}

Actions::Actions(const std::string& actions_json)
{
auto json = nlohmann::json::parse(actions_json.begin(), actions_json.end());
Expand Down
8 changes: 0 additions & 8 deletions trview.app/Routing/IActions.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions trview.app/Routing/IRoute.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions trview.app/Routing/Route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ namespace trview
}
}

IRoute::~IRoute()
{
}

Route::Route(std::unique_ptr<ISelectionRenderer> selection_renderer, const IWaypoint::Source& waypoint_source, const UserSettings& settings)
: _selection_renderer(std::move(selection_renderer)), _waypoint_source(waypoint_source), _colour(settings.route_colour), _waypoint_colour(settings.waypoint_colour)
{
Expand Down
8 changes: 0 additions & 8 deletions trview.app/Settings/ISettingsLoader.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions trview.app/Settings/IStartupOptions.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions trview.app/Settings/SettingsLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

namespace trview
{
ISettingsLoader::~ISettingsLoader()
{
}

void to_json(nlohmann::json& json, const UserSettings::RecentRoute& item)
{
json["route_path"] = item.route_path;
Expand Down
Loading

0 comments on commit 5a1211b

Please sign in to comment.