@gamely/gly-engine-lite 0.1.5 → 0.2.2

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 -102
  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_23ba = nil
3
- local source_shared_engine_loadcore_23c5 = nil
4
- local source_shared_engine_loadgame_23d0 = nil
5
- local source_engine_api_data_encoder_23e2 = nil
6
- local source_engine_api_system_app_23ed = nil
7
- local source_engine_api_data_hash_23f8 = nil
8
- local source_engine_api_io_http_2403 = nil
9
- local source_engine_api_data_i18n_240e = nil
10
- local source_engine_api_system_key_2419 = nil
11
- local source_engine_api_debug_log_2424 = nil
12
- local source_engine_api_math_basic_242f = nil
13
- local source_engine_api_math_clib_243a = nil
14
- local source_engine_api_math_random_2445 = nil
15
- local source_engine_api_data_array_2450 = nil
16
- local source_engine_api_io_media_245b = nil
17
- local source_engine_api_draw_fps_2466 = nil
18
- local source_engine_api_draw_text_2471 = nil
19
- local source_engine_api_draw_poly_247c = nil
20
- local source_engine_api_raw_memory_2487 = nil
21
- local source_engine_protocol_http_callback_2499 = nil
22
- local source_shared_var_object_root_24ab = nil
23
- local source_engine_api_system_color_24b6 = nil
24
- local source_shared_var_object_std_24c1 = nil
25
- local source_shared_functional_pipeline_2961 = nil
26
- local source_shared_string_dsl_requires_296c = nil
27
- local source_shared_string_eval_file_2bd3 = nil
28
- local source_shared_string_eval_code_2bde = nil
29
- local source_shared_functional_decorator_2e7f = nil
30
- local source_shared_string_encode_http_5c72 = nil
31
- local source_shared_string_encode_url_5c7d = nil
32
- local function main_23b1()
33
- local version = source_version_23ba()
34
- local loadcore = source_shared_engine_loadcore_23c5()
35
- local loadgame = source_shared_engine_loadgame_23d0()
36
- local engine_encoder = source_engine_api_data_encoder_23e2()
37
- local engine_game = source_engine_api_system_app_23ed()
38
- local engine_hash = source_engine_api_data_hash_23f8()
39
- local engine_http = source_engine_api_io_http_2403()
40
- local engine_i18n = source_engine_api_data_i18n_240e()
41
- local engine_key = source_engine_api_system_key_2419()
42
- local engine_log = source_engine_api_debug_log_2424()
43
- local engine_math = source_engine_api_math_basic_242f()
44
- local engine_math_clib = source_engine_api_math_clib_243a()
45
- local engine_math_random = source_engine_api_math_random_2445()
46
- local engine_array = source_engine_api_data_array_2450()
47
- local engine_media = source_engine_api_io_media_245b()
48
- local engine_api_draw_fps = source_engine_api_draw_fps_2466()
49
- local engine_api_draw_text = source_engine_api_draw_text_2471()
50
- local engine_api_draw_poly = source_engine_api_draw_poly_247c()
51
- local engine_raw_memory = source_engine_api_raw_memory_2487()
52
- local callback_http = source_engine_protocol_http_callback_2499()
53
- local application_default = source_shared_var_object_root_24ab()
54
- local color = source_engine_api_system_color_24b6()
55
- local std = source_shared_var_object_std_24c1()
2
+ local source_version_23a6 = nil
3
+ local source_shared_engine_loadcore_23b1 = nil
4
+ local source_shared_engine_loadgame_23bc = nil
5
+ local source_engine_api_data_encoder_23ce = nil
6
+ local source_engine_api_system_app_23d9 = nil
7
+ local source_engine_api_data_hash_23e4 = nil
8
+ local source_engine_api_io_http_23ef = nil
9
+ local source_engine_api_data_i18n_23fa = nil
10
+ local source_engine_api_system_key_2405 = nil
11
+ local source_engine_api_debug_log_2410 = nil
12
+ local source_engine_api_math_basic_241b = nil
13
+ local source_engine_api_math_clib_2426 = nil
14
+ local source_engine_api_math_random_2431 = nil
15
+ local source_engine_api_data_array_243c = nil
16
+ local source_engine_api_io_media_2447 = nil
17
+ local source_engine_api_draw_fps_2452 = nil
18
+ local source_engine_api_draw_text_245d = nil
19
+ local source_engine_api_draw_poly_2468 = nil
20
+ local source_engine_api_raw_memory_2473 = nil
21
+ local source_engine_protocol_http_callback_2485 = nil
22
+ local source_shared_var_object_root_2497 = nil
23
+ local source_engine_api_system_color_24a2 = nil
24
+ local source_shared_var_object_std_24ad = nil
25
+ local source_shared_functional_pipeline_295b = nil
26
+ local source_shared_string_dsl_requires_2966 = nil
27
+ local source_shared_string_eval_file_2bcd = nil
28
+ local source_shared_string_eval_code_2bd8 = nil
29
+ local source_shared_functional_decorator_2e79 = nil
30
+ local source_shared_string_encode_http_5c6c = nil
31
+ local source_shared_string_encode_url_5c77 = nil
32
+ local function main_239d()
33
+ local version = source_version_23a6()
34
+ local loadcore = source_shared_engine_loadcore_23b1()
35
+ local loadgame = source_shared_engine_loadgame_23bc()
36
+ local engine_encoder = source_engine_api_data_encoder_23ce()
37
+ local engine_game = source_engine_api_system_app_23d9()
38
+ local engine_hash = source_engine_api_data_hash_23e4()
39
+ local engine_http = source_engine_api_io_http_23ef()
40
+ local engine_i18n = source_engine_api_data_i18n_23fa()
41
+ local engine_key = source_engine_api_system_key_2405()
42
+ local engine_log = source_engine_api_debug_log_2410()
43
+ local engine_math = source_engine_api_math_basic_241b()
44
+ local engine_math_clib = source_engine_api_math_clib_2426()
45
+ local engine_math_random = source_engine_api_math_random_2431()
46
+ local engine_array = source_engine_api_data_array_243c()
47
+ local engine_media = source_engine_api_io_media_2447()
48
+ local engine_api_draw_fps = source_engine_api_draw_fps_2452()
49
+ local engine_api_draw_text = source_engine_api_draw_text_245d()
50
+ local engine_api_draw_poly = source_engine_api_draw_poly_2468()
51
+ local engine_raw_memory = source_engine_api_raw_memory_2473()
52
+ local callback_http = source_engine_protocol_http_callback_2485()
53
+ local application_default = source_shared_var_object_root_2497()
54
+ local color = source_engine_api_system_color_24a2()
55
+ local std = source_shared_var_object_std_24ad()
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)
@@ -156,10 +156,12 @@ listen_std_engine=function() end
156
156
  }
