nit.git
8 years agomodel: add `MEntity::is_broken`
Jean Privat [Tue, 6 Oct 2015 19:00:21 +0000 (15:00 -0400)]
model: add `MEntity::is_broken`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitc: print errors if all modules are invalid
Jean Privat [Tue, 6 Oct 2015 18:52:36 +0000 (14:52 -0400)]
nitc: print errors if all modules are invalid

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agosemantize: set and use `ANode::is_broken`
Jean Privat [Tue, 6 Oct 2015 18:37:09 +0000 (14:37 -0400)]
semantize: set and use `ANode::is_broken`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agomodelbuilder: add `ANode::is_broken`
Jean Privat [Tue, 6 Oct 2015 15:53:32 +0000 (11:53 -0400)]
modelbuilder: add `ANode::is_broken`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agomodel: make `MPropDef::is_intro` more robust
Jean Privat [Tue, 6 Oct 2015 15:50:59 +0000 (11:50 -0400)]
model: make `MPropDef::is_intro` more robust

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Beef up OrderedTree API
Jean Privat [Wed, 23 Sep 2015 18:20:22 +0000 (14:20 -0400)]
Merge: Beef up OrderedTree API

This add services to the class OrderedTree

Pull-Request: #1732
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoMerge: Geometry
Jean Privat [Wed, 23 Sep 2015 18:20:19 +0000 (14:20 -0400)]
Merge: Geometry

Adds a README for the geometry package.
Also adds an abstraction for polygons and an algorithm to triangulate them

Pull-Request: #1731
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agolib/ordered_tree: add `parent`, `has` and `length`
Jean Privat [Wed, 23 Sep 2015 01:23:43 +0000 (21:23 -0400)]
lib/ordered_tree: add `parent`, `has` and `length`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/ordered_tree: add `==`, `hash` and `clone`
Jean Privat [Tue, 22 Sep 2015 14:22:30 +0000 (10:22 -0400)]
lib/ordered_tree: add `==`, `hash` and `clone`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: new game: memory
Jean Privat [Tue, 22 Sep 2015 19:41:37 +0000 (15:41 -0400)]
Merge: new game: memory

The code is good enough and the game complete enough I think.

Pull-Request: #1730
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Migration from ascii to code_point
Jean Privat [Tue, 22 Sep 2015 19:41:29 +0000 (15:41 -0400)]
Merge: Migration from ascii to code_point

As complement to #1262 and #1718, this PR solves part of both issues.

One does the migration from `ascii` to `code_point` since Unicode is a bit more than ASCII, let's try to use the right vocabulary when dealing with it.

The `ascii` service is however kept alive, but its contract is changed from Int to Byte to be used directly on a `Char` without the need to have the old `'c'.ascii.to_b`, now a simple `'c'.ascii` will do the exact same.

A further PR will be submitted later to prevent the use of `ascii` on non-ASCII literal characters.

Pull-Request: #1726
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: nitc: fix some broken case in equal_test
Jean Privat [Tue, 22 Sep 2015 19:41:23 +0000 (15:41 -0400)]
Merge: nitc: fix some broken case in equal_test

The code that handle the various cases of comparison when one of the two types is primitive was broken in the specific sub-case of comparison between something tagged and something boxed.
The fact that this code date back from before tagging explain that, but the fact that the bug was discovered only now is more mysterious.

Reported-by: Lucas Bajolet <r4pass@hotmail.com>

