Ensure storage exists

This commit is contained in:
unknown 2017-12-30 12:14:36 +01:00
parent c6de00dc60
commit ea21439d9f
3 changed files with 7 additions and 0 deletions

View file

@ -18,6 +18,9 @@ void main() {
gl_Position = vec4(pos.xy, 0.0, 1.0);
// fullscreen triangle: http://de.slideshare.net/DevCentralAMD/vertex-shader-tricks-bill-bilodeau
// gl_Position = vec4((gl_VertexID % 2) * 4.0 - 1.0, (gl_VertexID / 2) * 4.0 - 1.0, 0.0, 1.0);
// NDC (at the back of cube)
vec4 v = vec4(pos.x, pos.y, 1.0, 1.0);
v = vec4(invVP * v);

View file

@ -10,6 +10,8 @@ class ReadStorageNode extends LogicNode {
var key:String = inputs[0].get();
var data:Dynamic = iron.system.Storage.data;
if (data == null) return null;
var value:Dynamic = Reflect.field(data, key);
if (value == null) {

View file

@ -11,6 +11,8 @@ class WriteStorageNode extends LogicNode {
var value:Dynamic = inputs[2].get();
var data = iron.system.Storage.data;
if (data == null) return;
Reflect.setField(data, key, value);
iron.system.Storage.save();