fixed endian issues (bug #340965).
2006-09-20 Sven Neumann <sven@gimp.org> * app/base/tile-manager.c (read_pixel_data_1) (write_pixel_data_1): fixed endian issues (bug #340965).
This commit is contained in:
committed by
Sven Neumann
parent
11abe64f58
commit
d3904c6d85
@ -1,3 +1,8 @@
|
||||
2006-09-20 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/base/tile-manager.c (read_pixel_data_1) (write_pixel_data_1):
|
||||
fixed endian issues (bug #340965).
|
||||
|
||||
2006-09-20 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/plug-in/gimpplugin.c (gimp_plug_in_close): if the plug-in is
|
||||
|
||||
@ -828,9 +828,12 @@ read_pixel_data_1 (TileManager *tm,
|
||||
switch (tm->bpp)
|
||||
{
|
||||
case 4:
|
||||
#if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
|
||||
*(guint32 *) buffer = *(const guint32 *) src;
|
||||
break;
|
||||
|
||||
#else
|
||||
*dest++ = *buffer++;
|
||||
#endif
|
||||
case 3:
|
||||
*buffer++ = *src++;
|
||||
case 2:
|
||||
@ -848,18 +851,18 @@ write_pixel_data_1 (TileManager *tm,
|
||||
gint y,
|
||||
const guchar *buffer)
|
||||
{
|
||||
Tile *tile;
|
||||
guchar *dest;
|
||||
|
||||
tile = tile_manager_get_tile (tm, x, y, TRUE, TRUE);
|
||||
dest = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT);
|
||||
Tile *tile = tile_manager_get_tile (tm, x, y, TRUE, TRUE);
|
||||
guchar *dest = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT);
|
||||
|
||||
switch (tm->bpp)
|
||||
{
|
||||
case 4:
|
||||
#if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
|
||||
*(guint32 *) dest = *(const guint32 *) buffer;
|
||||
break;
|
||||
|
||||
#else
|
||||
*dest++ = *buffer++;
|
||||
#endif
|
||||
case 3:
|
||||
*dest++ = *buffer++;
|
||||
case 2:
|
||||
|
||||
Reference in New Issue
Block a user