@gamely/gly-engine-micro 0.3.2 → 0.3.4
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.
- package/dist/main.lua +41 -34
- package/package.json +1 -1
package/dist/main.lua
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
local
|
|
2
|
-
local
|
|
1
|
+
local b14cb = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
|
|
2
|
+
local r14cb = function(i, f)
|
|
3
3
|
return function()
|
|
4
4
|
local c = f()
|
|
5
|
-
|
|
5
|
+
b14cb[i] = function() return c end
|
|
6
6
|
return c
|
|
7
7
|
end
|
|
8
8
|
end
|
|
9
9
|
local math = ((function() local x, y = pcall(require, 'math'); return x and y end)()) or _G.math
|
|
10
|
-
local function
|
|
11
|
-
local version =
|
|
12
|
-
local engine_game =
|
|
13
|
-
local engine_key =
|
|
14
|
-
local engine_math =
|
|
15
|
-
local engine_math_clib =
|
|
16
|
-
local engine_math_random =
|
|
17
|
-
local engine_array =
|
|
18
|
-
local engine_api_draw_text =
|
|
19
|
-
local engine_api_draw_poly =
|
|
20
|
-
local engine_raw_memory =
|
|
21
|
-
local color =
|
|
22
|
-
local std =
|
|
23
|
-
local eval_code =
|
|
10
|
+
local function m14cb()
|
|
11
|
+
local version = b14cb[1]('source_version')
|
|
12
|
+
local engine_game = b14cb[2]('source_engine_api_system_app')
|
|
13
|
+
local engine_key = b14cb[3]('source_engine_api_system_key')
|
|
14
|
+
local engine_math = b14cb[4]('source_engine_api_math_basic')
|
|
15
|
+
local engine_math_clib = b14cb[5]('source_engine_api_math_clib')
|
|
16
|
+
local engine_math_random = b14cb[6]('source_engine_api_math_random')
|
|
17
|
+
local engine_array = b14cb[7]('source_engine_api_data_array')
|
|
18
|
+
local engine_api_draw_text = b14cb[8]('source_engine_api_draw_text')
|
|
19
|
+
local engine_api_draw_poly = b14cb[9]('source_engine_api_draw_poly')
|
|
20
|
+
local engine_raw_memory = b14cb[10]('source_engine_api_raw_memory')
|
|
21
|
+
local color = b14cb[11]('source_engine_api_system_color')
|
|
22
|
+
local std = b14cb[12]('source_shared_var_object_std')
|
|
23
|
+
local eval_code = b14cb[13]('source_shared_string_eval_code')
|
|
24
24
|
local f=function(a,b)end
|
|
25
25
|
local engine={keyboard=f}
|
|
26
26
|
local application={
|
|
@@ -135,10 +135,10 @@ version=version
|
|
|
135
135
|
}
|
|
136
136
|
return P
|
|
137
137
|
end
|
|
138
|
-
|
|
139
|
-
return '0.3.
|
|
138
|
+
b14cb[1] = r14cb(1, function()
|
|
139
|
+
return '0.3.4'
|
|
140
140
|
end)
|
|
141
|
-
|
|
141
|
+
b14cb[2] = r14cb(2, function()
|
|
142
142
|
local function reset(std, engine)
|
|
143
143
|
if std.node then
|
|
144
144
|
return function()
|
|
@@ -164,6 +164,11 @@ func(window_name)
|
|
|
164
164
|
end
|
|
165
165
|
end
|
|
166
166
|
end
|
|
167
|
+
local function get_info(my, info)
|
|
168
|
+
return function()
|
|
169
|
+
return my.root.meta[info]
|
|
170
|
+
end
|
|
171
|
+
end
|
|
167
172
|
local function install(std, engine, config)
|
|
168
173
|
std = std or {}
|
|
169
174
|
config = config or {}
|
|
@@ -176,6 +181,8 @@ end)
|
|
|
176
181
|
std.app.title = title(config.set_title)
|
|
177
182
|
std.app.exit = exit(std)
|
|
178
183
|
std.app.reset = reset(std, engine)
|
|
184
|
+
std.app.get_name = get_info(engine, 'title')
|
|
185
|
+
std.app.get_version = get_info(engine, 'version')
|
|
179
186
|
std.app.get_fps = config.get_fps
|
|
180
187
|
return std.app
|
|
181
188
|
end
|
|
@@ -184,7 +191,7 @@ install=install
|
|
|
184
191
|
}
|
|
185
192
|
return P
|
|
186
193
|
end)
|
|
187
|
-
|
|
194
|
+
b14cb[3] = r14cb(3, function()
|
|
188
195
|
local function real_key(std, engine, rkey, rvalue)
|
|
189
196
|
local value = (rvalue == 1 or rvalue == true) or false
|
|
190
197
|
local key = engine.key_bindings[rkey] or (std.key.axis[rkey] and rkey)
|
|
@@ -233,7 +240,7 @@ return {
|
|
|
233
240
|
install = install
|
|
234
241
|
}
|
|
235
242
|
end)
|
|
236
|
-
|
|
243
|
+
b14cb[4] = r14cb(4, function()
|
|
237
244
|
local function abs(value)
|
|
238
245
|
if value < 0 then
|
|
239
246
|
return -value
|
|
@@ -331,7 +338,7 @@ install = install
|
|
|
331
338
|
}
|
|
332
339
|
return P
|
|
333
340
|
end)
|
|
334
|
-
|
|
341
|
+
b14cb[5] = r14cb(5, function()
|
|
335
342
|
local function install(std)
|
|
336
343
|
assert(math and (1/2 ~= 0))
|
|
337
344
|
std.math = std.math or {}
|
|
@@ -366,7 +373,7 @@ install = install
|
|
|
366
373
|
}
|
|
367
374
|
return P
|
|
368
375
|
end)
|
|
369
|
-
|
|
376
|
+
b14cb[6] = r14cb(6, function()
|
|
370
377
|
local function install(std)
|
|
371
378
|
assert(math and (1/2 ~= 0))
|
|
372
379
|
std.math = std.math or {}
|
|
@@ -382,8 +389,8 @@ install = install
|
|
|
382
389
|
}
|
|
383
390
|
return P
|
|
384
391
|
end)
|
|
385
|
-
|
|
386
|
-
local util_decorator =
|
|
392
|
+
b14cb[7] = r14cb(7, function()
|
|
393
|
+
local util_decorator = b14cb[15]('source_shared_functional_decorator')
|
|
387
394
|
local function array_map(array, func)
|
|
388
395
|
local res = {}
|
|
389
396
|
local index = 1
|
|
@@ -543,7 +550,7 @@ install = install
|
|
|
543
550
|
}
|
|
544
551
|
return P
|
|
545
552
|
end)
|
|
546
|
-
|
|
553
|
+
b14cb[8] = r14cb(8, function()
|
|
547
554
|
local function text_put(std, engine, font_previous)
|
|
548
555
|
return function(pos_x, pos_y, text, size)
|
|
549
556
|
size = size or 2
|
|
@@ -575,7 +582,7 @@ install=install
|
|
|
575
582
|
}
|
|
576
583
|
return P
|
|
577
584
|
end)
|
|
578
|
-
|
|
585
|
+
b14cb[9] = r14cb(9, function()
|
|
579
586
|
local function decorator_poo(object, func)
|
|
580
587
|
if not object or not func then return func end
|
|
581
588
|
return function(a, b, c, d)
|
|
@@ -681,7 +688,7 @@ install=install
|
|
|
681
688
|
}
|
|
682
689
|
return P
|
|
683
690
|
end)
|
|
684
|
-
|
|
691
|
+
b14cb[10] = r14cb(10, function()
|
|
685
692
|
local memory_dict_unload = {}
|
|
686
693
|
local memory_dict = {}
|
|
687
694
|
local memory_list = {}
|
|
@@ -735,7 +742,7 @@ install=install
|
|
|
735
742
|
}
|
|
736
743
|
return P
|
|
737
744
|
end)
|
|
738
|
-
|
|
745
|
+
b14cb[11] = r14cb(11, function()
|
|
739
746
|
local function install(std)
|
|
740
747
|
std.color = std.color or {}
|
|
741
748
|
std.color.white = 0xFFFFFFFF
|
|
@@ -769,7 +776,7 @@ install = install
|
|
|
769
776
|
}
|
|
770
777
|
return P
|
|
771
778
|
end)
|
|
772
|
-
|
|
779
|
+
b14cb[12] = r14cb(12, function()
|
|
773
780
|
local P = {
|
|
774
781
|
milis = 0,
|
|
775
782
|
delta = 0,
|
|
@@ -836,7 +843,7 @@ any=false
|
|
|
836
843
|
}
|
|
837
844
|
return P;
|
|
838
845
|
end)
|
|
839
|
-
|
|
846
|
+
b14cb[13] = r14cb(13, function()
|
|
840
847
|
local function script(src)
|
|
841
848
|
local loader = loadstring or load
|
|
842
849
|
if not loader then
|
|
@@ -856,7 +863,7 @@ script = script,
|
|
|
856
863
|
}
|
|
857
864
|
return P
|
|
858
865
|
end)
|
|
859
|
-
|
|
866
|
+
b14cb[15] = r14cb(15, function()
|
|
860
867
|
local function decorator_prefix3(zig, zag, zom, func)
|
|
861
868
|
return function (a, b, c, d, e, f)
|
|
862
869
|
return func(zig, zag, zom, a, b, c, d, e, f)
|
|
@@ -913,4 +920,4 @@ prefix1_t = table_prefix1
|
|
|
913
920
|
}
|
|
914
921
|
return P
|
|
915
922
|
end)
|
|
916
|
-
return
|
|
923
|
+
return m14cb()
|