Skip to content

Commit dde5a3d

Browse files
authored
Merge pull request #188 from TokisanGames/seperate-surface-list
Separate Texture List
2 parents 83bd6fb + 571224d commit dde5a3d

22 files changed

+975
-313
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Terrain3D
22
project/test/
3+
project/addons/godot-jolt/
34
project/addons/terrain_3d/bin/
45
project/addons/terrain_3d/editor/gterrain-ui/
56
project/_dev/
67
project/_export/
78
project/tests/
89
patches/
10+
*.zip
911

1012
# Godot-specific ignores
1113
/project/.import/
@@ -16,6 +18,7 @@ export_presets.cfg
1618
# Objects
1719
.scons-cache/
1820
*.os
21+
*.obj
1922

2023
# SConstruct
2124
.sconf_temp
@@ -28,4 +31,3 @@ export_presets.cfg
2831
# Editors
2932
.vscode/
3033
.vs/
31-
*.obj

Terrain3D.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.7.34024.191
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Terrain3D", "Terrain3D.vcxproj", "{B8850C81-3339-46A9-9668-CAA004E84629}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Debug|x86 = Debug|x86
12+
Release|x64 = Release|x64
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{B8850C81-3339-46A9-9668-CAA004E84629}.Debug|x64.ActiveCfg = Debug|x64
17+
{B8850C81-3339-46A9-9668-CAA004E84629}.Debug|x64.Build.0 = Debug|x64
18+
{B8850C81-3339-46A9-9668-CAA004E84629}.Debug|x86.ActiveCfg = Debug|Win32
19+
{B8850C81-3339-46A9-9668-CAA004E84629}.Debug|x86.Build.0 = Debug|Win32
20+
{B8850C81-3339-46A9-9668-CAA004E84629}.Release|x64.ActiveCfg = Release|x64
21+
{B8850C81-3339-46A9-9668-CAA004E84629}.Release|x64.Build.0 = Release|x64
22+
{B8850C81-3339-46A9-9668-CAA004E84629}.Release|x86.ActiveCfg = Release|Win32
23+
{B8850C81-3339-46A9-9668-CAA004E84629}.Release|x86.Build.0 = Release|Win32
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {119F9825-B9FE-4F51-9225-7EA96BF5BF7F}
30+
EndGlobalSection
31+
EndGlobal

