summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Add tile map example.David Thompson2018-01-295-1/+135
| | | | | | | | * examples/images/tiles.png: New file. * examples/map/example.tmx: New file. * examples/tiled.scm: New file. * Makefile.am (EXTRA_DIST): Add them. * examples/images/AUTHORS: Credit the author of the tileset.
* render: Add Tiled map renderer.David Thompson2018-01-293-0/+472
| | | | | | * chickadee/render/tiled.scm: New file. * Makefile.am (SOURCES): Add it. * doc/api.texi (Tile Maps): New subsection.
* render: texture: Define custom record type printer for texture atlas.David Thompson2018-01-291-0/+8
| | | | * chickadee/render/texture.scm (display-texture): New procedure.
* guix: Switch back to Guile 2.2.2.David Thompson2018-01-291-3/+3
| | | | 2.2.3 has a bad performance regression. :(
* window: Display warning when vsync is not supported.David Thompson2018-01-271-1/+7
| | | | | | | | | A lot better than crashing, I'd say. :) Reported-By: Christopher Howard <christopher.howard@qlfiles.net> * chickadee/window.scm (open-window): Catch errors thrown by set-gl-swap-interval! and emit warning.
* math: matrix: Fix typos in matrix4-2d-transform!David Thompson2018-01-171-2/+2
| | | | * chickadee/math/matrix.scm (matrix4-2d-transform!): Fix bad typos!
* render: texture: Keep a rect for use with draw-sprite and friends.David Thompson2018-01-172-27/+34
| | | | | | | | | | Easier to calculate it once and hang onto it than to generate it each time draw-sprite is called. * chickadee/render/texture.scm (<texture>)[rect]: Delete field. [x y width height gl-tex-rect]: New fields. * chickadee/render/sprite.scm (draw-sprite*, draw-sprite, draw-nine-patch*): Use proper accessors for texture rects.
* render: font: Fix typo.David Thompson2018-01-171-1/+1
| | | | | * chickadee/render/font.scm (%null-vec): Rename to... (%null-vec2): ...this.
* render: sprite: Fix bug in rendering texture regions.David Thompson2018-01-171-3/+9
| | | | | | | | | | The texture-rect procedure contains the pixel location of the texture region, so if you use that rect to render a sprite the result is a sprite offset by its location in the greater texture, which is very very very wrong. * chickadee/render/sprite.scm (draw-sprite): Dynamically configure rendering rect based on the texture region's width and height.
* render: texture: Fix split-texture.David Thompson2018-01-171-2/+2
| | | | | * chickadee/render/texture.scm (split-texture): Width and height variables need to contain exact numbers.
* Revert "Add error handling to game loop."David Thompson2018-01-171-73/+65
| | | | This reverts commit 8cbb7eed56c4b5edd780c2d51aaa0a4c3eab7350.
* render: Refactor sprite rendering.David Thompson2018-01-174-245/+228
| | | | | | | | | | | | | | | | | | | * chickadee/render/texture.scm (<texture-region>): Delete type. (<texture>)[width, height, gl-size]: Delete fields. [parent, rect, gl-rect]: Add fields. (texture-region?): Rewrite. (make-texture, null-texture): Use new texture constructor. (make-texture-region): Rewrite in terms of <texture> type. (list->texture-atlas, split-texture): Use new texture region constructor. * chickadee/render/sprite.scm (draw-sprite*): New procedure. (draw-sprite): Rewrite in terms of draw-sprite*. (draw-nine-patch*): New procedure. (draw-nine-patch): Rewrite in terms of draw-nine-patch*. * chickadee/render/font.scm (draw-text*): New procedure. (draw-text): Rewrite in terms of draw-text*. * doc/api.texi: Update draw-sprite, draw-nine-patch, and draw-text docs.
* math: matrix: Add matrix4-2d-transform! procedure.David Thompson2018-01-171-0/+42
| | | | * chickadee/math/matrix.scm (matrix4-2d-transform): New procedure.
* Add error handling to game loop.David Thompson2018-01-121-65/+73
| | | | | | * chickadee.scm (error-handler): New procedure. (with-error-handling): New syntax. (run-game): Handle errors caught when running hooks.
* Fix broken mouse Y coordinate inversion.David Thompson2018-01-091-1/+1
| | | | * chickadee.scm (run-game): window-height is not a procedure!
* audio: Use values between 0 and 1 for volume.David Thompson2018-01-091-9/+12
| | | | | | | Hide the weird SDL usage of 0 to 128. * chickadee/audio.scm (set-sample-volume!, music-volume, set-music-volume!): Translate to/from SDL's volume range.
* render: shapes: Add draw-filled-rect procedure.David Thompson2018-01-081-2/+74
| | | | * chickadee/render/shapes.scm (draw-filled-rect): New procedure.
* render: color: Add color-lerp procedure.David Thompson2018-01-081-2/+5
| | | | * chickadee/render/color.scm (color-lerp): New procedure.
* render: sprite: Allow passing custom transformation matrices.David Thompson2018-01-052-129/+180
| | | | | | | | | | | | | | * chickadee/render/sprite.scm (draw-sprite-unbatched, draw-sprite-batched): Replace 'scale' and 'rotation' arguments with a 'matrix' argument. (sprite-batch-add!): Ditto. Also, correctly transform sprite vertices. This was previously not handling rotations properly. (%default-offset): New variable. (draw-sprite, draw-nine-patch): Change default values for 'rotation' and 'scale'. Add 'matrix' and 'offset' arguments. * chickadee/render/font.scm (%default-offset): New variable. (draw-text): Change default values for 'rotation' and 'scale'. Add 'offset' and 'matrix' arguments.
* Fix inverted Y coordinates in mouse events.David Thompson2018-01-051-3/+7
| | | | * chickadee.scm (run-game): Invert all Y coordinates received from SDL.
* math: matrix: Allow translation by rect as if it were a vector.David Thompson2018-01-051-0/+7
| | | | * chickadee/math/matrix.scm (matrix4-translate!): Add rect support.
* guix: Use Guile 2.2.3.David Thompson2018-01-051-3/+3
|
* window: Remove problematic GL attribute.David Thompson2017-11-141-1/+0
| | | | | | | | I found that the 'framebuffer-srgb-capable' setting does not work with Mesa 17.2.1. Best to just get rid of it. * chickadee/window.scm (open-window): Remove setting for 'framebuffer-srgb-capable'.
* math: matrix: Allow translation with 3D vectors.David Thompson2017-11-121-5/+13
| | | | | * chickadee/math/matrix.scm (matrix4-translate!): Add support for the vec3 type.
* math: vector: Export vec3-z.David Thompson2017-11-121-0/+1
|
* math: quaternion: Add custom record type printer.David Thompson2017-11-121-0/+11
| | | | * chickadee/math/quaternion.scm (display-quaternion): New procedure.
* math: quaternion: Stop referncing inline procedure before it's defined.David Thompson2017-11-121-1/+2
| | | | | * chickadee/math/quaternion.scm (with-new-quaternion): Build quaternion manually instead of using make-null-quaternion.
* math: matrix: Support converting a quaternion into a rotation matrix.David Thompson2017-11-121-0/+32
| | | | | * chickadee/math/matrix.scm (matrix4-rotate!, matrix4-rotate): New procedures.
* render: font: Add support for .fnt formatted fonts.David Thompson2017-11-111-3/+112
| | | | | | * chickadee/render/font.scm (load-font): Check for .xml and .fnt file extensions and DTRT. (parse-fnt, parse-bmfont-sxml): New procedure.
* guix: Update to latest guile-sdl2 commit.David Thompson2017-11-101-2/+2
|
* render: font: Add support for tile fonts.David Thompson2017-11-101-0/+30
| | | | * chickadee/render/font.scm (load-tile-font): New procedure.
* render: font: Simplify implementation with texture regions.David Thompson2017-11-101-20/+13
| | | | | | | * chickadee/render/font.scm (<font-char>) [texture, region]: Remove. [texture-region]: New field. (load-font): Use texture regions. (draw-text): Render using texture regions.
* doc: scripting: Replace references to "wait" with "sleep".David Thompson2017-10-271-4/+4
|
* scripting: agenda: Add reset-agenda procedure.David Thompson2017-10-191-0/+7
| | | | * chickadee/scripting/agenda.scm (reset-agenda): New procedure.
* render: texture: Fix bug in texture region coordinate calculation.David Thompson2017-10-171-1/+1
| | | | | * chickadee/render/texture.scm (make-texture-region): Fix broken texcoord width/height calculation.
* Third time's the charm for a bug fix?David Thompson2017-10-171-2/+1
|
* Fix build bug for real this time.David Thompson2017-10-171-6/+5
|
* render: texture: Fix strange parallel compilation issue.David Thompson2017-10-171-1/+0
| | | | | I have no damn clue why #:select causes this problem, but simply not using it fixes things!
* Add generalized A* path finding algorithm.David Thompson2017-10-172-0/+78
| | | | | * chickadee/path-finding.scm: New file. * Makefile.am (SOURCES): Add it.
* render: sprite: Add support for drawing texture regions.David Thompson2017-10-173-30/+52
| | | | | | | | | | * chickadee/render/sprite.scm (%default-texture-region): Rename to... (%default-texcoords): ...this. (draw-sprite): Replace #:texture-region arg with #:texcoords. Add support for texture regions. Update docstring. (draw-nine-patch): Add support for texture regions. * chickadee/render/font.scm (draw-text): Change #:texture-region to #:texcoords in draw-sprite call.
* render: texture: Use texture regions in texture atlas.David Thompson2017-10-171-5/+6
| | | | | | | * chickadee/render/texture.scm (list->texture-atlas): Create texture regions. Switch from rects to 4-tuples. (texture-atlas, texture-atlas-ref): Update docstring. (split-texture): Create texture regions.
* render: texture: Add private gl-size field.David Thompson2017-10-171-4/+7
| | | | | * chickadee/render/texture.scm (<texture>)[gl-size]: New field. (null-texture, make-texture): Add gl-size argument.
* render: texture: Add texture region data type.David Thompson2017-10-171-0/+35
| | | | * chickadee/render/texture.scm (<texture-region>): New record type.
* render: sprite: Fix sprite batch resizing.David Thompson2017-10-141-8/+11
| | | | | * chickadee/render/sprite.scm (double-sprite-batch-size!): Get reference to bytevectors before unmapping old buffers.
* scripting: Cancelling a script cancels all nested scripts.David Thompson2017-10-141-7/+20
| | | | | | | * chickadee/scripting/script.scm (<script>)[children]: New field. (current-script): New variable. (cancel-script): Cancel all child scripts, too. (spawn-script): Register new script as a child of the current script.
* scripting: Fix bugs in script-running? and script-complete?David Thompson2017-10-141-2/+2
| | | | | * chickadee/scripting/script.scm (script-running?, script-complete?): Test for the correct status instead of 'cancelled'.
* scripting: Rename coroutine to script.David Thompson2017-10-146-150/+148
| | | | | | | | | | * chickadee/scripting/coroutine.scm: Move to... * chickadee/scripting/script.scm: ...here, and s/coroutine/script. * chickadee/scripting/channel.scm (channel-get, channel-put): Update docstring to say "script" instead of "coroutine". * chickadee/scripting.scm: s/coroutine/script/ * Makefile.am (SOURCES): Replace coroutine.scm with script.scm. * doc/api.texi: s/coroutine/script/
* scripting: Rename wait to sleep.David Thompson2017-10-141-4/+7
| | | | | * chickadee/scripting.scm (wait): Rename to... (sleep): ...this.
* scripting: Fix bug where dynamic state wasn't being respected.David Thompson2017-10-142-4/+10
| | | | | | | * chickadee/scripting/coroutine.scm (spawn-coroutine): Save dynamic state during coroutine execution. * chickadee/scripting.scm (wait): Schedule continuation in the coroutine's current agenda.
* math: vector: Fix a couple docstrings.David Thompson2017-10-141-2/+2
|