From 1ec99cb5e1d0c757a84399e0050bf7eaa1ce9af2 Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Wed, 23 Mar 2005 21:09:57 +0000 Subject: [PATCH] tweakage --- ChangeLog | 9 +++++++++ cltr.c | 10 +++++++--- cltr.h | 5 ++--- pixbuf.c | 12 +++++++----- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index b64d2061b..18442b2d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-03-23 mallum,,, + + * cltr.c: (cltr_photo_grid_populate), (cltr_photo_grid_redraw), + (cltr_photo_grid_new), (main): + * cltr.h: + Various minor tweaks + * pixbuf.c: (pixbuf_set_pixel), (pixbuf_get_pixel): + Fix RGBA ordering in set/get pixel + 2005-03-23 mallum,,, * cltr.c: (ctrl_photo_grid_get_trans_coords), diff --git a/cltr.c b/cltr.c index 490973a7a..3a3197347 100644 --- a/cltr.c +++ b/cltr.c @@ -497,12 +497,16 @@ cltr_photo_grid_populate(ClutterPhotoGrid *grid, GL_UNSIGNED_INT_8_8_8_8, grid->tex_data); + CLTR_GLERR(); + glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, (GLsizei)tpixb->width, (GLsizei)tpixb->height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, tpixb->data); + CLTR_GLERR(); + i++; } while ( (cell = g_list_next(cell)) != NULL ); @@ -520,7 +524,7 @@ cltr_photo_grid_redraw(ClutterPhotoGrid *grid) glLoadIdentity (); /* XXX pushmatrix */ - glClearColor( 0.0, 0.0, 0.0, 1.0); + glClearColor( 0.6, 0.6, 0.62, 1.0); glClear (GL_COLOR_BUFFER_BIT); /* @@ -727,7 +731,7 @@ cltr_photo_grid_new(ClutterWindow *win, /* Assmes cols == rows */ - grid->zoom_max = /* 1.0 + */ (float) (n_rows * 1.0); + grid->zoom_max = /* 1.0 + */ (float) (n_rows * 1.0) ; /* Below needs to go else where - some kind of texture manager/helper */ @@ -777,7 +781,7 @@ main(int argc, char **argv) win = cltr_window_new(640, 480); - grid = cltr_photo_grid_new(win, 3, 3, argv[1]); + grid = cltr_photo_grid_new(win, 4, 4, argv[1]); Grid = grid; /* laaaaaazy globals */ diff --git a/cltr.h b/cltr.h index 8a33e7835..6a259dd8e 100644 --- a/cltr.h +++ b/cltr.h @@ -29,9 +29,8 @@ GLenum err = glGetError (); /* Roundtrip */ \ if (err != GL_NO_ERROR) \ { \ - const GLubyte *message = gluErrorString (err); \ - g_printerr (__FILE__ ": GL Error: %s [at %s:%d]\n", \ - __func__, __LINE__); \ + g_printerr (__FILE__ ": GL Error: %i [at %s:%d]\n", \ + err, __func__, __LINE__); \ } \ } diff --git a/pixbuf.c b/pixbuf.c index 3977df7ea..edd3b7ec7 100644 --- a/pixbuf.c +++ b/pixbuf.c @@ -510,7 +510,8 @@ pixbuf_set_pixel(Pixbuf *pixb, int x, int y, PixbufPixel *p) /* ARGB_32 MSB */ - *offset = (p->r << 0) | (p->g << 8) | (p->b << 16) | (p->a << 24); + // *offset = (p->r << 0) | (p->g << 8) | (p->b << 16) | (p->a << 24); + *offset = (p->r << 24) | (p->g << 16) | (p->b << 8) | (p->a); } void @@ -520,10 +521,11 @@ pixbuf_get_pixel(Pixbuf *pixb, int x, int y, PixbufPixel *p) /* ARGB_32 MSB */ - p->r = *offset & 0xff; - p->g = (*offset >> 8) & 0xff; - p->b = (*offset >> 16) & 0xff; - p->a = (*offset >> 24) & 0xff; + p->r = (*offset >> 24) & 0xff; + p->g = (*offset >> 16) & 0xff; + p->b = (*offset >> 8) & 0xff; + p->a = *offset & 0xff; + } void /* XXX could be DEFINE */