@gamely/gly-engine-micro 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 +54 -52
  2. package/package.json +2 -2
package/dist/main.lua CHANGED
@@ -1,32 +1,32 @@
1
1
  local math = ((function() local x, y = pcall(require, 'math'); return x and y end)()) or _G.math
2
- local source_version_13ea = nil
3
- local source_engine_api_system_app_13fc = nil
4
- local source_engine_api_system_key_1407 = nil
5
- local source_engine_api_math_basic_1412 = nil
6
- local source_engine_api_math_clib_141d = nil
7
- local source_engine_api_math_random_1428 = nil
8
- local source_engine_api_data_array_1433 = nil
9
- local source_engine_api_draw_text_143e = nil
10
- local source_engine_api_draw_poly_1449 = nil
11
- local source_engine_api_raw_memory_1454 = nil
12
- local source_engine_api_system_color_1466 = nil
13
- local source_shared_var_object_std_1471 = nil
14
- local source_shared_string_eval_code_1483 = nil
15
- local source_shared_functional_decorator_17e1 = nil
16
- local function main_13e1()
17
- local version = source_version_13ea()
18
- local engine_game = source_engine_api_system_app_13fc()
19
- local engine_key = source_engine_api_system_key_1407()
20
- local engine_math = source_engine_api_math_basic_1412()
21
- local engine_math_clib = source_engine_api_math_clib_141d()
22
- local engine_math_random = source_engine_api_math_random_1428()
23
- local engine_array = source_engine_api_data_array_1433()
24
- local engine_api_draw_text = source_engine_api_draw_text_143e()
25
- local engine_api_draw_poly = source_engine_api_draw_poly_1449()
26
- local engine_raw_memory = source_engine_api_raw_memory_1454()
27
- local color = source_engine_api_system_color_1466()
28
- local std = source_shared_var_object_std_1471()
29
- local eval_code = source_shared_string_eval_code_1483()
2
+ local source_version_13d6 = nil
3
+ local source_engine_api_system_app_13e8 = nil
4
+ local source_engine_api_system_key_13f3 = nil
5
+ local source_engine_api_math_basic_13fe = nil
6
+ local source_engine_api_math_clib_1409 = nil
7
+ local source_engine_api_math_random_1414 = nil
8
+ local source_engine_api_data_array_141f = nil
9
+ local source_engine_api_draw_text_142a = nil
10
+ local source_engine_api_draw_poly_1435 = nil
11
+ local source_engine_api_raw_memory_1440 = nil
12
+ local source_engine_api_system_color_1452 = nil
13
+ local source_shared_var_object_std_145d = nil
14
+ local source_shared_string_eval_code_146f = nil
15
+ local source_shared_functional_decorator_17db = nil
16
+ local function main_13cd()
17
+ local version = source_version_13d6()
18
+ local engine_game = source_engine_api_system_app_13e8()
19
+ local engine_key = source_engine_api_system_key_13f3()
20
+ local engine_math = source_engine_api_math_basic_13fe()
21
+ local engine_math_clib = source_engine_api_math_clib_1409()
22
+ local engine_math_random = source_engine_api_math_random_1414()
23
+ local engine_array = source_engine_api_data_array_141f()
24
+ local engine_api_draw_text = source_engine_api_draw_text_142a()
25
+ local engine_api_draw_poly = source_engine_api_draw_poly_1435()
26
+ local engine_raw_memory = source_engine_api_raw_memory_1440()
27
+ local color = source_engine_api_system_color_1452()
28
+ local std = source_shared_var_object_std_145d()
29
+ local eval_code = source_shared_string_eval_code_146f()
30
30
  local f=function(a,b)end
31
31
  local engine={keyboard=f}
32
32
  local application={
@@ -63,11 +63,11 @@ font_previous=native_text_font_previous
63
63
  }
64
64
  function native_callback_loop(dt)
65
65
  std.milis, std.delta=std.milis + dt, dt
66
- application.callbacks.loop(std, application.data)
66
+ application.callbacks.loop(application.data, std)
67
67
  end
68
68
  function native_callback_draw()
69
69
  native_draw_start()
70
- application.callbacks.draw(std, application.data)
70
+ application.callbacks.draw(application.data, std)
71
71
  native_draw_flush()
72
72
  end
73
73
  function native_callback_resize(width, height)
@@ -97,10 +97,12 @@ script.config=application.config
97
97
  application=script
98
98
  std.draw.color=native_draw_color
99
99
  std.draw.font=native_draw_font
100
+ std.draw.rect2=native_draw_rect2 or native_draw_rect
100
101
  std.draw.rect=native_draw_rect
101
102
  std.draw.line=native_draw_line
102
103
  std.image.load=native_image_load
103
104
  std.image.draw=native_image_draw
105
+ std.image.mensure=native_image_mensure
104
106
  std.text.print=native_text_print
105
107
  std.text.mensure=native_text_mensure
106
108
  std.text.font_size=native_text_font_size
@@ -124,7 +126,7 @@ if application.meta and application.meta.title then
124
126
  std.app.title(application.meta.title..' - '..(application.meta.version or ''))
125
127
  end
126
128
  engine.current=application
127
- application.callbacks.init(std, application.data)
129
+ application.callbacks.init(application.data, std)
128
130
  end
