merge upstream

This commit is contained in:
2025-08-14 21:32:32 +00:00
9 changed files with 39 additions and 27 deletions

View File

@ -2,10 +2,12 @@
-cp ../Kha/Backends/Krom -cp ../Kha/Backends/Krom
-cp ../leenkx/Sources -cp ../leenkx/Sources
-cp ../iron/Sources -cp ../iron/Sources
-cp ../lib/aura/Sources
-cp ../lib/haxebullet/Sources -cp ../lib/haxebullet/Sources
-cp ../lib/haxerecast/Sources -cp ../lib/haxerecast/Sources
-cp ../lib/zui/Sources -cp ../lib/zui/Sources
--macro include('iron', true, null, ['../iron/Sources']) --macro include('iron', true, null, ['../iron/Sources'])
--macro include('aura', true, null, ['../lib/aura/Sources'])
--macro include('haxebullet', true, null, ['../lib/haxebullet/Sources']) --macro include('haxebullet', true, null, ['../lib/haxebullet/Sources'])
--macro include('haxerecast', true, null, ['../lib/haxerecast/Sources']) --macro include('haxerecast', true, null, ['../lib/haxerecast/Sources'])
--macro include('leenkx', true, ['leenkx.network'], ['../leenkx/Sources','../iron/Sources']) --macro include('leenkx', true, ['leenkx.network'], ['../leenkx/Sources','../iron/Sources'])

View File

