Commit graph

283 commits

Author SHA1 Message Date
Gered 57ff0b26ae add helper for constructing BlendMaps suitable for translucency overlays 2022-07-17 14:43:05 -04:00
Gered db408a3b06 added helper functions for computing rgb color luminance and "grey"ness 2022-07-17 14:42:04 -04:00
Gered 23c7c448b7 add visual comparison tests for most graphics functionality 2022-07-17 14:12:53 -04:00
Gered d36f0aa9e6 fix clipping issues with certain rotozoom blit methods 2022-07-17 13:37:49 -04:00
Gered d06ae1837b add some extra derive's to various structs 2022-07-16 16:52:43 -04:00
Gered 5b2a3c9cb6 added benchmarks for all blit methods
in advance of doing a bit of refactoring work
2022-07-16 16:03:38 -04:00
Gered e72628f9b1 fix broken benchmarks 2022-07-16 14:55:58 -04:00
Gered 884e13032f add blended variants of primitive rendering
except circles for now, there is a little issue to be resolved yet that
i've just been too lazy to figure out for now.
2022-07-13 07:35:55 -04:00
Gered 7ee6df7d7c add BlendMap 2022-07-13 07:34:53 -04:00
Gered 100c02fc58 add doc comments for entity and event functionality 2022-07-10 15:23:30 -04:00
Gered e8cbe1debe add some inline's 2022-07-10 15:15:59 -04:00
Gered 881fe1d2fd the take_queue function was not intended to be public 2022-07-10 15:14:09 -04:00
Gered b856ab2fc6 add doc comments for audio functionality 2022-07-10 14:31:23 -04:00
Gered 44984c716c add "apply" method variant that handles device locking itself
rename the old "apply" to "apply_to_device". meh. naming is hard.
i expect that most of the time i'd want to use the "apply" method i'm
adding here that handles device locking internally, so that is why i've
chosen to let it be called "apply" and to rename the other one.
2022-07-10 14:21:52 -04:00
Gered 253e70463e better method name
i guess "from" implies it is converting one thing to another, but that
is not what this method was doing really.
2022-07-10 13:18:59 -04:00
Gered cbfd66d42e return index of the audio channel instead of the channel itself
this is more useful because playing/stopping can be done on a specific
channel more easily by specifying a channel index. and the index can
obviously also be used to get the channel itself when/if needed, but
it's not super convenient to get the index of a channel when you only
have the channel itself
2022-07-10 12:58:14 -04:00
Gered 06d3d927fe return true/false based on if playback was actually started or not 2022-07-10 12:55:09 -04:00
Gered b4e641ed41 forgot to commit necessary test asset for previously added tests
another oopsie.
2022-07-10 11:52:11 -04:00
Gered 933811f705 address some compiler warnings. oopsie 2022-07-10 11:51:05 -04:00
Gered 6b7b525597 add font string measurement 2022-07-10 11:49:36 -04:00
Gered 67005faa7b mark some getter methods inline 2022-07-09 18:19:01 -04:00
Gered 0ccc37420d add blit_atlas method
for some additional convenience when blitting BitmapAtlas tiles
2022-07-09 18:17:28 -04:00
Gered 6a730ed70c remove redundant clones 2022-07-01 16:29:47 -04:00
Gered e276eb950d add AudioQueue
for queuing audio "commands" which is a much nicer way to interact
with the audio system in general in a more complex application, as this
lets you play audio in more of a "fire and forget" kind of way.

Rc<AudioBuffer> play methods provided as an alternative because
otherwise you end up with a somewhat gross double-copy of the audio
buffer being played. but i didn't want to necessarily force use of
Rc<AudioBuffer> just yet ... thus both versions of these methods are
provided.
2022-07-01 16:23:28 -04:00
Gered 1a82436661 re-organize audio crates a bit 2022-07-01 15:23:34 -04:00
Gered 2b082fe040 add flipped blit clipping tests 2022-06-15 18:22:26 -04:00
Gered bb54c3bec6 fix flipped blit clipping 2022-06-15 18:10:34 -04:00
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