Skip to content

Commit

Permalink
Adding support for prefab2 in Library.hx
Browse files Browse the repository at this point in the history
  • Loading branch information
EspeuteClement committed Jan 8, 2024
1 parent 5753787 commit 6fe90b7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions hxd/fmt/hmd/Library.hx
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,19 @@ class Library {
if (materialContainer == null)
materialContainer = new h3d.scene.Mesh(null, mat, null);

var ctx = new hrt.prefab.Context();
ctx.shared = new ContextShared(loadTexture, null);
#if prefab2
var shared = new ContextShared(loadTexture, null);

materialContainer.material = mat;
ctx.local3d = materialContainer;
m.make(ctx);
m.make(materialContainer,shared);
#else
var ctx = new hrt.prefab.Context();
ctx.shared = new ContextShared(loadTexture, null);

materialContainer.material = mat;
ctx.local3d = materialContainer;
m.make(ctx);
#end
// Ensure there is no leak with this
materialContainer.material = null;

Expand Down

0 comments on commit 6fe90b7

Please sign in to comment.