Terrain3D.vcxproj

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>17.0</VCProjectVersion>
23+
<Keyword>Win32Proj</Keyword>
24+
<ProjectGuid>{b8850c81-3339-46a9-9668-caa004e84629}</ProjectGuid>
25+
<RootNamespace>Terrain3D</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>Application</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v143</PlatformToolset>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v143</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>Makefile</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v143</PlatformToolset>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>Application</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v143</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
74+
<NMakeBuildCommandLine>scons dev_build=yes</NMakeBuildCommandLine>
75+
<NMakeReBuildCommandLine>scons dev_build=yes</NMakeReBuildCommandLine>
76+
<NMakeCleanCommandLine>scons --clean</NMakeCleanCommandLine>
77+
<NMakeIncludeSearchPath>$(SolutionDir)\src;$(SolutionDir)\godot-cpp\gdextension;$(SolutionDir)\godot-cpp\gen\include;$(SolutionDir)\godot-cpp\include</NMakeIncludeSearchPath>
78+
<AdditionalOptions>/std:c++17</AdditionalOptions>
79+
<OutDir>.vs</OutDir>
80+
<IntDir>.vs</IntDir>
81+
</PropertyGroup>
82+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
83+
<ClCompile>
84+
<WarningLevel>Level3</WarningLevel>
85+
<SDLCheck>true</SDLCheck>
86+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
87+
<ConformanceMode>true</ConformanceMode>
88+
</ClCompile>
89+
<Link>
90+
<SubSystem>Console</SubSystem>
91+
<GenerateDebugInformation>true</GenerateDebugInformation>
92+
</Link>
93+
</ItemDefinitionGroup>
94+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
95+
<ClCompile>
96+
<WarningLevel>Level3</WarningLevel>
97+
<FunctionLevelLinking>true</FunctionLevelLinking>
98+
<IntrinsicFunctions>true</IntrinsicFunctions>
99+
<SDLCheck>true</SDLCheck>
100+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
101+
<ConformanceMode>true</ConformanceMode>
102+
</ClCompile>
103+
<Link>
104+
<SubSystem>Console</SubSystem>
105+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
106+
<OptimizeReferences>true</OptimizeReferences>
107+
<GenerateDebugInformation>true</GenerateDebugInformation>
108+
</Link>
109+
</ItemDefinitionGroup>
110+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
111+
<ClCompile>
112+
<WarningLevel>Level3</WarningLevel>
113+
<SDLCheck>true</SDLCheck>
114+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
115+
<ConformanceMode>true</ConformanceMode>
116+
</ClCompile>
117+
<Link>
118+
<SubSystem>Console</SubSystem>
119+
<GenerateDebugInformation>true</GenerateDebugInformation>
120+
</Link>
121+
<BuildLog>
122+
<Path>.vs/Terrain3D-build.log</Path>
123+
</BuildLog>
124+
</ItemDefinitionGroup>
125+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
126+
<ClCompile>
127+
<WarningLevel>Level3</WarningLevel>
128+
<FunctionLevelLinking>true</FunctionLevelLinking>
129+
<IntrinsicFunctions>true</IntrinsicFunctions>
130+
<SDLCheck>true</SDLCheck>
131+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
132+
<ConformanceMode>true</ConformanceMode>
133+
</ClCompile>
134+
<Link>
135+
<SubSystem>Console</SubSystem>
136+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
137+
<OptimizeReferences>true</OptimizeReferences>
138+
<GenerateDebugInformation>true</GenerateDebugInformation>
139+
</Link>
140+
</ItemDefinitionGroup>
141+
<ItemGroup>
142+
<ClInclude Include="src\geoclipmap.h" />
143+
<ClInclude Include="src\register_types.h" />
144+
<ClInclude Include="src\terrain_3d.h" />
145+
<ClInclude Include="src\terrain_3d_editor.h" />
146+
<ClInclude Include="src\terrain_3d_logger.h" />
147+
<ClInclude Include="src\terrain_3d_storage.h" />
148+
<ClInclude Include="src\terrain_3d_surface.h" />
149+
<ClInclude Include="src\terrain_3d_texture.h" />
150+
<ClInclude Include="src\terrain_3d_texture_list.h" />
151+
</ItemGroup>
152+
<ItemGroup>
153+
<ClCompile Include="src\geoclipmap.cpp" />
154+
<ClCompile Include="src\register_types.cpp" />
155+
<ClCompile Include="src\terrain_3d.cpp" />
156+
<ClCompile Include="src\terrain_3d_editor.cpp" />
157+
<ClCompile Include="src\terrain_3d_storage.cpp" />
158+
<ClCompile Include="src\terrain_3d_surface.cpp" />
159+
<ClCompile Include="src\terrain_3d_texture.cpp" />
160+
<ClCompile Include="src\terrain_3d_texture_list.cpp" />
161+
</ItemGroup>
162+
<ItemGroup>
163+
<None Include="src\shaders\debug_views.glsl" />
164+
<None Include="src\shaders\main.glsl" />
165+
<None Include="src\shaders\world_noise.glsl" />
166+
</ItemGroup>
167+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
168+
<ImportGroup Label="ExtensionTargets">
169+
</ImportGroup>
170+
</Project>

Terrain3D.vcxproj.filters

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClInclude Include="src\terrain_3d_texture_list.h">
19+
<Filter>Header Files</Filter>
20+
</ClInclude>
21+
<ClInclude Include="src\geoclipmap.h">
22+
<Filter>Header Files</Filter>
23+
</ClInclude>
24+
<ClInclude Include="src\register_types.h">
25+
<Filter>Header Files</Filter>
26+
</ClInclude>
27+
<ClInclude Include="src\terrain_3d.h">
28+
<Filter>Header Files</Filter>
29+
</ClInclude>
30+
<ClInclude Include="src\terrain_3d_editor.h">
31+
<Filter>Header Files</Filter>
32+
</ClInclude>
33+
<ClInclude Include="src\terrain_3d_logger.h">
34+
<Filter>Header Files</Filter>
35+
</ClInclude>
36+
<ClInclude Include="src\terrain_3d_storage.h">
37+
<Filter>Header Files</Filter>
38+
</ClInclude>
39+
<ClInclude Include="src\terrain_3d_surface.h">
40+
<Filter>Header Files</Filter>
41+
</ClInclude>
42+
<ClInclude Include="src\terrain_3d_texture.h">
43+
<Filter>Header Files</Filter>
44+
</ClInclude>
45+
</ItemGroup>
46+
<ItemGroup>
47+
<ClCompile Include="src\geoclipmap.cpp">
48+
<Filter>Source Files</Filter>
49+
</ClCompile>
50+
<ClCompile Include="src\register_types.cpp">
51+
<Filter>Source Files</Filter>
52+
</ClCompile>
53+
<ClCompile Include="src\terrain_3d.cpp">
54+
<Filter>Source Files</Filter>
55+
</ClCompile>
56+
<ClCompile Include="src\terrain_3d_editor.cpp">
57+
<Filter>Source Files</Filter>
58+
</ClCompile>
59+
<ClCompile Include="src\terrain_3d_storage.cpp">
60+
<Filter>Source Files</Filter>
61+
</ClCompile>
62+
<ClCompile Include="src\terrain_3d_surface.cpp">
63+
<Filter>Source Files</Filter>
64+
</ClCompile>
65+
<ClCompile Include="src\terrain_3d_texture.cpp">
66+
<Filter>Source Files</Filter>
67+
</ClCompile>
68+
<ClCompile Include="src\terrain_3d_texture_list.cpp">
69+
<Filter>Source Files</Filter>
70+
</ClCompile>
71+
</ItemGroup>
72+
<ItemGroup>
73+
<None Include="src\shaders\world_noise.glsl" />
74+
<None Include="src\shaders\main.glsl" />
75+
<None Include="src\shaders\debug_views.glsl" />
76+
</ItemGroup>
77+
</Project>

