]> git.tdb.fi Git - libs/game.git/commitdiff
Add an early_tick function to System
authorMikko Rasa <tdb@tdb.fi>
Sat, 15 Mar 2025 15:23:49 +0000 (17:23 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 15 Mar 2025 15:23:49 +0000 (17:23 +0200)
source/game/stage.cpp
source/game/system.h

index 889000bfcd8d43d11b0e445bdca7eb305e7998ea..5a1e90433c52b13fde20a01e117ae7da0359eafd 100644 (file)
@@ -68,6 +68,9 @@ void Stage::tick(Time::TimeDelta dt)
                pending_reschedule = false;
        }
 
+       for(const auto &s: systems)
+               s->early_tick();
+
        {
 #ifdef DEBUG
                AccessGuard::BlockForScope _block;
index 4f4c1a6ba3a0d9246146fda443cbbc56838bc7d5..d4ba13e9cdf39789b8a7fe9fa3f9f31f732228fe 100644 (file)
@@ -81,6 +81,7 @@ private:
        static System *&get_active_ptr();
 
 public:
+       virtual void early_tick() { }
        void begin_tick();
        virtual void tick(Time::TimeDelta) = 0;
        void end_tick();