Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams committed Apr 30, 2023
2 parents 96c8d4a + aa4ffbc commit 2b2c37b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center">SNAP 5.8.0</h1>
<h1 align="center">SNAP 5.8.1</h1>

<p align="center">Data format converters for GameMaker Studio 2022 LTS by Juju Adams</p>

Expand Down
2 changes: 1 addition & 1 deletion options/windows/options_windows.yy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Windows",
"option_windows_display_name": "SNAP",
"option_windows_executable_name": "${project_name}.exe",
"option_windows_version": "5.8.0.0",
"option_windows_version": "5.8.1.0",
"option_windows_company_info": "@jujuadams",
"option_windows_product_info": "SNAP",
"option_windows_copyright_info": "@jujuadams 2023",
Expand Down
43 changes: 40 additions & 3 deletions scripts/SnapBufferReadGML/SnapBufferReadGML.gml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,15 @@ function __SnapBufferReadGMLParser(_buffer, _buffer_size) constructor
}
else
{
show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true);
var _asset_index = try_to_find_asset_index(token);
if (_asset_index >= 0)
{
token = _asset_index;
}
else
{
show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true);
}
}
}

Expand Down Expand Up @@ -216,7 +224,15 @@ function __SnapBufferReadGMLParser(_buffer, _buffer_size) constructor
}
else
{
show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true);
var _asset_index = try_to_find_asset_index(token);
if (_asset_index >= 0)
{
token = _asset_index;
}
else
{
show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true);
}
}
}

Expand Down Expand Up @@ -355,7 +371,15 @@ function __SnapBufferReadGMLParser(_buffer, _buffer_size) constructor
}
else
{
show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true);
var _asset_index = try_to_find_asset_index(token);
if (_asset_index >= 0)
{
token = _asset_index;
}
else
{
show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true);
}
}
}

Expand Down Expand Up @@ -469,5 +493,18 @@ function __SnapBufferReadGMLParser(_buffer, _buffer_size) constructor
}
}

static try_to_find_asset_index = function(_asset)
{
static _constantStruct = __DynamoGMLConstants();

if (!is_string(_asset)) return _asset;

var _index = asset_get_index(_asset);
if (_index >= 0) return _index;

if (!variable_struct_exists(_constantStruct, _asset)) return -1;
return _constantStruct[$ _asset];
}

read_root();
}
4 changes: 2 additions & 2 deletions scripts/__SnapSystem/__SnapSystem.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#macro __SNAP_VERSION "5.8.0"
#macro __SNAP_DATE "2023-04-27"
#macro __SNAP_VERSION "5.8.1"
#macro __SNAP_DATE "2023-04-30"

show_debug_message("SNAP: Welcome to SNAP by @jujuadams! This is version " + __SNAP_VERSION + ", " + __SNAP_DATE);

0 comments on commit 2b2c37b

Please sign in to comment.