@gamely/gly-engine-lite 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.lua +104 -103
  2. package/package.json +2 -2
package/dist/main.lua CHANGED
@@ -1,58 +1,58 @@
1
1
  local math = ((function() local x, y = pcall(require, 'math'); return x and y end)()) or _G.math
2
- local source_version_2399 = nil
3
- local source_shared_engine_loadcore_23a4 = nil
4
- local source_shared_engine_loadgame_23af = nil
5
- local source_engine_api_data_encoder_23c1 = nil
6
- local source_engine_api_system_app_23cc = nil
7
- local source_engine_api_data_hash_23d7 = nil
8
- local source_engine_api_io_http_23e2 = nil
9
- local source_engine_api_data_i18n_23ed = nil
10
- local source_engine_api_system_key_23f8 = nil
11
- local source_engine_api_debug_log_2403 = nil
12
- local source_engine_api_math_basic_240e = nil
13
- local source_engine_api_math_clib_2419 = nil
14
- local source_engine_api_math_random_2424 = nil
15
- local source_engine_api_data_array_242f = nil
16
- local source_engine_api_io_media_243a = nil
17
- local source_engine_api_draw_fps_2445 = nil
18
- local source_engine_api_draw_text_2450 = nil
19
- local source_engine_api_draw_poly_245b = nil
20
- local source_engine_api_raw_memory_2466 = nil
21
- local source_engine_protocol_http_callback_2478 = nil
22
- local source_shared_var_object_root_248a = nil
23
- local source_engine_api_system_color_2495 = nil
24
- local source_shared_var_object_std_24a0 = nil
25
- local source_shared_functional_pipeline_2940 = nil
26
- local source_shared_string_dsl_requires_294b = nil
27
- local source_shared_string_eval_file_2bb2 = nil
28
- local source_shared_string_eval_code_2bbd = nil
29
- local source_shared_functional_decorator_2e5e = nil
30
- local source_shared_string_encode_http_5c51 = nil
31
- local source_shared_string_encode_url_5c5c = nil
32
- local function main_2390()
33
- local version = source_version_2399()
34
- local loadcore = source_shared_engine_loadcore_23a4()
35
- local loadgame = source_shared_engine_loadgame_23af()
36
- local engine_encoder = source_engine_api_data_encoder_23c1()
37
- local engine_game = source_engine_api_system_app_23cc()
38
- local engine_hash = source_engine_api_data_hash_23d7()
39
- local engine_http = source_engine_api_io_http_23e2()
40
- local engine_i18n = source_engine_api_data_i18n_23ed()
41
- local engine_key = source_engine_api_system_key_23f8()
42
- local engine_log = source_engine_api_debug_log_2403()
43
- local engine_math = source_engine_api_math_basic_240e()
44
- local engine_math_clib = source_engine_api_math_clib_2419()
45
- local engine_math_random = source_engine_api_math_random_2424()
46
- local engine_array = source_engine_api_data_array_242f()
47
- local engine_media = source_engine_api_io_media_243a()
48
- local engine_api_draw_fps = source_engine_api_draw_fps_2445()
49
- local engine_api_draw_text = source_engine_api_draw_text_2450()
50
- local engine_api_draw_poly = source_engine_api_draw_poly_245b()
51
- local engine_raw_memory = source_engine_api_raw_memory_2466()
52
- local callback_http = source_engine_protocol_http_callback_2478()
53
- local application_default = source_shared_var_object_root_248a()
54
- local color = source_engine_api_system_color_2495()
55
- local std = source_shared_var_object_std_24a0()
2
+ local source_version_23a4 = nil
3
+ local source_shared_engine_loadcore_23af = nil
4
+ local source_shared_engine_loadgame_23ba = nil
5
+ local source_engine_api_data_encoder_23cc = nil
6
+ local source_engine_api_system_app_23d7 = nil
7
+ local source_engine_api_data_hash_23e2 = nil
8
+ local source_engine_api_io_http_23ed = nil
9
+ local source_engine_api_data_i18n_23f8 = nil
10
+ local source_engine_api_system_key_2403 = nil
11
+ local source_engine_api_debug_log_240e = nil
12
+ local source_engine_api_math_basic_2419 = nil
13
+ local source_engine_api_math_clib_2424 = nil
14
+ local source_engine_api_math_random_242f = nil
15
+ local source_engine_api_data_array_243a = nil
16
+ local source_engine_api_io_media_2445 = nil
17
+ local source_engine_api_draw_fps_2450 = nil
18
+ local source_engine_api_draw_text_245b = nil
19
+ local source_engine_api_draw_poly_2466 = nil
20
+ local source_engine_api_raw_memory_2471 = nil
21
+ local source_engine_protocol_http_callback_2483 = nil
22
+ local source_shared_var_object_root_2495 = nil
23
+ local source_engine_api_system_color_24a0 = nil
24
+ local source_shared_var_object_std_24ab = nil
25
+ local source_shared_functional_pipeline_2952 = nil
26
+ local source_shared_string_dsl_requires_295d = nil
27
+ local source_shared_string_eval_file_2bc4 = nil
28
+ local source_shared_string_eval_code_2bcf = nil
29
+ local source_shared_functional_decorator_2e70 = nil
30
+ local source_shared_string_encode_http_5c63 = nil
31
+ local source_shared_string_encode_url_5c6e = nil
32
+ local function main_239b()
33
+ local version = source_version_23a4()
34
+ local loadcore = source_shared_engine_loadcore_23af()
35
+ local loadgame = source_shared_engine_loadgame_23ba()
36
+ local engine_encoder = source_engine_api_data_encoder_23cc()
37
+ local engine_game = source_engine_api_system_app_23d7()
38
+ local engine_hash = source_engine_api_data_hash_23e2()
39
+ local engine_http = source_engine_api_io_http_23ed()
40
+ local engine_i18n = source_engine_api_data_i18n_23f8()
41
+ local engine_key = source_engine_api_system_key_2403()
42
+ local engine_log = source_engine_api_debug_log_240e()
43
+ local engine_math = source_engine_api_math_basic_2419()
44
+ local engine_math_clib = source_engine_api_math_clib_2424()
45
+ local engine_math_random = source_engine_api_math_random_242f()
46
+ local engine_array = source_engine_api_data_array_243a()
47
+ local engine_media = source_engine_api_io_media_2445()
48
+ local engine_api_draw_fps = source_engine_api_draw_fps_2450()
49
+ local engine_api_draw_text = source_engine_api_draw_text_245b()
50
+ local engine_api_draw_poly = source_engine_api_draw_poly_2466()
51
+ local engine_raw_memory = source_engine_api_raw_memory_2471()
52
+ local callback_http = source_engine_protocol_http_callback_2483()
53
+ local application_default = source_shared_var_object_root_2495()
54
+ local color = source_engine_api_system_color_24a0()
55
+ local std = source_shared_var_object_std_24ab()
56
56
  local application = application_default
