diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/TextureRender.cc | 23 | ||||
-rw-r--r-- | src/FbTk/TextureRender.hh | 2 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/FbTk/TextureRender.cc b/src/FbTk/TextureRender.cc index 89a88ea..87fbd96 100644 --- a/src/FbTk/TextureRender.cc +++ b/src/FbTk/TextureRender.cc | |||
@@ -1310,7 +1310,6 @@ TextureRender::TextureRender(ImageControl &imgctrl, | |||
1310 | FbTk::Orientation orient): | 1310 | FbTk::Orientation orient): |
1311 | control(imgctrl), | 1311 | control(imgctrl), |
1312 | cpc(imgctrl.colorsPerChannel()), | 1312 | cpc(imgctrl.colorsPerChannel()), |
1313 | cpccpc(cpc * cpc), | ||
1314 | red(0), green(0), blue(0), | 1313 | red(0), green(0), blue(0), |
1315 | orientation(orient), | 1314 | orientation(orient), |
1316 | width(w), | 1315 | width(w), |
@@ -1545,19 +1544,21 @@ XImage *TextureRender::renderXImage() { | |||
1545 | switch (control.visual()->c_class) { | 1544 | switch (control.visual()->c_class) { |
1546 | case StaticColor: | 1545 | case StaticColor: |
1547 | case PseudoColor: | 1546 | case PseudoColor: |
1548 | for (y = 0, offset = 0; y < height; y++) { | 1547 | { |
1549 | for (x = 0; x < width; x++, offset++) { | 1548 | int cpccpc = cpc * cpc; |
1550 | r = red_table[red[offset]]; | 1549 | for (y = 0, offset = 0; y < height; y++) { |
1551 | g = green_table[green[offset]]; | 1550 | for (x = 0; x < width; x++, offset++) { |
1552 | b = blue_table[blue[offset]]; | 1551 | r = red_table[red[offset]]; |
1552 | g = green_table[green[offset]]; | ||
1553 | b = blue_table[blue[offset]]; | ||
1554 | |||
1555 | pixel = (r * cpccpc) + (g * cpc) + b; | ||
1556 | *pixel_data++ = control.colors()[pixel].pixel; | ||
1557 | } | ||
1553 | 1558 | ||
1554 | pixel = (r * cpccpc) + (g * cpc) + b; | 1559 | pixel_data = (ppixel_data += image->bytes_per_line); |
1555 | *pixel_data++ = control.colors()[pixel].pixel; | ||
1556 | } | 1560 | } |
1557 | |||
1558 | pixel_data = (ppixel_data += image->bytes_per_line); | ||
1559 | } | 1561 | } |
1560 | |||
1561 | break; | 1562 | break; |
1562 | 1563 | ||
1563 | case TrueColor: | 1564 | case TrueColor: |
diff --git a/src/FbTk/TextureRender.hh b/src/FbTk/TextureRender.hh index 7896c06..b19a606 100644 --- a/src/FbTk/TextureRender.hh +++ b/src/FbTk/TextureRender.hh | |||
@@ -68,7 +68,7 @@ private: | |||
68 | ImageControl &control; | 68 | ImageControl &control; |
69 | 69 | ||
70 | int red_offset, green_offset, blue_offset, red_bits, green_bits, blue_bits, | 70 | int red_offset, green_offset, blue_offset, red_bits, green_bits, blue_bits, |
71 | cpc, cpccpc; | 71 | cpc; |
72 | unsigned char *red, *green, *blue; | 72 | unsigned char *red, *green, *blue; |
73 | const unsigned char *red_table, *green_table, *blue_table; | 73 | const unsigned char *red_table, *green_table, *blue_table; |
74 | Orientation orientation; | 74 | Orientation orientation; |