157
157
  std.draw.color=native_draw_color
158
158
  std.draw.font=native_draw_font
159
+ std.draw.rect2=native_draw_rect2 or native_draw_rect
159
160
  std.draw.rect=native_draw_rect
160
161
  std.draw.line=native_draw_line
161
162
  std.image.load=native_image_load
162
163
  std.image.draw=native_image_draw
164
+ std.image.mensure=native_image_mensure
163
165
  std.text.print=native_text_print
164
166
  std.text.mensure=native_text_mensure
165
167
  std.text.font_size=native_text_font_size
@@ -196,7 +198,7 @@ application.data.width, std.app.width = width, width
196
198
  application.data.height, std.app.height = height, height
197
199
  std.app.title(application.meta.title..' - '..application.meta.version)
198
200
  engine.current = application
199
- application.callbacks.init(std, application.data)
201
+ application.callbacks.init(application.data, std)
200
202
  end
201
203
  local P = {
202
204
  meta={
@@ -208,13 +210,13 @@ version=version
208
210
  }
209
211
  return P
210
212
  end
211
- source_version_23ba = function()
212
- return '0.1.5'
213
+ source_version_23a6 = function()
214
+ return '0.2.2'
213
215
  end
214
216
  --
215
- source_shared_engine_loadcore_23c5 = function()
216
- local zeebo_pipeline = source_shared_functional_pipeline_2961()
217
- local requires = source_shared_string_dsl_requires_296c()
217
+ source_shared_engine_loadcore_23b1 = function()
218
+ local zeebo_pipeline = source_shared_functional_pipeline_295b()
219
+ local requires = source_shared_string_dsl_requires_2966()
218
220
  local function step_install_libsys(self, lib_name, library, custom, is_system)
219
221
  if not is_system then return end
220
222
  local ok, msg = pcall(function()
@@ -296,9 +298,9 @@ setup = setup
296
298
  return P
297
299
  end
298
300
  --
299
- source_shared_engine_loadgame_23d0 = function()
300
- local eval_file = source_shared_string_eval_file_2bd3()
301
- local eval_code = source_shared_string_eval_code_2bde()
301
+ source_shared_engine_loadgame_23bc = function()
302
+ local eval_file = source_shared_string_eval_file_2bcd()
303
+ local eval_code = source_shared_string_eval_code_2bd8()
302
304
  local has_io_open = io and io.open
303
305
  local function normalize(app, base)
304
306
  if not app then return nil end
@@ -371,7 +373,7 @@ script = script
371
373
  return P
372
374
  end
373
375
  --
374
- source_engine_api_data_encoder_23e2 = function()
376
+ source_engine_api_data_encoder_23ce = function()
375
377
  local function install(std, engine, library, name)
376
378
  std = std or {}
377
379
  std[name] = {
@@ -386,15 +388,15 @@ install=install
386
388
  return P
387
389
  end
388
390
  --
389
- source_engine_api_system_app_23ed = function()
390
- local util_decorator = source_shared_functional_decorator_2e7f()
391
+ source_engine_api_system_app_23d9 = function()
392
+ local util_decorator = source_shared_functional_decorator_2e79()
391
393
  local function reset(std, engine)
392
394
  if std.node then
393
395
  std.bus.emit('exit')
394
396
  std.bus.emit('init')
395
397
  else
396
- engine.root.callbacks.exit(std, engine.root.data)
397
- engine.root.callbacks.init(std, engine.root.data)
398
+ engine.root.callbacks.exit(engine.root.data, std)
399
+ engine.root.callbacks.init(engine.root.data, std)
398
400
  end
399
401
  end
400
402
  local function exit(std)
@@ -427,7 +429,7 @@ install=install
427
429
  return P
428
430
  end
429
431
  --
430
- source_engine_api_data_hash_23f8 = function()
432
+ source_engine_api_data_hash_23e4 = function()
431
433
  local function djb2(digest)
432
434
  local index = 1
433
435
  local hash = 5381
@@ -451,8 +453,8 @@ install = install
451
453
  return P
452
454
  end
453
455
  --
454
- source_engine_api_io_http_2403 = function()
455
- local zeebo_pipeline = source_shared_functional_pipeline_2961()
456
+ source_engine_api_io_http_23ef = function()
457
+ local zeebo_pipeline = source_shared_functional_pipeline_295b()
456
458
  local function json(self)
457
459
  self.options['json'] = true
458
460
  return self
@@ -610,7 +612,7 @@ install=install
610
612
  return P
611
613
  end
612
614
  --
613
- source_engine_api_data_i18n_240e = function()
615
+ source_engine_api_data_i18n_23fa = function()
614
616
  local language = 'en-US'
615
617
  local language_default = 'en-US'
616
618
  local language_list = {}
@@ -702,7 +704,7 @@ install=install
702
704
  return P
703
705
  end
704
706
  --
705
- source_engine_api_system_key_2419 = function()
707
+ source_engine_api_system_key_2405 = function()
706
708
  local function real_key(std, engine, rkey, rvalue)
707
709
  local value = rvalue == 1 or rvalue == true
708
710
  local key = engine.key_bindings[rkey] or (std.key.axis[rkey] and rkey)
@@ -739,8 +741,8 @@ install = install
739
741
  return P
740
742
  end
741
743
  --
742
- source_engine_api_debug_log_2424 = function()
743
- local util_decorator = source_shared_functional_decorator_2e7f()
744
+ source_engine_api_debug_log_2410 = function()
745
+ local util_decorator = source_shared_functional_decorator_2e79()
744
746
  local logging_types = {
745
747
  'none', 'fatal', 'error', 'warn', 'debug', 'info'
746
748
  }
@@ -786,7 +788,7 @@ install = install
786
788
  return P
787
789
  end
788
790
  --
789
- source_engine_api_math_basic_242f = function()
791
+ source_engine_api_math_basic_241b = function()
790
792
  local function abs(value)
791
793
  if value < 0 then
792
794
  return -value
@@ -885,7 +887,7 @@ install = install
885
887
  return P
886
888
  end
887
889
  --
888
- source_engine_api_math_clib_243a = function()
890
+ source_engine_api_math_clib_2426 = function()
889
891
  local function install(std)
890
892
  assert(math and (1/2 ~= 0))
891
893
  std.math = std.math or {}
@@ -921,7 +923,7 @@ install = install
921
923
  return P
922
924
  end
923
925
  --
924
- source_engine_api_math_random_2445 = function()
926
+ source_engine_api_math_random_2431 = function()
925
927
  local function install(std)
926
928
  assert(math and (1/2 ~= 0))
927
929
  std.math = std.math or {}
@@ -938,8 +940,8 @@ install = install
938
940
  return P
939
941
  end
940
942
  --
941
- source_engine_api_data_array_2450 = function()
942
- local util_decorator = source_shared_functional_decorator_2e7f()
943
+ source_engine_api_data_array_243c = function()
944
+ local util_decorator = source_shared_functional_decorator_2e79()
943
945
  local function array_map(array, func)
944
946
  local res = {}
945
947
  local index = 1
@@ -1100,7 +1102,7 @@ install = install
1100
1102
  return P
1101
1103
  end
1102
1104
  --
1103
- source_engine_api_io_media_245b = function()
1105
+ source_engine_api_io_media_2447 = function()
1104
1106
  local function media_create(node, channels, handler)
1105
1107
  local decorator = function(func)
1106
1108
  func = func or function() end
@@ -1147,7 +1149,7 @@ install=install
1147
1149
  return P
1148
1150
  end
1149
1151
  --
1150
- source_engine_api_draw_fps_2466 = function()
1152
+ source_engine_api_draw_fps_2452 = function()
1151
1153
  local function draw_fps(std, engine, show, pos_x, pos_y)
1152
1154
  if show < 1 then return end
1153
1155
  local x = engine.current.config.offset_x + pos_x
@@ -1196,8 +1198,8 @@ install=install
1196
1198
  return P
1197
1199
  end
1198
1200
  --
1199
- source_engine_api_draw_text_2471 = function()
1200
- local util_decorator = source_shared_functional_decorator_2e7f()
1201
+ source_engine_api_draw_text_245d = function()
1202
+ local util_decorator = source_shared_functional_decorator_2e79()
1201
1203
  local function text_put(std, engine, font_previous, pos_x, pos_y, text, size)
1202
1204
  size = size or 2
1203
1205
  local hem = engine.current.data.width / 80
@@ -1226,7 +1228,7 @@ install=install
1226
1228
  return P
1227
1229
  end
1228
1230
  --
1229
- source_engine_api_draw_poly_247c = function()
1231
+ source_engine_api_draw_poly_2468 = function()
1230
1232
  local function decorator_poo(object, func)
1231
1233
  if not object or not func then return func end
1232
1234
  return function(a, b, c, d)
@@ -1333,7 +1335,7 @@ install=install
1333
1335
  return P
1334
1336
  end
1335
1337
  --
1336
- source_engine_api_raw_memory_2487 = function()
1338
+ source_engine_api_raw_memory_2473 = function()
1337
1339
  local memory_dict_unload = {}
1338
1340
  local memory_dict = {}
1339
1341
  local memory_list = {}
@@ -1388,9 +1390,9 @@ install=install
1388
1390
  return P
1389
1391
  end
1390
1392
  --
1391
- source_engine_protocol_http_callback_2499 = function()
1392
- local str_http = source_shared_string_encode_http_5c72()
1393
- local str_url = source_shared_string_encode_url_5c7d()
1393
+ source_engine_protocol_http_callback_2485 = function()
1394
+ local str_http = source_shared_string_encode_http_5c6c()
1395
+ local str_url = source_shared_string_encode_url_5c77()
1394
1396
  local callbacks = {
1395
1397
  ['async-promise'] = function(self)
1396
1398
  return self:promise()
@@ -1457,7 +1459,7 @@ func = native_http_callback
1457
1459
  return P
1458
1460
  end
1459
1461
  --
1460
- source_shared_var_object_root_24ab = function()
1462
+ source_shared_var_object_root_2497 = function()
1461
1463
  local P = {
1462
1464
  data={
1463
1465
  width=1280,
@@ -1487,7 +1489,7 @@ callbacks={
1487
1489
  return P;
1488
1490
  end
1489
1491
  --
1490
- source_engine_api_system_color_24b6 = function()
1492
+ source_engine_api_system_color_24a2 = function()
1491
1493
  local function install(std)
1492
1494
  std.color = std.color or {}
1493
1495
  std.color.white = 0xFFFFFFFF
@@ -1522,7 +1524,7 @@ install = install
1522
1524
  return P
1523
1525
  end
1524
1526
  --
1525
- source_shared_var_object_std_24c1 = function()
1527
+ source_shared_var_object_std_24ad = function()
1526
1528
  local P = {
1527
1529
  milis = 0,
1528
1530
  delta = 0,
@@ -1590,7 +1592,7 @@ any=false
1590
1592
  return P;
1591
1593
  end
1592
1594
  --
1593
- source_shared_functional_pipeline_2961 = function()
1595
+ source_shared_functional_pipeline_295b = function()
1594
1596
  local function pipe(self)
1595
1597
  return function()
1596
1598
  self:run()
@@ -1640,7 +1642,7 @@ run=run
1640
1642
  return P
1641
1643
  end
1642
1644
  --
1643
- source_shared_string_dsl_requires_296c = function()
1645
+ source_shared_string_dsl_requires_2966 = function()
1644
1646
  local function encode(dsl_string)
1645
1647
  local spec = {
1646
1648
  list = {},
@@ -1689,7 +1691,7 @@ should_import = should_import
1689
1691
  return P
1690
1692
  end
1691
1693
  --
1692
- source_shared_string_eval_file_2bd3 = function()
1694
+ source_shared_string_eval_file_2bcd = function()
1693
1695
  local function script(src)
1694
1696
  local ok, app = false, nil
1695
1697
  if require then
@@ -1715,7 +1717,7 @@ script = script,
1715
1717
  return P
1716
1718
  end
1717
1719
  --
1718
- source_shared_string_eval_code_2bde = function()
1720
+ source_shared_string_eval_code_2bd8 = function()
1719
1721
  local function script(src)
1720
1722
  local loader = loadstring or load
1721
1723
  if not loader then
@@ -1736,7 +1738,7 @@ script = script,
1736
1738
  return P
1737
1739
  end
1738
1740
  --
1739
- source_shared_functional_decorator_2e7f = function()
1741
+ source_shared_functional_decorator_2e79 = function()
1740
1742
  local function decorator_prefix3(zig, zag, zom, func)
1741
1743
  return function (a, b, c, d, e, f)
1742
1744
  return func(zig, zag, zom, a, b, c, d, e, f)
@@ -1794,7 +1796,7 @@ prefix1_t = table_prefix1
1794
1796
  return P
1795
1797
  end
1796
1798
  --
1797
- source_shared_string_encode_http_5c72 = function()
1799
+ source_shared_string_encode_http_5c6c = function()
1798
1800
  local function is_ok(status)
1799
1801
  return (status and 200 <= status and status < 300) or false
1800
1802
  end
@@ -1941,7 +1943,7 @@ create_request=create_request
1941
1943
  }
1942
1944
  end
1943
1945
  --
1944
- source_shared_string_encode_url_5c7d = function()
1946
+ source_shared_string_encode_url_5c77 = function()
1945
1947
  local function search_param(param_list, param_dict)
1946
1948
  local index, params = 1, ''
1947
1949
  while param_list and param_dict and index <= #param_list do
@@ -1963,4 +1965,4 @@ search_param = search_param
1963
1965
  return P
1964
1966
  end
1965
1967
  --
1966
- return main_23b1()
1968
+ return main_239d()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamely/gly-engine-lite",
3
- "version": "0.1.5",
3
+ "version": "0.2.2",
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"