Skip to content

Commit

Permalink
fix major bug on 32 bpp algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
citronneur committed Jul 9, 2015
1 parent af4785d commit 7197d2d
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 17 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## 0.2.1 - 20150708
## 0.2.3 - 20150709
* Fix major bug on 32 bpp image decompression

## 0.2.2 - 20150708
* Fix bug on freeze event after close event
* Remove border of canvas
* Add better favicon
Expand Down
146 changes: 133 additions & 13 deletions client/js/rle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions obj/rle.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,21 @@ bitmap_decompress_24(uint8 * output, int output_width, int output_height, int in
}

int
bitmap_decompress_32(uint8 * output, int width, int height, uint8* input, int size) {
return bitmap_decompress4(output, width, height, input, size);
bitmap_decompress_32(uint8 * output, int output_width, int output_height, int input_width, int input_height, uint8* input, int size) {
uint8 * temp = (uint8*)malloc(input_width * input_height * 4);
RD_BOOL rv = bitmap_decompress4(temp, input_width, input_height, input, size);

// convert to rgba
for (int y = 0; y < output_height; y++) {
for (int x = 0; x < output_width; x++) {
uint8 r = temp[(y * input_width + x) * 4];
uint8 g = temp[(y * input_width + x) * 4 + 1];
uint8 b = temp[(y * input_width + x) * 4 + 2];
uint8 a = temp[(y * input_width + x) * 4 + 3];
((uint32*)output)[y * output_width + x] = 0xff << 24 | r << 16 | g << 8 | b;
}
}
free(temp);

return rv;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mstsc.js",
"author": "Sylvain Peyrefitte",
"version": "0.2.2",
"version": "0.2.3",
"engines":
[
"node = 0.10.x"
Expand Down

0 comments on commit 7197d2d

Please sign in to comment.