mirror of
https://github.com/Relintai/terraman_2d.git
synced 2025-02-20 17:24:45 +01:00
Work on fixing compile.
This commit is contained in:
parent
4b4db780f2
commit
01c83d647c
@ -171,7 +171,7 @@ void Terrain2DLibraryMerger::set_prop(const int index, const Ref<Prop2DData> &va
|
|||||||
void Terrain2DLibraryMerger::remove_prop(const int index) {
|
void Terrain2DLibraryMerger::remove_prop(const int index) {
|
||||||
ERR_FAIL_INDEX(index, _props.size());
|
ERR_FAIL_INDEX(index, _props.size());
|
||||||
|
|
||||||
_props.remove(index);
|
_props.remove_at(index);
|
||||||
}
|
}
|
||||||
int Terrain2DLibraryMerger::get_num_props() const {
|
int Terrain2DLibraryMerger::get_num_props() const {
|
||||||
return _props.size();
|
return _props.size();
|
||||||
@ -319,7 +319,7 @@ void Terrain2DLibraryMerger::_setup_material_albedo(const int material_index, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
Terrain2DLibraryMerger::Terrain2DLibraryMerger() {
|
Terrain2DLibraryMerger::Terrain2DLibraryMerger() {
|
||||||
_packer.instance();
|
_packer.instantiate();
|
||||||
|
|
||||||
#if GODOT4
|
#if GODOT4
|
||||||
#warning implement
|
#warning implement
|
||||||
@ -331,7 +331,7 @@ Terrain2DLibraryMerger::Terrain2DLibraryMerger() {
|
|||||||
_packer->set_keep_original_atlases(false);
|
_packer->set_keep_original_atlases(false);
|
||||||
_packer->set_margin(0);
|
_packer->set_margin(0);
|
||||||
|
|
||||||
_prop_packer.instance();
|
_prop_packer.instantiate();
|
||||||
|
|
||||||
#if GODOT4
|
#if GODOT4
|
||||||
#warning implement
|
#warning implement
|
||||||
|
@ -143,7 +143,7 @@ void Terrain2DLibraryMergerPCM::_material_cache_get_key(Ref<Terrain2DChunk> chun
|
|||||||
//print_error("New cache: " + hstr);
|
//print_error("New cache: " + hstr);
|
||||||
|
|
||||||
Ref<Terrain2DMaterialCachePCM> cache;
|
Ref<Terrain2DMaterialCachePCM> cache;
|
||||||
cache.instance();
|
cache.instantiate();
|
||||||
cache->inc_ref_count();
|
cache->inc_ref_count();
|
||||||
|
|
||||||
cache->set_texture_flags(get_texture_flags());
|
cache->set_texture_flags(get_texture_flags());
|
||||||
@ -322,7 +322,7 @@ void Terrain2DLibraryMergerPCM::_prop_material_cache_get_key(Ref<Terrain2DChunk>
|
|||||||
//print_error("New prop cache: " + hstr);
|
//print_error("New prop cache: " + hstr);
|
||||||
|
|
||||||
Ref<Terrain2DMaterialCachePCM> cache;
|
Ref<Terrain2DMaterialCachePCM> cache;
|
||||||
cache.instance();
|
cache.instantiate();
|
||||||
cache->inc_ref_count();
|
cache->inc_ref_count();
|
||||||
|
|
||||||
cache->set_texture_flags(get_texture_flags());
|
cache->set_texture_flags(get_texture_flags());
|
||||||
@ -546,7 +546,7 @@ void Terrain2DLibraryMergerPCM::set_prop(const int index, const Ref<Prop2DData>
|
|||||||
void Terrain2DLibraryMergerPCM::remove_prop(const int index) {
|
void Terrain2DLibraryMergerPCM::remove_prop(const int index) {
|
||||||
ERR_FAIL_INDEX(index, _props.size());
|
ERR_FAIL_INDEX(index, _props.size());
|
||||||
|
|
||||||
_props.remove(index);
|
_props.remove_at(index);
|
||||||
}
|
}
|
||||||
int Terrain2DLibraryMergerPCM::get_num_props() const {
|
int Terrain2DLibraryMergerPCM::get_num_props() const {
|
||||||
return _props.size();
|
return _props.size();
|
||||||
@ -694,7 +694,7 @@ void Terrain2DLibraryMergerPCM::_setup_material_albedo(const int material_index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Terrain2DLibraryMergerPCM::Terrain2DLibraryMergerPCM() {
|
Terrain2DLibraryMergerPCM::Terrain2DLibraryMergerPCM() {
|
||||||
_packer.instance();
|
_packer.instantiate();
|
||||||
|
|
||||||
#if GODOT4
|
#if GODOT4
|
||||||
#warning implement
|
#warning implement
|
||||||
@ -706,7 +706,7 @@ Terrain2DLibraryMergerPCM::Terrain2DLibraryMergerPCM() {
|
|||||||
_packer->set_keep_original_atlases(false);
|
_packer->set_keep_original_atlases(false);
|
||||||
_packer->set_margin(0);
|
_packer->set_margin(0);
|
||||||
|
|
||||||
_prop_packer.instance();
|
_prop_packer.instantiate();
|
||||||
|
|
||||||
#if GODOT4
|
#if GODOT4
|
||||||
#warning implement
|
#warning implement
|
||||||
|
@ -170,7 +170,7 @@ void Terrain2DMaterialCachePCM::_setup_material_albedo(Ref<Texture> texture) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Terrain2DMaterialCachePCM::Terrain2DMaterialCachePCM() {
|
Terrain2DMaterialCachePCM::Terrain2DMaterialCachePCM() {
|
||||||
_packer.instance();
|
_packer.instantiate();
|
||||||
|
|
||||||
#if GODOT4
|
#if GODOT4
|
||||||
#warning implement
|
#warning implement
|
||||||
|
@ -629,7 +629,7 @@ void Terrain2DMesherIsometric::mesh_walls(Ref<Terrain2DChunkDefault> chunk) {
|
|||||||
|
|
||||||
Ref<Shape2D> Terrain2DMesherIsometric::create_terrain_tile_collider_shape(Ref<Terrain2DChunk> chunk) {
|
Ref<Shape2D> Terrain2DMesherIsometric::create_terrain_tile_collider_shape(Ref<Terrain2DChunk> chunk) {
|
||||||
Ref<ConvexPolygonShape2D> sh;
|
Ref<ConvexPolygonShape2D> sh;
|
||||||
sh.instance();
|
sh.instantiate();
|
||||||
|
|
||||||
Vector<Vector2> points;
|
Vector<Vector2> points;
|
||||||
|
|
||||||
|
@ -518,7 +518,7 @@ AABB Terrain2DMesher::calculate_stored_mesh_aabb(const int index) {
|
|||||||
|
|
||||||
Ref<Shape2D> Terrain2DMesher::create_terrain_tile_collider_shape(Ref<Terrain2DChunk> chunk) {
|
Ref<Shape2D> Terrain2DMesher::create_terrain_tile_collider_shape(Ref<Terrain2DChunk> chunk) {
|
||||||
Ref<RectangleShape2D> sh;
|
Ref<RectangleShape2D> sh;
|
||||||
sh.instance();
|
sh.instantiate();
|
||||||
|
|
||||||
sh->set_extents(Vector2(_cell_size_x, _cell_size_y));
|
sh->set_extents(Vector2(_cell_size_x, _cell_size_y));
|
||||||
|
|
||||||
|
@ -114,13 +114,13 @@ Ref<Terrain2DChunk> Terrain2DWorldDefault::_create_chunk(int x, int y, Ref<Terra
|
|||||||
|
|
||||||
if (chunk->job_get_count() == 0) {
|
if (chunk->job_get_count() == 0) {
|
||||||
Ref<Terrain2DTerrain2DJob> tj;
|
Ref<Terrain2DTerrain2DJob> tj;
|
||||||
tj.instance();
|
tj.instantiate();
|
||||||
|
|
||||||
Ref<Terrain2DLightJob> lj;
|
Ref<Terrain2DLightJob> lj;
|
||||||
lj.instance();
|
lj.instantiate();
|
||||||
|
|
||||||
Ref<Terrain2DProp2DJob> pj;
|
Ref<Terrain2DProp2DJob> pj;
|
||||||
pj.instance();
|
pj.instantiate();
|
||||||
pj->set_prop_mesher(Ref<Terrain2DMesher>(memnew(Terrain2DMesherDefault)));
|
pj->set_prop_mesher(Ref<Terrain2DMesher>(memnew(Terrain2DMesherDefault)));
|
||||||
|
|
||||||
chunk->job_add(lj);
|
chunk->job_add(lj);
|
||||||
|
@ -36,20 +36,20 @@ Ref<Terrain2DChunk> Terrain2DWorldIsometric::_create_chunk(int x, int y, Ref<Ter
|
|||||||
|
|
||||||
if (chunk->job_get_count() == 0) {
|
if (chunk->job_get_count() == 0) {
|
||||||
Ref<Terrain2DTerrain2DJob> tj;
|
Ref<Terrain2DTerrain2DJob> tj;
|
||||||
tj.instance();
|
tj.instantiate();
|
||||||
|
|
||||||
Ref<Terrain2DLightJob> lj;
|
Ref<Terrain2DLightJob> lj;
|
||||||
lj.instance();
|
lj.instantiate();
|
||||||
|
|
||||||
tj->set_mesher(Ref<Terrain2DMesher>(memnew(Terrain2DMesherIsometric())));
|
tj->set_mesher(Ref<Terrain2DMesher>(memnew(Terrain2DMesherIsometric())));
|
||||||
|
|
||||||
Ref<Terrain2DMesherIsometric> liquid_mesher;
|
Ref<Terrain2DMesherIsometric> liquid_mesher;
|
||||||
liquid_mesher.instance();
|
liquid_mesher.instantiate();
|
||||||
liquid_mesher->set_channel_index_type(Terrain2DChunkDefault::DEFAULT_CHANNEL_LIQUID_TYPE);
|
liquid_mesher->set_channel_index_type(Terrain2DChunkDefault::DEFAULT_CHANNEL_LIQUID_TYPE);
|
||||||
tj->set_liquid_mesher(liquid_mesher);
|
tj->set_liquid_mesher(liquid_mesher);
|
||||||
|
|
||||||
Ref<Terrain2DProp2DJob> pj;
|
Ref<Terrain2DProp2DJob> pj;
|
||||||
pj.instance();
|
pj.instantiate();
|
||||||
pj->set_prop_mesher(Ref<Terrain2DMesher>(memnew(Terrain2DMesherIsometric)));
|
pj->set_prop_mesher(Ref<Terrain2DMesher>(memnew(Terrain2DMesherIsometric)));
|
||||||
|
|
||||||
chunk->job_add(lj);
|
chunk->job_add(lj);
|
||||||
|
@ -124,7 +124,7 @@ void Terrain2DJob::generate_random_ao(int seed, int octaves, int period, float p
|
|||||||
float cy = _chunk->get_cell_size_y();
|
float cy = _chunk->get_cell_size_y();
|
||||||
|
|
||||||
Ref<OpenSimplexNoise> noise;
|
Ref<OpenSimplexNoise> noise;
|
||||||
noise.instance();
|
noise.instantiate();
|
||||||
|
|
||||||
noise->set_seed(seed);
|
noise->set_seed(seed);
|
||||||
noise->set_octaves(octaves);
|
noise->set_octaves(octaves);
|
||||||
|
@ -32,7 +32,7 @@ SOFTWARE.
|
|||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
#include "core/object/reference.h"
|
#include "core/object/ref_counted.h"
|
||||||
#else
|
#else
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -36,20 +36,20 @@ Ref<Terrain2DChunk> Terrain2DWorldSimple::_create_chunk(int x, int y, Ref<Terrai
|
|||||||
|
|
||||||
if (chunk->job_get_count() == 0) {
|
if (chunk->job_get_count() == 0) {
|
||||||
Ref<Terrain2DTerrain2DJob> tj;
|
Ref<Terrain2DTerrain2DJob> tj;
|
||||||
tj.instance();
|
tj.instantiate();
|
||||||
|
|
||||||
Ref<Terrain2DLightJob> lj;
|
Ref<Terrain2DLightJob> lj;
|
||||||
lj.instance();
|
lj.instantiate();
|
||||||
|
|
||||||
tj->set_mesher(Ref<Terrain2DMesher>(memnew(Terrain2DMesherSimple())));
|
tj->set_mesher(Ref<Terrain2DMesher>(memnew(Terrain2DMesherSimple())));
|
||||||
|
|
||||||
Ref<Terrain2DMesherSimple> liquid_mesher;
|
Ref<Terrain2DMesherSimple> liquid_mesher;
|
||||||
liquid_mesher.instance();
|
liquid_mesher.instantiate();
|
||||||
liquid_mesher->set_channel_index_type(Terrain2DChunkDefault::DEFAULT_CHANNEL_LIQUID_TYPE);
|
liquid_mesher->set_channel_index_type(Terrain2DChunkDefault::DEFAULT_CHANNEL_LIQUID_TYPE);
|
||||||
tj->set_liquid_mesher(liquid_mesher);
|
tj->set_liquid_mesher(liquid_mesher);
|
||||||
|
|
||||||
Ref<Terrain2DProp2DJob> pj;
|
Ref<Terrain2DProp2DJob> pj;
|
||||||
pj.instance();
|
pj.instantiate();
|
||||||
pj->set_prop_mesher(Ref<Terrain2DMesher>(memnew(Terrain2DMesherSimple)));
|
pj->set_prop_mesher(Ref<Terrain2DMesher>(memnew(Terrain2DMesherSimple)));
|
||||||
|
|
||||||
chunk->job_add(lj);
|
chunk->job_add(lj);
|
||||||
|
@ -234,7 +234,7 @@ Terrain2DWorldEditor::Terrain2DWorldEditor(EditorNode *p_editor) {
|
|||||||
spatial_editor_hb->set_alignment(BoxContainer::ALIGN_BEGIN);
|
spatial_editor_hb->set_alignment(BoxContainer::ALIGN_BEGIN);
|
||||||
SpatialEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb);
|
SpatialEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb);
|
||||||
|
|
||||||
_tool_button_group.instance();
|
_tool_button_group.instantiate();
|
||||||
|
|
||||||
ToolButton *add_button = memnew(ToolButton);
|
ToolButton *add_button = memnew(ToolButton);
|
||||||
add_button->set_text("Add");
|
add_button->set_text("Add");
|
||||||
@ -291,7 +291,7 @@ Terrain2DWorldEditor::Terrain2DWorldEditor(EditorNode *p_editor) {
|
|||||||
scs->add_child(_surfaces_vbox_container);
|
scs->add_child(_surfaces_vbox_container);
|
||||||
_surfaces_vbox_container->set_h_size_flags(SIZE_EXPAND_FILL);
|
_surfaces_vbox_container->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||||
|
|
||||||
_surfaces_button_group.instance();
|
_surfaces_button_group.instantiate();
|
||||||
}
|
}
|
||||||
Terrain2DWorldEditor::~Terrain2DWorldEditor() {
|
Terrain2DWorldEditor::~Terrain2DWorldEditor() {
|
||||||
_world = NULL;
|
_world = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user