Pull-Request: #1729
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agocontrib: add memory, the game with shapes and colors
Jean Privat [Tue, 22 Sep 2015 19:17:42 +0000 (15:17 -0400)]
contrib: add memory, the game with shapes and colors

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/ordered_tree: add and used `add_all`
Jean Privat [Tue, 22 Sep 2015 14:21:57 +0000 (10:21 -0400)]
lib/ordered_tree: add and used `add_all`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agogeometry/polygon: adds polygon triangulation + polygon abstraction
BlackMinou [Mon, 21 Sep 2015 03:24:47 +0000 (05:24 +0200)]
geometry/polygon: adds polygon triangulation + polygon abstraction

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agolib: Update libs to use correctly ascii and code_point
Lucas Bajolet [Mon, 21 Sep 2015 20:26:07 +0000 (16:26 -0400)]
lib: Update libs to use correctly ascii and code_point

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agolib/core: fix nitunit that should have failed earlier because of bad ==
Jean Privat [Mon, 21 Sep 2015 19:36:44 +0000 (15:36 -0400)]
lib/core: fix nitunit that should have failed earlier because of bad ==

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocore/math: add basic Bézier interpolations on Float
Jean Privat [Mon, 21 Sep 2015 19:22:14 +0000 (15:22 -0400)]
core/math: add basic Bézier interpolations on Float

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: add base_eq_int4*.nit for more combination of test cases
Jean Privat [Mon, 21 Sep 2015 17:57:39 +0000 (13:57 -0400)]
tests: add base_eq_int4*.nit for more combination of test cases

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agosepcomp: rewrote, fix and document `equal_test` in the c_primitive case
Jean Privat [Mon, 21 Sep 2015 17:52:42 +0000 (13:52 -0400)]
sepcomp: rewrote, fix and document `equal_test` in the c_primitive case

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agosepcomp: fix potential tagging issue in `is_same_type_test`
Jean Privat [Mon, 21 Sep 2015 17:51:37 +0000 (13:51 -0400)]
sepcomp: fix potential tagging issue in `is_same_type_test`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agosepcomp: add `MType::tag_value`
Jean Privat [Mon, 21 Sep 2015 17:34:59 +0000 (13:34 -0400)]
sepcomp: add `MType::tag_value`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib: Changes in the way ascii is coded and its semantics.
Lucas Bajolet [Wed, 16 Sep 2015 17:55:08 +0000 (13:55 -0400)]
lib: Changes in the way ascii is coded and its semantics.

Old ascii method is replaced by code_point, which returns the Unicode code-point value of a Char

ascii now returns a byte and requires a <= 127 code_point to work properly

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agolib/core: Fix bug in StringByteView, misuse of `String::length`
Lucas Bajolet [Mon, 21 Sep 2015 17:07:49 +0000 (13:07 -0400)]
lib/core: Fix bug in StringByteView, misuse of `String::length`

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agogeometry: Adds a README
BlackMinou [Tue, 15 Sep 2015 07:13:36 +0000 (09:13 +0200)]
geometry: Adds a README

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoMerge: Extends catalog with a *try it* and a *download apk* links
Jean Privat [Wed, 16 Sep 2015 17:11:55 +0000 (13:11 -0400)]
Merge: Extends catalog with a *try it* and a *download apk* links

Two new package metadata are added

* `upstream.tryit` for an URL that points to a demo version or a live version of the main web service offered by the package.
* `upstream.apk` for an URL that points to a dry `apk`, or an install page on some store, for the main android application offered by the package.

Moreover, packages that have one them will be respectively tagged `tryit` and `apk`

A demo is available: http://info.uqam.ca/~privat/catalog/#tag_tryit and http://info.uqam.ca/~privat/catalog/#tag_apk

Pull-Request: #1724
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agoMerge: Some improvement of benchmarks
Jean Privat [Wed, 16 Sep 2015 17:11:54 +0000 (13:11 -0400)]
Merge: Some improvement of benchmarks

Some work in the benchmarks directory. The most important stuff is some `make check` to test the brokenness of specific benches.

Pull-Request: #1723
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agoMerge: Prepare FDroid deployment
Jean Privat [Wed, 16 Sep 2015 17:11:52 +0000 (13:11 -0400)]
Merge: Prepare FDroid deployment

Finish the job of #1710 by adding missing `make android-release`, F-Droid metadata and simplifying the check_contrib script.

ping @xymus for review

Pull-Request: #1722
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: android/audio: fix multiple music playing when pausing app
Jean Privat [Wed, 16 Sep 2015 17:11:50 +0000 (13:11 -0400)]
Merge: android/audio: fix multiple music playing when pausing app

Asked by @privat because friendz's app played multiple musics when pausing/resuming the app

