Skip to content

Commit

Permalink
Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams committed May 13, 2024
1 parent eb81378 commit e874b8a
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 27 deletions.
31 changes: 31 additions & 0 deletions objects/oTest/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
hltVoice = undefined;
blendVoice = undefined;

VinylSetupImportJSON([
{
mix: "Test",
members: [
{
sound: sndBleep0,
},
{
sound: sndBleep1,
},
{
shuffle: "Shuffle",
gain: [0.9, 1.1],
pitch: [0.8, 1.2],
sounds: [sndBleep0, sndBleep1, sndBleep2, sndBleep3, sndBleep4, sndBleep5,
sndBleep6, sndBleep7, sndBleep8, sndBleep9, sndBleep10, sndBleep11,],
},
{
hlt: "HLT",
head: sndSync0,
loop: sndSync1,
tail: sndSync2,
},
{
blend: "Blend",
sounds: [sndSync0, sndSync1, sndSync2, sndSync3,],
},
],
},
]);

show_debug_message(json_stringify(VinylSetupExportJSON(), true));
show_debug_message(__VinylSetupExportGMLMacros());
show_debug_message(__VinylSetupExportGML(true));
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
///
/// @jujuadams 2022-10-30

function SnapBufferReadGML(_buffer, _offset, _size)
function __VinylBufferReadGML(_buffer, _offset, _size)
{
var _oldOffset = buffer_tell(_buffer);
buffer_seek(_buffer, buffer_seek_start, _offset);
var _parser = new __SnapBufferReadGMLParser(_buffer, _size);
var _parser = new ____VinylBufferReadGMLParser(_buffer, _size);
buffer_seek(_buffer, buffer_seek_start, _oldOffset);
return _parser.root;
}