Terrain3D.vcxproj.user

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ShowAllFiles>false</ShowAllFiles>
5+
</PropertyGroup>
6+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
7+
<LocalDebuggerCommand>c:\gd\bin\Godot_v4.1-stable_win64_console.exe</LocalDebuggerCommand>
8+
<LocalDebuggerCommandArguments>-e project.godot</LocalDebuggerCommandArguments>
9+
<LocalDebuggerWorkingDirectory>project</LocalDebuggerWorkingDirectory>
10+
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
11+
</PropertyGroup>
12+
</Project>

project/addons/terrain_3d/editor/components/surface_list.gd renamed to project/addons/terrain_3d/editor/components/texture_dock.gd

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func _init() -> void:
1717
var scroll: ScrollContainer = ScrollContainer.new()
1818
var label: Label = Label.new()
1919

20-
label.set_text("Surfaces")
20+
label.set_text("Textures")
2121
label.set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER)
2222
label.set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER)
2323
scroll.set_v_size_flags(SIZE_EXPAND_FILL)
@@ -127,10 +127,10 @@ class ListContainer extends Container:
127127

128128
class ListEntry extends VBoxContainer:
129129
signal selected()
130-
signal changed(resource: Terrain3DSurface)
131-
signal inspected(resource: Terrain3DSurface)
130+
signal changed(resource: Terrain3DTexture)
131+
signal inspected(resource: Terrain3DTexture)
132132

133-
var resource: Terrain3DSurface
133+
var resource: Terrain3DTexture
134134
var drop_data: bool = false
135135
var is_hovered: bool = false
136136
var is_selected: bool = false
@@ -189,7 +189,7 @@ class ListEntry extends VBoxContainer:
189189
draw_texture(add_icon, (get_size() / 2) - (add_icon.get_size() / 2))
190190
else:
191191
name_label.text = resource.get_name()
192-
self_modulate = resource.get_albedo()
192+
self_modulate = resource.get_albedo_color()
193193
var texture: Texture2D = resource.get_albedo_texture()
194194
if texture:
195195
draw_texture_rect(texture, rect, false)
@@ -219,7 +219,7 @@ class ListEntry extends VBoxContainer:
219219
MOUSE_BUTTON_LEFT:
220220
# If `Add new` is clicked
221221
if !resource:
222-
set_edited_resource(Terrain3DSurface.new(), false)
222+
set_edited_resource(Terrain3DTexture.new(), false)
223223
edit()
224224
else:
225225
emit_signal("selected")
@@ -243,19 +243,19 @@ class ListEntry extends VBoxContainer:
243243
func _drop_data(at_position: Vector2, data: Variant) -> void:
244244
if typeof(data) == TYPE_DICTIONARY:
245245
var res: Resource = load(data.files[0])
246-
if res is Terrain3DSurface:
246+
if res is Terrain3DTexture:
247247
set_edited_resource(res, false)
248248
if res is Texture2D:
249-
var surf: Terrain3DSurface = Terrain3DSurface.new()
249+
var surf: Terrain3DTexture = Terrain3DTexture.new()
250250
surf.set_albedo_texture(res)
251251
set_edited_resource(surf, false)
252252

253253

254-
func set_edited_resource(res: Terrain3DSurface, no_signal: bool = true) -> void:
254+
func set_edited_resource(res: Terrain3DTexture, no_signal: bool = true) -> void:
255255
resource = res
256256
if resource:
257-
resource.value_changed.connect(_on_surface_changed)
258-
resource.texture_changed.connect(_on_surface_changed)
257+
resource.setting_changed.connect(_on_texture_changed)
258+
resource.texture_changed.connect(_on_texture_changed)
259259

260260
if button_clear:
261261
button_clear.set_visible(resource != null)
@@ -265,7 +265,7 @@ class ListEntry extends VBoxContainer:
265265
emit_signal("changed", resource)
266266

267267

268-
func _on_surface_changed() -> void:
268+
func _on_texture_changed() -> void:
269269
emit_signal("changed", resource)
270270

271271

0 commit comments

Comments
 (0)