Skip to content

Commit c1a0e47

Browse files
committed
Removed a bunch of unused (or barely used) dependencies between addons and features.
1 parent 9f0ad47 commit c1a0e47

File tree

14 files changed

+18
-41
lines changed

14 files changed

+18
-41
lines changed

code/addons/nflatbuffer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ fips_dir(.)
1414
flatbufferinterface.h
1515
)
1616
nebula_flatc(SYSTEM foundation/math.fbs)
17-
fips_deps(flatbuffers sqlite3 foundation)
17+
fips_deps(flatbuffers foundation)
1818
nebula_end_lib()

code/addons/physicsfeature/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
nebula_begin_module(physicsfeature)
2-
fips_deps(physics application graphicsfeature)
2+
fips_deps(physics application)
33
target_precompile_headers(physicsfeature PRIVATE <application/stdneb.h>)
44
fips_ide_group(features)
55
fips_files(

code/addons/physicsfeature/components/physicsfeature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"resource": {
4848
"type": "resource",
49-
"default": "mdl:"
49+
"default": "sysphys:box.actor"
5050
},
5151
"actorType": {
5252
"type": "PhysicsFeature::ActorType",

code/addons/physicsfeature/managers/charactermanager.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
#include "physics/actorcontext.h"
1313
#include "resources/resourceserver.h"
1414
#include "components/physicsfeature.h"
15-
#include "graphicsfeature/graphicsfeatureunit.h"
1615
#include "basegamefeature/components/basegamefeature.h"
1716
#include "basegamefeature/components/position.h"
1817
#include "basegamefeature/components/orientation.h"
1918
#include "basegamefeature/components/scale.h"
2019
#include "basegamefeature/components/velocity.h"
21-
#include "graphicsfeature/components/model.h"
2220

2321
namespace PhysicsFeature
2422
{

code/addons/physicsfeature/managers/physicsmanager.cc

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@
1010
#include "physics/actorcontext.h"
1111
#include "resources/resourceserver.h"
1212
#include "components/physicsfeature.h"
13-
#include "graphicsfeature/graphicsfeatureunit.h"
1413
#include "basegamefeature/components/basegamefeature.h"
1514
#include "basegamefeature/components/position.h"
1615
#include "basegamefeature/components/orientation.h"
1716
#include "basegamefeature/components/scale.h"
1817
#include "basegamefeature/components/velocity.h"
19-
#include "graphicsfeature/components/model.h"
2018

2119
namespace PhysicsFeature
2220
{
@@ -52,26 +50,13 @@ PhysicsManager::InitPhysicsActor(Game::World* world, Game::Entity entity, Physic
5250
return;
5351
}
5452

55-
auto res = actor->resource;
56-
if (res == "mdl:")
57-
{
58-
n_assert(world->HasComponent<GraphicsFeature::Model>(entity));
59-
Util::String modelRes = world->GetComponent<GraphicsFeature::Model>(entity).resource.Value();
60-
Util::String fileName = modelRes.ExtractFileName();
61-
fileName.StripFileExtension();
62-
res = Util::String::Sprintf(
63-
"phys:%s/%s.actor", modelRes.ExtractLastDirName().AsCharPtr(), fileName.AsCharPtr()
64-
);
65-
actor->resource = res;
66-
}
67-
6853
Math::transform worldTransform = Math::transform(
6954
world->GetComponent<Game::Position>(entity),
7055
world->GetComponent<Game::Orientation>(entity),
7156
world->GetComponent<Game::Scale>(entity)
7257
);
7358

74-
Resources::ResourceId resId = Resources::CreateResource(res, "PHYS", nullptr, nullptr, true);
59+
Resources::ResourceId resId = Resources::CreateResource(actor->resource, "PHYS", nullptr, nullptr, true);
7560
Physics::ActorId actorid =
7661
Physics::CreateActorInstance(resId, worldTransform, (Physics::ActorType)actor->actorType, Ids::Id64(entity));
7762
actor->actorId = actorid.id;

code/application/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
nebula_begin_module(application)
66
nebula_add_blueprints()
77
target_include_directories(application PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
8-
fips_deps(foundation audio resource scripting memdb imgui input options)
8+
fips_deps(foundation resource memdb imgui input options)
99
fips_dir(.)
1010
if (FIPS_WINDOWS)
1111
fips_files(application.natvis)

code/application/appgame/gameapplication.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "appgame/gameapplication.h"
88

9+
#include "core/sysfunc.h"
910
#include "options.h"
1011
#include "core/debug/corepagehandler.h"
1112
#include "threading/debug/threadpagehandler.h"
@@ -20,7 +21,6 @@
2021
#include "input/inputserver.h"
2122
#include "basegamefeature/basegamefeatureunit.h"
2223
#include "nflatbuffer/flatbufferinterface.h"
23-
2424
#include "profiling/profiling.h"
2525

2626
namespace App
@@ -222,6 +222,9 @@ GameApplication::Close()
222222
Application::Close();
223223
}
224224

225+
226+
227+
225228
//------------------------------------------------------------------------------
226229
/**
227230
Run the application. This method will return when the application wishes

code/physics/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ nebula_begin_lib(physics)
77
target_include_directories(physics PUBLIC ${FIPS_DEPLOY_DIR}/physx/include ${CMAKE_CURRENT_SOURCE_DIR} ${CODE_ROOT}/physics)
88
target_link_libraries(physics PxLibs)
99
target_precompile_headers(physics PRIVATE [["foundation/stdneb.h"]])
10-
fips_deps(foundation resource render nflatbuffer)
10+
fips_deps(foundation resource nflatbuffer render)
1111
fips_files(physicsinterface.h physicsinterface.cc)
1212
fips_dir(physics)
1313
fips_files(

code/physics/physics/debugui.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "dynui/im3d/im3dcontext.h"
1313
#include "physics/utils.h"
1414
#include "imgui.h"
15-
#include "graphics/cameracontext.h"
1615
#include "flat/physics/material.h"
1716
#include "nflatbuffer/flatbufferinterface.h"
1817
#include "io/safefilestream.h"
@@ -235,7 +234,7 @@ DrawPhysicsDebug()
235234
/**
236235
*/
237236
void
238-
RenderUI(Graphics::GraphicsEntityId camera)
237+
RenderUI(Math::mat4 const& cameraViewTransform)
239238
{
240239
RenderMaterialsUI();
241240
ImGui::Separator();
@@ -250,7 +249,7 @@ RenderUI(Graphics::GraphicsEntityId camera)
250249
ImGui::PushItemWidth(100.0f);
251250
ImGui::DragFloat("Viewing Distance", &viewRange, 1.0f, 1.0f, 100.0f);
252251
ImGui::PopItemWidth();
253-
Math::mat4 trans = Math::inverse(Graphics::CameraContext::GetView(camera));
252+
Math::mat4 trans = Math::inverse(cameraViewTransform);
254253

255254
Math::point center = trans.get_w() - trans.get_z() * viewRange;
256255
PxBounds3 bound = PxBounds3::centerExtents(Neb2PxPnt(center), PxVec3(viewRange));

code/physics/physics/debugui.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
@copyright
77
(C) 2020-2025 Individual contributors, see AUTHORS file
88
*/
9-
#include "graphics/graphicsentity.h"
109
#include "util/color.h"
1110
#include <functional>
1211

@@ -24,7 +23,7 @@ void SetDebugDrawInterface(DebugDrawInterface const& drawInterface);
2423

2524
void EnableDebugDrawing(bool enabled);
2625

27-
void RenderUI(Graphics::GraphicsEntityId camera);
26+
void RenderUI(Math::mat4 const& cameraViewTransform);
2827

2928
void RenderMaterialsUI();
3029

0 commit comments

Comments
 (0)