1
This commit is contained in:
parent
3ad1dda451
commit
f3ba4ae130
@ -146,18 +146,18 @@ int App::Run()
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
a8::UdpLog::Instance()->Info("gameserver running", {});
|
a8::UdpLog::Instance()->Info("gameserver running", {});
|
||||||
last_run_tick_ = a8::XGetTickCount();
|
last_run_tick_ = a8::XGetTickCount();
|
||||||
|
int delta_time = 0;
|
||||||
while (!terminated) {
|
while (!terminated) {
|
||||||
a8::tick_t begin_tick = a8::XGetTickCount();
|
a8::tick_t begin_tick = a8::XGetTickCount();
|
||||||
Global::g_nowtime = time(nullptr);
|
Global::g_nowtime = time(nullptr);
|
||||||
int delta_time = a8::XGetTickCount() - last_run_tick_;
|
|
||||||
QuickExecute(delta_time);
|
QuickExecute(delta_time);
|
||||||
SlowerExecute(delta_time);
|
SlowerExecute(delta_time);
|
||||||
|
Schedule();
|
||||||
a8::tick_t end_tick = a8::XGetTickCount();
|
a8::tick_t end_tick = a8::XGetTickCount();
|
||||||
if (end_tick - begin_tick > perf.max_run_delay_time) {
|
if (end_tick - begin_tick > perf.max_run_delay_time) {
|
||||||
perf.max_run_delay_time = end_tick - begin_tick;
|
perf.max_run_delay_time = end_tick - begin_tick;
|
||||||
}
|
}
|
||||||
Schedule();
|
delta_time = end_tick - begin_tick;
|
||||||
last_run_tick_ = a8::XGetTickCount();
|
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ Bullet::Bullet():Entity()
|
|||||||
{
|
{
|
||||||
entity_type = ET_Bullet;
|
entity_type = ET_Bullet;
|
||||||
movement = new MovementComponent();
|
movement = new MovementComponent();
|
||||||
|
movement->owner = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bullet::~Bullet()
|
Bullet::~Bullet()
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
Human::Human()
|
Human::Human()
|
||||||
{
|
{
|
||||||
movement = new MovementComponent();
|
movement = new MovementComponent();
|
||||||
|
movement->owner = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Human::~Human()
|
Human::~Human()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user