diff --git a/resources/shader.yml b/resources/shader.yml index a7af97b..5391550 100644 --- a/resources/shader.yml +++ b/resources/shader.yml @@ -1,30 +1,36 @@ shaders: - slang: glsl430 programs: - - name: default + - + name: default vs: path: /Users/ccuddigan/Github/delve-framework/assets/shaders/built/default/default_default_glsl430_vs.glsl is_binary: false entry_point: main inputs: - - slot: 0 + - + slot: 0 name: pos sem_name: TEXCOORD sem_index: 0 - - slot: 1 + - + slot: 1 name: color0 sem_name: TEXCOORD sem_index: 1 - - slot: 2 + - + slot: 2 name: texcoord0 sem_name: TEXCOORD sem_index: 2 outputs: - - slot: 0 + - + slot: 0 name: color sem_name: TEXCOORD sem_index: 0 - - slot: 1 + - + slot: 1 name: uv sem_name: TEXCOORD sem_index: 1 @@ -43,7 +49,8 @@ shaders: is_binary: false entry_point: main inputs: - - slot: 0 + - + slot: 0 name: color sem_name: TEXCOORD sem_index: 0 @@ -81,23 +88,28 @@ shaders: name: tex_smp image_name: tex sampler_name: smp - - slang: glsl300es + - + slang: glsl300es programs: - - name: default + - + name: default vs: path: /Users/ccuddigan/Github/delve-framework/assets/shaders/built/default/default_default_glsl300es_vs.glsl is_binary: false entry_point: main inputs: - - slot: 0 + - + slot: 0 name: pos sem_name: TEXCOORD sem_index: 0 - - slot: 1 + - + slot: 1 name: color0 sem_name: TEXCOORD sem_index: 1 - - slot: 2 + - + slot: 2 name: texcoord0 sem_name: TEXCOORD sem_index: 2 diff --git a/src/root.zig b/src/root.zig index 8712ab3..7b851bb 100644 --- a/src/root.zig +++ b/src/root.zig @@ -305,6 +305,13 @@ pub fn Ymlz(comptime Destination: type) type { return null; } + fn isArrayEntryOnlyChar(raw_line: []const u8) bool { + // Trim whitespace to see if this is only the array start char + var trimmed_line = std.mem.trimLeft(u8, raw_line, " "); + trimmed_line = std.mem.trimRight(u8, trimmed_line, " "); + return std.mem.eql(u8, trimmed_line, "-"); + } + fn isNewExpression(self: *Self, raw_value_line: []const u8, depth: usize) bool { const indent_depth = self.getIndentDepth(depth); @@ -344,6 +351,11 @@ pub fn Ymlz(comptime Destination: type) type { while (true) { const raw_value_line = try self.readLine() orelse break; + // If this is only the array entry char '-', just eat this line + if (isArrayEntryOnlyChar(raw_value_line)) { + continue; + } + try self.suspense.set(raw_value_line); if (self.isNewExpression(raw_value_line, depth)) {