-
-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISheduled: move data to ScheduledBase.
- Loading branch information
nitrocaster
committed
Nov 11, 2015
1 parent
a8f5a35
commit 4ba953d
Showing
21 changed files
with
84 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,48 @@ | ||
#ifndef XRENGINE_ISHEDULED_H_INCLUDED | ||
#define XRENGINE_ISHEDULED_H_INCLUDED | ||
|
||
class ENGINE_API ISheduled | ||
class SchedulerData | ||
{ | ||
public: | ||
struct | ||
{ | ||
u32 t_min : 14; // minimal bound of update time (sample: 20ms) | ||
u32 t_max : 14; // maximal bound of update time (sample: 200ms) | ||
u32 b_RT : 1; | ||
u32 b_locked : 1; | ||
} shedule; | ||
|
||
u32 t_min : 14; // minimal bound of update time (sample: 20ms) | ||
u32 t_max : 14; // maximal bound of update time (sample: 200ms) | ||
u32 b_RT : 1; | ||
u32 b_locked : 1; | ||
#ifdef DEBUG | ||
u32 dbg_startframe; | ||
u32 dbg_update_shedule; | ||
#endif | ||
}; | ||
|
||
ISheduled(); | ||
virtual ~ISheduled(); | ||
|
||
void shedule_register(); | ||
void shedule_unregister(); | ||
|
||
class ISheduled | ||
{ | ||
public: | ||
virtual ~ISheduled() = 0; | ||
virtual SchedulerData &GetSchedulerData() = 0; | ||
virtual float shedule_Scale() = 0; | ||
virtual void shedule_Update(u32 dt); | ||
virtual shared_str shedule_Name() const { return shared_str("unknown"); }; | ||
virtual void shedule_Update(u32 dt) = 0; | ||
// XXX nitrocaster: return (const char *) to reduce string pool spoiling | ||
virtual shared_str shedule_Name() const = 0; | ||
virtual bool shedule_Needed() = 0; | ||
}; | ||
|
||
inline ISheduled::~ISheduled() {} | ||
|
||
class ENGINE_API ScheduledBase : public ISheduled | ||
{ | ||
public: | ||
SchedulerData shedule; | ||
|
||
ScheduledBase(); | ||
virtual ~ScheduledBase(); | ||
|
||
virtual SchedulerData &GetSchedulerData() override { return shedule; } | ||
virtual void shedule_Update(u32 dt) override; | ||
virtual shared_str shedule_Name() const override { return shared_str("unknown"); } | ||
|
||
protected: | ||
void shedule_register(); | ||
void shedule_unregister(); | ||
}; | ||
|
||
#endif // #ifndef XRENGINE_ISHEDULED_H_INCLUDED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.