diff options
| author | Chris Larson <clarson@kergoth.com> | 2004-12-09 09:47:41 +0000 |
|---|---|---|
| committer | Chris Larson <clarson@kergoth.com> | 2004-12-09 09:47:41 +0000 |
| commit | 2c5b8ec6d95cf68650265941530e5ce38c8dd6d9 (patch) | |
| tree | bf879bea7ef8517ba8c3d1286ef300401d3d484c /libsdl | |
| parent | 101e2f1623def0a355d20aacb8bd93810703e834 (diff) | |
Merge oe-devel@oe-devel.bkbits.net:openembedded
into hyperion.kergoth.com:/home/kergoth/code/openembedded
2004/12/09 03:39:39-06:00 kergoth.com!kergoth
Break people's builds again.. this time moving the packages into a packages/ subdir to clean things up a bit.
BKrev: 41b81f3dvlp3rU7_8MUXLcI8LDdDoA
Diffstat (limited to 'libsdl')
| -rw-r--r-- | libsdl/libsdl-gfx_2.0.11.bb | 0 | ||||
| -rw-r--r-- | libsdl/libsdl-image_1.2.3.bb | 0 | ||||
| -rw-r--r-- | libsdl/libsdl-mixer_1.2.5.bb | 0 | ||||
| -rw-r--r-- | libsdl/libsdl-net_1.2.5.bb | 0 | ||||
| -rw-r--r-- | libsdl/libsdl-qpe-1.2.7/acinclude.m4 | 189 | ||||
| -rw-r--r-- | libsdl/libsdl-qpe-1.2.7/agawa-piro-mickey.patch | 2042 | ||||
| -rw-r--r-- | libsdl/libsdl-qpe-1.2.7/gcc34.patch | 176 | ||||
| -rw-r--r-- | libsdl/libsdl-qpe-1.2.7/kill-stdc++.patch | 401 | ||||
| -rw-r--r-- | libsdl/libsdl-qpe-1.2.7/mouse.patch | 47 | ||||
| -rw-r--r-- | libsdl/libsdl-qpe-1.2.7/pygame.patch | 42 | ||||
| -rw-r--r-- | libsdl/libsdl-qpe_1.2.7.bb | 0 | ||||
| -rw-r--r-- | libsdl/libsdl-ttf-2.0.3/new-freetype-includes.patch | 17 | ||||
| -rw-r--r-- | libsdl/libsdl-ttf_2.0.3.bb | 0 | ||||
| -rw-r--r-- | libsdl/libsdl-x11-1.2.7/acinclude.m4 | 189 | ||||
| -rw-r--r-- | libsdl/libsdl-x11-1.2.7/extra-keys.patch | 53 | ||||
| -rw-r--r-- | libsdl/libsdl-x11_1.2.7.bb | 0 |
16 files changed, 0 insertions, 3156 deletions
diff --git a/libsdl/libsdl-gfx_2.0.11.bb b/libsdl/libsdl-gfx_2.0.11.bb deleted file mode 100644 index e69de29bb2..0000000000 --- a/libsdl/libsdl-gfx_2.0.11.bb +++ /dev/null diff --git a/libsdl/libsdl-image_1.2.3.bb b/libsdl/libsdl-image_1.2.3.bb deleted file mode 100644 index e69de29bb2..0000000000 --- a/libsdl/libsdl-image_1.2.3.bb +++ /dev/null diff --git a/libsdl/libsdl-mixer_1.2.5.bb b/libsdl/libsdl-mixer_1.2.5.bb deleted file mode 100644 index e69de29bb2..0000000000 --- a/libsdl/libsdl-mixer_1.2.5.bb +++ /dev/null diff --git a/libsdl/libsdl-net_1.2.5.bb b/libsdl/libsdl-net_1.2.5.bb deleted file mode 100644 index e69de29bb2..0000000000 --- a/libsdl/libsdl-net_1.2.5.bb +++ /dev/null diff --git a/libsdl/libsdl-qpe-1.2.7/acinclude.m4 b/libsdl/libsdl-qpe-1.2.7/acinclude.m4 deleted file mode 100644 index ca2df9d5e5..0000000000 --- a/libsdl/libsdl-qpe-1.2.7/acinclude.m4 +++ /dev/null @@ -1,189 +0,0 @@ -# Local macros for the SDL configure.in script - -dnl Function to link an architecture specific file -dnl LINK_ARCH_SRC(source_dir, arch, source_file) -AC_DEFUN([COPY_ARCH_SRC], -[ - old="$srcdir/$1/$2/$3" - new="$1/$3" - if test ! -d $1; then - echo "Creating directory $1" - mkdir -p $1 - fi - echo "Copying $old -> $new" - cat >$new <<__EOF__ -/* WARNING: This file was automatically generated! - * Original: $old - */ -__EOF__ - cat >>$new <$old -]) - -# -# --- esd.m4 --- -# -# Configure paths for ESD -# Manish Singh 98-9-30 -# stolen back from Frank Belew -# stolen from Manish Singh -# Shamelessly stolen from Owen Taylor - -dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS -dnl -AC_DEFUN([AM_PATH_ESD], -[dnl -dnl Get the cflags and libraries from the esd-config script -dnl -AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], - esd_prefix="$withval", esd_prefix="") -AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], - esd_exec_prefix="$withval", esd_exec_prefix="") -AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], - , enable_esdtest=yes) - - if test x$esd_exec_prefix != x ; then - esd_args="$esd_args --exec-prefix=$esd_exec_prefix" - if test x${ESD_CONFIG+set} != xset ; then - ESD_CONFIG=$esd_exec_prefix/bin/esd-config - fi - fi - if test x$esd_prefix != x ; then - esd_args="$esd_args --prefix=$esd_prefix" - if test x${ESD_CONFIG+set} != xset ; then - ESD_CONFIG=$esd_prefix/bin/esd-config - fi - fi - - AC_PATH_PROG(ESD_CONFIG, esd-config, no) - min_esd_version=ifelse([$1], ,0.2.7,$1) - AC_MSG_CHECKING(for ESD - version >= $min_esd_version) - no_esd="" - if test "$ESD_CONFIG" = "no" ; then - no_esd=yes - else - ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` - ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` - - esd_major_version=`$ESD_CONFIG $esd_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - esd_minor_version=`$ESD_CONFIG $esd_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_esdtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $ESD_CFLAGS" - LIBS="$LIBS $ESD_LIBS" -dnl -dnl Now check if the installed ESD is sufficiently new. (Also sanity -dnl checks the results of esd-config to some extent -dnl - rm -f conf.esdtest - AC_TRY_RUN([ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <esd.h> - -char* -my_strdup (char *str) -{ - char *new_str; - - if (str) - { - new_str = malloc ((strlen (str) + 1) * sizeof(char)); - strcpy (new_str, str); - } - else - new_str = NULL; - - return new_str; -} - -int main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.esdtest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = my_strdup("$min_esd_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_esd_version"); - exit(1); - } - - if (($esd_major_version > major) || - (($esd_major_version == major) && ($esd_minor_version > minor)) || - (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); - printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); - printf("*** to point to the correct copy of esd-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} - -],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_esd" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$ESD_CONFIG" = "no" ; then - echo "*** The esd-config script installed by ESD could not be found" - echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the ESD_CONFIG environment variable to the" - echo "*** full path to esd-config." - else - if test -f conf.esdtest ; then - : - else - echo "*** Could not run ESD test program, checking why..." - CFLAGS="$CFLAGS $ESD_CFLAGS" - LIBS="$LIBS $ESD_LIBS" - AC_TRY_LINK([ -#include <stdio.h> -#include <esd.h> -], [ return 0; ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding ESD or finding the wrong" - echo "*** version of ESD. If it is not finding ESD, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means ESD was incorrectly installed" - echo "*** or that you have moved ESD since it was installed. In the latter case, you" - echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - ESD_CFLAGS="" - ESD_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(ESD_CFLAGS) - AC_SUBST(ESD_LIBS) - rm -f conf.esdtest -]) - diff --git a/libsdl/libsdl-qpe-1.2.7/agawa-piro-mickey.patch b/libsdl/libsdl-qpe-1.2.7/agawa-piro-mickey.patch deleted file mode 100644 index 7d2c0d922f..0000000000 --- a/libsdl/libsdl-qpe-1.2.7/agawa-piro-mickey.patch +++ /dev/null @@ -1,2042 +0,0 @@ - -# -# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher -# - ---- libsdl1.2qte/src/video/qtopia/SDL_QWin.cc~agawa-piro-mickey 2003-01-20 02:08:20.000000000 +0100 -+++ libsdl1.2qte/src/video/qtopia/SDL_QWin.cc 2003-12-28 19:02:22.000000000 +0100 -@@ -1,3 +1,4 @@ -+ - /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga -@@ -27,15 +28,24 @@ - - #include "SDL_QWin.h" - #include <qapplication.h> -+#include <qpe/qpeapplication.h> - #include <qdirectpainter_qws.h> - -+extern int fb_hwrot; -+extern int fb_direct; -+extern bool is_VGA_machine; -+static int mouse_button_mode=1; -+ - screenRotationT screenRotation = SDL_QT_NO_ROTATION; - - SDL_QWin::SDL_QWin(const QSize& size) - : QWidget(0, "SDL_main"), my_painter(0), my_image(0), - my_inhibit_resize(false), my_mouse_pos(-1,-1), my_flags(0), -- my_has_fullscreen(false), my_locked(0) -+ my_has_fullscreen(false), my_locked(0), -+ rotation_(0), qteRotation_(0), keyRotation_(0), qteKeyRotation_(0), -+ isSLA300InputFix_(0) - { -+ for (int i = 0; i < 5; i++) curAxis_[i] = 0; - setBackgroundMode(NoBackground); - } - -@@ -84,6 +94,7 @@ - } - - void SDL_QWin::setMousePos(const QPoint &pos) { -+#if 0 - if(my_image->width() == height()) { - if (screenRotation == SDL_QT_ROTATION_90) - my_mouse_pos = QPoint(height()-pos.y(), pos.x()); -@@ -92,6 +103,66 @@ - } else { - my_mouse_pos = pos; - } -+#else -+ QPoint realPos; -+ -+ if (is_VGA_machine) { -+ realPos = pos; -+ my_mouse_pos = realPos; -+ }else { -+ switch (qteRotation_) { -+ case 0: -+ realPos = pos; -+ break; -+ case 1: -+ realPos.setX(pos.y()); -+ realPos.setY(fbSize_.height() - 1 - pos.x()); -+ break; -+ case 2: -+ realPos.setX(fbSize_.width() - 1 - pos.x()); -+ realPos.setY(fbSize_.height() - 1 - pos.y()); -+ break; -+ case 3: -+ realPos.setX(fbSize_.width() - 1 - pos.y()); -+ realPos.setY(pos.x()); -+ break; -+ }; -+ -+ // fprintf(stderr, "setMousePos: realPos(%d, %d)\n", realPos.x(), realPos.y()); -+ -+ int borderWidth = (fbSize_.width() - my_image->width()) >> 1; -+ int borderHeight = (fbSize_.height() - my_image->height()) >> 1; -+ if ( rotation_ & 1 ){ -+ borderWidth = (fbSize_.height() - my_image->width()) >> 1; -+ borderHeight = (fbSize_.width() - my_image->height()) >> 1; -+ } -+ realPos.setX(realPos.x() - borderWidth); -+ realPos.setY(realPos.y() - borderHeight); -+ -+ fprintf(stderr, "setMousePos: realPos2(%d, %d)\n", realPos.x(), realPos.y()); -+ -+ switch (rotation_) { -+ case 0: -+ my_mouse_pos = realPos; -+ break; -+ case 1: -+ my_mouse_pos.setX(realPos.y()); -+ my_mouse_pos.setY(my_image->height() - 1 - realPos.x()); -+ break; -+ case 2: -+ my_mouse_pos.setX(my_image->width() - 1 - realPos.x()); -+ my_mouse_pos.setY(my_image->height() - 1 - realPos.y()); -+ break; -+ case 3: -+ my_mouse_pos.setX(realPos.y());//my_image->width() - 1 - realPos.y()); -+ my_mouse_pos.setY(my_image->height() - realPos.x()); -+ break; -+ } -+ } -+ -+// fprintf(stderr, "setMousePos: mymousePos(%d, %d)\n", (short)my_mouse_pos.x(), (short)my_mouse_pos.y()); -+ -+#endif - } - - void SDL_QWin::mouseMoveEvent(QMouseEvent *e) { -@@ -113,269 +184,318 @@ - void SDL_QWin::mousePressEvent(QMouseEvent *e) { - mouseMoveEvent(e); - Qt::ButtonState button = e->button(); -- SDL_PrivateMouseButton(SDL_PRESSED, -- (button & Qt::LeftButton) ? 1 : -- ((button & Qt::RightButton) ? 2 : 3), -+ SDL_PrivateMouseButton(SDL_PRESSED,mouse_button_mode, - my_mouse_pos.x(), my_mouse_pos.y()); - } - - void SDL_QWin::mouseReleaseEvent(QMouseEvent *e) { - setMousePos(e->pos()); - Qt::ButtonState button = e->button(); -- SDL_PrivateMouseButton(SDL_RELEASED, -- (button & Qt::LeftButton) ? 1 : -- ((button & Qt::RightButton) ? 2 : 3), -+ SDL_PrivateMouseButton(SDL_RELEASED,mouse_button_mode, - my_mouse_pos.x(), my_mouse_pos.y()); - my_mouse_pos = QPoint(-1, -1); - } - --static inline void --gs_fastRotateBlit_3 ( unsigned short *fb, -- unsigned short *bits, -- const QRect& rect ) -+#ifndef __i386__ -+ -+static void -+blitRotate3(Uint16 *dstBits, const QSize& dstSize, -+ const Uint16 *srcBits, const QSize& srcSize, -+ const QRect& srcBlitRect); -+ -+static void -+blitRotate0(Uint16 *dstBits, const QSize& dstSize, -+ const Uint16 *srcBits, const QSize& srcSize, -+ const QRect& srcBlitRect) - { -- // FIXME: this only works correctly for 240x320 displays -- int startx, starty; -- int width, height; -- -- startx = rect.left() >> 1; -- starty = rect.top() >> 1; -- width = ((rect.right() - rect.left()) >> 1) + 2; -- height = ((rect.bottom() - rect.top()) >> 1) + 2; -+ srcBits += srcBlitRect.left() + srcBlitRect.top() * srcSize.width(); -+ dstBits += ((dstSize.width() - srcSize.width()) >> 1) -+ + (((dstSize.height() - srcSize.height()) >> 1) * dstSize.width()); -+ dstBits += srcBlitRect.left() + srcBlitRect.top() * dstSize.width(); -+ int w = srcBlitRect.width() << 1; -+ int h = srcBlitRect.height(); - -- if((startx+width) > 120) { -- width = 120 - startx; // avoid horizontal overflow -- } -- if((starty+height) > 160) { -- height = 160 - starty; // avoid vertical overflow -+ while (h--) { -+ memcpy(dstBits, srcBits, w); -+ dstBits += dstSize.width(); -+ srcBits += srcSize.width(); - } -+} - -- ulong *sp1, *sp2, *dp1, *dp2; -- ulong stop, sbot, dtop, dbot; -- -- sp1 = (ulong*)bits + startx + starty*240; -- sp2 = sp1 + 120; -- dp1 = (ulong *)fb + (159 - starty) + startx*320; -- dp2 = dp1 + 160; -- int rowadd = (-320*width) - 1; -- int rowadd2 = 240 - width; -- // transfer in cells of 2x2 pixels in words -- for (int y=0; y<height; y++) { -- for (int x=0; x<width; x++) { -- // read source pixels -- stop = *sp1; -- sbot = *sp2; -- // rotate pixels -- dtop = (sbot & 0xffff) + ((stop & 0xffff)<<16); -- dbot = ((sbot & 0xffff0000)>>16) + (stop & 0xffff0000); -- // write to framebuffer -- *dp1 = dtop; -- *dp2 = dbot; -- // update source ptrs -- sp1++; sp2++; -- // update dest ptrs - 2 pix at a time -- dp1 += 320; -- dp2 += 320; -- } -- // adjust src ptrs - skip a row as we work in pairs -- sp1 += rowadd2; -- sp2 += rowadd2; -- // adjust dest ptrs for rotation -- dp1 += rowadd; -- dp2 += rowadd; -- } -+static void -+blitRotate1(Uint16 *dstBits, const QSize& dstSize, -+ const Uint16 *srcBits, const QSize& srcSize, -+ const QRect& srcBlitRect) -+{ -+// fprintf(stdout, "SDL_QT_ROTATION (1) is not implemented.\n"); -+ blitRotate3(dstBits, dstSize, srcBits, srcSize, srcBlitRect); - } - --static inline void --gs_fastRotateBlit_1 ( unsigned short *fb, -- unsigned short *bits, -- const QRect& rect ) { -- // FIXME: this only works correctly for 240x320 displays -- int startx, starty; -- int width, height; -+static void -+blitRotate2(Uint16 *dstBits, const QSize& dstSize, -+ const Uint16 *srcBits, const QSize& srcSize, -+ QRect srcBlitRect) -+{ -+// if (srcBlitRect.left() & 1) -+// srcBlitRect.setLeft(srcBlitRect.left() - 1); -+// if (srcBlitRect.right() & 1) -+// srcBlitRect.setRight(srcBlitRect.right() - 1); - -- startx = rect.left() >> 1; -- starty = rect.top() >> 1; -- width = ((rect.right() - rect.left()) >> 1) + 2; -- height = ((rect.bottom() - rect.top()) >> 1) + 2; -+ int dstBorderLeftRight = (dstSize.width() - srcSize.width()) >>1; -+ int dstBorderTopBottom = (dstSize.height() - srcSize.height()) >>1; -+ int dstStartOffsetX = dstSize.width() - dstBorderLeftRight - 2; -+ int dstStartOffsetY = dstSize.height() - dstBorderTopBottom - 1; -+ int left = srcBlitRect.left() & ~(int)1; // to be 32bit aligned -+ srcBits += left + srcBlitRect.top() * srcSize.width(); -+ dstBits += dstStartOffsetY * dstSize.width() + dstStartOffsetX; -+ dstBits -= left; -+ dstBits -= srcBlitRect.top() * dstSize.width(); - -- if((startx+width) > 120) { -- width = 120 - startx; // avoid horizontal overflow -+ Uint32 *pSrc = (Uint32 *)srcBits; -+ Uint32 *pDst = (Uint32 *)dstBits; -+ -+ int width = srcBlitRect.width(), width2 = srcBlitRect.width(), w; -+ if ( srcBlitRect.left() & 1 ){ -+ width--; width2++; - } -- if((starty+height) > 160) { -- height = 160 - starty; // avoid vertical overflow -+ if ( (srcBlitRect.left()+srcBlitRect.width()) & 1 ){ -+ width--; width2++; - } -+ width >>= 1; -+ int height = srcBlitRect.height(); -+ int srcYAdd = srcSize.width() - width2; -+ int dstYSub = dstSize.width() - width2; - -- ulong *sp1, *sp2, *dp1, *dp2; -- ulong stop, sbot, dtop, dbot; -- fb += 320*239; // Move "fb" to top left corner -- sp1 = (ulong*)bits + startx + starty*240; -- sp2 = sp1 + 120; -- dp1 = (ulong*)fb - startx * 320 - starty; -- dp2 = dp1 - 160; -- int rowadd = (320*width) + 1; -- int rowadd2 = 240 - width; -- // transfer in cells of 2x2 pixels in words -- for (int y=0; y<height; y++) { -- for (int x=0; x<width; x++) { -- // read -- stop = *sp1; -- sbot = *sp2; -- // rotate -- dtop = (stop & 0xffff) + ((sbot & 0xffff)<<16); -- dbot = ((stop & 0xffff0000)>>16) + (sbot & 0xffff0000); -- // write -- *dp1 = dtop; -- *dp2 = dbot; -- // update source ptrs -- sp1++; sp2++; -- // update dest ptrs - 2 pix at a time -- dp1 -= 320; -- dp2 -= 320; -+ while (height--) { -+ w = width; -+ if (srcBlitRect.left() & 1){ -+ *((Uint16 *)pDst) = *(((Uint16 *)pSrc) + 1); -+ pDst--; pSrc++; - } -- // adjust src ptrs - skip a row as we work in pairs -- sp1 += rowadd2; -- sp2 += rowadd2; -- // adjust dest ptrs for rotation -- dp1 += rowadd; -- dp2 += rowadd; -+ while (w--) { -+ *pDst-- = (*pSrc << 16) | (*pSrc >> 16); -+ ++pSrc; -+ } -+ if ((srcBlitRect.left()+srcBlitRect.width()) & 1){ -+ *(((Uint16 *)pDst) + 1) = *((Uint16 *)pSrc); -+ pDst--; pSrc++; -+ } -+ pSrc += srcYAdd; -+ pDst -= dstYSub; - } - } - --// desktop, SL-A300 etc --bool SDL_QWin::repaintRotation0(const QRect& rect) { -- if(my_image->width() == width()) { -- uchar *fb = (uchar*)my_painter->frameBuffer(); -- uchar *buf = (uchar*)my_image->bits(); -- if(rect == my_image->rect()) { -- memcpy(fb, buf, width()*height()*2); -- } else { -- int h = rect.height(); -- int wd = rect.width()<<1; -- int fblineadd = my_painter->lineStep(); -- int buflineadd = my_image->bytesPerLine(); -- fb += (rect.left()<<1) + rect.top() * my_painter->lineStep(); -- buf += (rect.left()<<1) + rect.top() * my_image->bytesPerLine(); -- while(h--) { -- memcpy(fb, buf, wd); -- fb += fblineadd; -- buf += buflineadd; -+#define BLIT_ROTATE_3_MOV32 -+ -+static void -+blitRotate3(Uint16 *dstBits, const QSize& dstSize, -+ const Uint16 *srcBits, const QSize& srcSize, -+ const QRect& srcBlitRect) -+{ -+ if (srcBlitRect.width() != dstSize.height() || -+ srcBlitRect.height() != dstSize.width()) { -+ // partial update -+ const Uint16 *pSrc = srcBits + -+ (srcBlitRect.left() + srcBlitRect.top() * srcSize.width()); -+ -+ int dstBorderLeftRight = (dstSize.width() - srcSize.height()) >>1; -+ int dstBorderTopBottom = (dstSize.height() - srcSize.width()) >>1; -+ int dstStartOffsetX = dstSize.width() - dstBorderLeftRight - 1; -+ int dstStartOffsetY = dstBorderTopBottom; -+ Uint16 *pDst = dstBits + -+ (dstStartOffsetY * dstSize.width() + dstStartOffsetX); -+ pDst += srcBlitRect.left() * dstSize.width(); -+ pDst -= srcBlitRect.top(); -+ -+ int width = srcBlitRect.width(), height = srcBlitRect.height(), w; -+ int srcYAdd = srcSize.width() - srcBlitRect.width(); -+ int dstXAdd = dstSize.width(); -+ int dstYSub = (dstSize.width() * srcBlitRect.width()) + 1; -+ -+#if 0 -+ fprintf(stderr, "---- Blit begin\n"); -+ fprintf(stderr, "srcSize.width: %d srcSize.height:%d\n", -+ srcSize.width(), srcSize.height()); -+ fprintf(stderr, "srcBlitRect.left:%d srcBlitRect.right:%d srcBlitRect.top:%d srcBlitRect.bottom:%d srcBlitRect.width:%d srcBlitRect.height:%d\n", -+ srcBlitRect.left(), srcBlitRect.right(), srcBlitRect.top(), srcBlitRect.bottom(), srcBlitRect.width(), srcBlitRect.height()); -+ -+ fprintf(stderr, "dstSize.width: %d dstSize.height:%d\n", -+ dstSize.width(), dstSize.height()); -+ fprintf(stderr, "dstBorderLeftRight:%d dstBorderTopBottom:%d dstStartOffsetX:%d dstStartOffsetY:%d\n", -+ dstBorderLeftRight, dstBorderTopBottom, dstStartOffsetX, dstStartOffsetY); -+ fprintf(stderr, "srcYAdd:%d dstXAdd:%d dstYSub:%d\n", srcYAdd, dstXAdd, dstYSub); -+#endif -+ -+ while (height--) { -+ w = width; -+ while (w--) { -+ *pDst = *pSrc ++; -+ pDst += dstXAdd; - } -+ pSrc += srcYAdd; -+ pDst -= dstYSub; - } -+ // fprintf(stderr, "---- Blit end\n"); - } else { -- return false; // FIXME: Landscape -- } --#ifdef __i386__ -- my_painter->fillRect( rect, QBrush( Qt::NoBrush ) ); --#endif -- return true; --} -+ // full update -+#if !defined(BLIT_ROTATE_3_MOV32) -+ const Uint16 *src = srcBits; -+ Uint16 *dst = dstBits + (dstSize.width() - 1); -+ int w = srcBlitRect.width(); -+ int h = srcBlitRect.height(); -+ int i, dstSub = dstSize.width() * w + 1; -+ int dstAdd = dstSize.width(); - -- --// Sharp Zaurus SL-5500 etc --bool SDL_QWin::repaintRotation3(const QRect& rect) { -- if(my_image->width() == width()) { -- ushort *fb = (ushort*)my_painter->frameBuffer(); -- ushort *buf = (ushort*)my_image->bits(); -- gs_fastRotateBlit_3(fb, buf, rect); -- } else { -- // landscape mode -- if (screenRotation == SDL_QT_ROTATION_90) { -- uchar *fb = (uchar*)my_painter->frameBuffer(); -- uchar *buf = (uchar*)my_image->bits(); -- if(rect == my_image->rect()) { -- memcpy(fb, buf, width()*height()*2); -- } else { -- int h = rect.height(); -- int wd = rect.width()<<1; -- int fblineadd = my_painter->lineStep(); -- int buflineadd = my_image->bytesPerLine(); -- fb += (rect.left()<<1) + rect.top() * my_painter->lineStep(); -- buf += (rect.left()<<1) + rect.top() * my_image->bytesPerLine(); -- while(h--) { -- memcpy(fb, buf, wd); -- fb += fblineadd; -- buf += buflineadd; -- } -+ while (h--) { -+ i = w; -+ while (i--) { -+ *dst = *src ++; -+ dst += dstAdd; - } -- } else if (screenRotation == SDL_QT_ROTATION_270) { -- int h = rect.height(); -- int wd = rect.width(); -- int fblineadd = my_painter->lineStep() - (rect.width() << 1); -- int buflineadd = my_image->bytesPerLine() - (rect.width() << 1); -- int w; -+ dst -= dstSub; -+ } -+#else // BLIT_ROTATE_3_MOV32 -+ Uint32 *src1 = (Uint32 *)(srcBits); -+ Uint32 *src2 = (Uint32 *)(srcBits + srcSize.width()); -+ Uint32 *dst1 = (Uint32 *)(dstBits + (dstSize.width() - 2)); -+ Uint32 *dst2 = (Uint32 *)(dstBits + (dstSize.width() + dstSize.width() - 2)); -+ int w = srcBlitRect.width() >> 3; -+ int h = srcBlitRect.height() >> 1; -+ int i, dstSub = ((dstSize.width() * srcBlitRect.width()) >> 1) + 1; -+ int dstAdd = dstSize.width(); - -- uchar *fb = (uchar*)my_painter->frameBuffer(); -- uchar *buf = (uchar*)my_image->bits(); -- -- fb += ((my_painter->width() - (rect.top() + rect.height())) * -- my_painter->lineStep()) + ((my_painter->height() - ((rect.left() + -- rect.width()))) << 1); -+ Uint32 a, b; -+ while (h--) { -+ i = w; -+ while (i--) { -+ a = *src1 ++; -+ b = *src2 ++; -+ *dst1 = (a << 16) | (b & 0xFFFF); -+ *dst2 = (a & 0xFFFF0000) | (b >> 16); -+ dst1 += dstAdd; -+ dst2 += dstAdd; - -- buf += my_image->bytesPerLine() * (rect.top() + rect.height()) - -- (((my_image->width() - (rect.left() + rect.width())) << 1) + 2); -+ a = *src1 ++; -+ b = *src2 ++; -+ *dst1 = (a << 16) | (b & 0xFFFF); -+ *dst2 = (a & 0xFFFF0000) | (b >> 16); -+ dst1 += dstAdd; -+ dst2 += dstAdd; - -- while(h--) { -- w = wd; -- while(w--) *((unsigned short*)fb)++ = *((unsigned short*)buf)--; -- fb += fblineadd; -- buf -= buflineadd; -+ a = *src1 ++; -+ b = *src2 ++; -+ *dst1 = (a << 16) | (b & 0xFFFF); -+ *dst2 = (a & 0xFFFF0000) | (b >> 16); -+ dst1 += dstAdd; -+ dst2 += dstAdd; -+ -+ a = *src1 ++; -+ b = *src2 ++; -+ *dst1 = (a << 16) | (b & 0xFFFF); -+ *dst2 = (a & 0xFFFF0000) | (b >> 16); -+ dst1 += dstAdd; -+ dst2 += dstAdd; - } -+ src1 += srcSize.width() >> 1; -+ src2 += srcSize.width() >> 1; -+ dst1 -= dstSub; -+ dst2 -= dstSub; - } -+#endif // BLIT_ROTATE_3_MOV32 - } -- return true; - } - --// ipaq 3800... --bool SDL_QWin::repaintRotation1(const QRect& rect) { -- if(my_image->width() == width()) { -- ushort *fb = (ushort*)my_painter->frameBuffer(); -- ushort *buf = (ushort*)my_image->bits(); -- gs_fastRotateBlit_1(fb, buf, rect); -- } else { -- return false; // FIXME: landscape mode -- } -- return true; --} -+#endif // __i386__ - - void SDL_QWin::repaintRect(const QRect& rect) { - if(!my_painter || !rect.width() || !rect.height()) { - return; - } -- -- if(QPixmap::defaultDepth() == 16) { -- switch(my_painter->transformOrientation()) { -- case 3: -- if(repaintRotation3(rect)) { return; } -+#ifndef __i386__ -+ if (QPixmap::defaultDepth() == 16 && my_painter->numRects() >= 0) { -+ Uint16 *fb = (Uint16*)my_painter->frameBuffer(); -+ Uint16 *buf = (Uint16*)my_image->bits(); -+ switch (rotation_) { -+ case 0: -+ blitRotate0(fb, fbSize_, -+ buf, QSize(my_image->width(), my_image->height()), -+ rect); - break; - case 1: -- if(repaintRotation1(rect)) { return; } -+ blitRotate1(fb, fbSize_, -+ buf, QSize(my_image->width(), my_image->height()), -+ rect); - break; -- case 0: -- if(repaintRotation0(rect)) { return; } -+ case 2: -+ blitRotate2(fb, fbSize_, -+ buf, QSize(my_image->width(), my_image->height()), -+ rect); -+ break; -+ case 3: -+ blitRotate3(fb, fbSize_, -+ buf, QSize(my_image->width(), my_image->height()), -+ rect); - break; - } -- } -- my_painter->drawImage(rect.topLeft(), *my_image, rect); -+ } else { -+#endif // __i386__ -+ QDirectPainter pp(this); -+ pp.drawImage(rect.topLeft(), *my_image, rect); -+// pp.end(); -+#ifndef __i386__ -+ } -+#endif // __i386__ - } - - // This paints the current buffer to the screen, when desired. - void SDL_QWin::paintEvent(QPaintEvent *ev) { -- if(my_image) { -+ if(my_image && isVisible() && isActiveWindow()) { -+ // TODO: better handling - lockScreen(true); - repaintRect(ev->rect()); - unlockScreen(); - } - } - -+int SDL_QWin::ApplyKeyRotation(int key) -+{ -+ int c; -+ int sdlScancode[] = { SDLK_LEFT, SDLK_DOWN, SDLK_RIGHT, SDLK_UP }; -+ -+ switch (key) { -+ case Qt::Key_Left: -+ c = 0; -+ break; -+ case Qt::Key_Down: -+ c = 1; -+ break; -+ case Qt::Key_Right: -+ c = 2; -+ break; -+ case Qt::Key_Up: -+ c = 3; -+ break; -+ default: -+ return 0; -+ } -+ -+// c = (c + qteKeyRotation_) & 3; -+// return sdlScancode[(c - keyRotation_) & 3]; -+ return sdlScancode[(c + qteKeyRotation_ - keyRotation_) & 3]; -+} -+ - /* Function to translate a keyboard transition and queue the key event - * This should probably be a table although this method isn't exactly - * slow. - */ - void SDL_QWin::QueueKey(QKeyEvent *e, int pressed) --{ -+{ -+ if (e->isAutoRepeat()) -+ return; -+ - SDL_keysym keysym; - int scancode = e->key(); -+ - /* Set the keysym information */ - if(scancode >= 'A' && scancode <= 'Z') { - // Qt sends uppercase, SDL wants lowercase -@@ -396,26 +516,12 @@ - case Qt::Key_Home: scancode = SDLK_HOME; break; - case Qt::Key_End: scancode = SDLK_END; break; - // We want the control keys to rotate with the screen -- case Qt::Key_Left: -- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_UP; -- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_DOWN; -- else scancode = SDLK_LEFT; -- break; -- case Qt::Key_Up: -- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_RIGHT; -- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_LEFT; -- else scancode = SDLK_UP; -- break; -- case Qt::Key_Right: -- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_DOWN; -- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_UP; -- else scancode = SDLK_RIGHT; -- break; -+ case Qt::Key_Left: -+ case Qt::Key_Up: -+ case Qt::Key_Right: - case Qt::Key_Down: -- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_LEFT; -- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_RIGHT; -- else scancode = SDLK_DOWN; -- break; -+ scancode = ApplyKeyRotation(scancode); -+ break; - case Qt::Key_Prior: scancode = SDLK_PAGEUP; break; - case Qt::Key_Next: scancode = SDLK_PAGEDOWN; break; - case Qt::Key_Shift: scancode = SDLK_LSHIFT; break; -@@ -434,9 +540,18 @@ - case Qt::Key_F7: scancode = SDLK_F7; break; - case Qt::Key_F8: scancode = SDLK_F8; break; - case Qt::Key_F9: scancode = SDLK_F9; break; -- case Qt::Key_F10: scancode = SDLK_F10; break; -- case Qt::Key_F11: scancode = SDLK_F11; break; -- case Qt::Key_F12: scancode = SDLK_F12; break; -+ case Qt::Key_F10: -+ scancode = SDLK_F10; -+ mouse_button_mode=1; -+ break; -+ case Qt::Key_F11: -+ scancode = SDLK_F11; -+ mouse_button_mode=3; -+ break; -+ case Qt::Key_F12: -+ scancode = SDLK_F12; -+ mouse_button_mode=2; -+ break; - case Qt::Key_F13: scancode = SDLK_F13; break; - case Qt::Key_F14: scancode = SDLK_F14; break; - case Qt::Key_F15: scancode = SDLK_F15; break; -@@ -452,13 +567,14 @@ - // david@hedbor.org - scancode = SDLK_RETURN; - break; -+ - default: - scancode = SDLK_UNKNOWN; - break; - } -- keysym.sym = static_cast<SDLKey>(scancode); -+ keysym.sym = static_cast<SDLKey>(scancode); - } else { -- keysym.sym = static_cast<SDLKey>(scancode); -+ keysym.sym = static_cast<SDLKey>(scancode); - } - keysym.scancode = scancode; - keysym.mod = KMOD_NONE; |
