From 9b6e6a1215de1ebf1ffe74998756824012ab7d31 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 28 May 2011 14:11:37 +0200 Subject: [PATCH] Goddamnit, it was ARGB after all o.O weird. --- driver.c | 4 ++-- gfx/ext.c | 2 +- gfx/ext/ssnes_video.h | 4 ++-- gfx/gl.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/driver.c b/driver.c index bf7c44d8b9..e5ddae8d6e 100644 --- a/driver.c +++ b/driver.c @@ -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 diff --git a/gfx/ext.c b/gfx/ext.c index 2522a59972..41f4ad67d2 100644 --- a/gfx/ext.c +++ b/gfx/ext.c @@ -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, diff --git a/gfx/ext/ssnes_video.h b/gfx/ext/ssnes_video.h index 4fba822c5f..8f447d256b 100644 --- a/gfx/ext/ssnes_video.h +++ b/gfx/ext/ssnes_video.h @@ -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; diff --git a/gfx/gl.c b/gfx/gl.c index 098b809fd2..41ca093f70 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -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);