Jean Privat [Fri, 18 Dec 2015 20:27:37 +0000 (15:27 -0500)]
Merge: core: add Text::levenshtein_distance
Pull-Request: #1912
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Fri, 18 Dec 2015 20:27:32 +0000 (15:27 -0500)]
Merge: Better mmodule location
This mainly close a undocumented issue where `mmodule.location.source` is wrong
Pull-Request: #1911
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Fri, 18 Dec 2015 20:27:28 +0000 (15:27 -0500)]
Merge: hightlight: correctly highlight loose comments
close #1907
Pull-Request: #1910
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Fri, 18 Dec 2015 20:27:25 +0000 (15:27 -0500)]
Merge: readme: add information section
Pull-Request: #1909
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 18 Dec 2015 18:41:52 +0000 (13:41 -0500)]
lib/core: Added an optimized `to_hex` function to `FlatText`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Fri, 18 Dec 2015 16:00:02 +0000 (11:00 -0500)]
tests: update nitx sav because more information
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 18 Dec 2015 15:59:40 +0000 (10:59 -0500)]
nitc: use mmodule.filepath at some place
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 18 Dec 2015 15:47:55 +0000 (10:47 -0500)]
model: promote MModule::filename to model::mmodule
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 18 Dec 2015 15:47:22 +0000 (10:47 -0500)]
loader: update the mmodule location once the source is parsed
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 18 Dec 2015 17:44:50 +0000 (12:44 -0500)]
core: add Text::levenshtein_distance
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 18 Dec 2015 14:40:27 +0000 (09:40 -0500)]
hightlight: correctly highlight loose comments
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 18 Dec 2015 13:57:14 +0000 (08:57 -0500)]
readme: add information section
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 18 Dec 2015 13:53:23 +0000 (08:53 -0500)]
Merge: model: Beefup model visitor
Add usefull services to model visitor and introduce a model view based on it.
Pull-Request: #1903
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 18 Dec 2015 13:53:18 +0000 (08:53 -0500)]
Merge: Json benchmark
Added a JSON parser benchmark between different languages and Nit using 3 variants:
* Nit/NitCC: The old parser relying on NitCC, which is slow and memory-consuming (more than 6 Gio RAM for the 100Mio escaping-intensive file)
* Nit/Ad-hoc UTF-8 no ropes: The new parser working exclusively on `FlatString`
* Nit/Ad-hoc UTF-8 with ropes: The new parser with a mix of `Concat` and `FlatString`
![vr5fa](https://cloud.githubusercontent.com/assets/1444825/
11787549/
4375a4e6-a25a-11e5-87b3-
ac4346dee3bd.jpg)
I hear you all clamouring, well, here are the results (after #1885 and #1887, naturally):
![output](https://cloud.githubusercontent.com/assets/1444825/
11787622/
b24c0c98-a25a-11e5-8cff-
0e0afe03c9d8.png)
So yeah, I guess we could do better when it comes to escaping since the biggest difference in runtime is in the `large_escape` benchmark which coincidentally contains mostly `\uXXXX` characters.
Other than that, we do as well as Go and better than Ruby (also worse than Python, but this does not count), which is nice.
About the inputs:
* large_escaped is an unusual file since it contains large strings with lots of unicode escaping sequences which should highlight the handling of String-to-Int conversions and Unicode-escape-sequences-to-UTF-8-characters, and it is big, as in very big (94.7 Mio)
* magic, a normally-formatted 54 Mio JSON file with quite a bunch of Unicode characters
* gov_data, a 6.9 Mio JSON file with ASCII characters only
* twitter, a 64 kio JSON file with a lot of japanese characters
I might add some more files later to better represent the variety of inputs, but right now is a good time to push the benchmark suite, enjoy !
Note: Since the ad-hoc JSON parser is benched, #1886 will need to be merged prior to this one if the bench is to work on your machines
Pull-Request: #1895
Reviewed-by: Jean Privat <jean@pryen.org>
Alexandre Terrasa [Fri, 18 Dec 2015 05:13:10 +0000 (00:13 -0500)]
tests: update tests for model_visitor
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 15 Dec 2015 23:22:55 +0000 (18:22 -0500)]
model_view: introduce views to model based on model visitor
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 18 Dec 2015 03:03:37 +0000 (22:03 -0500)]
model: introduce MEntityTree
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 16 Dec 2015 02:09:20 +0000 (21:09 -0500)]
model: beef up ModelVisitor
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Lucas Bajolet [Tue, 15 Dec 2015 16:51:28 +0000 (11:51 -0500)]
contrib/pep8analysis: Fix operand check in hexdigit
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Tue, 15 Dec 2015 16:26:30 +0000 (11:26 -0500)]
lib/json: Improved performance of Unicode-escaping in a `Text`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 14 Dec 2015 22:31:53 +0000 (17:31 -0500)]
lib: Perfized `to_hex` and have it work anywhere in a `Text`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 14 Dec 2015 22:31:16 +0000 (17:31 -0500)]
lib: Added `is_surrogate` service to `Char`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 14 Dec 2015 22:30:58 +0000 (17:30 -0500)]
lib: Added `from_hex` service to transform an hexadecimal digit to an `Int`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 17 Dec 2015 16:05:57 +0000 (11:05 -0500)]
tests: rm sav/niti/fixme/test_intern_extern.res from #1898 because #1902 fixed it
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 17 Dec 2015 16:03:02 +0000 (11:03 -0500)]
Merge: FFI: Fix extern methods in generic classes with the interpreter, and complex types with nith
A kind of resolve was missing so the name of the generated C function was different between the call and its implementation.
Fix #1899.
Pull-Request: #1902
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 17 Dec 2015 16:02:55 +0000 (11:02 -0500)]
Merge: Alternative intern
Improve the handling of alternative of intern methods since an extern body can be used as a fallback.
~~~
redef class Int
fun foo is intern `{ return foo(self) `}
end
~~~
Moreover, NativeArray intern alternatives is now fixed with nitc.
There is still an issue with the extern methods of NativeArray in the interpreter.
Pull-Request: #1898
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 17 Dec 2015 16:02:44 +0000 (11:02 -0500)]
Merge: Asteronits: add sounds and decouple app::audio from mnit
Add some sound effects to Asteronits, when opening fire, on asteroid explosion and on collisions with the ship. There is no sound for the thruster because the pause feature is currently broken on Android and inexistant on GNU/Linux.
Also update app::soounds so they no longer depend on mnit and now rely only on app.nit.
Pull-Request: #1901
Reviewed-by: Jean Privat <jean@pryen.org>
Lucas Bajolet [Mon, 14 Dec 2015 16:53:34 +0000 (11:53 -0500)]
benchmarks: Added Makefile for bench_json
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Wed, 16 Dec 2015 16:50:53 +0000 (11:50 -0500)]
benchmarks: Added multiplier for small JSON files
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Thu, 17 Dec 2015 15:11:55 +0000 (10:11 -0500)]
FFI nith: fix using `void*` for generics and nullables types in the light FFI
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 17 Dec 2015 14:50:24 +0000 (09:50 -0500)]
FFI niti: fix extern methods in generic classes
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 17 Dec 2015 14:49:32 +0000 (09:49 -0500)]
tests: add a test for extern methods in generic classes
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Tue, 15 Dec 2015 22:22:34 +0000 (17:22 -0500)]
nitni: can mangle all formal type, not just virtual ones
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 16 Dec 2015 20:07:39 +0000 (15:07 -0500)]
Merge: nitrpg: avoid race conditions in tests that imply database
As asked by @privat, the nitrpg test suite now uses random db names
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Pull-Request: #1892
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 16 Dec 2015 17:12:30 +0000 (12:12 -0500)]
Merge: Qualified class identifiers
Extends the parsed and the AST to handle qualified class identifiers.
Now you can parse
~~~nit
redef class m0::A
super m1::S
redef type m2::B::T: Int
fun foo: m3::G[m4::C] do end
end
~~~
Currently, the class qualifiers, if any, are just ignored by semantic phases. Like with method qualifiers.
Pull-Request: #1900
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 16 Dec 2015 17:12:22 +0000 (12:12 -0500)]
Merge: niunit: fix after/before test calls
The specification of `nitunit` states that before and after methods can be called to initialize or clean test related things:
~~~nit
module my_test_suite
class MyTestSuite
super TestSuite
redef fun before_test do
# complex things to set up the test
end
redef fun after_test do
# complex things to tear down the test
end
fun test_foo do end
fun test_bar do end
end
~~~
In the above example, `nitunit` will call the methods precisely in this order:
~~~nit
test_before
test_foo
test_after
test_before
test_bar
test_after
~~~
Before this PR, the before and after methods were only call if a redefinition of the before/after method exists locally in the test suite. Inheritance was not considered:
~~~nit
module my_test_suite
class TestBase
super TestSuite
redef fun before_test do # ...
redef fun after_test do # ...
end
class MyTestSuite
super TestBase
fun test_foo do end
fun test_bar do end
end
~~~
So the output was only:
~~~nit
test_foo
test_bar
~~~
This PR fixes that behavior.
Pull-Request: #1897
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 16 Dec 2015 17:12:20 +0000 (12:12 -0500)]
Merge: gamnit: simple 2D API, input events and the game Asteronits
You should probably read this PR commit by commit, it is a bit long but it's mostly due to the sample game, a big XML file and changes to indentation.
The new API provided by `simple_2d` is meant to replace mnit for writing 2D games.
Client modules only have to create instances of `Sprite` which will be displayed as long as they are in `App::sprites`.
At this point, the `simple_2d` API is not optimized and you may see a slowdown at the insertion of new sprites. However, we could improve the performance by preallocating buffer space for more sprites, and by caching sprites state on the GPU to avoid unnecessary updates.
This PR also adds support for input events for Linux and Android. It uses the existing services from `mnit::input`, `sdl` and `android::input_events`.
Finally, the game Asteronits is an example for the `simple_2d` API. In this game, the player controls a ship, avoids asteroids and destroys them. The gameplay and UI is limited by design to be a simple example. Note that the `touch_ui` variant is used on Android only but it also works on Linux.
The tool texture_atlas_parser reads XML TextureAtlas files and produces Nit classes with one attribute per subtexture. We could move this tool if it is useful for any other projects.
Pull-Request: #1894
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Wed, 16 Dec 2015 17:12:13 +0000 (12:12 -0500)]
Merge: Json Ad-Hoc string parser
Simple ad-hoc JSON parser working in a similar way as `DOMXmlParser` or `SExpParser`, on the simple example, the runtime now is around 1.5 seconds.
Once #1885 is merged however, the runtime is ~0.65 seconds, which is nice.
Depends on #1884
Pull-Request: #1886
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Lucas Bajolet [Thu, 10 Dec 2015 20:47:48 +0000 (15:47 -0500)]
benchmarks: Added JSON benchmark script
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Sun, 13 Dec 2015 18:57:07 +0000 (13:57 -0500)]
tests: Update sav without escaped `/` characters in a string
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Tue, 8 Dec 2015 19:20:23 +0000 (14:20 -0500)]
tests: Added ad-hoc json parser test
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 11 Dec 2015 21:35:53 +0000 (16:35 -0500)]
lib/json: Added ad-hoc string parser for JSON
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Tue, 15 Dec 2015 22:35:18 +0000 (17:35 -0500)]
lib/android: fix frenglish doc
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 15 Dec 2015 22:34:47 +0000 (17:34 -0500)]
contrib/asteronits: intro Android version with vibration
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 15 Dec 2015 16:41:51 +0000 (11:41 -0500)]
contrib/asteronits: add sound effects
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 15 Dec 2015 15:35:46 +0000 (10:35 -0500)]
lib/linux: audio has no more needs for mnit
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 7 Oct 2015 15:38:34 +0000 (11:38 -0400)]
lib: move assets_dir
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 16 Dec 2015 13:21:14 +0000 (08:21 -0500)]
contrib/asteronits: fix android rules dependency on pre-build
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 16 Dec 2015 05:16:38 +0000 (00:16 -0500)]
tests: update sav for AST-related tests
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 16 Dec 2015 04:23:10 +0000 (23:23 -0500)]
nitc: update code to use qclassids
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 16 Dec 2015 04:22:37 +0000 (23:22 -0500)]
parser: regenerate (with qclassid)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 16 Dec 2015 04:22:07 +0000 (23:22 -0500)]
parser: use qualified class ids in the AST (changes API)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 16 Dec 2015 04:21:17 +0000 (23:21 -0500)]
parser: expose qualified class id (qclassid)
Signed-off-by: Jean Privat <jean@pryen.org>
Alexandre Terrasa [Wed, 16 Dec 2015 01:33:21 +0000 (20:33 -0500)]
model: fix some warnings
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexis Laferrière [Tue, 15 Dec 2015 23:18:04 +0000 (18:18 -0500)]
contrib/asteronits: fix dependency on inkscape_tools
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexandre Terrasa [Tue, 15 Dec 2015 01:58:49 +0000 (20:58 -0500)]
nitrpg: avoid race conditions in tests that imply database
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Tue, 15 Dec 2015 22:28:32 +0000 (17:28 -0500)]
test: add test_intern_extern.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 15 Dec 2015 22:24:25 +0000 (17:24 -0500)]
interpreter: a method can be extern and intern, extern is used as a fallback
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 15 Dec 2015 22:22:34 +0000 (17:22 -0500)]
nitni: can mangle all formal type, not just virtual ones
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 15 Dec 2015 22:07:06 +0000 (17:07 -0500)]
compiler: a method can be extern and intern, extern is used as a fallback
Signed-off-by: Jean Privat <jean@pryen.org>
Alexandre Terrasa [Tue, 15 Dec 2015 22:04:23 +0000 (17:04 -0500)]
nitunit: always call before/after methods
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 15 Dec 2015 22:04:02 +0000 (17:04 -0500)]
nitunit: add a test to show how non-local redefinition of before/after methods should work
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Tue, 15 Dec 2015 21:59:38 +0000 (16:59 -0500)]
compiler: intern methods on NativeArray can fallback instead of no-op
Signed-off-by: Jean Privat <jean@pryen.org>
Alexandre Terrasa [Tue, 15 Dec 2015 21:56:43 +0000 (16:56 -0500)]
nitunit: clean warnings for testing_suite
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Tue, 15 Dec 2015 19:19:47 +0000 (14:19 -0500)]
Merge: nitweb: nitcorn based API to access model and source code
Description from man page:
# NAME
nitweb - provide a web API to nit model and source code.
# SYNOPSIS
nitweb [*options*] FILE...
# DESCRIPTION
`nitweb` use `nitcorn` actions to provide an API to loaded model and source code.
Usage:
~~~sh
nitweb --host localhost --port 3000 lib/core/
~~~
### `GET /` HOME
Show the home page of the webserver.
Display all the loaded model entities in a tree.
### `GET /search/:namespace` SEARCH BY NAMESPACE
Search all model entities matching `namespace`.
It is possible to retrieve the result as a JsonArray instead of raw html
using the uri param `json=true` (default `false`).
### `GET /code/:namespace` SHOW SOURCE CODE
Display the source code of the entity matching `namespace`.
### `GET /doc/:namespace` DOCUMENTATION PAGE
Display a short documentation page about the entity matching `namespace`.
### `GET /random/` RANDOM LIST
Display a random list of entities found in the model.
The list is parametrable with the following uri params:
* `n=10` size of the list (default `10`)
* `k=modules` kind of entities in the list (default `modules`)
It is possible to retrieve the result as a JsonArray instead of raw html
using the uri param `json=true` (default `false`).
# OPTIONS
### `--host`
The host to bind the web server on.
### `--port`
Port number to use
### `-h`, `-?`, `--help`
Show Help (the list of options).
Pull-Request: #1889
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 15 Dec 2015 18:42:10 +0000 (13:42 -0500)]
Merge: Add simple proxy action
For now anything proxied using this action is blocking.
close #1845
Pull-Request: #1858
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Thu, 10 Dec 2015 20:47:27 +0000 (15:47 -0500)]
benchmarks: Added benchmarks for C, Go, Ruby, Python and Nit
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Tue, 15 Dec 2015 14:31:27 +0000 (09:31 -0500)]
Merge: Make all Sets cloneable
Since there is no reason to forbid it (or I have not seen one at the very least), here's a simple `clone` method that should work on any `Set`
Pull-Request: #1893
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 15 Dec 2015 13:09:12 +0000 (08:09 -0500)]
contrib/asteronits: fix check rule
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 14 Dec 2015 20:04:06 +0000 (15:04 -0500)]
lib/gamnit: fix not executing gamnit programs when testing
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 14 Dec 2015 17:46:18 +0000 (12:46 -0500)]
contrib: move lib/gamnit/examples/asteronits to contrib/
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Lucas Bajolet [Thu, 10 Dec 2015 15:40:57 +0000 (10:40 -0500)]
benchs: Added submodule reference to ujson4c
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Mon, 14 Dec 2015 16:46:08 +0000 (11:46 -0500)]
lib/gamnit: tweak the world_camera to support devices with small depth buffer
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 14 Dec 2015 16:44:56 +0000 (11:44 -0500)]
lib/gamnit: make controls larger in asteronits
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 13 Dec 2015 18:29:02 +0000 (13:29 -0500)]
lib/gamnit: intro README.md
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 12 Dec 2015 00:19:06 +0000 (19:19 -0500)]
lib/gamnit: intro the asteronit example
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 10 Dec 2015 22:10:34 +0000 (17:10 -0500)]
lib/gamnit: intro `accept_events` and other input related services
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 26 Sep 2015 18:40:14 +0000 (14:40 -0400)]
lib/gamnit: intro `simple_2d` and API for easy 2D games programming
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 13 Dec 2015 17:25:00 +0000 (12:25 -0500)]
lib/gamnit: intro `EulerCamera::reset_to_fit`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 12 Dec 2015 00:25:28 +0000 (19:25 -0500)]
lib/gamnit: intro `UICamera`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 12 Dec 2015 16:16:38 +0000 (11:16 -0500)]
lib/gamnit: add a non-null display argument to frame_core
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 12 Dec 2015 04:48:18 +0000 (23:48 -0500)]
lib/gamnit: make `all_root_textures` public
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 12 Dec 2015 00:26:08 +0000 (19:26 -0500)]
lib/gamnit: fix offsets in textures to be lazy
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 12 Dec 2015 16:28:03 +0000 (11:28 -0500)]
lib/android: fix `AndroidKeyEvent::to_c` to return a `nullable Char`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 10 Dec 2015 22:10:24 +0000 (17:10 -0500)]
lib/mnit: update doc and style of the `input` module
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 13 Dec 2015 01:22:48 +0000 (20:22 -0500)]
lib/mnit & implementations: move up `is_move` from Android to abstract
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Lucas Bajolet [Sun, 13 Dec 2015 17:06:56 +0000 (12:06 -0500)]
tests: Updated error message (different line) in sav
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Sat, 12 Dec 2015 18:39:19 +0000 (13:39 -0500)]
lib/core: Make all `Set` cloneable
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Sat, 12 Dec 2015 02:17:53 +0000 (21:17 -0500)]
contrib/inkscape_tools: update support for gamnit
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 11 Dec 2015 23:24:56 +0000 (18:24 -0500)]
lib/opts: `OptionContext::parse` use `args` by default
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexandre Terrasa [Wed, 9 Dec 2015 20:14:57 +0000 (15:14 -0500)]
nitweb: add man page
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 9 Dec 2015 20:02:59 +0000 (15:02 -0500)]
tests: add nitweb
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 9 Dec 2015 06:54:46 +0000 (01:54 -0500)]
nitweb: introduce nitweb binary
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 9 Dec 2015 06:54:32 +0000 (01:54 -0500)]
nitweb: introduce web actions
Basic services for now.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 9 Dec 2015 06:53:53 +0000 (01:53 -0500)]
nitweb: introduce views used to render information
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 9 Dec 2015 06:53:15 +0000 (01:53 -0500)]
nitweb: render model entities to html
Actually move up common html templates from
doc::html_templates::html_model.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 9 Dec 2015 06:52:24 +0000 (01:52 -0500)]
src: introduce a new tool called nitweb
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 11 Dec 2015 19:05:24 +0000 (14:05 -0500)]
modelize: introduce ModelBuilder::mentity2node method
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Philippe Pepos Petitclerc [Sat, 28 Nov 2015 23:59:58 +0000 (18:59 -0500)]
Add simple proxy action
Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>
Jean Privat [Fri, 11 Dec 2015 00:32:20 +0000 (19:32 -0500)]
Merge: gamnit: intro textures, programs, camera and the globe example
Intro 3 core modules for gamnit with a lot of features:
* textures: Provices portable services to load textures. Textures are organized as trees where only the roots have the pixels data and subtextures relay load calls to the root. This structure should remain as is but more features need to be implemented, namely automating the use of offsets in the subtexture, auto reloading textures when invalidated and services to unload the textures.
* programs: Structures to organize GL programs and shaders and to facilitate access to shader variables. The main advantages of this API are static types on shader variables and the gamnit programs that can be specialized.
I'm not 100% satisfied with the structure of GamnitProgram and GamnitProgramFromSource, but I don't have a better idea on how to organize it. Also I will probably review the implementation of how `GamnitProgram::attributes` and `uniforms` are populated, but it shouldn't change the API much.
* cameras: Add an abstract Camera class and a simple EulerCamera based on euler angles, perfect for FPS type games or top-down strategy games. These camera main feature is to produce the MVP matrix.
More camera should be implemented, they should also be considered objects attachable to a scene when we have scenes. The EulerCamera lacks some feature, like the usual `look_at`.
These services are independent, it's clean but maybe it's not the best idea. We can't pass a camera to a mat4 shader variable, we have to manually extract the MVP matrix from the camera and pass it to the shader. Also to assign a texture to a sampler2d shader variable, we have to load the texture, assign its GL id to a texture unit and assign the unit's index as the shader variable value. This last issue could be simplified by more code in gamnit itself, but it will add coupling, it will be for a next PR.
The globe examples should replace the triangle example as the "minimal" example for gamnit. However I plan on updating it as I integrate more code into gamnit services allowing me to remove custom calls to OpenGL ES 2.0 from the example.
Pull-Request: #1890
Reviewed-by: Jean Privat <jean@pryen.org>