Optimized buildings a bit
This commit is contained in:
@@ -191,6 +191,7 @@ void Contours::build()
|
||||
|
||||
void Contours::debug()
|
||||
{
|
||||
return;
|
||||
int i, j;
|
||||
if (!dbg) {
|
||||
dbg = memnew(ImmediateGeometry);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <scene/resources/mesh.h>
|
||||
#include <scene/3d/mesh_instance.h>
|
||||
#include <scene/3d/immediate_geometry.h>
|
||||
#include <scene/3d/merge_group.h>
|
||||
#include <scene/main/viewport.h>
|
||||
#include <scene/resources/world.h>
|
||||
#include <core/math/transform.h>
|
||||
@@ -2062,11 +2063,8 @@ public:
|
||||
&wedge))
|
||||
build_split_segment(
|
||||
lanes[k].xform1,
|
||||
lanes[k].xform_m1,
|
||||
mside1.lot_depth_eff,
|
||||
MIN(mside1.lot_depth_eff,
|
||||
mside2.lot_depth_eff),
|
||||
surfaces[h],
|
||||
lanes[k].xform_m1, 1.5f,
|
||||
1.5f, surfaces[h],
|
||||
out_surfaces[h], 0.0f,
|
||||
get_split_level(wedge) +
|
||||
1);
|
||||
@@ -2141,10 +2139,8 @@ public:
|
||||
&wedge))
|
||||
build_split_segment(
|
||||
lanes[k].xform_m2,
|
||||
lanes[k].xform2,
|
||||
get_lot_depth(wedge),
|
||||
mside2.lot_depth_eff,
|
||||
surfaces[h],
|
||||
lanes[k].xform2, 1.5f,
|
||||
1.5f, surfaces[h],
|
||||
out_surfaces[h], 0.0f,
|
||||
get_split_level(wedge));
|
||||
} else if (k <= params.nlanes) /* normal lane */
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -34,6 +34,7 @@ private:
|
||||
int view_distance;
|
||||
bool initialized;
|
||||
int current_x, current_z;
|
||||
int frame_count;
|
||||
void _notification(int which);
|
||||
void create_tilemap();
|
||||
void update_view();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <core/object.h>
|
||||
#include <core/engine.h>
|
||||
#include <core/os/input.h>
|
||||
#include <core/os/time.h>
|
||||
#include <core/input_map.h>
|
||||
#include <scene/gui/control.h>
|
||||
#include <scene/gui/box_container.h>
|
||||
|
||||
Reference in New Issue
Block a user