src/video/qtopia/SDL_QWin.cc
branchSDL-1.3
changeset 1663 11775724e3fe
parent 1662 782fd950bd46
child 1664 cd3db072ba8a
equal deleted inserted replaced
1662:782fd950bd46 1663:11775724e3fe
   263         dp2 += rowadd;
   263         dp2 += rowadd;
   264     }
   264     }
   265 }
   265 }
   266 
   266 
   267 // desktop, SL-A300 etc
   267 // desktop, SL-A300 etc
   268 bool SDL_QWin::repaintRotation0 (const QRect & rect)
   268 bool
       
   269 SDL_QWin::repaintRotation0 (const QRect & rect)
   269 {
   270 {
   270     if (my_image->width () == width ()) {
   271     if (my_image->width () == width ()) {
   271         uchar *
   272         uchar *fb = (uchar *) my_painter->frameBuffer ();
   272             fb = (uchar *) my_painter->frameBuffer ();
   273         uchar *buf = (uchar *) my_image->bits ();
   273         uchar *
       
   274             buf = (uchar *) my_image->bits ();
       
   275         if (rect == my_image->rect ()) {
   274         if (rect == my_image->rect ()) {
   276             SDL_memcpy (fb, buf, width () * height () * 2);
   275             SDL_memcpy (fb, buf, width () * height () * 2);
   277         } else {
   276         } else {
   278             int
   277             int h = rect.height ();
   279                 h = rect.height ();
   278             int wd = rect.width () << 1;
   280             int
   279             int fblineadd = my_painter->lineStep ();
   281                 wd = rect.width () << 1;
   280             int buflineadd = my_image->bytesPerLine ();
   282             int
       
   283                 fblineadd = my_painter->lineStep ();
       
   284             int
       
   285                 buflineadd = my_image->bytesPerLine ();
       
   286             fb += (rect.left () << 1) + rect.top () * my_painter->lineStep ();
   281             fb += (rect.left () << 1) + rect.top () * my_painter->lineStep ();
   287             buf +=
   282             buf +=
   288                 (rect.left () << 1) + rect.top () * my_image->bytesPerLine ();
   283                 (rect.left () << 1) + rect.top () * my_image->bytesPerLine ();
   289             while (h--) {
   284             while (h--) {
   290                 SDL_memcpy (fb, buf, wd);
   285                 SDL_memcpy (fb, buf, wd);
   301     return true;
   296     return true;
   302 }
   297 }
   303 
   298 
   304 
   299 
   305 // Sharp Zaurus SL-5500 etc 
   300 // Sharp Zaurus SL-5500 etc 
   306 bool SDL_QWin::repaintRotation3 (const QRect & rect)
   301 bool
       
   302 SDL_QWin::repaintRotation3 (const QRect & rect)
   307 {
   303 {
   308     if (my_image->width () == width ()) {
   304     if (my_image->width () == width ()) {
   309         ushort *
   305         ushort *fb = (ushort *) my_painter->frameBuffer ();
   310             fb = (ushort *) my_painter->frameBuffer ();
   306         ushort *buf = (ushort *) my_image->bits ();
   311         ushort *
       
   312             buf = (ushort *) my_image->bits ();
       
   313         gs_fastRotateBlit_3 (fb, buf, rect);
   307         gs_fastRotateBlit_3 (fb, buf, rect);
   314     } else {
   308     } else {
   315         // landscape mode
   309         // landscape mode
   316         if (screenRotation == SDL_QT_ROTATION_90) {
   310         if (screenRotation == SDL_QT_ROTATION_90) {
   317             uchar *
   311             uchar *fb = (uchar *) my_painter->frameBuffer ();
   318                 fb = (uchar *) my_painter->frameBuffer ();
   312             uchar *buf = (uchar *) my_image->bits ();
   319             uchar *
       
   320                 buf = (uchar *) my_image->bits ();
       
   321             if (rect == my_image->rect ()) {
   313             if (rect == my_image->rect ()) {
   322                 SDL_memcpy (fb, buf, width () * height () * 2);
   314                 SDL_memcpy (fb, buf, width () * height () * 2);
   323             } else {
   315             } else {
   324                 int
   316                 int h = rect.height ();
   325                     h = rect.height ();
   317                 int wd = rect.width () << 1;
   326                 int
   318                 int fblineadd = my_painter->lineStep ();
   327                     wd = rect.width () << 1;
   319                 int buflineadd = my_image->bytesPerLine ();
   328                 int
       
   329                     fblineadd = my_painter->lineStep ();
       
   330                 int
       
   331                     buflineadd = my_image->bytesPerLine ();
       
   332                 fb +=
   320                 fb +=
   333                     (rect.left () << 1) +
   321                     (rect.left () << 1) +
   334                     rect.top () * my_painter->lineStep ();
   322                     rect.top () * my_painter->lineStep ();
   335                 buf +=
   323                 buf +=
   336                     (rect.left () << 1) +
   324                     (rect.left () << 1) +
   340                     fb += fblineadd;
   328                     fb += fblineadd;
   341                     buf += buflineadd;
   329                     buf += buflineadd;
   342                 }
   330                 }
   343             }
   331             }
   344         } else if (screenRotation == SDL_QT_ROTATION_270) {
   332         } else if (screenRotation == SDL_QT_ROTATION_270) {
   345             int
   333             int h = rect.height ();
   346                 h = rect.height ();
   334             int wd = rect.width ();
   347             int
   335             int fblineadd = my_painter->lineStep () - (rect.width () << 1);
   348                 wd = rect.width ();
   336             int buflineadd = my_image->bytesPerLine () - (rect.width () << 1);
   349             int
   337             int w;
   350                 fblineadd = my_painter->lineStep () - (rect.width () << 1);
   338 
   351             int
   339             uchar *fb = (uchar *) my_painter->frameBuffer ();
   352                 buflineadd = my_image->bytesPerLine () - (rect.width () << 1);
   340             uchar *buf = (uchar *) my_image->bits ();
   353             int
       
   354                 w;
       
   355 
       
   356             uchar *
       
   357                 fb = (uchar *) my_painter->frameBuffer ();
       
   358             uchar *
       
   359                 buf = (uchar *) my_image->bits ();
       
   360 
   341 
   361             fb +=
   342             fb +=
   362                 ((my_painter->width () -
   343                 ((my_painter->width () -
   363                   (rect.top () +
   344                   (rect.top () +
   364                    rect.height ())) * my_painter->lineStep ()) +
   345                    rect.height ())) * my_painter->lineStep ()) +
   382     }
   363     }
   383     return true;
   364     return true;
   384 }
   365 }
   385 
   366 
   386 // ipaq 3800...
   367 // ipaq 3800...
   387 bool SDL_QWin::repaintRotation1 (const QRect & rect)
   368 bool
       
   369 SDL_QWin::repaintRotation1 (const QRect & rect)
   388 {
   370 {
   389     if (my_image->width () == width ()) {
   371     if (my_image->width () == width ()) {
   390         ushort *
   372         ushort *fb = (ushort *) my_painter->frameBuffer ();
   391             fb = (ushort *) my_painter->frameBuffer ();
   373         ushort *buf = (ushort *) my_image->bits ();
   392         ushort *
       
   393             buf = (ushort *) my_image->bits ();
       
   394         gs_fastRotateBlit_1 (fb, buf, rect);
   374         gs_fastRotateBlit_1 (fb, buf, rect);
   395     } else {
   375     } else {
   396         return false;           // FIXME: landscape mode
   376         return false;           // FIXME: landscape mode
   397     }
   377     }
   398     return true;
   378     return true;
   678         showFullScreen ();
   658         showFullScreen ();
   679         my_has_fullscreen = true;
   659         my_has_fullscreen = true;
   680     }
   660     }
   681 }
   661 }
   682 
   662 
   683 bool SDL_QWin::lockScreen (bool force)
   663 bool
       
   664 SDL_QWin::lockScreen (bool force)
   684 {
   665 {
   685     if (!my_painter) {
   666     if (!my_painter) {
   686         if (force || (isVisible () && isActiveWindow ())) {
   667         if (force || (isVisible () && isActiveWindow ())) {
   687             my_painter = new QDirectPainter (this);
   668             my_painter = new QDirectPainter (this);
   688         } else {
   669         } else {