129
131
  local P={
130
132
  meta={
@@ -136,19 +138,19 @@ version=version
136
138
  }
137
139
  return P
138
140
  end
139
- source_version_13ea = function()
140
- return '0.1.5'
141
+ source_version_13d6 = function()
142
+ return '0.2.2'
141
143
  end
142
144
  --
143
- source_engine_api_system_app_13fc = function()
144
- local util_decorator = source_shared_functional_decorator_17e1()
145
+ source_engine_api_system_app_13e8 = function()
146
+ local util_decorator = source_shared_functional_decorator_17db()
145
147
  local function reset(std, engine)
146
148
  if std.node then
147
149
  std.bus.emit('exit')
148
150
  std.bus.emit('init')
149
151
  else
150
- engine.root.callbacks.exit(std, engine.root.data)
151
- engine.root.callbacks.init(std, engine.root.data)
152
+ engine.root.callbacks.exit(engine.root.data, std)
153
+ engine.root.callbacks.init(engine.root.data, std)
152
154
  end
153
155
  end
154
156
  local function exit(std)
@@ -181,7 +183,7 @@ install=install
181
183
  return P
182
184
  end
183
185
  --
184
- source_engine_api_system_key_1407 = function()
186
+ source_engine_api_system_key_13f3 = function()
185
187
  local function real_key(std, engine, rkey, rvalue)
186
188
  local value = rvalue == 1 or rvalue == true
187
189
  local key = engine.key_bindings[rkey] or (std.key.axis[rkey] and rkey)
@@ -218,7 +220,7 @@ install = install
218
220
  return P
219
221
  end
220
222
  --
221
- source_engine_api_math_basic_1412 = function()
223
+ source_engine_api_math_basic_13fe = function()
222
224
  local function abs(value)
223
225
  if value < 0 then
224
226
  return -value
@@ -317,7 +319,7 @@ install = install
317
319
  return P
318
320
  end
319
321
  --
320
- source_engine_api_math_clib_141d = function()
322
+ source_engine_api_math_clib_1409 = function()
321
323
  local function install(std)
322
324
  assert(math and (1/2 ~= 0))
323
325
  std.math = std.math or {}
@@ -353,7 +355,7 @@ install = install
353
355
  return P
354
356
  end
355
357
  --
356
- source_engine_api_math_random_1428 = function()
358
+ source_engine_api_math_random_1414 = function()
357
359
  local function install(std)
358
360
  assert(math and (1/2 ~= 0))
359
361
  std.math = std.math or {}
@@ -370,8 +372,8 @@ install = install
370
372
  return P
371
373
  end
372
374
  --
373
- source_engine_api_data_array_1433 = function()
374
- local util_decorator = source_shared_functional_decorator_17e1()
375
+ source_engine_api_data_array_141f = function()
376
+ local util_decorator = source_shared_functional_decorator_17db()
375
377
  local function array_map(array, func)
376
378
  local res = {}
377
379
  local index = 1
@@ -532,8 +534,8 @@ install = install
532
534
  return P
533
535
  end
534
536
  --
535
- source_engine_api_draw_text_143e = function()
536
- local util_decorator = source_shared_functional_decorator_17e1()
537
+ source_engine_api_draw_text_142a = function()
538
+ local util_decorator = source_shared_functional_decorator_17db()
537
539
  local function text_put(std, engine, font_previous, pos_x, pos_y, text, size)
538
540
  size = size or 2
539
541
  local hem = engine.current.data.width / 80
@@ -562,7 +564,7 @@ install=install
562
564
  return P
563
565
  end
564
566
  --
565
- source_engine_api_draw_poly_1449 = function()
567
+ source_engine_api_draw_poly_1435 = function()
566
568
  local function decorator_poo(object, func)
567
569
  if not object or not func then return func end
568
570
  return function(a, b, c, d)
@@ -669,7 +671,7 @@ install=install
669
671
  return P
670
672
  end
671
673
  --
672
- source_engine_api_raw_memory_1454 = function()
674
+ source_engine_api_raw_memory_1440 = function()
673
675
  local memory_dict_unload = {}
674
676
  local memory_dict = {}
675
677
  local memory_list = {}
@@ -724,7 +726,7 @@ install=install
724
726
  return P
725
727
  end
726
728
  --
727
- source_engine_api_system_color_1466 = function()
729
+ source_engine_api_system_color_1452 = function()
728
730
  local function install(std)
729
731
  std.color = std.color or {}
730
732
  std.color.white = 0xFFFFFFFF
@@ -759,7 +761,7 @@ install = install
759
761
  return P
760
762
  end
761
763
  --
762
- source_shared_var_object_std_1471 = function()
764
+ source_shared_var_object_std_145d = function()
763
765
  local P = {
764
766
  milis = 0,
765
767
  delta = 0,
@@ -827,7 +829,7 @@ any=false
827
829
  return P;
828
830
  end
829
831
  --
830
- source_shared_string_eval_code_1483 = function()
832
+ source_shared_string_eval_code_146f = function()
831
833
  local function script(src)
832
834
  local loader = loadstring or load
833
835
  if not loader then
@@ -848,7 +850,7 @@ script = script,
848
850
  return P
849
851
  end
850
852
  --
851
- source_shared_functional_decorator_17e1 = function()
853
+ source_shared_functional_decorator_17db = function()
852
854
  local function decorator_prefix3(zig, zag, zom, func)
853
855
  return function (a, b, c, d, e, f)
854
856
  return func(zig, zag, zom, a, b, c, d, e, f)
@@ -906,4 +908,4 @@ prefix1_t = table_prefix1
906
908
  return P
907
909
  end
908
910
  --
909
- return main_13e1()
911
+ return main_13cd()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamely/gly-engine-micro",
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 micro --bundler --outdir dist/dist",
21
+ "step2": "cd ../.. && node cli.js build-engine @micro --bundler --outdir dist/dist",
22
22
  "step3": "cd ../.. && node cli.js meta source/cli/main.lua --infile npm/gly-engine-micro/package.json --outfile dist/package.json",
23
23
  "step4": "cd ../.. && echo \"declare module '@gamely/gly-engine-micro' {\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"