summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/blurfx.c
diff options
context:
space:
mode:
authorlupine <lupine@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-17 18:55:21 +0000
committerlupine <lupine@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-17 18:55:21 +0000
commit657be39da76039bb3070191e9309510a19039eb0 (patch)
treee706224be8eabd1730e877f8fcb93002fbbcb381 /beryl-plugins/src/blurfx.c
parentd6e66cbdbecad2fb427e86b243690d0bf4755c15 (diff)
downloadmarex-dev-657be39da76039bb3070191e9309510a19039eb0.tar.gz
marex-dev-657be39da76039bb3070191e9309510a19039eb0.tar.bz2
Fix bug #378; also change display.c's HOME_IMGDIR from .compiz/images to .beryl/images
git-svn-id: file:///beryl/trunk@1835 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/blurfx.c')
-rw-r--r--beryl-plugins/src/blurfx.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/beryl-plugins/src/blurfx.c b/beryl-plugins/src/blurfx.c
index af01864..9e9cb57 100644
--- a/beryl-plugins/src/blurfx.c
+++ b/beryl-plugins/src/blurfx.c
@@ -536,8 +536,7 @@ blurfxSetScreenOption(CompScreen * s, char *name, CompOptionValue * value)
case BLURFX_SCREEN_OPTION_REFLECTION_FILE:
if (compSetStringOption(o, value)) {
if (bs->reflection_supported) {
- loadPngToTexture2D(bs, &bs->modTex,
- value->s);
+ loadPngToTexture2D(s, bs, &bs->modTex, value->s);
damageScreen(s);
}
return TRUE;
@@ -547,7 +546,7 @@ blurfxSetScreenOption(CompScreen * s, char *name, CompOptionValue * value)
case BLURFX_SCREEN_OPTION_REFLECTION_USE_IMAGE_ALPHA:
if (compSetBoolOption(o, value)) {
if (bs->reflection_supported) {
- loadPngToTexture2D(bs, &bs->modTex,
+ loadPngToTexture2D(s, bs, &bs->modTex,
bs->
opt
[BLURFX_SCREEN_OPTION_REFLECTION_FILE].
@@ -4630,7 +4629,7 @@ initBlurfxScreen(BlurfxScreen * bs, int Screenwidth, int Screenheight,
if (bs->reflection_supported) {
// load reflection map
- loadPngToTexture2D(bs, &bs->modTex,
+ loadPngToTexture2D(s, bs, &bs->modTex,
bs->
opt
[BLURFX_SCREEN_OPTION_REFLECTION_FILE].
@@ -4732,11 +4731,11 @@ loadShader(GLenum type, CompScreen * s, GLuint * shader, const char *prog)
// load png
static void
-loadPngToTexture2D(BlurfxScreen * bs, BlurTexture * tex, char *filename)
+loadPngToTexture2D(CompScreen *s, BlurfxScreen * bs, BlurTexture * tex, char *filename)
{
- unsigned int img_w = 0, img_h = 0;
- char *img_data = NULL;
+ int img_w = 0, img_h = 0, stride = 0;
+ char *img_data;
char *img_mod;
struct stat fInfo;
@@ -4757,13 +4756,16 @@ loadPngToTexture2D(BlurfxScreen * bs, BlurTexture * tex, char *filename)
return;
}
fprintf(stderr, "Loading image \"%s\" \n", filename);
- readPng(filename, &img_data, &img_w, &img_h);
- if (img_w == 0 || img_h == 0 || img_data == NULL) {
- fprintf(stderr, "Unable to load image \"%s\" \n",
- filename);
+ // Was: readPng(filename, &img_data, &img_w, &img_h);
+ if (!fileToImage(s->display, NULL, filename, &img_w, &img_h, &stride, (void *)&img_data))
+ {
+ printf("Unable to load image \"%s\" \n", filename);
return;
}
+
+ printf("%s loaded. w: %i; h: %i\n", filename, img_w, img_h);
+
//Generate the OpenGL textures
if (tex->handle == 0)
glGenTextures(1, &tex->handle);