Pull-Request: #1721
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: Friendz: save states
Jean Privat [Wed, 16 Sep 2015 17:11:47 +0000 (13:11 -0400)]
Merge: Friendz: save states

Save the state of the sound and the levels in the data store.

If you leave a level and come back, your grid in the level is no more lost

Pull-Request: #1715
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agomoles: cleanup Makefile
Jean Privat [Wed, 16 Sep 2015 13:54:21 +0000 (09:54 -0400)]
moles: cleanup Makefile

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocheck_contrib: only make given targets.
Jean Privat [Wed, 16 Sep 2015 13:09:44 +0000 (09:09 -0400)]
check_contrib: only make given targets.

So this avoid doing a full desktop build only when a specific build is required (eg. android-release)

A special case is made for `all` that falls back as the default,

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocontrib: add some missing FDroid metadate files
Jean Privat [Tue, 15 Sep 2015 18:38:25 +0000 (14:38 -0400)]
contrib: add some missing FDroid metadate files

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocalculator: add FDroid apk description
Jean Privat [Tue, 15 Sep 2015 18:25:29 +0000 (14:25 -0400)]
calculator: add FDroid apk description

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocalculator: clean Makefile and add `android` and `android-release`
Jean Privat [Tue, 15 Sep 2015 18:24:10 +0000 (14:24 -0400)]
calculator: clean Makefile and add `android` and `android-release`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobenckmarks: git-ignore directories `logs` and `nit_compile`
Jean Privat [Wed, 16 Sep 2015 01:17:52 +0000 (21:17 -0400)]
benckmarks: git-ignore directories `logs` and `nit_compile`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocontrib: add `upstream.apk` to packages that have an apk
Jean Privat [Wed, 16 Sep 2015 01:04:37 +0000 (21:04 -0400)]
contrib: add `upstream.apk` to packages that have an apk

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcatalog: new package metadata `upstream.apk`
Jean Privat [Wed, 16 Sep 2015 01:03:47 +0000 (21:03 -0400)]
nitcatalog: new package metadata `upstream.apk`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocontrib: add `upstream.tryit` to packages that have a online service
Jean Privat [Wed, 16 Sep 2015 01:03:16 +0000 (21:03 -0400)]
contrib: add `upstream.tryit` to packages that have a online service

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcatalog: new package metadata `upstream.tryit`
Jean Privat [Wed, 16 Sep 2015 01:01:43 +0000 (21:01 -0400)]
nitcatalog: new package metadata `upstream.tryit`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcatalog: refactor tags collection
Jean Privat [Wed, 16 Sep 2015 01:00:34 +0000 (21:00 -0400)]
nitcatalog: refactor tags collection

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobenchmarks/strings: add `make check`
Jean Privat [Tue, 15 Sep 2015 20:53:24 +0000 (16:53 -0400)]
benchmarks/strings: add `make check`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobenchmarks/strings: continue in case of error
Jean Privat [Tue, 15 Sep 2015 20:53:06 +0000 (16:53 -0400)]
benchmarks/strings: continue in case of error

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobenchmarks/markdown: generate an html file
Jean Privat [Tue, 15 Sep 2015 20:16:14 +0000 (16:16 -0400)]
benchmarks/markdown: generate an html file

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobenchmarks/polygons: check failures at the end of the script
Jean Privat [Tue, 15 Sep 2015 20:06:27 +0000 (16:06 -0400)]
benchmarks/polygons: check failures at the end of the script

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobenchmarks: factorize the `die()` function into `bench_common.sh`
Jean Privat [Tue, 15 Sep 2015 20:02:47 +0000 (16:02 -0400)]
benchmarks: factorize the `die()` function into `bench_common.sh`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobenchmarks/polygons: add make check
Jean Privat [Tue, 15 Sep 2015 13:20:44 +0000 (09:20 -0400)]
benchmarks/polygons: add make check

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobenchmarks/markdown: add a `make check` rule
Jean Privat [Mon, 14 Sep 2015 20:49:18 +0000 (16:49 -0400)]
benchmarks/markdown: add a `make check` rule

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobenchmarks/markdown: make `$s` configurable
Jean Privat [Mon, 14 Sep 2015 20:34:02 +0000 (16:34 -0400)]
benchmarks/markdown: make `$s` configurable

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobenchmarks: add a Makefile
Jean Privat [Mon, 14 Sep 2015 20:28:54 +0000 (16:28 -0400)]
benchmarks: add a Makefile

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobench_engines: add test for misc options
Jean Privat [Mon, 14 Sep 2015 20:26:28 +0000 (16:26 -0400)]
bench_engines: add test for misc options

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: lib: intro the matrix package
Jean Privat [Tue, 15 Sep 2015 19:18:44 +0000 (15:18 -0400)]
Merge: lib: intro the matrix package