@ -54,6 +54,22 @@ class App {
if (Scene.active == null || !Scene.active.ready) return; if (Scene.active == null || !Scene.active.ready) return;
iron.system.Time.update(); iron.system.Time.update();
if (lastw == -1) {
lastw = App.w();
lasth = App.h();
}
if (lastw != App.w() || lasth != App.h()) {
if (onResize != null) onResize();
else {
if (Scene.active != null && Scene.active.camera != null) {
Scene.active.camera.buildProjection();
}
}
}
lastw = App.w();
lasth = App.h();
if (pauseUpdates) return; if (pauseUpdates) return;
#if lnx_debug #if lnx_debug
@ -98,22 +114,6 @@ class App {
for (cb in endFrameCallbacks) cb(); for (cb in endFrameCallbacks) cb();
updateTime = kha.Scheduler.realTime() - startTime; updateTime = kha.Scheduler.realTime() - startTime;
#end #end
// Rebuild projection on window resize
if (lastw == -1) {
lastw = App.w();
lasth = App.h();
}
if (lastw != App.w() || lasth != App.h()) {
if (onResize != null) onResize();
else {
if (Scene.active != null && Scene.active.camera != null) {
Scene.active.camera.buildProjection();
}
}
}
lastw = App.w();
lasth = App.h();
} }
static function render(frames: Array<kha.Framebuffer>) { static function render(frames: Array<kha.Framebuffer>) {

View File

@ -887,7 +887,7 @@ class Scene {
var ptype: String = t.props[i * 3 + 1]; var ptype: String = t.props[i * 3 + 1];
var pval: Dynamic = t.props[i * 3 + 2]; var pval: Dynamic = t.props[i * 3 + 2];
if (StringTools.endsWith(ptype, "Object") && pval != "") { if (StringTools.endsWith(ptype, "Object") && pval != "" && pval != null) {
Reflect.setProperty(traitInst, pname, Scene.active.getChild(pval)); Reflect.setProperty(traitInst, pname, Scene.active.getChild(pval));
} else if (ptype == "TSceneFormat" && pval != "") { } else if (ptype == "TSceneFormat" && pval != "") {
Data.getSceneRaw(pval, function (r: TSceneFormat) { Data.getSceneRaw(pval, function (r: TSceneFormat) {

View File

@ -62,7 +62,7 @@ class DrawStringNode extends LogicNode {
override function get(from: Int): Dynamic { override function get(from: Int): Dynamic {
return from == 1 ? RenderToTexture.g.font.height(RenderToTexture.g.fontSize) : RenderToTexture.g.font.width(RenderToTexture.g.fontSize, string); return from == 1 ? RenderToTexture.g.font.width(RenderToTexture.g.fontSize, string) : RenderToTexture.g.font.height(RenderToTexture.g.fontSize);
} }
} }

View File

@ -73,7 +73,17 @@ class PhysicsBreak extends Trait {
collisionMargin: 0.04, collisionMargin: 0.04,
linearDeactivationThreshold: 0.0, linearDeactivationThreshold: 0.0,
angularDeactivationThrshold: 0.0, angularDeactivationThrshold: 0.0,
deactivationTime: 0.0 deactivationTime: 0.0,
linearVelocityMin: 0.0,
linearVelocityMax: 0.0,
angularVelocityMin: 0.0,
angularVelocityMax: 0.0,
lockTranslationX: false,
lockTranslationY: false,
lockTranslationZ: false,
lockRotationX: false,
lockRotationY: false,
lockRotationZ: false
}; };
o.addTrait(new RigidBody(Shape.ConvexHull, ud.mass, ud.friction, 0, 1, params)); o.addTrait(new RigidBody(Shape.ConvexHull, ud.mass, ud.friction, 0, 1, params));
if (cast(o, MeshObject).data.geom.positions.values.length < 600) { if (cast(o, MeshObject).data.geom.positions.values.length < 600) {

View File

@ -281,7 +281,7 @@ class DebugConsole extends Trait {
function drawObjectNameInList(object: iron.object.Object, selected: Bool) { function drawObjectNameInList(object: iron.object.Object, selected: Bool) {
var _y = ui._y; var _y = ui._y;
if (object.parent.name == 'Root') if (object.parent.name == 'Root' && object.raw == null)
ui.text(object.uid+'_'+object.name+' ('+iron.Scene.active.raw.world_ref+')'); ui.text(object.uid+'_'+object.name+' ('+iron.Scene.active.raw.world_ref+')');
else else
ui.text(object.uid+'_'+object.name); ui.text(object.uid+'_'+object.name);

View File

@ -10,7 +10,7 @@ class SetCameraStartEndNode(LnxLogicTreeNode):
def remove_extra_inputs(self, context): def remove_extra_inputs(self, context):
while len(self.inputs) > 2: while len(self.inputs) > 2:
self.inputs.remove(self.inputs[-1]) self.inputs.remove(self.inputs[-1])
if self.property0 == 'Start': if self.property0 == 'Start':
self.add_input('LnxFloatSocket', 'Start') self.add_input('LnxFloatSocket', 'Start')
if self.property0 == 'End': if self.property0 == 'End':

View File

@ -71,7 +71,7 @@ class DrawTextAreaStringNode(LnxLogicTreeNode):
layout.prop(self, 'property2') layout.prop(self, 'property2')
def get_replacement_node(self, node_tree: bpy.types.NodeTree): def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 2): if self.lnx_version not in (0, 1, 2):
raise LookupError() raise LookupError()
return NodeReplacement.Identity(self) return NodeReplacement.Identity(self)

View File

@ -17,15 +17,15 @@ class DrawStringNode(LnxLogicTreeNode):
at the anchor point. at the anchor point.
@output Out: Activated after the string has been drawn. @output Out: Activated after the string has been drawn.
@output Height: String Height.
@output Width: String Width. @output Width: String Width.
@output Height: String Height.
@see [`kha.graphics2.Graphics.drawString()`](http://kha.tech/api/kha/graphics2/Graphics.html#drawString). @see [`kha.graphics2.Graphics.drawString()`](http://kha.tech/api/kha/graphics2/Graphics.html#drawString).
""" """
bl_idname = 'LNDrawStringNode' bl_idname = 'LNDrawStringNode'
bl_label = 'Draw String' bl_label = 'Draw String'
lnx_section = 'draw' lnx_section = 'draw'
lnx_version = 2 lnx_version = 3
def lnx_init(self, context): def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'Draw') self.add_input('LnxNodeSocketAction', 'Draw')
@ -38,11 +38,11 @@ class DrawStringNode(LnxLogicTreeNode):
self.add_input('LnxFloatSocket', 'Angle') self.add_input('LnxFloatSocket', 'Angle')
self.add_output('LnxNodeSocketAction', 'Out') self.add_output('LnxNodeSocketAction', 'Out')
self.add_output('LnxFloatSocket', 'Height')
self.add_output('LnxFloatSocket', 'Width') self.add_output('LnxFloatSocket', 'Width')
self.add_output('LnxFloatSocket', 'Height')
def get_replacement_node(self, node_tree: bpy.types.NodeTree): def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1): if self.lnx_version not in (0, 1, 2):
raise LookupError() raise LookupError()
return NodeReplacement.Identity(self) return NodeReplacement.Identity(self)