moved rarely used 'cpccpc' out of class declaration

This commit is contained in:
Mathias Gumz 2011-02-22 22:33:56 +01:00
parent 4f921f77f4
commit 6fb2960756
2 changed files with 13 additions and 12 deletions

View file

@ -1310,7 +1310,6 @@ TextureRender::TextureRender(ImageControl &imgctrl,
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 @@ XImage *TextureRender::renderXImage() {
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:

View file

@ -68,7 +68,7 @@ private:
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;