comparison src/video/os2fslib/SDL_os2fslib.c @ 3013:8cc00819c8d6

Reverted Bob's indent checkin
author Sam Lantinga <slouken@libsdl.org>
date Sat, 10 Jan 2009 21:50:26 +0000
parents 8f4ed5ec2b06
children
comparison
equal deleted inserted replaced
3012:7e30c2dc7783 3013:8cc00819c8d6
438 // Only switch between fullscreen and back if it's not 438 // Only switch between fullscreen and back if it's not
439 // a resizable mode! 439 // a resizable mode!
440 if ((!pVideo->hidden->pSDLSurface) || 440 if ((!pVideo->hidden->pSDLSurface) ||
441 ((pVideo->hidden->pSDLSurface) 441 ((pVideo->hidden->pSDLSurface)
442 && 442 &&
443 ((pVideo->hidden->pSDLSurface-> 443 ((pVideo->hidden->
444 flags & SDL_RESIZABLE) == 0))) 444 pSDLSurface->flags & SDL_RESIZABLE) == 0)))
445 FSLib_ToggleFSMode(hwnd, !FSLib_QueryFSMode(hwnd)); 445 FSLib_ToggleFSMode(hwnd, !FSLib_QueryFSMode(hwnd));
446 #ifdef DEBUG_BUILD 446 #ifdef DEBUG_BUILD
447 else 447 else
448 printf(" Resizable mode, so discarding ALT+HOME!\n"); 448 printf(" Resizable mode, so discarding ALT+HOME!\n");
449 fflush(stdout); 449 fflush(stdout);
688 // the window is resizable and the source buffer size is the 688 // the window is resizable and the source buffer size is the
689 // same as the destination buffer size! 689 // same as the destination buffer size!
690 WinQueryWindowPos(hwnd, &swp); 690 WinQueryWindowPos(hwnd, &swp);
691 if ((!pVideo->hidden->pSDLSurface) || 691 if ((!pVideo->hidden->pSDLSurface) ||
692 ((pVideo->hidden->pSDLSurface) && 692 ((pVideo->hidden->pSDLSurface) &&
693 (pVideo->hidden->pSDLSurface-> 693 (pVideo->hidden->
694 flags & SDL_RESIZABLE) 694 pSDLSurface->flags & SDL_RESIZABLE)
695 && 695 &&
696 ((swp.cx != 696 ((swp.cx !=
697 pVideo->hidden->SrcBufferDesc. 697 pVideo->hidden->
698 uiXResolution) 698 SrcBufferDesc.uiXResolution)
699 || (swp.cy != 699 || (swp.cy !=
700 pVideo->hidden-> 700 pVideo->hidden->SrcBufferDesc.
701 SrcBufferDesc.uiYResolution)) 701 uiYResolution))
702 && (!FSLib_QueryFSMode(hwnd)))) { 702 && (!FSLib_QueryFSMode(hwnd)))) {
703 // Resizable surface and in resizing! 703 // Resizable surface and in resizing!
704 // So, don't blit now! 704 // So, don't blit now!
705 #ifdef DEBUG_BUILD 705 #ifdef DEBUG_BUILD
706 printf 706 printf
715 fflush(stdout); 715 fflush(stdout);
716 #endif 716 #endif
717 FSLIB_BITBLT(hwnd, 717 FSLIB_BITBLT(hwnd,
718 pVideo->hidden->pchSrcBuffer, 0, 718 pVideo->hidden->pchSrcBuffer, 0,
719 0, 719 0,
720 pVideo->hidden->
721 SrcBufferDesc.uiXResolution,
720 pVideo->hidden->SrcBufferDesc. 722 pVideo->hidden->SrcBufferDesc.
721 uiXResolution, 723 uiYResolution);
722 pVideo->hidden->
723 SrcBufferDesc.uiYResolution);
724 } 724 }
725 } 725 }
726 #ifdef DEBUG_BUILD 726 #ifdef DEBUG_BUILD
727 else 727 else
728 printf 728 printf
2501 // Create new software surface! 2501 // Create new software surface!
2502 pResult = SDL_CreateRGBSurface(SDL_SWSURFACE, 2502 pResult = SDL_CreateRGBSurface(SDL_SWSURFACE,
2503 pModeInfoFound->uiXResolution, 2503 pModeInfoFound->uiXResolution,
2504 pModeInfoFound->uiYResolution, 2504 pModeInfoFound->uiYResolution,
2505 pModeInfoFound->uiBPP, ((unsigned int) 2505 pModeInfoFound->uiBPP, ((unsigned int)
2506 pModeInfoFound->PixelFormat.ucRedMask) 2506 pModeInfoFound->
2507 << pModeInfoFound-> 2507 PixelFormat.
2508 PixelFormat.ucRedPosition, 2508 ucRedMask)
2509 ((unsigned int) 2509 << pModeInfoFound->PixelFormat.
2510 pModeInfoFound->PixelFormat.ucGreenMask) 2510 ucRedPosition, ((unsigned int)
2511 << pModeInfoFound-> 2511 pModeInfoFound->
2512 PixelFormat.ucGreenPosition, 2512 PixelFormat.
2513 ((unsigned int) 2513 ucGreenMask)
2514 pModeInfoFound->PixelFormat.ucBlueMask) 2514 << pModeInfoFound->PixelFormat.
2515 << pModeInfoFound-> 2515 ucGreenPosition, ((unsigned int)
2516 PixelFormat.ucBluePosition, 2516 pModeInfoFound->
2517 ((unsigned int) 2517 PixelFormat.
2518 pModeInfoFound->PixelFormat.ucAlphaMask) 2518 ucBlueMask)
2519 << pModeInfoFound-> 2519 << pModeInfoFound->PixelFormat.
2520 PixelFormat.ucAlphaPosition); 2520 ucBluePosition, ((unsigned int)
2521 pModeInfoFound->
2522 PixelFormat.
2523 ucAlphaMask)
2524 << pModeInfoFound->PixelFormat.
2525 ucAlphaPosition);
2521 2526
2522 if (pResult == NULL) { 2527 if (pResult == NULL) {
2523 DosReleaseMutexSem(_this->hidden->hmtxUseSrcBuffer); 2528 DosReleaseMutexSem(_this->hidden->hmtxUseSrcBuffer);
2524 SDL_OutOfMemory(); 2529 SDL_OutOfMemory();
2525 return NULL; 2530 return NULL;
2529 fflush(stdout); 2534 fflush(stdout);
2530 #endif 2535 #endif
2531 2536
2532 // Adjust pixel format mask! 2537 // Adjust pixel format mask!
2533 pResult->format->Rmask = 2538 pResult->format->Rmask =
2534 ((unsigned int) pModeInfoFound->PixelFormat. 2539 ((unsigned int) pModeInfoFound->
2535 ucRedMask) << pModeInfoFound->PixelFormat.ucRedPosition; 2540 PixelFormat.ucRedMask) << pModeInfoFound->PixelFormat.
2541 ucRedPosition;
2536 pResult->format->Rshift = pModeInfoFound->PixelFormat.ucRedPosition; 2542 pResult->format->Rshift = pModeInfoFound->PixelFormat.ucRedPosition;
2537 pResult->format->Rloss = pModeInfoFound->PixelFormat.ucRedAdjust; 2543 pResult->format->Rloss = pModeInfoFound->PixelFormat.ucRedAdjust;
2538 pResult->format->Gmask = 2544 pResult->format->Gmask =
2539 ((unsigned int) pModeInfoFound->PixelFormat. 2545 ((unsigned int) pModeInfoFound->
2540 ucGreenMask) << pModeInfoFound->PixelFormat.ucGreenPosition; 2546 PixelFormat.ucGreenMask) << pModeInfoFound->PixelFormat.
2547 ucGreenPosition;
2541 pResult->format->Gshift = pModeInfoFound->PixelFormat.ucGreenPosition; 2548 pResult->format->Gshift = pModeInfoFound->PixelFormat.ucGreenPosition;
2542 pResult->format->Gloss = pModeInfoFound->PixelFormat.ucGreenAdjust; 2549 pResult->format->Gloss = pModeInfoFound->PixelFormat.ucGreenAdjust;
2543 pResult->format->Bmask = 2550 pResult->format->Bmask =
2544 ((unsigned int) pModeInfoFound->PixelFormat. 2551 ((unsigned int) pModeInfoFound->
2545 ucBlueMask) << pModeInfoFound->PixelFormat.ucBluePosition; 2552 PixelFormat.ucBlueMask) << pModeInfoFound->PixelFormat.
2553 ucBluePosition;
2546 pResult->format->Bshift = pModeInfoFound->PixelFormat.ucBluePosition; 2554 pResult->format->Bshift = pModeInfoFound->PixelFormat.ucBluePosition;
2547 pResult->format->Bloss = pModeInfoFound->PixelFormat.ucBlueAdjust; 2555 pResult->format->Bloss = pModeInfoFound->PixelFormat.ucBlueAdjust;
2548 pResult->format->Amask = 2556 pResult->format->Amask =
2549 ((unsigned int) pModeInfoFound->PixelFormat. 2557 ((unsigned int) pModeInfoFound->
2550 ucAlphaMask) << pModeInfoFound->PixelFormat.ucAlphaPosition; 2558 PixelFormat.ucAlphaMask) << pModeInfoFound->PixelFormat.
2559 ucAlphaPosition;
2551 pResult->format->Ashift = pModeInfoFound->PixelFormat.ucAlphaPosition; 2560 pResult->format->Ashift = pModeInfoFound->PixelFormat.ucAlphaPosition;
2552 pResult->format->Aloss = pModeInfoFound->PixelFormat.ucAlphaAdjust; 2561 pResult->format->Aloss = pModeInfoFound->PixelFormat.ucAlphaAdjust;
2553 2562
2554 #ifdef REPORT_EMPTY_ALPHA_MASK 2563 #ifdef REPORT_EMPTY_ALPHA_MASK
2555 pResult->format->Amask = 2564 pResult->format->Amask =
2804 /* Determine the screen depth */ 2813 /* Determine the screen depth */
2805 vformat->BitsPerPixel = pDesktopMode->uiBPP; 2814 vformat->BitsPerPixel = pDesktopMode->uiBPP;
2806 vformat->BytesPerPixel = (vformat->BitsPerPixel + 7) / 8; 2815 vformat->BytesPerPixel = (vformat->BitsPerPixel + 7) / 8;
2807 2816
2808 vformat->Rmask = 2817 vformat->Rmask =
2809 ((unsigned int) pDesktopMode->PixelFormat.ucRedMask) << pDesktopMode-> 2818 ((unsigned int) pDesktopMode->PixelFormat.
2810 PixelFormat.ucRedPosition; 2819 ucRedMask) << pDesktopMode->PixelFormat.ucRedPosition;
2811 vformat->Rshift = pDesktopMode->PixelFormat.ucRedPosition; 2820 vformat->Rshift = pDesktopMode->PixelFormat.ucRedPosition;
2812 vformat->Rloss = pDesktopMode->PixelFormat.ucRedAdjust; 2821 vformat->Rloss = pDesktopMode->PixelFormat.ucRedAdjust;
2813 vformat->Gmask = 2822 vformat->Gmask =
2814 ((unsigned int) pDesktopMode->PixelFormat. 2823 ((unsigned int) pDesktopMode->
2815 ucGreenMask) << pDesktopMode->PixelFormat.ucGreenPosition; 2824 PixelFormat.ucGreenMask) << pDesktopMode->PixelFormat.
2825 ucGreenPosition;
2816 vformat->Gshift = pDesktopMode->PixelFormat.ucGreenPosition; 2826 vformat->Gshift = pDesktopMode->PixelFormat.ucGreenPosition;
2817 vformat->Gloss = pDesktopMode->PixelFormat.ucGreenAdjust; 2827 vformat->Gloss = pDesktopMode->PixelFormat.ucGreenAdjust;
2818 vformat->Bmask = 2828 vformat->Bmask =
2819 ((unsigned int) pDesktopMode->PixelFormat. 2829 ((unsigned int) pDesktopMode->
2820 ucBlueMask) << pDesktopMode->PixelFormat.ucBluePosition; 2830 PixelFormat.ucBlueMask) << pDesktopMode->PixelFormat.ucBluePosition;
2821 vformat->Bshift = pDesktopMode->PixelFormat.ucBluePosition; 2831 vformat->Bshift = pDesktopMode->PixelFormat.ucBluePosition;
2822 vformat->Bloss = pDesktopMode->PixelFormat.ucBlueAdjust; 2832 vformat->Bloss = pDesktopMode->PixelFormat.ucBlueAdjust;
2823 vformat->Amask = 2833 vformat->Amask =
2824 ((unsigned int) pDesktopMode->PixelFormat. 2834 ((unsigned int) pDesktopMode->
2825 ucAlphaMask) << pDesktopMode->PixelFormat.ucAlphaPosition; 2835 PixelFormat.ucAlphaMask) << pDesktopMode->PixelFormat.
2836 ucAlphaPosition;
2826 vformat->Ashift = pDesktopMode->PixelFormat.ucAlphaPosition; 2837 vformat->Ashift = pDesktopMode->PixelFormat.ucAlphaPosition;
2827 vformat->Aloss = pDesktopMode->PixelFormat.ucAlphaAdjust; 2838 vformat->Aloss = pDesktopMode->PixelFormat.ucAlphaAdjust;
2828 2839
2829 #ifdef REPORT_EMPTY_ALPHA_MASK 2840 #ifdef REPORT_EMPTY_ALPHA_MASK
2830 vformat->Amask = vformat->Ashift = vformat->Aloss = 0; 2841 vformat->Amask = vformat->Ashift = vformat->Aloss = 0;
2925 SDL_memcpy(&(_this->hidden->SrcBufferDesc), 2936 SDL_memcpy(&(_this->hidden->SrcBufferDesc),
2926 _this->hidden->pAvailableFSLibVideoModes, 2937 _this->hidden->pAvailableFSLibVideoModes,
2927 sizeof(_this->hidden->SrcBufferDesc)); 2938 sizeof(_this->hidden->SrcBufferDesc));
2928 // Allocate new video buffer! 2939 // Allocate new video buffer!
2929 _this->hidden->pchSrcBuffer = 2940 _this->hidden->pchSrcBuffer =
2930 (char *) SDL_malloc(_this->hidden->pAvailableFSLibVideoModes-> 2941 (char *) SDL_malloc(_this->hidden->
2931 uiScanLineSize * 2942 pAvailableFSLibVideoModes->uiScanLineSize *
2932 _this->hidden->pAvailableFSLibVideoModes-> 2943 _this->hidden->
2933 uiYResolution); 2944 pAvailableFSLibVideoModes->uiYResolution);
2934 if (!_this->hidden->pchSrcBuffer) { 2945 if (!_this->hidden->pchSrcBuffer) {
2935 #ifdef DEBUG_BUILD 2946 #ifdef DEBUG_BUILD
2936 printf 2947 printf
2937 ("[os2fslib_VideoInit] : Yikes, not enough memory for new video buffer!\n"); 2948 ("[os2fslib_VideoInit] : Yikes, not enough memory for new video buffer!\n");
2938 fflush(stdout); 2949 fflush(stdout);