diff options
| author | louist103 <35883445+louist103@users.noreply.github.com> | 2022-06-02 13:20:36 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-02 13:20:36 -0400 |
| commit | f54f2fa96bfc476a15fcc3ebcd6124bc19164fcd (patch) | |
| tree | 1f3eff4a540daef6a8679ba2b78c4580185d73dd /ZAPD/ImageBackend.cpp | |
| parent | 87cb648b4311d20673452111edaf4d38a5290c28 (diff) | |
Extract palette data from external file (#249)
* WIP
* Done
* Fix
* Fixes
* More fixes
* Fixes for backgrounds.
* Roman's fixes and format.
* Update docs and use tinyxml function for validation.
* Update docs/zapd_extraction_xml_reference.md
Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
* move tlut texture data to stack variable
Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
Diffstat (limited to 'ZAPD/ImageBackend.cpp')
| -rw-r--r-- | ZAPD/ImageBackend.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ZAPD/ImageBackend.cpp b/ZAPD/ImageBackend.cpp index 8accb6b..307945b 100644 --- a/ZAPD/ImageBackend.cpp +++ b/ZAPD/ImageBackend.cpp @@ -398,7 +398,7 @@ void ImageBackend::SetPaletteIndex(size_t index, uint8_t nR, uint8_t nG, uint8_t alphaPalette[index] = nA; } -void ImageBackend::SetPalette(const ImageBackend& pal) +void ImageBackend::SetPalette(const ImageBackend& pal, uint32_t offset) { assert(isColorIndexed); size_t bytePerPixel = pal.GetBytesPerPixel(); @@ -422,7 +422,7 @@ void ImageBackend::SetPalette(const ImageBackend& pal) uint8_t g = pal.pixelMatrix[y][x * bytePerPixel + 1]; uint8_t b = pal.pixelMatrix[y][x * bytePerPixel + 2]; uint8_t a = pal.pixelMatrix[y][x * bytePerPixel + 3]; - SetPaletteIndex(index, r, g, b, a); + SetPaletteIndex(index + offset, r, g, b, a); } } } |