This PR intro `Matrix` to represent a matrix of floats. The main module offers only general services and the `projection` module adds services useful for 3D manipulations.

The package is oriented towards matrices of floats and was designed alongside Gamnit. As such, is a bit specialized and may not be appropriate for all usage of matrices (such as integer matrices). So if you prefer, I can move these back to Gamnit. But since this module does not have any dependencies and `Matrix` can be useful for a wide array of context, I chose to leave it in lib.

Pull-Request: #1719
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: vim plugin: intro NitExecute to interpret the current file with `nit`
Jean Privat [Tue, 15 Sep 2015 19:18:41 +0000 (15:18 -0400)]
Merge: vim plugin: intro NitExecute to interpret the current file with `nit`

Adds the `:NitExecute` command (or `:NitE` as shortcut) to interpret the current file with `nit`.

This is very similar to the manual `:!nit %` but it saves modified buffers to a temp file to execute the content of the current buffer and not the last saved content.

This is completely up to you but I recommend mapping this to `ctrl-f` to fit between `ctrl-d -> Nitdoc` and `ctrl-g -> NitGitGrep`. Here are the required lines for `.vimrc`:

~~~
" Map the Nitdoc command to Ctrl-D
map <C-d> :Nitdoc<enter>

" Map the NitGitGrep function to Ctrl-G
map <C-g> :call NitGitGrep()<enter>

" Map the NitExecute function to Ctrl-F <------- The new one
map <C-f> :NitExecute<enter>
~~~

Pull-Request: #1717
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: nitcatalog: isolate package page into a subdirectory
Jean Privat [Tue, 15 Sep 2015 19:18:38 +0000 (15:18 -0400)]
Merge: nitcatalog: isolate package page into a subdirectory

HTML files are generated into a `/p/` subdirectory so they will not conflict with other generated files.

One other point is to have stable and final URL for packages in the catalog. eg http://nitlanguage.org/catalog/p/nitiwiki.html

Pull-Request: #1714
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agolib/matrix: intro `Matrix::to_a & transposed`
Alexis Laferrière [Tue, 15 Sep 2015 17:17:17 +0000 (13:17 -0400)]
lib/matrix: intro `Matrix::to_a & transposed`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/matrix: add services for projection Matrix and 3D coord manipulation
Alexis Laferrière [Tue, 15 Sep 2015 14:40:12 +0000 (10:40 -0400)]
lib/matrix: add services for projection Matrix and 3D coord manipulation

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/matrix: intro Matrix with general services
Alexis Laferrière [Sun, 19 Apr 2015 14:59:11 +0000 (10:59 -0400)]
lib/matrix: intro Matrix with general services

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Bytes from hexdigest
Jean Privat [Tue, 15 Sep 2015 16:59:10 +0000 (12:59 -0400)]
Merge: Bytes from hexdigest

As @xymus requested in #1705, a new method is available in Text, `hexdigest_to_bytes` which transforms a regular hexdigest in its Bytes counterpart.

Ping @ppepos this could please your Pythonneous eyes

Pull-Request: #1716
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Clean UTF-8 string update
Jean Privat [Tue, 15 Sep 2015 16:57:16 +0000 (12:57 -0400)]
Merge: Clean UTF-8 string update

Since quite some time now we've had the cleaning function for Bytes that ensured that what was coming from the exterior was clean and could be transformed safely to a String.

This is now generalized to any NativeString, and the clean function will be called each time a NativeString is `to_s`'d

