mirror of
https://github.com/mpv-player/mpv
synced 2025-03-23 20:00:56 +00:00
Fix for big endian systems
Patch by Jean-Francois Panisset < panisset (at) comcast (dot) net > git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12574 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
2583016302
commit
a68cbb44ef
@ -11,8 +11,8 @@
|
|||||||
* The 16 bit file are loaded without problem from Gimp and ImageMagick but give an error
|
* The 16 bit file are loaded without problem from Gimp and ImageMagick but give an error
|
||||||
* with entice (a visualizer from the enlightenment package that use the imlib2 package).
|
* with entice (a visualizer from the enlightenment package that use the imlib2 package).
|
||||||
*
|
*
|
||||||
* In 32 bit mode the alpha channel is set to 255 (0xff). I may not work with big endian
|
* In 32 bit mode the alpha channel is set to 255 (0xff). For big endian
|
||||||
* machine (is probably enought to change the TGA_ALPHA32 from 0xff000000 to 0x000000ff).
|
* machines, TGA_ALPHA32 changes from 0xff000000 to 0x000000ff, and TGA_SHIFT32 from 0 to 8.
|
||||||
*
|
*
|
||||||
* I need to fill the alpha channel because entice consider that alpha channel (and displays
|
* I need to fill the alpha channel because entice consider that alpha channel (and displays
|
||||||
* nothing, only the background!), but ImageMacick (the program display) or gimp doesn't
|
* nothing, only the background!), but ImageMacick (the program display) or gimp doesn't
|
||||||
@ -35,8 +35,13 @@
|
|||||||
#include "video_out.h"
|
#include "video_out.h"
|
||||||
#include "video_out_internal.h"
|
#include "video_out_internal.h"
|
||||||
|
|
||||||
/* This must be changed for Motorola type processor ? */
|
#ifdef WORDS_BIGENDIAN
|
||||||
|
#define TGA_ALPHA32 0x000000ff
|
||||||
|
#define TGA_SHIFT32 8
|
||||||
|
#else
|
||||||
#define TGA_ALPHA32 0xff000000
|
#define TGA_ALPHA32 0xff000000
|
||||||
|
#define TGA_SHIFT32 0
|
||||||
|
#endif
|
||||||
|
|
||||||
static vo_info_t info =
|
static vo_info_t info =
|
||||||
{
|
{
|
||||||
@ -121,7 +126,7 @@ static int write_tga( char *file, int bpp, int dx, int dy, uint8_t *buf, int str
|
|||||||
s = (uint32_t *)buf;
|
s = (uint32_t *)buf;
|
||||||
d = line_buff;
|
d = line_buff;
|
||||||
for(x = 0; x < dx; x++) {
|
for(x = 0; x < dx; x++) {
|
||||||
*d++ = *s++ | TGA_ALPHA32;
|
*d++ = ((*s++) << TGA_SHIFT32) | TGA_ALPHA32;
|
||||||
}
|
}
|
||||||
if (fwrite(line_buff, wb, 1, fo) != 1) {
|
if (fwrite(line_buff, wb, 1, fo) != 1) {
|
||||||
er = 4;
|
er = 4;
|
||||||
|
Loading…
Reference in New Issue
Block a user