Update to latest Godot and godot-nim

This commit is contained in:
Ruslan Mustakov 2017-10-05 20:55:44 +07:00
commit cba3d8ff51
9 changed files with 43 additions and 17 deletions

1
.gitignore vendored
View file

@ -2,5 +2,6 @@
/_dlls /_dlls
/nakefile /nakefile
/_godotapi /_godotapi
/logs
nimcache nimcache
.nimcache .nimcache

View file

@ -4,8 +4,7 @@ Prerequisites:
1. Install [nake](https://github.com/fowlmouth/nake): `nimble install nake -n`. 1. Install [nake](https://github.com/fowlmouth/nake): `nimble install nake -n`.
2. Ensure `~/.nimble/bin` is in your PATH (On Windows: `C:\Users\<your_username>\.nimble\bin`). 2. Ensure `~/.nimble/bin` is in your PATH (On Windows: `C:\Users\<your_username>\.nimble\bin`).
3. Set `GODOT_BIN` environment varible to point to Godot executable (requires Godot 3.0 changeset [d28e9c3](https://github.com/godotengine/godot/commit/d28e9c3c0813e729195357dbb9ccd337494bc6d7) or newer). 3. Set `GODOT_BIN` environment varible to point to Godot executable (requires Godot 3.0 changeset [b759d14](https://github.com/godotengine/godot/commit/b759d1416f574e5b642413edd623b04f2a1d20ad) or newer).
4. Install godot-nim: `nimble install godot` 4. Install godot-nim: `nimble install godot`
5. (Windows only) Set `GODOT_LIB` environment variable to point to Godot's .lib file. It should be in the `bin` folder after you build Godot.
Run `nake build` in any directory within the project to compile for the current platform. Run `nake build` in any directory within the project to compile for the current platform.

View file

@ -24,7 +24,7 @@ texture_size = 2
background_mode = 2 background_mode = 2
background_sky = SubResource( 1 ) background_sky = SubResource( 1 )
background_sky_scale = 1.0 background_sky_custom_fov = 0.0
background_color = Color( 0, 0, 0, 1 ) background_color = Color( 0, 0, 0, 1 )
background_energy = 1.0 background_energy = 1.0
background_canvas_max_layer = 0 background_canvas_max_layer = 0

View file

@ -21,3 +21,4 @@ process/HDR_as_SRGB=false
stream=false stream=false
size_limit=0 size_limit=0
detect_3d=true detect_3d=true
svg/scale=1.0

View file

@ -14,8 +14,10 @@ _sections_unfolded = [ "Font", "Settings" ]
[node name="Panel" type="Panel"] [node name="Panel" type="Panel"]
anchor_right = 1 anchor_left = 0.0
anchor_bottom = 1 anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 0 mouse_filter = 0
@ -26,8 +28,10 @@ _sections_unfolded = [ "Anchor", "Margin" ]
[node name="Label" type="Label" parent="."] [node name="Label" type="Label" parent="."]
anchor_right = 1 anchor_left = 0.0
anchor_bottom = 1 anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 2 mouse_filter = 2
@ -44,6 +48,8 @@ _sections_unfolded = [ "Anchor", "Margin", "custom_fonts" ]
[node name="FPS" parent="." instance=ExtResource( 3 )] [node name="FPS" parent="." instance=ExtResource( 3 )]
anchor_top = 0.0
anchor_bottom = 0.0
margin_left = 189.0 margin_left = 189.0
margin_bottom = 58.0 margin_bottom = 58.0

View file

@ -7,6 +7,7 @@ platform/X11_64bit = "res://_dlls/nim_linux_64.so"
platform/Windows_32bit = "res://_dlls/nim_32.dll" platform/Windows_32bit = "res://_dlls/nim_32.dll"
platform/Windows_64bit = "res://_dlls/nim_64.dll" platform/Windows_64bit = "res://_dlls/nim_64.dll"
platform/OSX = "res://_dlls/nim_mac.dylib" platform/OSX = "res://_dlls/nim_mac.dylib"
platform/Android = "res://_dlls/nim_android.so" platform/Android = "res://nim_android.so"
platform/iOS = "res://_dlls/nim_ios.dylib" platform/iOS_32bit = "res://_dlls/nim_ios_32.dylib"
platform/iOS_64bit = "res://_dlls/nim_ios_64.dylib"
platform/WebAssembly = "" platform/WebAssembly = ""

View file

@ -1,10 +1,23 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=3 config_version=3
[application] [application]
config/name="Godot-Nim Stub" config/name="Godot-Nim Stub"
run/main_scene="res://main.tscn" run/main_scene="res://main.tscn"
config/icon="res://icon.png" config/icon="res://icon.png"
[gdnative]
singletons=[ ]
[rendering] [rendering]
environment/default_environment="res://default_env.tres" environment/default_environment="res://default_env.tres"

View file

@ -3,7 +3,17 @@ import ospaths
switch("nimcache", ".nimcache"/hostOS/hostCPU) switch("nimcache", ".nimcache"/hostOS/hostCPU)
when defined(macosx): when defined(macosx):
switch("passL", "-framework Cocoa -Wl,-undefined,dynamic_lookup") when defined(ios):
if hostCPU == "arm64":
switch("passC", "-arch arm64")
switch("passL", "-arch arm64")
elif hostCPU == "arm":
switch("passC", "-arch armv7")
switch("passL", "-arch armv7")
switch("passC", "-mios-version-min=9.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk")
switch("passL", "-mios-version-min=9.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk")
else:
switch("passL", "-framework Cocoa")
elif defined(android): elif defined(android):
let ndk = getEnv("ANDROID_NDK_ROOT") let ndk = getEnv("ANDROID_NDK_ROOT")
let toolchain = getEnv("ANDROID_TOOLCHAIN") let toolchain = getEnv("ANDROID_TOOLCHAIN")
@ -29,11 +39,6 @@ elif defined(android):
elif defined(windows): elif defined(windows):
assert(sizeof(int) == 8) assert(sizeof(int) == 8)
switch("cc", "vcc") switch("cc", "vcc")
let godotLib = getEnv("GODOT_LIB")
if godotLib.len == 0:
raise newException(OSError,
"GODOT_LIB must be specified and point to the .lib file")
switch("clib", godotLib.changeFileExt(""))
elif defined(linux): elif defined(linux):
switch("passC", "-fPIC") switch("passC", "-fPIC")
else: else:

View file

@ -4,7 +4,7 @@ description = "Godot-Nim Project Stub"
license = "MIT" license = "MIT"
bin = @["stub"] bin = @["stub"]
requires "godot >= 0.5.0 & < 0.6.0" requires "godot >= 0.6.0 & < 0.7.0"
task make, "build": task make, "build":
const bitsPostfix = when sizeof(int) == 8: "_64" else: "_32" const bitsPostfix = when sizeof(int) == 8: "_64" else: "_32"
@ -12,7 +12,7 @@ task make, "build":
when defined(windows): when defined(windows):
"nim" & bitsPostfix & ".dll" "nim" & bitsPostfix & ".dll"
elif defined(ios): elif defined(ios):
"nim_ios.dylib" "nim_ios" & bitsPostfix & ".dylib"
elif defined(macosx): elif defined(macosx):
"nim_mac.dylib" "nim_mac.dylib"
elif defined(android): elif defined(android):