At the same time, `clean_utf8` is now better performing (for `Files::read_all`, Ir per call is roughly 40% less than before), which limits the impacts of the new strategy.

Furthermore, the string produced by `NativeString::clean_utf8` has its length calculated which saves time on later operations on the string.

It also limits the number of calls by avoiding allocations if not necessary (if the string is already clean, which should happen a lot more often than not).

As for performances,

Valgrind `./bin/nitc src/nitc.nit`:
Before: 14.040 GIr
After: 13.859 GIr

Time, best of 10 for `./bin/nitc src/nitc.nit -o bin/nitc`:
Before: 0m4.989s
After: 0m4.933s

Time, best of 10 for `./bin/nitc --semi-global src/nitc.nit -o bin/nitc`:
Before: 0m4.696s
After: 0m4.691s

Pretty much equivalent in real time, and a bit better in Valgrind, not bad considering every String is now cleaner than ever !

Pull-Request: #1705
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib: Update sha1 and base64 to use Bytes instead of String
Lucas Bajolet [Mon, 14 Sep 2015 15:13:24 +0000 (11:13 -0400)]
lib: Update sha1 and base64 to use Bytes instead of String

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agolib/core: Fixed bug in `BytesIterator::init with_buffer`
Lucas Bajolet [Tue, 15 Sep 2015 14:19:00 +0000 (10:19 -0400)]
lib/core: Fixed bug in `BytesIterator::init with_buffer`

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agolib/core: Added hexdigest_to_bytes method from String to Bytes
Lucas Bajolet [Tue, 15 Sep 2015 14:26:00 +0000 (10:26 -0400)]
lib/core: Added hexdigest_to_bytes method from String to Bytes

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agolib/core: Added validation method for hexdigest
Lucas Bajolet [Tue, 15 Sep 2015 14:25:25 +0000 (10:25 -0400)]
lib/core: Added validation method for hexdigest

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agomisc/vim: intro NitExecute to interpret the current file with `nit`
Alexis Laferrière [Tue, 15 Sep 2015 12:45:11 +0000 (08:45 -0400)]
misc/vim: intro NitExecute to interpret the current file with `nit`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Prepare Android projects to be compiled in release mode for F-Droid
Jean Privat [Tue, 15 Sep 2015 13:27:16 +0000 (09:27 -0400)]
Merge: Prepare Android projects to be compiled in release mode for F-Droid

This PR prepares the Android projects to be compiled in release mode by Jenkins (or a cron) for F-Droid. It adds the `android-release` rule to all Android projects and it vectorizes the fonts in the logos to get the desired result when the font is not installed.

At this point, the release APK file is written over the debug one, this should not be such a big problem as we usually use both separately.

@privat To prepare to compile in release mode on the server you can follow the instructions at the end of http://nitlanguage.org/catalog/android.html , it's pretty much a single command to generate a keystore. We'll have to find a way to manage the key to the keystore... For the TSA server, we could use http://tsa.safecreative.org/ but it's limited to 5 timestamps per days so we would need to choose our requests.

