Remove dead / unused code
Again: Compiler happy, we are happy.
This commit is contained in:
parent
65e0654249
commit
6fe7fbdc6b
2 changed files with 5 additions and 78 deletions
|
@ -181,29 +181,6 @@ void prepareLinearTable(size_t size, FbTk::RGBA* rgba,
|
|||
}
|
||||
}
|
||||
|
||||
void prepareSquareTable(size_t size, FbTk::RGBA* rgba,
|
||||
const FbTk::Color* from, const FbTk::Color* to, double scale) {
|
||||
|
||||
|
||||
const double r = from->red();
|
||||
const double g = from->green();
|
||||
const double b = from->blue();
|
||||
|
||||
const double delta_r = (to->red() - r);
|
||||
const double delta_g = (to->green() - g);
|
||||
const double delta_b = (to->blue() - b);
|
||||
|
||||
double s;
|
||||
size_t i;
|
||||
for (i = 0; i < size; ++i) {
|
||||
s = 1.0 - ((double)(i + 1) / (double)size);
|
||||
s *= s;
|
||||
rgba[i].r = static_cast<unsigned char>(scale * (r + (s * delta_r)));
|
||||
rgba[i].g = static_cast<unsigned char>(scale * (g + (s * delta_g)));
|
||||
rgba[i].b = static_cast<unsigned char>(scale * (b + (s * delta_b)));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// To + . From + .
|
||||
|
@ -591,17 +568,17 @@ void renderEllipticGradient(bool interlaced,
|
|||
double _y;
|
||||
double d;
|
||||
|
||||
for (i = 0, y = 0; y < height; ++y) {
|
||||
for (x = 0; x < width; ++x, ++i) {
|
||||
for (i = 0, y = 0; y < static_cast<int>(height); ++y) {
|
||||
for (x = 0; x < static_cast<int>(width); ++x, ++i) {
|
||||
|
||||
_x = x - w2;
|
||||
_y = y - h2;
|
||||
|
||||
d = ((_x * _x * sw) + (_y * _y * sh)) / 2.0;
|
||||
|
||||
rgba[i].r = (unsigned char)(r - (d * dr));
|
||||
rgba[i].g = (unsigned char)(g - (d * dg));
|
||||
rgba[i].b = (unsigned char)(b - (d * db));
|
||||
rgba[i].r = static_cast<unsigned char>(r - (d * dr));
|
||||
rgba[i].g = static_cast<unsigned char>(g - (d * dg));
|
||||
rgba[i].b = static_cast<unsigned char>(b - (d * db));
|
||||
|
||||
pseudoInterlace(rgba[i], interlaced, y);
|
||||
}
|
||||
|
|
|
@ -51,56 +51,6 @@ using std::string;
|
|||
|
||||
namespace {
|
||||
|
||||
const char *getFontSize(const char *pattern, int *size) {
|
||||
const char *p;
|
||||
const char *p2=0;
|
||||
int n=0;
|
||||
|
||||
for (p=pattern; 1; p++) {
|
||||
if (!*p) {
|
||||
if (p2!=0 && n>1 && n<72) {
|
||||
*size = n; return p2+1;
|
||||
} else {
|
||||
*size = 16; return 0;
|
||||
}
|
||||
} else if (*p=='-') {
|
||||
if (n>1 && n<72 && p2!=0) {
|
||||
*size = n;
|
||||
return p2+1;
|
||||
}
|
||||
p2=p; n=0;
|
||||
} else if (*p>='0' && *p<='9' && p2!=0) {
|
||||
n *= 10;
|
||||
n += *p-'0';
|
||||
} else {
|
||||
p2=0; n=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...) {
|
||||
const char *p, *v;
|
||||
char *p2;
|
||||
va_list va;
|
||||
|
||||
va_start(va, bufsiz);
|
||||
buf[bufsiz-1] = 0;
|
||||
buf[bufsiz-2] = '*';
|
||||
while((v = va_arg(va, char *)) != 0) {
|
||||
p = FbTk::StringUtil::strcasestr(pattern, v);
|
||||
if (p) {
|
||||
strncpy(buf, p+1, bufsiz-2);
|
||||
p2 = strchr(buf, '-');
|
||||
if (p2) *p2=0;
|
||||
va_end(va);
|
||||
return p;
|
||||
}
|
||||
}
|
||||
va_end(va);
|
||||
strncpy(buf, "*", bufsiz);
|
||||
return 0;
|
||||
}
|
||||
|
||||
XFontSet createFontSet(const char *fontname, bool& utf8mode) {
|
||||
Display *display = FbTk::App::instance()->display();
|
||||
XFontSet fs;
|
||||
|
|
Loading…
Reference in a new issue