Goddamnit, it was ARGB after all o.O weird.

This commit is contained in:
Themaister 2011-05-28 14:11:37 +02:00
parent e5a9d78b70
commit 9b6e6a1215
4 changed files with 8 additions and 8 deletions

View File

@ -338,7 +338,7 @@ static void init_filter(void)
g_extern.filter.colormap = malloc(32768 * sizeof(uint32_t));
assert(g_extern.filter.colormap);
// Set up conversion map from 16-bit XBGR1555 to 32-bit RGBA.
// Set up conversion map from 16-bit XRGB1555 to 32-bit ARGB.
for (int i = 0; i < 32768; i++)
{
unsigned r = (i >> 10) & 31;
@ -348,7 +348,7 @@ static void init_filter(void)
r = (r << 3) | (r >> 2);
g = (g << 3) | (g >> 2);
b = (b << 3) | (b >> 2);
g_extern.filter.colormap[i] = (r << 24) | (g << 16) | (b << 8);
g_extern.filter.colormap[i] = (r << 16) | (g << 8) | (b << 0);
}
}
#endif

View File

@ -233,7 +233,7 @@ static bool setup_video(ext_t *ext, const video_info_t *video, const input_drive
.aspect_ratio = g_settings.video.aspect_ratio,
.smooth = video->smooth,
.input_scale = video->input_scale,
.color_format = video->rgb32 ? SSNES_COLOR_FORMAT_RGBA8888 : SSNES_COLOR_FORMAT_XRGB1555,
.color_format = video->rgb32 ? SSNES_COLOR_FORMAT_ARGB8888 : SSNES_COLOR_FORMAT_XRGB1555,
.xml_shader = g_settings.video.bsnes_shader_path,
.cg_shader = g_settings.video.cg_shader_path,
.ttf_font = *g_settings.video.font_path ? g_settings.video.font_path : NULL,

View File

@ -44,7 +44,7 @@ extern "C" {
#endif
#define SSNES_COLOR_FORMAT_XRGB1555 0
#define SSNES_COLOR_FORMAT_RGBA8888 1
#define SSNES_COLOR_FORMAT_ARGB8888 1
typedef struct ssnes_video_info
{
@ -90,7 +90,7 @@ typedef struct ssnes_video_info
// Defines the coloring format used of the input frame.
// XRGB1555 format is 16-bit and has byte ordering: 0RRRRRGGGGGBBBBB,
// in native endian.
// RGBA8888 is RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA, native endian.
// ARGB8888 is AAAAAAAARRRRRRRRGGGGGGGGBBBBBBBB, native endian.
// Alpha channel should be disregarded.
int color_format;

View File

@ -155,7 +155,7 @@ typedef struct gl
GLfloat fbo_tex_coords[8];
#endif
GLenum texture_type; // XBGR1555 or RGBA
GLenum texture_type; // XBGR1555 or ARGB
GLenum texture_fmt;
unsigned base_size; // 2 or 4
@ -1044,8 +1044,8 @@ static void* gl_init(const video_info_t *video, const input_driver_t **input, vo
else
gl->tex_filter = video->smooth ? GL_LINEAR : GL_NEAREST;
gl->texture_type = video->rgb32 ? GL_RGBA : GL_BGRA;
gl->texture_fmt = video->rgb32 ? GL_UNSIGNED_INT_8_8_8_8 : GL_UNSIGNED_SHORT_1_5_5_5_REV;
gl->texture_type = GL_BGRA;
gl->texture_fmt = video->rgb32 ? GL_UNSIGNED_INT_8_8_8_8_REV : GL_UNSIGNED_SHORT_1_5_5_5_REV;
gl->base_size = video->rgb32 ? sizeof(uint32_t) : sizeof(uint16_t);
glEnable(GL_TEXTURE_2D);