1
This commit is contained in:
parent
6ad0a30010
commit
c00c0aad31
@ -61,19 +61,23 @@ static void SavePerfLog()
|
|||||||
PlayerMgr::Instance()->OnlineNum()
|
PlayerMgr::Instance()->OnlineNum()
|
||||||
});
|
});
|
||||||
if (App::Instance()->HasFlag(4)) {
|
if (App::Instance()->HasFlag(4)) {
|
||||||
a8::XPrintf("mainloop_time:%d netmsg_time:%d room:%d over_room:%d online:%d bullet:%d\n",
|
a8::XPrintf("mainloop_time:%d netmsg_time:%d room:%d over_room:%d online:%d bullet:%d grid_chg_times:%d test_times:%d\n",
|
||||||
{
|
{
|
||||||
App::Instance()->perf.max_run_delay_time,
|
App::Instance()->perf.max_run_delay_time,
|
||||||
App::Instance()->perf.max_dispatchmsg_time,
|
App::Instance()->perf.max_dispatchmsg_time,
|
||||||
RoomMgr::Instance()->RoomNum(),
|
RoomMgr::Instance()->RoomNum(),
|
||||||
RoomMgr::Instance()->OverRoomNum(),
|
RoomMgr::Instance()->OverRoomNum(),
|
||||||
PlayerMgr::Instance()->OnlineNum(),
|
PlayerMgr::Instance()->OnlineNum(),
|
||||||
App::Instance()->perf.entity_num[ET_Bullet]
|
App::Instance()->perf.entity_num[ET_Bullet],
|
||||||
|
App::Instance()->perf.grid_chg_times,
|
||||||
|
App::Instance()->perf.test_times,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
App::Instance()->perf.max_run_delay_time = 0;
|
App::Instance()->perf.max_run_delay_time = 0;
|
||||||
App::Instance()->perf.max_dispatchmsg_time = 0;
|
App::Instance()->perf.max_dispatchmsg_time = 0;
|
||||||
App::Instance()->perf.max_timer_idle = 0;
|
App::Instance()->perf.max_timer_idle = 0;
|
||||||
|
App::Instance()->perf.grid_chg_times = 0;
|
||||||
|
App::Instance()->perf.test_times = 0;
|
||||||
f8::HttpClientPool::Instance()->max_request_delay = 0;
|
f8::HttpClientPool::Instance()->max_request_delay = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,6 +157,7 @@ const int SMOKE_SLOT = 4;
|
|||||||
const int MAP_HEIGHT = 8192;
|
const int MAP_HEIGHT = 8192;
|
||||||
const int MAP_WIDTH = 8192;
|
const int MAP_WIDTH = 8192;
|
||||||
const int MAP_CELL_WIDTH = 64 * 8;
|
const int MAP_CELL_WIDTH = 64 * 8;
|
||||||
|
const int MAP_GRID_WIDTH = 64;
|
||||||
|
|
||||||
const int DOOR_THING_ID = 61701;
|
const int DOOR_THING_ID = 61701;
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ void Entity::GetCircleBox(CircleCollider& circle_box)
|
|||||||
|
|
||||||
bool Entity::TestCollision(Entity* b)
|
bool Entity::TestCollision(Entity* b)
|
||||||
{
|
{
|
||||||
|
App::Instance()->perf.test_times++;
|
||||||
for (auto& a_collider : colliders) {
|
for (auto& a_collider : colliders) {
|
||||||
for (auto& b_collider : b->colliders) {
|
for (auto& b_collider : b->colliders) {
|
||||||
if (a_collider->Intersect(b_collider)) {
|
if (a_collider->Intersect(b_collider)) {
|
||||||
|
@ -16,7 +16,7 @@ void MovementComponent::RayDetection()
|
|||||||
} else if (owner->entity_type == ET_Player) {
|
} else if (owner->entity_type == ET_Player) {
|
||||||
Human* hum = (Human*)owner;
|
Human* hum = (Human*)owner;
|
||||||
start_point = hum->pos;
|
start_point = hum->pos;
|
||||||
target_point = hum->pos + hum->move_dir * (MAP_CELL_WIDTH - 64);
|
target_point = hum->pos + hum->move_dir * (MAP_CELL_WIDTH - MAP_GRID_WIDTH);
|
||||||
target_distance = (target_point - start_point).Norm();
|
target_distance = (target_point - start_point).Norm();
|
||||||
{
|
{
|
||||||
Vector2D left_dir = hum->move_dir;
|
Vector2D left_dir = hum->move_dir;
|
||||||
@ -27,9 +27,9 @@ void MovementComponent::RayDetection()
|
|||||||
right_dir.Normalize();
|
right_dir.Normalize();
|
||||||
|
|
||||||
Vector2D left_p0 = left_dir * (hum->meta->i->radius() + 1);
|
Vector2D left_p0 = left_dir * (hum->meta->i->radius() + 1);
|
||||||
Vector2D left_p1 = left_p0 + hum->move_dir * (MAP_CELL_WIDTH - 64);
|
Vector2D left_p1 = left_p0 + hum->move_dir * (MAP_CELL_WIDTH - MAP_GRID_WIDTH);
|
||||||
Vector2D right_p0 = right_dir * (hum->meta->i->radius() + 1);
|
Vector2D right_p0 = right_dir * (hum->meta->i->radius() + 1);
|
||||||
Vector2D right_p1 = right_p0 + hum->move_dir * (MAP_CELL_WIDTH - 64);
|
Vector2D right_p1 = right_p0 + hum->move_dir * (MAP_CELL_WIDTH - MAP_GRID_WIDTH);
|
||||||
|
|
||||||
for (auto& grid : hum->grid_list) {
|
for (auto& grid : hum->grid_list) {
|
||||||
for (Entity* entity : grid->entity_list) {
|
for (Entity* entity : grid->entity_list) {
|
||||||
|
@ -8,6 +8,8 @@ struct PerfMonitor
|
|||||||
long long out_data_size = 0;
|
long long out_data_size = 0;
|
||||||
long long in_data_size = 0;
|
long long in_data_size = 0;
|
||||||
long long read_count = 0;
|
long long read_count = 0;
|
||||||
|
long long grid_chg_times = 0;
|
||||||
|
long long test_times = 0;
|
||||||
std::array<int, 30> entity_num = {};
|
std::array<int, 30> entity_num = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user