Optimized buildings a bit
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
#include <cassert>
|
||||
#include <core/set.h>
|
||||
#include <core/io/json.h>
|
||||
#include <core/os/time.h>
|
||||
#include <scene/main/viewport.h>
|
||||
#include <scene/resources/packed_scene.h>
|
||||
#include <scene/resources/material.h>
|
||||
#include <scene/3d/mesh_instance.h>
|
||||
#include <main/performance.h>
|
||||
#include <modules/voxel/terrain/voxel_viewer.h>
|
||||
#include <modules/voxel/terrain/voxel_lod_terrain.h>
|
||||
#include "from_string.h"
|
||||
@@ -471,8 +473,15 @@ void StreamWorld::_notification(int which)
|
||||
}
|
||||
break;
|
||||
case NOTIFICATION_EXIT_TREE:
|
||||
frame_count = 0;
|
||||
break;
|
||||
case NOTIFICATION_PROCESS: {
|
||||
if (frame_count % 60 == 0) {
|
||||
float fmon = Performance::get_singleton()->get_monitor(
|
||||
Performance::RENDER_DRAW_CALLS_IN_FRAME);
|
||||
print_line("Draw calls: " + String::num(fmon));
|
||||
}
|
||||
frame_count++;
|
||||
if (Engine::get_singleton()->is_editor_hint())
|
||||
break;
|
||||
update_view();
|
||||
@@ -505,6 +514,7 @@ StreamWorld::StreamWorld()
|
||||
, tile_size(0)
|
||||
, view_distance(0)
|
||||
, initialized(false)
|
||||
, frame_count(0)
|
||||
{
|
||||
Error result = config.load("res://config/stream.conf");
|
||||
ERR_FAIL_COND_MSG(result != OK, "Failed to load config");
|
||||
|
||||
Reference in New Issue
Block a user