From: Mikko Rasa Date: Tue, 22 Apr 2025 21:43:10 +0000 (+0300) Subject: Miscellaneous minor cleanups X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;p=libs%2Fgame.git Miscellaneous minor cleanups --- diff --git a/source/game/landscape.cpp b/source/game/landscape.cpp index 564443f..7be0fd1 100644 --- a/source/game/landscape.cpp +++ b/source/game/landscape.cpp @@ -49,7 +49,7 @@ void Landscape::generate(const Geometry::BoundingBox &bounds) { auto i = lower_bound(blocks, LinAl::Vector(x, y), block_index_compare); if(i==blocks.end() || (*i)->index.y!=y || (*i)->index.x!=x) - spawner.spawn(string(), LinAl::Vector(x*block_size, y*block_size, 0.0f)); + spawner.spawn(string(), {{ x*block_size, y*block_size, 0.0f }}); } } diff --git a/source/game/physicssystem.cpp b/source/game/physicssystem.cpp index 8464f1f..a5de19d 100644 --- a/source/game/physicssystem.cpp +++ b/source/game/physicssystem.cpp @@ -6,7 +6,6 @@ #include "rigidbody.h" #include "shape.h" #include "transform.h" -#include "transformpropagator.h" #include "weld.h" using namespace std; @@ -167,12 +166,12 @@ void PhysicsSystem::tick(Time::TimeDelta dt) if(transform_changed) { TransformValues tv = TransformValues::from_matrix(transform->get_world_transform().get_matrix()); - if(b.body->is_kinematic() && !motion_changed) + if(kinematic && !motion_changed) b.physics_body->move_kinematic(tv.position, tv.rotation, dt); else b.physics_body->set_transform(tv.position, tv.rotation); - if(b.body->is_kinematic() || !b.motion) + if(kinematic || !b.motion) b.transform_generation = transform->get_read_generation(); } diff --git a/source/game/pool.cpp b/source/game/pool.cpp index 427ea4f..5a0291e 100644 --- a/source/game/pool.cpp +++ b/source/game/pool.cpp @@ -160,7 +160,6 @@ void PoolBase::destroy(void *obj) throw invalid_argument("PoolBase::destroy"); } - int PoolBase::_destroy(void *obj) { unsigned block_index = 0; diff --git a/source/game/transform.h b/source/game/transform.h index 12bd8ab..495334b 100644 --- a/source/game/transform.h +++ b/source/game/transform.h @@ -20,7 +20,7 @@ struct MSPGAME_API TransformValues TransformValues() = default; TransformValues(const LinAl::Vector &p): position(p) { } TransformValues(const LinAl::Vector &p, const Geometry::Quaternion &r, - const LinAl::Vector &s = LinAl::Vector(1.0f, 1.0f, 1.0f)): + const LinAl::Vector &s = { 1.0f, 1.0f, 1.0f }): position(p), rotation(r), scale(s) { } diff --git a/source/gameview/application.h b/source/gameview/application.h index 9eeac84..752885e 100644 --- a/source/gameview/application.h +++ b/source/gameview/application.h @@ -43,6 +43,7 @@ public: protected: static GL::DeviceOptions create_gl_device_options(VR::System * = nullptr); +public: int main() override; protected: void tick() override;