Commit graph

256 commits

Author SHA1 Message Date
Gered 20d0d8630d add global audio volume control 2022-06-05 18:42:09 -04:00
Gered 13b18e3d71 convenience methods for playing/stopping specific audio channels 2022-06-05 18:29:57 -04:00
Gered 5f5bc79d86 doc comment update for clarification 2022-06-05 13:01:10 -04:00
Gered 39964eb4de method naming standardization 2022-06-05 12:57:03 -04:00
Gered 51a9bddc33 add vertically and horizontally flipped BlitMethod variations 2022-06-05 12:55:31 -04:00
Gered d3e034d211 give multi-parameter BlitMethod enum values named parameters 2022-06-05 11:11:39 -04:00
Gered 12ad705fce mini refactor 2022-06-04 16:26:51 -04:00
Gered 819603ca2a more formatting and doc comments 2022-06-04 16:22:51 -04:00
Gered 1d9fceb98c rustfmt applied 2022-06-04 16:22:41 -04:00
Gered 71556c6d65 add color offset blit method variants
these allow a per-pixel color index offset to be applied during blits
2022-06-04 16:13:50 -04:00
Gered 6bb52e57e1 add initial somewhat imperfect rotozoom blit method 2022-06-04 15:54:37 -04:00
Gered a48f785ad0 mark some methods as inline
this probably doesn't really matter, as i understand it rust inlines
a hell of a lot of stuff, especially for method calls from within
the same crate ...
2022-05-29 19:23:16 -04:00
Gered 17e30fdec4 simplify 2022-05-29 17:47:24 -04:00
Gered 28c964e37e add initial support for playing custom audio waveform generators
with typical sine wave generator example added to the audio_playback
example project
2022-05-29 17:43:51 -04:00
Gered 9e8727c02b replace TARGET_AUDIO_SPEC with separate constants for freq and channels 2022-05-29 14:27:04 -04:00
Gered 94922caf71 minor updates to audio_playback example
using Audio's AudioSpec property to get the target format to convert to
2022-05-29 13:53:35 -04:00
Gered 03950c8d3e formatting 2022-05-29 13:52:53 -04:00
Gered 7ee256e12e add Audio struct to wrap underlying SDL AudioDevice
doesn't provide much value currently, but serves as a base for future
extension (e.g. queuing play commands, global volume changes, etc)
2022-05-29 13:51:55 -04:00
Gered c5b2e216cf formatting 2022-05-29 13:22:03 -04:00
Gered 23f2d4da02 update audio_playback example with varied wav file formats to convert 2022-05-29 13:18:51 -04:00
Gered 00eb6fcb20 support loading 16-bit wav files 2022-05-29 13:18:15 -04:00
Gered dd6178ca1f improve wav file loading. handle buggy/naive cases better 2022-05-29 12:54:02 -04:00
Gered b28c0f6555 add stream_size method
this is just a temporary alternative to the currently unstable
stream_len method, because i don't currently want to depend on unstable
rust versions if i don't need to.
2022-05-29 12:52:58 -04:00
Gered 9c35d670fa some AudioSpec usage cleanups and minor improvements 2022-05-29 11:19:57 -04:00
Gered e4a90e7f10 play_buffer now enforces matching AudioSpecs 2022-05-29 10:57:04 -04:00
Gered 3d3f46417d change audio channel methods to return options in places. add comments
i figure the option return types help clarify intent a bit instead of
using 0's as a default.
2022-05-28 20:57:14 -04:00
Gered 3bf69d651d add audio_playback example 2022-05-28 20:29:40 -04:00
Gered 342e2a3877 add initial audio playback and wav file support 2022-05-28 20:29:17 -04:00
Gered bc03961a49 bitmap font/char rendering now requires a FontRenderOpts
this is more flexible for future font types, which may not require
only a simple u8 color value (e.g. bitmap fonts)
2022-05-27 17:52:23 -04:00
Gered 51cb8a5bf5 add template_complicated example 2022-05-26 21:18:45 -04:00
Gered 0afc7e822a add template_minimal example 2022-05-26 18:43:22 -04:00
Gered 246367b50b remove push/pusher components from dead slime corpses 2022-05-23 20:32:12 -04:00
Gered 1f80c9943e attribute original artists 2022-05-23 18:17:53 -04:00
Gered 4f3928cf56 add READMEs and screenshots for examples 2022-05-23 17:45:22 -04:00
Gered 1ab1d8e0ad add "slimed" example 2022-05-23 17:43:38 -04:00
Gered 3ac0adea69 add method for transparent blit with visible pixels all a single color 2022-05-23 14:47:37 -04:00
Gered 2bb4365e08 add some derivations for BlitMethod enum 2022-05-23 14:46:58 -04:00
Gered 41c37fe874 add helper method for testing if a vector is almost the zero vector 2022-05-23 14:14:34 -04:00
Gered 9072879f4f fix incorrect return type. mutable component should be returned 2022-05-22 17:50:16 -04:00
Gered db261d2356 add 'Resume' state that game states go through when they wake up again
this is to provide an easy way for game states to react to the specific
scenario where they were previously paused and then are re-awakened and
may want to perform (re-)initialization like they may have done in a
previous 'Pending' state (which is only set when states are first
created)
2022-05-22 10:50:12 -04:00
Gered 2c2ba24e6b add method to create Palettes with specific initial color RGB value
for all colors, instead of always initializing new palettes to black
2022-05-21 20:09:27 -04:00
Gered 264c71677b add helper/debug method to draw a palette to a bitmap 2022-05-21 16:40:09 -04:00
Gered a4e98ce108 "clean up" imports, re-export under separate top-level crates 2022-05-20 22:12:55 -04:00
Gered f0930c90d7 allow for multiple states to be popped at once 2022-05-16 20:36:42 -04:00
Gered 4d7f84281b cleanup. return errors instead of panics
the panics were originally added to aid with testing during some rework.
i'm 99% certain these two scenarios cannot occur anymore anyway
2022-05-16 19:00:48 -04:00
Gered ee9474b231 add state swapping support 2022-05-16 18:59:38 -04:00
Gered af09c61796 fix state transitions for dead/pending so they happen faster
this removes some "dead" frames when pushing/popping states during the
transition between them where there would be at least 1 tick where
no update/render would be called because the top state would be still
in a "dead" or "pending" state
2022-05-15 20:43:54 -04:00
Gered e2888ca710 formatting 2022-05-15 20:39:56 -04:00
Gered 340dd445d7 minor adjustments 2022-05-15 19:31:56 -04:00
Gered 7c8e1dc21c add balls_v2 example 2022-05-15 16:34:25 -04:00