Pull-Request: #1710
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agocontrib & examples: add the android-release rule to all android projects
Alexis Laferrière [Mon, 14 Sep 2015 12:51:38 +0000 (08:51 -0400)]
contrib & examples: add the android-release rule to all android projects

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/tinks: add the rules android and android-release
Alexis Laferrière [Mon, 14 Sep 2015 13:03:23 +0000 (09:03 -0400)]
contrib/tinks: add the rules android and android-release

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agofriendz: fix grid deserialization
Jean Privat [Tue, 15 Sep 2015 08:57:02 +0000 (04:57 -0400)]
friendz: fix grid deserialization

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agofriendz: do not load level twice
Jean Privat [Tue, 15 Sep 2015 08:42:45 +0000 (04:42 -0400)]
friendz: do not load level twice

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agofriendz: save level on level change and game quit
Jean Privat [Tue, 15 Sep 2015 08:41:59 +0000 (04:41 -0400)]
friendz: save level on level change and game quit

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agofriendz: save and restore playing grids
Jean Privat [Tue, 15 Sep 2015 08:40:49 +0000 (04:40 -0400)]
friendz: save and restore playing grids

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agofriendz: grid save also non-metal tiles
Jean Privat [Tue, 15 Sep 2015 02:53:28 +0000 (22:53 -0400)]
friendz: grid save also non-metal tiles

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agofriendz: set status on key commands
Jean Privat [Tue, 15 Sep 2015 02:20:47 +0000 (22:20 -0400)]
friendz: set status on key commands

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agofriendz: activate cheat mode
Jean Privat [Tue, 15 Sep 2015 02:09:51 +0000 (22:09 -0400)]
friendz: activate cheat mode

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agofriendz: remove old coockies code
Jean Privat [Tue, 15 Sep 2015 02:03:06 +0000 (22:03 -0400)]
friendz: remove old coockies code

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agofriendz: save and restore music+sfx mute state
Jean Privat [Tue, 15 Sep 2015 01:54:02 +0000 (21:54 -0400)]
friendz: save and restore music+sfx mute state

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: nitc: fix --typing-test-metrics by using correct tags in FFI
Jean Privat [Tue, 15 Sep 2015 07:37:01 +0000 (03:37 -0400)]
Merge: nitc: fix --typing-test-metrics by using correct tags in FFI

Just fix `--typing-test-metrics` that was broken.

A future PR (still wip) will ensure that the option will be no more broken

Pull-Request: #1713
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoandroid/audio: doesn't resume sounds paused by the user anymore
BlackMinou [Tue, 15 Sep 2015 04:20:44 +0000 (06:20 +0200)]
android/audio: doesn't resume sounds paused by the user anymore

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoandroid/audio: fix multiple music playing when pausing app
BlackMinou [Mon, 14 Sep 2015 08:02:25 +0000 (10:02 +0200)]
android/audio: fix multiple music playing when pausing app

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoMerge: gamnit: portable services to setup an OpenGL ES 2.0 display
Jean Privat [Tue, 15 Sep 2015 03:08:47 +0000 (23:08 -0400)]
Merge: gamnit: portable services to setup an OpenGL ES 2.0 display

Intro portable services to setup and use an OpenGL ES 2.0 display: `GamnitDisplay, setup, close, flip`. These services can be used standalone when importing `gamnit::display`, or integrated in `app.nit` by importing the whole `gamnit`.

This is an important step for Gamnit as it allows to develop portable games and will simplify building new graphic APIs gradually. However, some very useful services are still missing: textures loading, input events, full app life-cycle support (pause/resume), etc.

The display still depends on the same libraries as mnit (sdl, egl, native_app_glue, etc.), but it is much cleaner and changing the libs should be easier.

You may notice that the examples duplicate a lot of code between themselves and with `lib/glesv2/examples/opengles2_hello_triangle.nit`. All 3 examples are very useful to understand and debug the different abstraction levels, and even if they are pretty long, they are pretty much the shortest possible OpenGL ES 2.0 program I could write. I plan on keeping this duplication to keep these debugging tool, but I may move one of them (standalone) to a test folder as to not attract unwanted attention to it.

The first 3 commits are from #1708 but they are each required by either the examples or the Android support.

Pull-Request: #1709
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge branch 'master' into gamnit
Alexis Laferrière [Tue, 15 Sep 2015 01:39:01 +0000 (21:39 -0400)]
Merge branch 'master' into gamnit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agofriendz: rename `par` as `gold` as is it more clear that it higer is better
Jean Privat [Tue, 15 Sep 2015 01:35:05 +0000 (21:35 -0400)]
friendz: rename `par` as `gold` as is it more clear that it higer is better

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcatalog: isolate package page into a subdirectory
Jean Privat [Tue, 15 Sep 2015 01:05:25 +0000 (21:05 -0400)]
nitcatalog: isolate package page into a subdirectory

So they will not conflict with other generated files

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitc: fix --typing-test-metrics by using correct tags inf FFI
Jean Privat [Tue, 15 Sep 2015 00:01:33 +0000 (20:01 -0400)]
nitc: fix --typing-test-metrics by using correct tags inf FFI

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: android: skip signing the APK if KEY_ALIAS env var is not set
Jean Privat [Mon, 14 Sep 2015 20:23:05 +0000 (16:23 -0400)]
Merge: android: skip signing the APK if KEY_ALIAS env var is not set

