Commit graph

124 commits

Author SHA1 Message Date
Gered f902b16d3c during lzw decoding, use a vector instead of a hashmap for the table
since the keys for the previously used hashmap all corresponded with
an index, this can obviously just be a vector where the element index
corresponds to the lzw code. simple.
2023-01-01 13:01:10 -05:00
Gered a9610a5762 add initial benchmark tests for asset loading
only for gif bitmaps right now, since i want to (eventually) clean that
up somewhat
2023-01-01 12:43:15 -05:00
Gered ed754cb9ac update example project entity system component store usage
i think i prefer this style. it's not _technically_ as safe as it was
before, but i prefer the explicitness of it (and it results in a little
bit less nesting in system functions which is nice).

i don't much like the need for an explicit `unwrap()` call however
but that's the tradeoff!
2023-01-01 12:22:03 -05:00
Gered 2b33a64120 naming changes for additional clarity, and very minor cleanups 2022-12-30 20:17:03 -05:00
Gered 88ecfb13e9 clarification comment for my future self 2022-12-30 20:12:06 -05:00
Gered 6f821e7885 remove LzwDataBuffer, just use Vec<u8>'s instead
i originally added LzwDataBuffer under a misunderstanding that i was
going to need to track values in these buffers that were not just
limited to 8-bits in size. this is not actually the case, so we can
do this change to simplify things.
2022-12-30 20:05:51 -05:00
Gered a97782d476 update incorrect comment that was clearly copy+pasted and then missed 2022-12-30 17:46:47 -05:00
Gered 319bea7305 add todo comment reminder for myself 2022-12-30 17:27:22 -05:00
Gered 1f31eaa17d add more pcx bitmap load/save tests 2022-12-30 17:25:10 -05:00
Gered fc88380ba3 add more iff bitmap load/save tests 2022-12-30 17:22:04 -05:00
Gered 39b0cd622c update module doc comment 2022-12-30 17:10:52 -05:00
Gered 6ffa742d84 rename lzw module to lzwgif to better reflect what it does
that it's not an implementation for LZW but the GIF-variant/specific
version of LZW
2022-12-30 11:53:22 -05:00
Gered cd9c44dab0 add second large gif image load/save in unit test
just to make me feel a bit better about the lzw encoding/decoding
2022-12-30 11:50:23 -05:00
Gered 60a22456c0 add module doc comment 2022-12-30 11:47:28 -05:00
Gered 88f8cbe1ad lzw encoding/decoding now reads/writes the min_code_size byte
as such, lzw_decode now no longer needs min_code_size as a function
parameter since it just reads it from the source bytes
2022-12-30 11:47:13 -05:00
Gered 803b31d8c8 fix lzw encoding code bit increment and max code value checks
this fixes it so that the full 12 bits for codes will be used instead
of only 11. whoops
2022-12-30 10:51:30 -05:00
Gered 0c1f50e63e initial stab at gif load/save bitmap support
the lzw encode / decode algorithm seems to work well enough, but could
be optimized and i'm worried there are still some lingering issues ...
2022-12-29 22:19:35 -05:00
Gered 8cb1d82b49 add support for loading/saving palettes with fewer than 256 colors 2022-12-29 22:17:44 -05:00
Gered 5e65d63540 use a rect for the destination area
this isn't strictly needed now, but will be useful in a future change
that changes how clipping works in rotozoom blits
2022-11-08 14:15:41 -05:00
Gered acbf36ee28 adjust rotozoom internal transformed destination rect coord calculation
maybe marginally better/simpler, but also some minor cleanups and a
semi-hackfix for minor destination blit corners being cutoff slightly
for some rotation angles
2022-11-07 13:21:45 -05:00
Gered a59bfc5511 update rotozoom blit algorithm to something a little bit better
but there are still performance improvements we can make. but at least
now we're not doing some silly double-pixel draw as a band-aid over
missing/gap pixels. and we no longer sometimes have missing scanlines
due to floating-point rounding issues.
2022-11-06 22:20:17 -05:00
Gered 018aeef6ed use position argument 2022-08-10 00:23:43 -04:00
Gered eb801d996a commit a whole bunch of test assets that were missed previously. oops! 2022-07-23 15:09:41 -04:00
Gered 2203035401 add a bunch of debug impls. switch some debug derives over too
mainly switching #[derive(Debug)] to manual std::fmt::Debug impls to
remove debug strings that would otherwise contain long strings of
byte arrays which most of the time isn't so useful to see in any kind
of debug logging
2022-07-23 15:08:36 -04:00
Gered cf02471aa8 fix compiler warning 2022-07-20 18:27:54 -04:00
Gered 9316f09e09 added blended drawing operation visual comparison tests 2022-07-20 18:27:27 -04:00
Gered 0dd90e48b4 fix clipping issues with some more blended blit method variants
jeez!
2022-07-20 18:25:22 -04:00
Gered 63ac007207 fix clipping issues with some blended blit method variants 2022-07-20 18:11:55 -04:00
Gered 0c9418aaa5 fix blendmap loading issue where the map had a full 256 source color set 2022-07-20 17:36:08 -04:00
Gered c4e0a11259 add loading and saving support to BlendMap 2022-07-20 16:32:19 -04:00
Gered d6e05c7e3a add new_colored_luminance_map method 2022-07-18 21:36:28 -04:00
Gered 9cac8d2500 add better (and significantly slower) new_translucency_map method 2022-07-18 21:22:50 -04:00
Gered 3265388d9d rename to new_colorized_map. maybe a better name? 2022-07-18 21:22:18 -04:00
Gered fb101db0ac stop searching for color matches if this color is an exact match
probably very rarely ever an optimization in real-world use, but it
still seems like the logical thing to do
2022-07-18 21:21:40 -04:00
Gered d9739b4e3e fix compile issues 2022-07-18 18:27:25 -04:00
Gered 380a0b5655 add blended blit method variants 2022-07-18 18:06:20 -04:00
Gered c9e32dfca5 add some inlines
these help undo some of the previous blit performance regressions.
mostly, anyway.
2022-07-17 20:49:59 -04:00
Gered 08bcb7f5a6 clean up rotozoom blit variants a bit 2022-07-17 15:41:53 -04:00
Gered 195fcea4c6 refactor blits, less copy+paste with slight modifications
this might still need to be tweaked still as benchmarks are showing
some performance loses (though, also, some minor performance gains?)
so i guess the lambda functions may not always be inlined, or if they
are, the optimizer isn't able to do the same level of optimizations as
it was before? unsure as of yet, so need to investigate further.

however, none of the performance regressions were huge, so i think this
is acceptable to me for now.

libretrogd was never intended to push performance boundaries anyway :-)
2022-07-17 15:18:01 -04:00
Gered 1b477d2731 Merge remote-tracking branch 'origin/master' 2022-07-17 14:44:02 -04:00
Gered b4b5cfb02b update BlendMap derive's 2022-07-17 14:43:26 -04:00
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