57
57
  local engine = {
58
58
  keyboard = function(a, b, c, d) end,
@@ -121,11 +121,11 @@ encode = native_xml_encode
121
121
  function native_callback_loop(dt)
122
122
  std.milis = std.milis + dt
123
123
  std.delta = dt
124
- application.callbacks.loop(std, application.data)
124
+ application.callbacks.loop(application.data, std)
125
125
  end
126
126
  function native_callback_draw()
127
127
  native_draw_start()
128
- application.callbacks.draw(std, application.data)
128
+ application.callbacks.draw(application.data, std)
129
129
  native_draw_flush()
130
130
  end
131
131
  function native_callback_resize(width, height)
@@ -160,6 +160,7 @@ std.draw.rect=native_draw_rect
160
160
  std.draw.line=native_draw_line
161
161
  std.image.load=native_image_load
162
162
  std.image.draw=native_image_draw
163
+ std.image.mensure=native_image_mensure
163
164
  std.text.print=native_text_print
164
165
  std.text.mensure=native_text_mensure
165
166
  std.text.font_size=native_text_font_size
@@ -196,7 +197,7 @@ application.data.width, std.app.width = width, width
196
197
  application.data.height, std.app.height = height, height
197
198
  std.app.title(application.meta.title..' - '..application.meta.version)
198
199
  engine.current = application
199
- application.callbacks.init(std, application.data)
200
+ application.callbacks.init(application.data, std)
200
201
  end
201
202
  local P = {
202
203
  meta={
@@ -208,13 +209,13 @@ version=version
208
209
  }
209
210
  return P
210
211
  end
211
- source_version_2399 = function()
212
- return '0.1.4'
212
+ source_version_23a4 = function()
213
+ return '0.2.1'
213
214
  end
214
215
  --
215
- source_shared_engine_loadcore_23a4 = function()
216
- local zeebo_pipeline = source_shared_functional_pipeline_2940()
217
- local requires = source_shared_string_dsl_requires_294b()
216
+ source_shared_engine_loadcore_23af = function()
217
+ local zeebo_pipeline = source_shared_functional_pipeline_2952()
218
+ local requires = source_shared_string_dsl_requires_295d()
218
219
  local function step_install_libsys(self, lib_name, library, custom, is_system)
219
220
  if not is_system then return end
220
221
  local ok, msg = pcall(function()
@@ -296,9 +297,9 @@ setup = setup
296
297
  return P
297
298
  end
298
299
  --
299
- source_shared_engine_loadgame_23af = function()
300
- local eval_file = source_shared_string_eval_file_2bb2()
301
- local eval_code = source_shared_string_eval_code_2bbd()
300
+ source_shared_engine_loadgame_23ba = function()
301
+ local eval_file = source_shared_string_eval_file_2bc4()
302
+ local eval_code = source_shared_string_eval_code_2bcf()
302
303
  local has_io_open = io and io.open
303
304
  local function normalize(app, base)
304
305
  if not app then return nil end
@@ -340,7 +341,7 @@ return normalize(src, base)
340
341
  end
341
342
  local application = type(src) == 'function' and src
342
343
  if not application then
343
- if type(application) ~= 'string' or #src == 0 then
344
+ if type(src) ~= 'string' or #src == 0 then
344
345
  src = 'game'
345
346
  end
346
347
  if src:find('\n') then
@@ -371,7 +372,7 @@ script = script
371
372
  return P
372
373
  end
373
374
  --
374
- source_engine_api_data_encoder_23c1 = function()
375
+ source_engine_api_data_encoder_23cc = function()
375
376
  local function install(std, engine, library, name)
376
377
  std = std or {}
377
378
  std[name] = {
@@ -386,15 +387,15 @@ install=install
386
387
  return P
387
388
  end
388
389
  --
389
- source_engine_api_system_app_23cc = function()
390
- local util_decorator = source_shared_functional_decorator_2e5e()
390
+ source_engine_api_system_app_23d7 = function()
391
+ local util_decorator = source_shared_functional_decorator_2e70()
391
392
  local function reset(std, engine)
392
393
  if std.node then
393
394
  std.bus.emit('exit')
394
395
  std.bus.emit('init')
395
396
  else
396
- engine.root.callbacks.exit(std, engine.root.data)
397
- engine.root.callbacks.init(std, engine.root.data)
397
+ engine.root.callbacks.exit(engine.root.data, std)
398
+ engine.root.callbacks.init(engine.root.data, std)
398
399
  end
399
400
  end
400
401
  local function exit(std)
@@ -427,7 +428,7 @@ install=install
427
428
  return P
428
429
  end
429
430
  --
430
- source_engine_api_data_hash_23d7 = function()
431
+ source_engine_api_data_hash_23e2 = function()
431
432
  local function djb2(digest)
432
433
  local index = 1
433
434
  local hash = 5381
@@ -451,8 +452,8 @@ install = install
451
452
  return P
452
453
  end
453
454
  --
454
- source_engine_api_io_http_23e2 = function()
455
- local zeebo_pipeline = source_shared_functional_pipeline_2940()
455
+ source_engine_api_io_http_23ed = function()
456
+ local zeebo_pipeline = source_shared_functional_pipeline_2952()
456
457
  local function json(self)
457
458
  self.options['json'] = true
458
459
  return self
@@ -610,7 +611,7 @@ install=install
610
611
  return P
611
612
  end
612
613
  --
613
- source_engine_api_data_i18n_23ed = function()
614
+ source_engine_api_data_i18n_23f8 = function()
614
615
  local language = 'en-US'
615
616
  local language_default = 'en-US'
616
617
  local language_list = {}
@@ -702,7 +703,7 @@ install=install
702
703
  return P
703
704
  end
704
705
  --
705
- source_engine_api_system_key_23f8 = function()
706
+ source_engine_api_system_key_2403 = function()
706
707
  local function real_key(std, engine, rkey, rvalue)
707
708
  local value = rvalue == 1 or rvalue == true
708
709
  local key = engine.key_bindings[rkey] or (std.key.axis[rkey] and rkey)
@@ -739,8 +740,8 @@ install = install
739
740
  return P
740
741
  end
741
742
  --
742
- source_engine_api_debug_log_2403 = function()
743
- local util_decorator = source_shared_functional_decorator_2e5e()
743
+ source_engine_api_debug_log_240e = function()
744
+ local util_decorator = source_shared_functional_decorator_2e70()
744
745
  local logging_types = {
745
746
  'none', 'fatal', 'error', 'warn', 'debug', 'info'
746
747
  }
@@ -786,7 +787,7 @@ install = install
786
787
  return P
787
788
  end
788
789
  --
789
- source_engine_api_math_basic_240e = function()
790
+ source_engine_api_math_basic_2419 = function()
790
791
  local function abs(value)
791
792
  if value < 0 then
792
793
  return -value
@@ -885,7 +886,7 @@ install = install
885
886
  return P
886
887
  end
887
888
  --
888
- source_engine_api_math_clib_2419 = function()
889
+ source_engine_api_math_clib_2424 = function()
889
890
  local function install(std)
890
891
  assert(math and (1/2 ~= 0))
891
892
  std.math = std.math or {}
@@ -921,7 +922,7 @@ install = install
921
922
  return P
922
923
  end
923
924
  --
924
- source_engine_api_math_random_2424 = function()
925
+ source_engine_api_math_random_242f = function()
925
926
  local function install(std)
926
927
  assert(math and (1/2 ~= 0))
927
928
  std.math = std.math or {}
@@ -938,8 +939,8 @@ install = install
938
939
  return P
939
940
  end
940
941
  --
941
- source_engine_api_data_array_242f = function()
942
- local util_decorator = source_shared_functional_decorator_2e5e()
942
+ source_engine_api_data_array_243a = function()
943
+ local util_decorator = source_shared_functional_decorator_2e70()
943
944
  local function array_map(array, func)
944
945
  local res = {}
945
946
  local index = 1
@@ -1100,7 +1101,7 @@ install = install
1100
1101
  return P
1101
1102
  end
1102
1103
  --
1103
- source_engine_api_io_media_243a = function()
1104
+ source_engine_api_io_media_2445 = function()
1104
1105
  local function media_create(node, channels, handler)
1105
1106
  local decorator = function(func)
1106
1107
  func = func or function() end
@@ -1147,7 +1148,7 @@ install=install
1147
1148
  return P
1148
1149
  end
1149
1150
  --
1150
- source_engine_api_draw_fps_2445 = function()
1151
+ source_engine_api_draw_fps_2450 = function()
1151
1152
  local function draw_fps(std, engine, show, pos_x, pos_y)
1152
1153
  if show < 1 then return end
1153
1154
  local x = engine.current.config.offset_x + pos_x
@@ -1196,8 +1197,8 @@ install=install
1196
1197
  return P
1197
1198
  end
1198
1199
  --
1199
- source_engine_api_draw_text_2450 = function()
1200
- local util_decorator = source_shared_functional_decorator_2e5e()
1200
+ source_engine_api_draw_text_245b = function()
1201
+ local util_decorator = source_shared_functional_decorator_2e70()
1201
1202
  local function text_put(std, engine, font_previous, pos_x, pos_y, text, size)
1202
1203
  size = size or 2
1203
1204
  local hem = engine.current.data.width / 80
@@ -1226,7 +1227,7 @@ install=install
1226
1227
  return P
1227
1228
  end
1228
1229
  --
1229
- source_engine_api_draw_poly_245b = function()
1230
+ source_engine_api_draw_poly_2466 = function()
1230
1231
  local function decorator_poo(object, func)
1231
1232
  if not object or not func then return func end
1232
1233
  return function(a, b, c, d)
@@ -1333,7 +1334,7 @@ install=install
1333
1334
  return P
1334
1335
  end
1335
1336
  --
1336
- source_engine_api_raw_memory_2466 = function()
1337
+ source_engine_api_raw_memory_2471 = function()
1337
1338
  local memory_dict_unload = {}
1338
1339
  local memory_dict = {}
1339
1340
  local memory_list = {}
@@ -1388,9 +1389,9 @@ install=install
1388
1389
  return P
1389
1390
  end
1390
1391
  --
1391
- source_engine_protocol_http_callback_2478 = function()
1392
- local str_http = source_shared_string_encode_http_5c51()
1393
- local str_url = source_shared_string_encode_url_5c5c()
1392
+ source_engine_protocol_http_callback_2483 = function()
1393
+ local str_http = source_shared_string_encode_http_5c63()
1394
+ local str_url = source_shared_string_encode_url_5c6e()
1394
1395
  local callbacks = {
1395
1396
  ['async-promise'] = function(self)
1396
1397
  return self:promise()
@@ -1457,7 +1458,7 @@ func = native_http_callback
1457
1458
  return P
1458
1459
  end
1459
1460
  --
1460
- source_shared_var_object_root_248a = function()
1461
+ source_shared_var_object_root_2495 = function()
1461
1462
  local P = {
1462
1463
  data={
1463
1464
  width=1280,
@@ -1487,7 +1488,7 @@ callbacks={
1487
1488
  return P;
1488
1489
  end
1489
1490
  --
1490
- source_engine_api_system_color_2495 = function()
1491
+ source_engine_api_system_color_24a0 = function()
1491
1492
  local function install(std)
1492
1493
  std.color = std.color or {}
1493
1494
  std.color.white = 0xFFFFFFFF
@@ -1522,7 +1523,7 @@ install = install
1522
1523
  return P
1523
1524
  end
1524
1525
  --
1525
- source_shared_var_object_std_24a0 = function()
1526
+ source_shared_var_object_std_24ab = function()
1526
1527
  local P = {
1527
1528
  milis = 0,
1528
1529
  delta = 0,
@@ -1590,7 +1591,7 @@ any=false
1590
1591
  return P;
1591
1592
  end
1592
1593
  --
1593
- source_shared_functional_pipeline_2940 = function()
1594
+ source_shared_functional_pipeline_2952 = function()
1594
1595
  local function pipe(self)
1595
1596
  return function()
1596
1597
  self:run()
@@ -1640,7 +1641,7 @@ run=run
1640
1641
  return P
1641
1642
  end
1642
1643
  --
1643
- source_shared_string_dsl_requires_294b = function()
1644
+ source_shared_string_dsl_requires_295d = function()
1644
1645
  local function encode(dsl_string)
1645
1646
  local spec = {
1646
1647
  list = {},
@@ -1689,7 +1690,7 @@ should_import = should_import
1689
1690
  return P
1690
1691
  end
1691
1692
  --
1692
- source_shared_string_eval_file_2bb2 = function()
1693
+ source_shared_string_eval_file_2bc4 = function()
1693
1694
  local function script(src)
1694
1695
  local ok, app = false, nil
1695
1696
  if require then
@@ -1715,7 +1716,7 @@ script = script,
1715
1716
  return P
1716
1717
  end
1717
1718
  --
1718
- source_shared_string_eval_code_2bbd = function()
1719
+ source_shared_string_eval_code_2bcf = function()
1719
1720
  local function script(src)
1720
1721
  local loader = loadstring or load
1721
1722
  if not loader then
@@ -1736,7 +1737,7 @@ script = script,
1736
1737
  return P
1737
1738
  end
1738
1739
  --
1739
- source_shared_functional_decorator_2e5e = function()
1740
+ source_shared_functional_decorator_2e70 = function()
1740
1741
  local function decorator_prefix3(zig, zag, zom, func)
1741
1742
  return function (a, b, c, d, e, f)
1742
1743
  return func(zig, zag, zom, a, b, c, d, e, f)
@@ -1794,7 +1795,7 @@ prefix1_t = table_prefix1
1794
1795
  return P
1795
1796
  end
1796
1797
  --
1797
- source_shared_string_encode_http_5c51 = function()
1798
+ source_shared_string_encode_http_5c63 = function()
1798
1799
  local function is_ok(status)
1799
1800
  return (status and 200 <= status and status < 300) or false
1800
1801
  end
@@ -1941,7 +1942,7 @@ create_request=create_request
1941
1942
  }
1942
1943
  end
1943
1944
  --
1944
- source_shared_string_encode_url_5c5c = function()
1945
+ source_shared_string_encode_url_5c6e = function()
1945
1946
  local function search_param(param_list, param_dict)
1946
1947
  local index, params = 1, ''
1947
1948
  while param_list and param_dict and index <= #param_list do
@@ -1963,4 +1964,4 @@ search_param = search_param
1963
1964
  return P
1964
1965
  end
1965
1966
  --
1966
- return main_2390()
1967
+ return main_239b()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamely/gly-engine-lite",
3
- "version": "0.1.4",
3
+ "version": "0.2.1",
4
4
  "author": "RodrigoDornelles",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://docs.gamely.com.br",
@@ -18,7 +18,7 @@
18
18
  ],
19
19
  "scripts": {
20
20
  "step1": "cd ../.. && rm -Rf dist && mkdir -p ./dist/types",
21
- "step2": "cd ../.. && node cli.js build --core lite --bundler --outdir dist/dist",
21
+ "step2": "cd ../.. && node cli.js build-engine @lite --bundler --outdir dist/dist",
22
22
  "step3": "cd ../.. && node cli.js meta source/cli/main.lua --infile npm/gly-engine-lite/package.json --outfile dist/package.json",
23
23
  "step4": "cd ../.. && echo \"declare module '@gamely/gly-engine-lite' {\n const content: string;\n export default content;\n}\" > dist/types/main.d.ts",
24
24
  "build": "npm run step1 && npm run step2 && npm run step3 && npm run step4"