This allows to manually sign your release APK file.

As requested by @privat.

Pull-Request: #1712
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: glesv2: more services from OpenGL ES 2.0 to prepare for gamnit
Jean Privat [Mon, 14 Sep 2015 20:23:01 +0000 (16:23 -0400)]
Merge: glesv2: more services from OpenGL ES 2.0 to prepare for gamnit

This PR adds a few services to the low-level graphics modules to prepare for gamnit.

This is the 2nd PR to use a new style for the glesv2 module. The old code has not yet been fully updated, so the style may vary in the same module. The new style try to stay as close as possible to the names and signatures used by the OpenGL ES 2.0 C API and by webgl.

As usual with this module, for more documentation please refer to the official doc at https://www.khronos.org/opengles/sdk/docs/man/.

Pull-Request: #1708
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: Fix Music loading bug for friendz
Jean Privat [Mon, 14 Sep 2015 20:22:55 +0000 (16:22 -0400)]
Merge: Fix Music loading bug for friendz

Added "music.ogg" to the res folder, android is aparently not able to load a .ogg from the assets.
I will investigate on the problem for a next PR

Pull-Request: #1707
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agobench_engines: fix descriptions in `bench_nitc_options`
Jean Privat [Mon, 14 Sep 2015 18:53:12 +0000 (14:53 -0400)]
bench_engines: fix descriptions in `bench_nitc_options`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobench_engines: add some missing options
Jean Privat [Mon, 14 Sep 2015 18:52:52 +0000 (14:52 -0400)]
bench_engines: add some missing options

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agobench_engines: always generate an html file
Jean Privat [Mon, 14 Sep 2015 18:51:59 +0000 (14:51 -0400)]
bench_engines: always generate an html file

There is no reason to not generate it since a lot of thing is already generated.

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: OS X ignores test using EGL
Alexis Laferrière [Mon, 14 Sep 2015 15:24:39 +0000 (11:24 -0400)]
tests: OS X ignores test using EGL

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/glesv2: intro glVertexAttribPointer
Alexis Laferrière [Sat, 12 Sep 2015 15:49:21 +0000 (11:49 -0400)]
lib/glesv2: intro glVertexAttribPointer

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/glesv2: intro glVertexAttrib*f and glUniform*i
Alexis Laferrière [Sat, 12 Sep 2015 15:49:03 +0000 (11:49 -0400)]
lib/glesv2: intro glVertexAttrib*f and glUniform*i

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/glesv2: move some services out of `VertexArray` as per the new style
Alexis Laferrière [Sat, 12 Sep 2015 14:30:25 +0000 (10:30 -0400)]
lib/glesv2: move some services out of `VertexArray` as per the new style

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/glesv2: update GLTextureTarget to the new contructor-less style
Alexis Laferrière [Sat, 12 Sep 2015 14:17:03 +0000 (10:17 -0400)]
lib/glesv2: update GLTextureTarget to the new contructor-less style

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/glesv2: intro glTexImage2D
Alexis Laferrière [Sat, 12 Sep 2015 14:14:20 +0000 (10:14 -0400)]
lib/glesv2: intro glTexImage2D

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/glesv2: intro glFramebufferTexture2D
Alexis Laferrière [Sat, 12 Sep 2015 14:01:00 +0000 (10:01 -0400)]
lib/glesv2: intro glFramebufferTexture2D

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/glesv2: intro glPixelStorei
Alexis Laferrière [Sat, 12 Sep 2015 13:59:26 +0000 (09:59 -0400)]
lib/glesv2: intro glPixelStorei

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/glesv2: intro glRenderbufferStorage
Alexis Laferrière [Sat, 12 Sep 2015 13:41:15 +0000 (09:41 -0400)]
lib/glesv2: intro glRenderbufferStorage

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/glesv2: intro glBindBuffer
Alexis Laferrière [Sat, 12 Sep 2015 13:33:30 +0000 (09:33 -0400)]
lib/glesv2: intro glBindBuffer

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>