function __SnapBufferReadGMLParser(_buffer, _buffer_size) constructor
function ____VinylBufferReadGMLParser(_buffer, _buffer_size) constructor
{
root = {};

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
///
/// @jujuadams 2022-10-30

function SnapBufferWriteGML(_buffer, _struct, _alphabetise = false, _indent = "")
function __VinylBufferWriteGML(_buffer, _struct, _alphabetise = false, _indent = "")
{
__SnapBufferWriteGMLInner(_buffer, _struct, _alphabetise, 1, _indent);
____VinylBufferWriteGMLInner(_buffer, _struct, _alphabetise, 1, _indent);
}

function __SnapBufferWriteGMLInner(_buffer, _value, _alphabetise, _depth, _indent)
function ____VinylBufferWriteGMLInner(_buffer, _value, _alphabetise, _depth, _indent)
{
if (is_method(_value)) //Implicitly also a struct so we have to check this first
{
Expand Down Expand Up @@ -54,15 +54,15 @@ function __SnapBufferWriteGMLInner(_buffer, _value, _alphabetise, _depth, _inden
buffer_write(_buffer, buffer_text, _indent);
buffer_write(_buffer, buffer_text, string(_name));
buffer_write(_buffer, buffer_text, " = ");
__SnapBufferWriteGMLInner(_buffer, _struct[$ _name], _alphabetise, _depth+1, _indent);
____VinylBufferWriteGMLInner(_buffer, _struct[$ _name], _alphabetise, _depth+1, _indent);
buffer_write(_buffer, buffer_text, ";\n");
}
else
{
buffer_write(_buffer, buffer_text, _indent);
buffer_write(_buffer, buffer_text, string(_name));
buffer_write(_buffer, buffer_text, ": ");
__SnapBufferWriteGMLInner(_buffer, _struct[$ _name], _alphabetise, _depth+1, _indent);
____VinylBufferWriteGMLInner(_buffer, _struct[$ _name], _alphabetise, _depth+1, _indent);
buffer_write(_buffer, buffer_text, ",\n");
}

Expand Down Expand Up @@ -96,7 +96,7 @@ function __SnapBufferWriteGMLInner(_buffer, _value, _alphabetise, _depth, _inden
repeat(_count)
{
buffer_write(_buffer, buffer_text, _indent);
__SnapBufferWriteGMLInner(_buffer, _array[_i], _alphabetise, _depth+1, _indent);
____VinylBufferWriteGMLInner(_buffer, _array[_i], _alphabetise, _depth+1, _indent);
buffer_write(_buffer, buffer_text, ",\n");
++_i;
}
Expand Down Expand Up @@ -133,7 +133,7 @@ function __SnapBufferWriteGMLInner(_buffer, _value, _alphabetise, _depth, _inden
}
else if (is_real(_value))
{
buffer_write(_buffer, buffer_text, SnapNumberToString(_value, true));
buffer_write(_buffer, buffer_text, __VinylNumberToString(_value, true));
}
else if (is_ptr(_value))
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Feather disable all
function SnapNumberToString(_value, _accurateFloats)
function __VinylNumberToString(_value, _accurateFloats)
{
if (_accurateFloats && is_real(_value) && (floor(_value) != _value))
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/__VinylSetupExportGML/__VinylSetupExportGML.gml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function __VinylSetupExportGML(_useMacros = false, _ignoreEmpty = true)
buffer_write(_buffer, buffer_text, "\",\n");

buffer_write(_buffer, buffer_text, " data: ");
SnapBufferWriteGML(_buffer, _metadataDict[$ _name], true, " ");
__VinylBufferWriteGML(_buffer, _metadataDict[$ _name], true, " ");
buffer_write(_buffer, buffer_text, ",\n");
buffer_write(_buffer, buffer_text, " },\n");

Expand Down
6 changes: 3 additions & 3 deletions scripts/__VinylSystem/__VinylSystem.gml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Feather disable all

#macro __VINYL_VERSION "6.0.0"
#macro __VINYL_DATE "2024-03-14"
#macro __VINYL_VERSION "6.0.0 (alpha)"
#macro __VINYL_DATE "2024-05-13"

#macro __VINYL_RUNNING_FROM_IDE (GM_build_type == "run")

Expand Down Expand Up @@ -119,7 +119,7 @@ function __VinylSystem()
_bootSetupHash = _newHash;

var _buffer = buffer_load(_bootSetupPath);
var _gml = SnapBufferReadGML(_buffer, 0, buffer_get_size(_buffer));
var _gml = __VinylBufferReadGML(_buffer, 0, buffer_get_size(_buffer));
buffer_delete(_buffer);

VinylSetupImportJSON(_gml[$ "global.VinylConfigSON"] ?? []);
Expand Down
6 changes: 3 additions & 3 deletions vinyl.resource_order
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
{"name":"oTest","order":3,"path":"objects/oTest/oTest.yy",},
{"name":"rMain","order":4,"path":"rooms/rMain/rMain.yy",},
{"name":"__VinylArrayShuffle","order":3,"path":"scripts/__VinylArrayShuffle/__VinylArrayShuffle.yy",},
{"name":"__VinylBufferReadGML","order":15,"path":"scripts/__VinylBufferReadGML/__VinylBufferReadGML.yy",},
{"name":"__VinylBufferWriteGML","order":16,"path":"scripts/__VinylBufferWriteGML/__VinylBufferWriteGML.yy",},
{"name":"__VinylClassPatternBlend","order":3,"path":"scripts/__VinylClassPatternBlend/__VinylClassPatternBlend.yy",},
{"name":"__VinylClassPatternHLT","order":2,"path":"scripts/__VinylClassPatternHLT/__VinylClassPatternHLT.yy",},
{"name":"__VinylClassPatternShuffle","order":1,"path":"scripts/__VinylClassPatternShuffle/__VinylClassPatternShuffle.yy",},
Expand All @@ -40,16 +42,14 @@
{"name":"__VinylImportSoundArray","order":7,"path":"scripts/__VinylImportSoundArray/__VinylImportSoundArray.yy",},
{"name":"__VinylIRandom","order":1,"path":"scripts/__VinylIRandom/__VinylIRandom.yy",},
{"name":"__VinylMultilineMacros","order":2,"path":"scripts/__VinylMultilineMacros/__VinylMultilineMacros.yy",},
{"name":"__VinylNumberToString","order":17,"path":"scripts/__VinylNumberToString/__VinylNumberToString.yy",},
{"name":"__VinylRandomRange","order":2,"path":"scripts/__VinylRandomRange/__VinylRandomRange.yy",},
{"name":"__VinylSetupExportGML","order":13,"path":"scripts/__VinylSetupExportGML/__VinylSetupExportGML.yy",},
{"name":"__VinylSetupExportGMLMacros","order":14,"path":"scripts/__VinylSetupExportGMLMacros/__VinylSetupExportGMLMacros.yy",},
{"name":"__VinylSystem","order":1,"path":"scripts/__VinylSystem/__VinylSystem.yy",},
{"name":"__VinylTrace","order":3,"path":"scripts/__VinylTrace/__VinylTrace.yy",},
{"name":"__VinylVoiceMoveMix","order":12,"path":"scripts/__VinylVoiceMoveMix/__VinylVoiceMoveMix.yy",},
{"name":"__VinylWarning","order":4,"path":"scripts/__VinylWarning/__VinylWarning.yy",},
{"name":"SnapBufferReadGML","order":15,"path":"scripts/SnapBufferReadGML/SnapBufferReadGML.yy",},
{"name":"SnapBufferWriteGML","order":16,"path":"scripts/SnapBufferWriteGML/SnapBufferWriteGML.yy",},
{"name":"SnapNumberToString","order":17,"path":"scripts/SnapNumberToString/SnapNumberToString.yy",},
{"name":"UIButtonInline","order":1,"path":"scripts/UIButtonInline/UIButtonInline.yy",},
{"name":"UINewline","order":2,"path":"scripts/UINewline/UINewline.yy",},
{"name":"UISpace","order":3,"path":"scripts/UISpace/UISpace.yy",},
Expand Down
6 changes: 3 additions & 3 deletions vinyl.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e874b8a

Please sign in to comment.