X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/f4f8f9a2775fa1794de6935756f30bf4d99f33e8..3b10e39dace3cda3669de0018bb591ecfadb5ca5:/lib/gdi/fb.cpp diff --git a/lib/gdi/fb.cpp b/lib/gdi/fb.cpp index adf06a2c..bb6041e0 100644 --- a/lib/gdi/fb.cpp +++ b/lib/gdi/fb.cpp @@ -27,7 +27,7 @@ fbClass *fbClass::getInstance() fbClass::fbClass(const char *fb) { - m_manual_blit=0; + m_manual_blit=-1; instance=this; locked=0; available=0; @@ -102,7 +102,32 @@ int fbClass::SetMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp) screeninfo.width=0; screeninfo.xoffset=screeninfo.yoffset=0; screeninfo.bits_per_pixel=nbpp; - + + switch (nbpp) { + case 16: + // ARGB 1555 + screeninfo.transp.offset = 15; + screeninfo.transp.length = 1; + screeninfo.red.offset = 10; + screeninfo.red.length = 5; + screeninfo.green.offset = 5; + screeninfo.green.length = 5; + screeninfo.blue.offset = 0; + screeninfo.blue.length = 5; + break; + case 32: + // ARGB 8888 + screeninfo.transp.offset = 24; + screeninfo.transp.length = 8; + screeninfo.red.offset = 16; + screeninfo.red.length = 8; + screeninfo.green.offset = 8; + screeninfo.green.length = 8; + screeninfo.blue.offset = 0; + screeninfo.blue.length = 8; + break; + } + if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) { // try single buffering @@ -157,7 +182,7 @@ int fbClass::waitVSync() void fbClass::blit() { - if (m_manual_blit) { + if (m_manual_blit == 1) { if (ioctl(fd, FBIO_BLIT) < 0) perror("FBIO_BLIT"); } @@ -182,7 +207,13 @@ int fbClass::lock() { if (locked) return -1; - locked=1; + if (m_manual_blit == 1) + { + locked = 2; + disableManualBlit(); + } + else + locked = 1; return fd; } @@ -190,6 +221,8 @@ void fbClass::unlock() { if (!locked) return; + if (locked == 2) // re-enable manualBlit + enableManualBlit(); locked=0; SetMode(xRes, yRes, bpp); PutCMAP();