Alexis Laferrière [Mon, 8 May 2017 23:43:30 +0000 (19:43 -0400)]
core: add non-breaking space to `is_whitespace`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 1 May 2017 15:49:51 +0000 (11:49 -0400)]
Merge: gamnit: fix gamepad path, pixelated minification, text X align and low-opacity textures
A few fixes to gamnit:
* Fix path of virtual gamepad texture.
* Fix the look of `pixelated` textures when minified (zoomed out).
* Fix X align of `TextSprites` so the first letter starts from the given coordinate.
* Lower the threshold to discard transparent fragments.
Pull-Request: #2415
Jean Privat [Mon, 1 May 2017 15:49:04 +0000 (11:49 -0400)]
Merge: opportunity: official docker image
Now that nitcorn can listen on any interface, why not having lightweight standalone web applications?
How to build?
1. install docker
2. cd nit/contrib/opportunity/docker
3. docker build --tag opportunity .
How to run?
1. docker run -d -p 8080:8080 --name opportunity opportunity
2. xdg-open http://localhost:8080
3. docker stop opportunity
or just get it from the [hub](https://hub.docker.com/r/nitlang/opportunity/tags/)
1. docker run -d -p 8080:8080 --name opportunity nitlang/opportunity
Pull-Request: #2284
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>
Alexis Laferrière [Thu, 13 Apr 2017 17:37:33 +0000 (13:37 -0400)]
gamnit: fix virtual gamepad asset name
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 15 Apr 2017 14:33:25 +0000 (10:33 -0400)]
gamnit: lower transparency threshold to discard fragments
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 29 Apr 2017 12:56:38 +0000 (08:56 -0400)]
gamnit: fix X position of first char of a TextSprites
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 29 Apr 2017 12:56:13 +0000 (08:56 -0400)]
gamnit: fix pixelated changing only magnification behavior
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Thu, 27 Apr 2017 20:07:37 +0000 (16:07 -0400)]
Merge: Check binary files that might be wrongly commited
Pull-Request: #2273
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 20 Aug 2016 01:16:01 +0000 (21:16 -0400)]
opportunity: official docker image
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 27 Apr 2017 14:47:20 +0000 (10:47 -0400)]
opportunity: optional argument is the iface
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 17 Aug 2016 15:04:19 +0000 (11:04 -0400)]
popcorn/README: remove a unexpected control character ^S
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 17 Aug 2016 15:00:34 +0000 (11:00 -0400)]
remove wrongly committed binary file `lib/core/collection/range`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 17 Aug 2016 14:56:15 +0000 (10:56 -0400)]
jenkins: add checkbinaryfiles.sh
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 27 Apr 2017 12:43:38 +0000 (08:43 -0400)]
Merge: Nitin catches the runtime errors
~~~
-->abort
1,1--5: Runtime error: Aborted
abort
^
,---- Stack trace -- - - -
| input-1$Sys$main (1,1--5)
`------------------- - - -
-->fun toto is abstract
-->toto
1,1--20: Runtime error: Abstract method `toto` called on `Sys`
fun toto is abstract
^
,---- Stack trace -- - - -
| input-2$Sys$toto (1,1--20)
| input-3$Sys$main (1,1--4)
`------------------- - - -
-->class A
...var a: String is noautoinit
...fun foo do print a
...end
-->(new A).foo
3,18: Runtime error: Uninitialized attribute _a
fun foo do print a
^
,---- Stack trace -- - - -
| input-4$A$foo (3,18)
| input-5$Sys$main (1,1--11)
`------------------- - - -
-->
~~~
Pull-Request: #2413
Jean Privat [Wed, 26 Apr 2017 19:47:06 +0000 (15:47 -0400)]
nitin/README: runtime errors/aborts return to the interactive loop
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 25 Apr 2017 18:24:56 +0000 (14:24 -0400)]
tests: add some runtime error in nitin.input
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 24 Apr 2017 20:01:44 +0000 (16:01 -0400)]
nitin: use the secret `catch` block to intercept runtime errors
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 26 Apr 2017 14:38:26 +0000 (10:38 -0400)]
Merge: Catch em all
Extends the `do catch` construct to catch all run time errors.
The interpreter also keep the error information if one wants it.
Pull-Request: #2411
Jean Privat [Wed, 26 Apr 2017 14:38:25 +0000 (10:38 -0400)]
Merge: Nitin tests
Add a basic test for the nit interactive interpreter.
I also added a new engine but most test fails because:
Local variables in main are too much local, so the following fail because `a` is unknown in the second line. I plan to solve this problem.
~~~
var a = 1
print a
~~~
Classes and top-level methods are analysed one after the other so the following fails because `B` is unknown while processing the first class. I do not plan to solve this problem as I think this is the expected behavior when interactive.
~~~
class A
var b: B
end
class B
end
~~~
Pull-Request: #2410
Jean Privat [Tue, 25 Apr 2017 16:42:42 +0000 (12:42 -0400)]
misc: update highlighters and indenters
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 25 Apr 2017 16:40:24 +0000 (12:40 -0400)]
tests: add test_catch_runtime
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 25 Apr 2017 16:04:12 +0000 (12:04 -0400)]
nitc: add `add_raw_throw` so raw_abortions are caught
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 25 Apr 2017 16:02:25 +0000 (12:02 -0400)]
nitc: document add_raw_abort
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 24 Apr 2017 20:00:24 +0000 (16:00 -0400)]
niti: make `catch_count` writable
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 24 Apr 2017 19:59:29 +0000 (15:59 -0400)]
niti: keep the fatal_error information
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 24 Apr 2017 19:58:46 +0000 (15:58 -0400)]
niti: all fatal errors are catchable, not just aborts
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 25 Apr 2017 11:20:55 +0000 (07:20 -0400)]
tests: to add a nitin engine
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 25 Apr 2017 11:20:42 +0000 (07:20 -0400)]
nitin: add option --no-prompt to ease testing
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 25 Apr 2017 00:17:17 +0000 (20:17 -0400)]
tests: add tests for nitin
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 24 Apr 2017 20:04:40 +0000 (16:04 -0400)]
Merge: nitin, an interactive interpreter
# An experimental Nit interactive interpreter
This tool is outside src/ because:
1. Is is greatly experimental
2. It can depend on readline (GPL3) whereas the rest of nitc is Apache2.
Both are compatible but the final binary result is GLP3.
## Features
* use GNU readline to read lines
* use importation/refinement to handle incremental execution (so basically everything works out of the box)
* maintain an interpreter and live objects (the model grows but the interpreter and runtime data are reused)
Main missing features
* top-level variables are local
* runtime error/aborts just abort the interactive loop
* FFI is strange
* No model/object inspection
## Examples
`-->` is the prompt, `...` the continuation prompt. What follows is the user input.
The rest is the output.
### Basic instructions
~~~raw
$ nitin
--> print 5+2
7
~~~
### Complex and control statements
~~~raw
-->for i in [0..5[ do
...print i
...end
0
1
2
3
4
~~~
You can use `do` blocks to delay the execution and control the scope of variables.
~~~raw
-->do
...var sum=0
...for i in [0..50[ do
...sum += i
...end
...print sum
...end
1225
~~~
### Classes and methods
~~~raw
-->class A
...fun foo do
...print "hello"
...end
...end
-->(new A).foo
hello
~~~
### Error management
In case of static errors, the history (up arrow) can be reused and updated.
~~~raw
-->class
...end
end
^: Syntax Error: unexpected keyword 'end'.
-->class A **up arrow and update, thanks readline**
end
1,7: Redef Error: `A` is an imported class. Add the `redef` keyword to refine it.
class A
^
-->redef class A **up arrow and update again, thanks readline**
redef fun foo do print "Bye"
end
-->(new A).foo
bye
~~~
### Class refinement
Already instantiated objects gain the new methods, attributes and specializations.
However, the new attributes are left uninitialized (default values or init are not recomputed on existing objects)
Top-level methods automatically refine Sys.
~~~raw
-->foo
1,1--3: Error: method or variable `foo` unknown in `Sys`.
foo
^
-->fun foo do
...print "I'm sys"
...end
-->foo
I'm sys
~~~
You can store global variables as attributes of Sys
~~~raw
-->redef class Sys
...var my_int: Int is writable
...end
-->my_int = 5
-->print my_int
5
~~~
### Dynamic importation
~~~
-->print([0..10[.to_a.to_json)
1,20--26: Error: method `to_json` does not exists in `Array[Int]`.
print([0..10[.to_a.to_json)
^
-->import json
-->print([0..10[.to_a.to_json)
[0,1,2,3,4,5,6,7,8,9]
~~~
Pull-Request: #2409
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 21 Apr 2017 19:01:29 +0000 (15:01 -0400)]
contrib/nitin: new interactive interpreter proof of concept
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 21 Apr 2017 18:59:13 +0000 (14:59 -0400)]
nitc/toolcontext: make error_count writable
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 21 Apr 2017 18:57:08 +0000 (14:57 -0400)]
nitc/loader: always build the module importation
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 21 Apr 2017 18:56:47 +0000 (14:56 -0400)]
nitc/loader: load_rt_module returns the MModule
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 21 Apr 2017 18:56:07 +0000 (14:56 -0400)]
nitc/interpreter: NaiveInterpreter::mainmodule is writable
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 11 Apr 2017 12:30:27 +0000 (08:30 -0400)]
Merge: gamnit: virtual gamepad
Intro an easy to use virtual gamepad for quick ports of desktop games to mobiles devices with a touchscreen only. The gamepad is composed of up to 2 d-pads and up to 6 action buttons. Each button and direction on the pad is mapped to customizable keyboard keys. As such, it is ideal to simulate keyboard inputs on mobile devices.
The `virtual_gamepad` module uses the `app_files` annotation which automatically includes the required PNG files in Android's APK files when the module is imported.
The virtual gamepad is derived from the one in Asteronits, which it replaced. It is now used in Asteronits and Action Nitro, and it will be added to Devil's Avocados as soon as this is merged. The gamepad comes with a selection of button allowing for some customization, however custom buttons are also supported.
Usage example from Devil's Avocados:
~~~
var gamepad = new VirtualGamepad
gamepad.add_dpad
gamepad.add_button("q", gamepad_spritesheet.turn_left)
gamepad.add_button("e", gamepad_spritesheet.turn_right)
gamepad.add_button("space", gamepad_spritesheet.star)
gamepad.visible = true
app.gamepad = gamepad
~~~
And the result, on Android:
![screenshot_20170404-125407](https://cloud.githubusercontent.com/assets/208057/
24668912/
641d091a-1936-11e7-81ff-
eaf026540db6.png)
This version should manage quite well the edge cases of touchscreen controls, which explains the complexity of `virtual_gamepad.nit`. However it is still limited, future work could add:
- Virtual analog joystick, it would be easier to code than the d-pad.
- Abstraction for gamepads (and analog joysticks). This would require unification with the current Android physical gamepad support and implementing desktop physical gamepad support with SDL2.
Pull-Request: #2405
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 11 Apr 2017 12:30:26 +0000 (08:30 -0400)]
Merge: gamnit: abstract camera scroll and zoom service
The new service `accept_scroll_and_zoom` lets the user adjust the camera using platform specific controls. On desktop computers, the mouse wheel controls the zoom and the middle mouse button drags the world/camera. On Android, a pinch gesture controls the zoom and 2 fingers slide the scroll.
This reuse the previous `accept_two_fingers_motion` and intro an implementation for desktop computers. It will be used by, at least, Sputnit in which it will replace the current implementation which is broken since the upgrade to SDL2.
Pull-Request: #2407
Jean Privat [Tue, 11 Apr 2017 12:30:24 +0000 (08:30 -0400)]
Merge: gamnit: intro dynamic resolution support
The dynamic resolution can change while the game is running to reduce the load on the GPU when more performance is needed. So an action scene may display tons of explosions and maintain a good framerate by reducing the number of pixels on screen, and a calm scene may gain back the full resolution to better show details.
At this point, the dynamic resolution must be set manually by the user (using something like a video quality slider) or by some heuristic. Future improvement could autodetect skipped frame and set the resolution accordingly.
While the current set of gamnit games rarely overload a GPU, there is many scenarios where a dynamic resolution can be useful: mobile device with a high-resolution display and a limited battery, 4K Android TVs and a VR headset that must maintain 90 FPS.
In Asteronits, the keys `, and .` change the dynamic resolution. Here are a few screenshots of the results.
At 1.0, the native resolution:
![screenshot from 2017-04-06 13 14 08](https://cloud.githubusercontent.com/assets/208057/
24768761/
cfd3bd6a-1ad1-11e7-993b-
5f2e76034a31.png)
At 0.25:
![screenshot from 2017-04-06 13 14 25](https://cloud.githubusercontent.com/assets/208057/
24768762/
d2292b36-1ad1-11e7-84b2-
7b3ab602cd67.png)
At 0.03: (I wouldn't recommend using this value by default)
![screenshot from 2017-04-06 13 14 34](https://cloud.githubusercontent.com/assets/208057/
24768771/
df0ac0d0-1ad1-11e7-8493-
7efb2e7c30fc.png)
Pull-Request: #2408
Alexis Laferrière [Fri, 31 Mar 2017 16:37:03 +0000 (12:37 -0400)]
gamnit: world_camera position defaults to 1080 pixels in height
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 31 Mar 2017 16:36:16 +0000 (12:36 -0400)]
asteronits: change dynamic resolution with , and .
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 31 Mar 2017 02:15:23 +0000 (22:15 -0400)]
gamnit: intro dynamic resolution support
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 31 Mar 2017 20:27:56 +0000 (16:27 -0400)]
glesv2: intro param to get names of bound entities
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 31 Mar 2017 20:07:33 +0000 (16:07 -0400)]
glesv2: small (but important) fixes
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 5 Apr 2017 19:10:22 +0000 (15:10 -0400)]
gamnit: implement `camera_control` for linux
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 5 Apr 2017 19:05:45 +0000 (15:05 -0400)]
gamnit: intro `camera_control` an abstraction of `accept_two_fingers_motion`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 5 Apr 2017 19:05:30 +0000 (15:05 -0400)]
sdl2 & gamnit: add mouse wheel events
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 5 Apr 2017 14:42:16 +0000 (10:42 -0400)]
action_nitro: add f-droid package description file
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 4 Apr 2017 21:52:48 +0000 (17:52 -0400)]
gamnit: fix clearing reference to context in sprites too
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 2 Apr 2017 20:48:41 +0000 (16:48 -0400)]
gamnit: add example to `gamnit::keys`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 5 Apr 2017 00:30:35 +0000 (20:30 -0400)]
Merge: inkscape_tools: support Inkscape versions before and after 0.92
Inkscape changed the default DPI at version 0.92. This PR improves `svg_to_png_and_nit` to set the default DPI according to the detected Inkscape version, 90 DPI up until version 0.92 and 96 DPI for version 0.92 and later.
Reference: http://wiki.inkscape.org/wiki/index.php/Release_notes/0.92#Important_changes
This is a more portable solution than #2374.
Pull-Request: #2406
Jean Privat [Wed, 5 Apr 2017 00:30:07 +0000 (20:30 -0400)]
Merge: GC now collect cycles
This fixes an issue with the actor model where the GC is unable to collect cycles associated with actors objects and printing an annoying warning
Theses modifs should fix the tests in #2401
The downside is that the finalization is no longer in topological order
Pull-Request: #2404
Jean Privat [Wed, 5 Apr 2017 00:30:03 +0000 (20:30 -0400)]
Merge: Some minor fixes to actors examples
Tried to follow @tremblay-guy commentaries on #2361 to improve the code of the actors examples
Pull-Request: #2401
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 2 Apr 2017 04:06:43 +0000 (00:06 -0400)]
action_nitro: intro Android client with gamepad and icon
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 2 Apr 2017 04:06:29 +0000 (00:06 -0400)]
action_nitro: general gameplay tweaks
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 2 Apr 2017 17:38:28 +0000 (13:38 -0400)]
asteronits: use the new touch gamepad
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 2 Apr 2017 04:05:42 +0000 (00:05 -0400)]
gamnit: intro virtual gamepad
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 4 Apr 2017 20:06:41 +0000 (16:06 -0400)]
inkscape_tools: support Inkscape versions before and after 0.92
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 2 Apr 2017 17:39:46 +0000 (13:39 -0400)]
gamnit: intro more anchor points
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 2 Apr 2017 04:07:12 +0000 (00:07 -0400)]
gamnit: fix Y axis un `screen_to_ui`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 2 Apr 2017 17:39:00 +0000 (13:39 -0400)]
mnit::input: move up pointer id
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
BlackMinou [Mon, 3 Apr 2017 17:24:01 +0000 (13:24 -0400)]
fix the GC warning about cycles
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Mon, 3 Apr 2017 17:46:14 +0000 (13:46 -0400)]
Update the doc for Finalizable
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Wed, 29 Mar 2017 18:55:03 +0000 (14:55 -0400)]
Actors example Chameneos redux fixes
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Wed, 29 Mar 2017 18:55:10 +0000 (14:55 -0400)]
Actors example Fannkuch redux fixes
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Wed, 29 Mar 2017 18:55:18 +0000 (14:55 -0400)]
Actors example Mandelbrot fixes
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Wed, 29 Mar 2017 18:54:12 +0000 (14:54 -0400)]
Actors example Thread ring fixes
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
Jean Privat [Tue, 28 Mar 2017 12:27:49 +0000 (08:27 -0400)]
Merge: intrepreter: Fix the documentation of `PrimitiveInstance`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #2400
Jean Privat [Tue, 28 Mar 2017 12:27:46 +0000 (08:27 -0400)]
Merge: intrepreter: Fix the documentation of `Instance::is_true`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #2399
Jean Privat [Tue, 28 Mar 2017 12:27:44 +0000 (08:27 -0400)]
Merge: compiler: Refactor
Various minor refactorings done for PR #2397.
Pull-Request: #2398
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 28 Mar 2017 12:27:32 +0000 (08:27 -0400)]
Merge: gamnit: optimize the `flat` 2D api using GPU buffers
`gamnit::flat` is an API to quickly and easily write 2D games, it is built around sprites added to either the world `sprites` or to the `ui_sprites` sets. However, the absolute lack of optimization led to slow performances when there was a large number of sprites.
This PR rewrites the implementation of the `flat` API using vertex buffer objects (VBO) to keep sprite data in the GPU memory. The data is updated only when an attribute of a sprite is modified.
The result is 200 times higher framerate in the new minimal program `template_flat` with 2000 sprites and random modifications, going from ~10 FPS to ~2000 FPS.
This requires managing the memory of the GPU, growing it as needed, keeping a list of freed spaces and defragmenting it to compress the data after sprite deletion. The GPU memory is simulated by the `GroupedArray` class, it keeps a bit more information than needed but it would also support objects with varying sizes like the 3D models of the `depth` API. All sprites are sorted when added to either `sprites` or `ui_sprites` allowing for bulk drawing of sprites using the same pixel data and usage type.
This PR extends the current API by adding a few new services:
* The attribute `Sprite::static`, when at `true`, gives a hint to the framework that this sprite won't change often and that it is added in bulk with other static sprites. This value can be ignored in the prototyping phase of a game and added when better performances are needed.
* The pseudo attributes `red`, `green` and `blue` modifies the tint of a sprite. They are more intuitive to use than the array `tint` and they allow for an automatic update of the related data on the GPU.
There is two downsides to this implementation:
* The attribute `Point3d::sprites` is added by refinement to all 3D points, even those not used directly by the graphics framework. Hopefully it will add only a small overhead, and (of course) only in clients of gamnit games.
* There is no easily predictable order in which the sprites are drawn anymore. Causing issues with non-opaque sprites which should normally be drawn last. This could be fixed by a new sprite category or a boolean attribute similar to `static`.
Pull-Request: #2395
Reviewed-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Tue, 28 Mar 2017 04:16:02 +0000 (00:16 -0400)]
intrepreter: Fix the documentation of `PrimitiveInstance`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 28 Mar 2017 04:14:30 +0000 (00:14 -0400)]
intrepreter: Fix the documentation of `Instance::is_true`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Alexis Laferrière [Fri, 24 Mar 2017 00:26:04 +0000 (20:26 -0400)]
gamnit: make SpriteSet behave more like a Set
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 27 Mar 2017 13:13:56 +0000 (09:13 -0400)]
Merge: mdoc_or_fallback: Refactor
Centralize its definition and update its documentation.
Pull-Request: #2231
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean-Christophe Beaupré [Fri, 24 Mar 2017 04:42:41 +0000 (00:42 -0400)]
model: Make the `anchor` parameter of `MType::anchor_to` nullable
Refactor the code of `TypeVisitor::anchor_to`.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Sun, 26 Mar 2017 02:43:13 +0000 (22:43 -0400)]
model: Add a constant for the bottom type
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 24 Mar 2017 04:39:52 +0000 (00:39 -0400)]
model: Add precision to the documentation of type metrics
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 24 Mar 2017 04:37:11 +0000 (00:37 -0400)]
model: Fix indentation
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Sat, 25 Mar 2017 02:45:14 +0000 (22:45 -0400)]
java_compiler: Fix the documentation of `is_java_primitive`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Sat, 25 Mar 2017 02:44:44 +0000 (22:44 -0400)]
compiler: Merge `maybenull` and `maybe_null`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Fri, 24 Mar 2017 16:09:58 +0000 (12:09 -0400)]
Merge: hash_collections: Fix the documentation of `Set::new`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #2393
Alexis Laferrière [Thu, 23 Mar 2017 21:15:11 +0000 (17:15 -0400)]
nitunit: intrude import modules to test private entities
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 17 Mar 2017 02:42:38 +0000 (22:42 -0400)]
gamnit: intro a template project for 2D games
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 17 Mar 2017 02:40:50 +0000 (22:40 -0400)]
gamnit: fix standalone triangle
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 23 Mar 2017 17:40:17 +0000 (13:40 -0400)]
action_nitro: update for the improved flat API and for a better look
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 10 Mar 2017 14:50:24 +0000 (09:50 -0500)]
action_nitro: bug fix
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 23 Mar 2017 16:59:40 +0000 (12:59 -0400)]
gamnit: intro color services to `Sprite`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 20 Mar 2017 15:32:02 +0000 (11:32 -0400)]
gamnit: rewrite implementation to use VBOs
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 17 Mar 2017 01:40:48 +0000 (21:40 -0400)]
c & matrix: make some services public for low level clients
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 16 Mar 2017 03:50:32 +0000 (23:50 -0400)]
glesv2: add integer variants to operations on buffers
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 20 Mar 2017 15:35:40 +0000 (11:35 -0400)]
glesv2: intro buffer services
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 6 Mar 2017 19:41:54 +0000 (14:41 -0500)]
gamnit: time the performance of the core services
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 19 Mar 2017 22:42:19 +0000 (18:42 -0400)]
core: implement `MinHeap::clear` and intro `Pointer::nul`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean-Christophe Beaupré [Wed, 22 Mar 2017 20:34:56 +0000 (16:34 -0400)]
hash_collections: Fix the documentation of `Set::new`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Mon, 22 Aug 2016 20:36:19 +0000 (16:36 -0400)]
model: Document base cases of `mdoc_or_fallback`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Thu, 14 Jul 2016 17:05:52 +0000 (13:05 -0400)]
mdoc: Fix documentation of `mdoc_or_fallback`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Mon, 22 Aug 2016 20:35:02 +0000 (16:35 -0400)]
highlight: Use `mdoc_or_fallback`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Mon, 22 Aug 2016 20:25:23 +0000 (16:25 -0400)]
model: Promote definitions of `mdoc_or_fallback`
Merge duplicates.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Wed, 22 Mar 2017 12:50:22 +0000 (08:50 -0400)]
Merge: oot: add Devil's Avocados, a Recipe Preparation Game
Pull-Request: #2392
Jean Privat [Mon, 20 Mar 2017 20:11:28 +0000 (16:11 -0400)]
oot: add Devil's Avocados, a Recipe Preparation Game
Signed-off-by: Jean Privat <jean@pryen.org>