Add 'brushed metal' texture
parent
857b4a40c5
commit
57e181ba3f
|
@ -49,6 +49,26 @@ void PTextures::InitTextures()
|
||||||
}
|
}
|
||||||
BindTexture(TEX_BACKTILE, size, size, buffer, GL_LUMINANCE);
|
BindTexture(TEX_BACKTILE, size, size, buffer, GL_LUMINANCE);
|
||||||
|
|
||||||
|
/* Create brushed background tile */
|
||||||
|
for (int i = 0; i < size * size; i++) {
|
||||||
|
buffer[i] = (rand() & 0x3F) + 0x80;
|
||||||
|
// buffer[i] += 0x20 * sin(((i + 0 / size) % size) * M_PI / size);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
uint8_t *row = &buffer[i * size];
|
||||||
|
uint8_t tmp[size];
|
||||||
|
for (int j = 0; j < size; j++) {
|
||||||
|
uint16_t t = 0;
|
||||||
|
for (int k = 0; k < 19; k++) {
|
||||||
|
t += row[(j + k) % size];
|
||||||
|
}
|
||||||
|
tmp[j] = t / 19;
|
||||||
|
}
|
||||||
|
memcpy(row, tmp, size);
|
||||||
|
}
|
||||||
|
BindTexture(TEX_BACKTILE2, size, size, buffer, GL_LUMINANCE);
|
||||||
|
|
||||||
/* Create glow, focused at 1/3 down the window */
|
/* Create glow, focused at 1/3 down the window */
|
||||||
int cx = size / 2;
|
int cx = size / 2;
|
||||||
int cy = size / 3;
|
int cy = size / 3;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
TEX_BACKTILE,
|
TEX_BACKTILE,
|
||||||
|
TEX_BACKTILE2,
|
||||||
TEX_BACKGLOW,
|
TEX_BACKGLOW,
|
||||||
|
|
||||||
TEX_SLIDER1,
|
TEX_SLIDER1,
|
||||||
|
|
Loading…
Reference in New Issue