all repos — fluxbox @ 6fb296075692b20122b1ecad53006f61e9c6939c

custom fork of the fluxbox windowmanager

moved rarely used 'cpccpc' out of class declaration
Mathias Gumz akira at fluxbox dot org
commit

6fb296075692b20122b1ecad53006f61e9c6939c

parent

4f921f77f459a983a75edb8bd3fb7b0bb2015298

2 files changed, 13 insertions(+), 12 deletions(-)

jump to
M src/FbTk/TextureRender.ccsrc/FbTk/TextureRender.cc

@@ -1310,7 +1310,6 @@ unsigned int w, unsigned int h,

FbTk::Orientation orient): control(imgctrl), cpc(imgctrl.colorsPerChannel()), - cpccpc(cpc * cpc), red(0), green(0), blue(0), orientation(orient), width(w),

@@ -1545,19 +1544,21 @@

switch (control.visual()->c_class) { case StaticColor: case PseudoColor: - for (y = 0, offset = 0; y < height; y++) { - for (x = 0; x < width; x++, offset++) { - r = red_table[red[offset]]; - g = green_table[green[offset]]; - b = blue_table[blue[offset]]; + { + int cpccpc = cpc * cpc; + for (y = 0, offset = 0; y < height; y++) { + for (x = 0; x < width; x++, offset++) { + r = red_table[red[offset]]; + g = green_table[green[offset]]; + b = blue_table[blue[offset]]; - pixel = (r * cpccpc) + (g * cpc) + b; - *pixel_data++ = control.colors()[pixel].pixel; + pixel = (r * cpccpc) + (g * cpc) + b; + *pixel_data++ = control.colors()[pixel].pixel; + } + + pixel_data = (ppixel_data += image->bytes_per_line); } - - pixel_data = (ppixel_data += image->bytes_per_line); } - break; case TrueColor:
M src/FbTk/TextureRender.hhsrc/FbTk/TextureRender.hh

@@ -68,7 +68,7 @@

ImageControl &control; int red_offset, green_offset, blue_offset, red_bits, green_bits, blue_bits, - cpc, cpccpc; + cpc; unsigned char *red, *green, *blue; const unsigned char *red_table, *green_table, *blue_table; Orientation orientation;