Linux Port (CLI and GTK-Glade): Add support for rendering the backlight intensity on the CPU-based display methods. (Related to commits f5c9a36
and 74ba49e.)
This commit is contained in:
parent
a3a577f2e9
commit
ff4a3e0a5c
|
@ -381,7 +381,7 @@ opengl_Draw(GLuint *texture) {
|
|||
|
||||
/* Draw the main screen as a textured quad */
|
||||
glBindTexture(GL_TEXTURE_2D, texture[NDSDisplayID_Main]);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 256, 192,
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, GPU_FRAMEBUFFER_NATIVE_WIDTH, GPU_FRAMEBUFFER_NATIVE_HEIGHT,
|
||||
GL_RGBA,
|
||||
GL_UNSIGNED_SHORT_1_5_5_5_REV,
|
||||
displayInfo.renderedBuffer[NDSDisplayID_Main]);
|
||||
|
@ -397,7 +397,7 @@ opengl_Draw(GLuint *texture) {
|
|||
|
||||
/* Draw the touch screen as a textured quad */
|
||||
glBindTexture(GL_TEXTURE_2D, texture[NDSDisplayID_Touch]);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 256, 192,
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, GPU_FRAMEBUFFER_NATIVE_WIDTH, GPU_FRAMEBUFFER_NATIVE_HEIGHT,
|
||||
GL_RGBA,
|
||||
GL_UNSIGNED_SHORT_1_5_5_5_REV,
|
||||
displayInfo.renderedBuffer[NDSDisplayID_Touch]);
|
||||
|
@ -429,16 +429,18 @@ resizeWindow_stub (u16 width, u16 height, void *screen_texture) {
|
|||
|
||||
static void
|
||||
Draw( void) {
|
||||
SDL_Surface *rawImage;
|
||||
const NDSDisplayInfo &displayInfo = GPU->GetDisplayInfo();
|
||||
const size_t pixCount = GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT;
|
||||
ColorspaceApplyIntensityToBuffer16<false, false>((u16 *)displayInfo.masterNativeBuffer, pixCount, displayInfo.backlightIntensity[NDSDisplayID_Main]);
|
||||
ColorspaceApplyIntensityToBuffer16<false, false>((u16 *)displayInfo.masterNativeBuffer + pixCount, pixCount, displayInfo.backlightIntensity[NDSDisplayID_Touch]);
|
||||
|
||||
rawImage = SDL_CreateRGBSurfaceFrom(GPU->GetDisplayInfo().masterNativeBuffer, 256, 384, 16, 512, 0x001F, 0x03E0, 0x7C00, 0);
|
||||
SDL_Surface *rawImage = SDL_CreateRGBSurfaceFrom(displayInfo.masterNativeBuffer, GPU_FRAMEBUFFER_NATIVE_WIDTH, GPU_FRAMEBUFFER_NATIVE_HEIGHT * 2, 16, GPU_FRAMEBUFFER_NATIVE_WIDTH * sizeof(u16), 0x001F, 0x03E0, 0x7C00, 0);
|
||||
if(rawImage == NULL) return;
|
||||
|
||||
SDL_BlitSurface(rawImage, 0, surface, 0);
|
||||
|
||||
SDL_UpdateRect(surface, 0, 0, 0, 0);
|
||||
|
||||
SDL_FreeSurface(rawImage);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -117,8 +117,14 @@ static void decode_screen () {
|
|||
|
||||
int x,y, m, W,H,L,BL;
|
||||
u32 image[RAW_H*2][RAW_W], pix;
|
||||
u16 * pixel = (u16 *)GPU->GetDisplayInfo().masterNativeBuffer;
|
||||
|
||||
const NDSDisplayInfo &displayInfo = GPU->GetDisplayInfo();
|
||||
const size_t pixCount = GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT;
|
||||
u16 * pixel = (u16 *)displayInfo.masterNativeBuffer;
|
||||
u32 * rgb32 = &on_screen_image32[0];
|
||||
|
||||
ColorspaceApplyIntensityToBuffer16<false, false>(pixel, pixCount, displayInfo.backlightIntensity[NDSDisplayID_Main]);
|
||||
ColorspaceApplyIntensityToBuffer16<false, false>(pixel + pixCount, pixCount, displayInfo.backlightIntensity[NDSDisplayID_Touch]);
|
||||
|
||||
/* decode colors */
|
||||
init_pix_col_map();
|
||||
|
|
Loading…
Reference in New Issue