Skip to content

Commit 9351e7f

Browse files
RodrigoDornellesFinalshare90joaoroveraJoão Vicente
authored
feat: revision 0.0.19 (#146)
* ci: docs workflow when modify samples or src * docs: written a little more * Update .gitattributes * fix: mustache precedence msdos filter * feat: support media on fengari driver html5 * merge (#144) * tests: dropped luaunit (#140) - #138 * feat: samples in very small screens 80x24 * feat: asteroids in screen <= 400 * feat: improve responsive menu asteroids * fix: self.params_dict is undefined #143 * fix: cleanup http native * fix: std accoplament error in http * style: fix luau linter --------- Co-authored-by: Finalshare90 <[email protected]> * feat: add support to fengari http module in html5 * chore: Fix URL parameter concatenation (#145) * tests: dropped luaunit (#140) - #138 * chore: Fix URL parameter concatenation --------- Co-authored-by: Finalshare90 <[email protected]> Co-authored-by: João Vicente <[email protected]> Co-authored-by: RodrigoDornelles <[email protected]> * feat: add support to json in html5 fengari * feat: start log system #14 * Add files via upload * fix: main entry in npm packages * fix: widescreen init html5 * ci: not allow non-ascii in codebase samples and src * feat: media.music mock.music mock.video * feat: add log system api to engine * docs: improve * docs: add example maze3d * docs: maze3d wolf_newmap and reference * change: read inteire file and split on build * feat: add flag --telemedia190 to build command * change: remove core repl from 'run' subcommand * feat: sync Ginga font size with HTML * fix: menu options order in asteroids * fix: remove current relative path in util fs * fix: custom dist on build * fix: dont create empty file cli fs.move * fix: mkdir in asset move * fix: mkdir in asset move * fix: luau-analyze warning media handler * feat: get enverioment [WIP] [0.0.20] * fix: icon32x32.bmp transparency in NDS * docs: write about std.draw * docs: add http in wget on README.md * feat: http force protocol * feat: optional fetch jsonrxi in fengari html5 * fix: transparenci in favicon.ico * fix: add protect to inexistent images * feat: add cache_set and cache_get --------- Co-authored-by: Finalshare90 <[email protected]> Co-authored-by: Joao Vicente <[email protected]> Co-authored-by: João Vicente <[email protected]>
1 parent 0faaccc commit 9351e7f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1254
-318
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
*.sh linguist-generated
44
*.bat linguist-generated
55
*.txt linguist-language=Dox
6+
*.xml linguist-language=Mustache
67
.luaurc linguist-language=Json

.github/workflows/CI.yml

+14
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@ jobs:
5959
lua tools/ci_version_local.lua
6060
lua tools/ci_version_remote.lua
6161
62+
ascii:
63+
if: github.event_name == 'push' || github.event.pull_request.draft == false
64+
runs-on: ubuntu-latest
65+
steps:
66+
-
67+
uses: actions/checkout@master
68+
-
69+
uses: leafo/gh-actions-lua@v10
70+
with:
71+
luaVersion: '5.4'
72+
-
73+
run: |
74+
lua tools/ci_asciicheck.lua
75+
6276
lint:
6377
if: github.event_name == 'push' || github.event.pull_request.draft == false
6478
runs-on: ubuntu-latest

.github/workflows/DOCS.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
branches:
1414
- main
1515
- develop
16+
paths:
17+
- 'samples/**'
18+
- 'src/**'
1619

1720
jobs:
1821
doxygen:
@@ -42,7 +45,7 @@ jobs:
4245
strategy:
4346
fail-fast: false
4447
matrix:
45-
game: ['asteroids', 'dvdplayer', 'launcher', '2games', 'helloworld', 'gridsystem', 'pong', 'capybird']
48+
game: ['asteroids', 'dvdplayer', 'launcher', '2games', 'helloworld', 'gridsystem', 'pong', 'capybird', 'maze3d']
4649
steps:
4750
-
4851
uses: actions/checkout@master

.luaurc

+9
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@
3838
"native_draw_triangle",
3939
"native_http_handler",
4040
"native_http_has_ssl",
41+
"native_http_install",
42+
"native_http_has_callback",
43+
"native_http_force_protocol",
4144
"native_json_decode",
4245
"native_json_encode",
46+
"native_media_bootstrap",
4347
"native_media_load",
4448
"native_media_pause",
4549
"native_media_play",
@@ -52,6 +56,11 @@
5256
"native_system_get_secret",
5357
"native_system_reset",
5458
"native_system_title",
59+
"native_log_fatal",
60+
"native_log_error",
61+
"native_log_warn",
62+
"native_log_info",
63+
"native_log_debug",
5564
"native_text_font_default",
5665
"native_text_font_name",
5766
"native_text_font_previous",

Doxyfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Custom Configs
22
DOXYFILE_ENCODING = UTF-8
33
PROJECT_NAME = "GlyEngine"
4-
PROJECT_NUMBER = 0.0.18
4+
PROJECT_NUMBER = 0.0.19
55
PROJECT_BRIEF = "Create games and apps with lua"
66
PROJECT_LOGO = assets/icon512x423.png
77
GENERATE_RTF = NO

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ lua cli.lua build @asteroids --core html5
2929
| command | lua 5.4 | lua 5.3 | lua 5.1 | luajit | installation |
3030
| :-----: | :-----: | :-----: | :-----: | :----: | :----------- |
3131
| cli.sh | :ok: | :ok: | :ok: | :ok: | `git clone https://github.com/gamelly/gly-engine`
32-
| cli.lua | :ok: | :ok: | :x: | :ok: | `wget get.gamely.com.br/cli.lua`
32+
| cli.lua | :ok: | :ok: | :x: | :ok: | `wget http://get.gamely.com.br/cli.lua`
3333
| gly-cli | :ok: | | | | `npm install -g @gamely/gly-cli`
3434

3535
#### Engine Platform Support
@@ -39,11 +39,12 @@ lua cli.lua build @asteroids --core html5
3939
| Tier 2 | Love2D | main plataform for development and tests
4040
| Tier 3 | Tizen 8 | full support WIP
4141
| Tier 4 | WebOS 6 | coming soon
42-
| Tier 5 | Native Core SDL2 | full support, not available for download yet
42+
| Tier 5 | Native Core Desktop | full support, not available for download yet
4343
| Tier 6 | Native Core Arduino | coming soon
4444
| Tier 7 | Ginga | support
45-
| Tier 8 | Console TUI (ASCII) | support, except images
45+
| Tier 8 | Console TUI (ASCII) | support
4646
| Tier 9 | Play Station 2 | coming soon
4747
| Tier 9 | Nintendo Wii | support is reworking
48-
| Tier 10 | Nintendo DS | coming soon
49-
| Tier 11 | Nintendo GBA | limited support
48+
| Tier 10 | Nintendo DS | support, except images
49+
| Tier 11 | Nintendo GBA | support, except images
50+
| Tier 12 | Play Station 1 | support, very limited

assets/favicon.ico

766 Bytes
Binary file not shown.

assets/icon32x32.bmp

630 Bytes
Binary file not shown.

docs/cli_build_native_homebrew.txt renamed to docs/cli_build_native_homebrew_nintendo.txt

+6-23
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,10 @@
11
@defgroup homebrew
22
@{
33

4-
@page sony_ps1 PlayStation 1
5-
6-
You can make your Lua games for nintendo ds using the Gly engine,
7-
but as limitations of only fixed point and without cmath library,
8-
as it has not been worked on yet.
9-
10-
- online IDE <https://playground.gamely.com.br>
11-
- source code <https://github.com/gamelly/core-native-ps1>
12-
- @ref cmake "more details"
13-
14-
```text
15-
git clone https://github.com/gamelly/core-native-ps1
16-
```
17-
18-
```text
19-
cmake -Bbuild -H. -DGAME=path/to/your/game.lua
20-
```
4+
@defgroup nintendo
5+
@{
216

22-
```text
23-
make -C build
24-
```
7+
@short consoles: gba, nds, wii
258

269
@page nintendo_gba Nintendo GBA
2710

@@ -64,12 +47,12 @@ cmake -Bbuild -H. -DGAME=path/to/your/game.lua
6447
make -C build
6548
```
6649

67-
@todo comming soon NDS roms
68-
6950
@page nintendo_wii Nintendo Wii
7051

7152
You can make your games in Lua for Nintendo Wii using Gly Engine, including support for motion controls.
7253

7354
@todo comming soon WII roms
7455

75-
@}
56+
@}
57+
58+
@}
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@defgroup homebrew
2+
@{
3+
4+
@defgroup Sony
5+
@{
6+
7+
@short consoles: ps1, ps2
8+
9+
@page sony_ps1 PlayStation 1
10+
11+
You can make your Lua games for nintendo ds using the Gly engine,
12+
but as limitations of only fixed point and without cmath library,
13+
as it has not been worked on yet.
14+
15+
- online IDE <https://playground.gamely.com.br>
16+
- source code <https://github.com/gamelly/core-native-ps1>
17+
- @ref cmake "more details"
18+
19+
```text
20+
git clone https://github.com/gamelly/core-native-ps1
21+
```
22+
23+
```text
24+
cmake -Bbuild -H. -DGAME=path/to/your/game.lua
25+
```
26+
27+
```text
28+
make -C build
29+
```
30+
31+
@}
32+
@}

docs/limits.txt

+3-4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ does not support requests with SSL and also HTTP 2.0 or higher.
3131

3232
## Limits in Sony PlayStation 1
3333

34+
@ref sony_ps1 It is a difficult hardware to work, **lua puc rio** cannot be used natively and a modified third-party version is used,
35+
because it is an outdated version 5.2 _(fixedpoint only)_ there are slowness problems caused by the garbage collector and no support for `float`.
36+
3437
@par Images
3538

3639
Currently not supported, but will be worked on in the future.
@@ -123,10 +126,6 @@ whether Windows or a POSIX system. The minimum resolution is 80x24, but you can
123126

124127
TLS 1.3 is not supported.
125128

126-
@par Images
127-
128-
Not supported.
129-
130129
@par Media
131130

132131
Does not support displaying videos.

docs/std_draw.txt

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
@defgroup std
2+
@{
3+
4+
@defgroup draw
5+
@{
6+
7+
@warning There is no support for
8+
@ref sony_ps1 "ps1",
9+
@ref nintendo_gba "gba"
10+
and @ref nintendo_ds "nds" to draw images,
11+
as they use a specific bitmap and it is necessary to implement a
12+
[sprite conversion tool](https://github.com/RodrigoDornelles/ultimate-sprite-sheet-replacer/).
13+
14+
@par Design Decision
15+
16+
There is no @b std.draw.pixel or @b std.draw.circle, nor plans to add them, due to frontend design decisions.
17+
The engine is designed to be multiplatform, ensuring code runs on all devices while respecting their processing and memory limits.
18+
19+
@li @c std.draw.pixel @n there are no optimizations to be done in many cases it would just be a @b std.draw.rect(x, y, 1, 1),
20+
so leave this as a user task.
21+
22+
@li @c std.draw.circle @n The @ref ginga "ginga" does not have the ability to draw circles on most televisions devices, @n
23+
and older video games like @ref nintendo_gba "gba" and @ref nintendo_ds "nds" are very expensive to resize them every frame.
24+
25+
@par Tool IMG Gen
26+
@details It is possible to create logos or any images using the engine's real-time drawing API while writing the rendering code and clicking download.
27+
@li source: https://github.com/gamelly/tool-img-gen
28+
@li website: https://gamelly.github.io/tool-img-gen
29+
30+
@call divcpp
31+
@short std.draw.clear
32+
@fakefunc clear(color)
33+
34+
@call divcpp
35+
@short std.draw.rect
36+
@fakefunc rect(mode, pos_x, pos_y, width, height)
37+
38+
@call divcpp
39+
@short std.draw.line
40+
@fakefunc line(x1, y1, y2, y1, y2)
41+
42+
@call divcpp
43+
@deprecated @c std.draw.image is moving to @c std.image.draw
44+
@short std.draw.image
45+
@fakefunc image(src, pos_x, pos_y)
46+
47+
@call divcpp
48+
@short std.draw.poly
49+
@par Example
50+
```java
51+
local spaceship = {-2,3, 0,-2, 2,3}
52+
std.draw.poly(0, game.player_x, game.player_y, 1, player_angle)
53+
```
54+
@fakefunc poly(mode, pos_x, pos_y, scale, angle, origin_x, origin_y)
55+
56+
@}
57+
@}

ee/engine/core/ginga/draw.lua

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ end
3737

3838
local function image(std, engine, canvas, src, pos_x, pos_y)
3939
local image = std.mem.cache('image'..src, function()
40+
local file = io.open(src, 'rb')
41+
if not file then return nil end
42+
file:close()
4043
return canvas:new(src)
4144
end)
4245
if image then

ee/engine/core/ginga/main.lua

+6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ local engine_hash = require('src/lib/engine/api/hash')
1010
local engine_http = require('src/lib/engine/api/http')
1111
local engine_i18n = require('src/lib/engine/api/i18n')
1212
local engine_keys = require('src/lib/engine/api/key')
13+
local engine_log = require('src/lib/engine/api/log')
1314
local engine_math = require('src/lib/engine/api/math')
15+
local engine_media = require('src/lib/engine/api/media')
1416
local engine_array = require('src/lib/engine/api/array')
1517
local engine_draw_ui = require('src/lib/engine/draw/ui')
1618
local engine_draw_fps = require('src/lib/engine/draw/fps')
@@ -22,6 +24,7 @@ local engine_node = require('src/lib/engine/raw/node')
2224
local engine_memory = require('src/lib/engine/raw/memory')
2325
--
2426
local cfg_json_rxi = require('third_party/json/rxi')
27+
local cfg_logsystem = require('src/lib/protocol/logsystem_print')
2528
local cfg_http_ginga = require('ee/lib/protocol/http_ginga')
2629
--
2730
local application_default = require('src/lib/object/root')
@@ -121,9 +124,12 @@ local function install(evt, gamefile)
121124
:package('@draw.fps', engine_draw_fps)
122125
:package('@draw.poly', engine_draw_poly, cfg_poly)
123126
:package('@color', color)
127+
:package('@log', engine_log, cfg_logsystem)
124128
:package('math', engine_math.clib)
125129
:package('hash', engine_hash, {'ginga'})
126130
:package('math.random', engine_math.clib_random)
131+
:package('mock.video', engine_media)
132+
:package('mock.audio', engine_media)
127133
:package('json', engine_encoder, cfg_json_rxi)
128134
:package('http', engine_http, cfg_http_ginga)
129135
:package('i18n', engine_i18n, cfg_system)

ee/engine/core/ginga/text.lua

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ local current_font_size = 8
99
local function apply_font()
1010
previous_font_name = current_font_name
1111
previous_font_size = current_font_size
12-
canvas:attrFont(current_font_name, current_font_size)
12+
canvas:attrFont(current_font_name, current_font_size/1.34)
1313
end
1414

1515
local function text_print(std, engine, canvas, pos_x, pos_y, text)
@@ -41,9 +41,7 @@ local function font_default(std, engine, font_id)
4141
end
4242

4343
local function font_previous()
44-
current_font_name = previous_font_name
45-
current_font_size = previous_font_size
46-
canvas:attrFont(current_font_name, current_font_size)
44+
current_font_name, previous_font_size = previous_font_name, current_font_name
4745
end
4846

4947
local function install(std, engine)

0 commit comments

Comments
 (0)