comparison test/testoverlay2.c @ 753:b14fdadd8311

Date: Thu, 4 Dec 2003 07:48:40 +0200 From: "Mike Gorchak" Subject: SDL/QNX6 new patch Here in attachment my patch for the SDL/QNX6 again :) It contain non-crtitical/cosmetic fixes: 1. Fixed window centering at other than the first consoles. 2. Fixed window centering algorithm in case when window height or width are greater than the desktop resolution. 3. Fixed window positioning on other than the first consoles. 4. Fixed occasional input focus lost when switching to fullscreen. 5. Removed the Photon's default chroma color for the overlays, added RGB(12, 6, 12) color instead (very dark pink). 6. Added more checks to the YUV overlay code (fixed crashes during resolution mode switches). 7. Added support for Enter/Backspace keys in unicode mode (used by Maelstrom and by other games). 8. Fixed window restore/maximize function. It works, finally.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 10 Dec 2003 12:35:56 +0000
parents 63419da96d13
children 05c551e5bc64
comparison
equal deleted inserted replaced
752:4bb432a0f6e0 753:b14fdadd8311
273 SDL_Overlay* overlay; 273 SDL_Overlay* overlay;
274 SDL_Rect overlayrect; 274 SDL_Rect overlayrect;
275 SDL_Event event; 275 SDL_Event event;
276 Uint32 lastftick; 276 Uint32 lastftick;
277 int paused=0; 277 int paused=0;
278 int resized=0;
278 int i; 279 int i;
279 int fps=12; 280 int fps=12;
280 int fpsdelay; 281 int fpsdelay;
281 int overlay_format=SDL_YUY2_OVERLAY; 282 int overlay_format=SDL_YUY2_OVERLAY;
282 int scale=5; 283 int scale=5;
503 { 504 {
504 case SDL_VIDEORESIZE: 505 case SDL_VIDEORESIZE:
505 screen=SDL_SetVideoMode(event.resize.w, event.resize.h, 0, SDL_RESIZABLE | SDL_SWSURFACE); 506 screen=SDL_SetVideoMode(event.resize.w, event.resize.h, 0, SDL_RESIZABLE | SDL_SWSURFACE);
506 overlayrect.w=event.resize.w; 507 overlayrect.w=event.resize.w;
507 overlayrect.h=event.resize.h; 508 overlayrect.h=event.resize.h;
509 if (paused)
510 {
511 resized=1;
512 }
508 break; 513 break;
509 case SDL_KEYDOWN: 514 case SDL_KEYDOWN:
510 if (event.key.keysym.sym == SDLK_SPACE) 515 if (event.key.keysym.sym == SDLK_SPACE)
511 { 516 {
512 paused=!paused; 517 paused=!paused;
524 } 529 }
525 return 0; 530 return 0;
526 } 531 }
527 } 532 }
528 533
529 if (!paused) 534 if ((!paused)||(resized))
530 { 535 {
531 if ((SDL_GetTicks()-lastftick)>fpsdelay) 536 if (((SDL_GetTicks()-lastftick)>fpsdelay)||(resized))
532 { 537 {
533 lastftick=SDL_GetTicks(); 538 lastftick=SDL_GetTicks();
534 539
535 switch (overlay_format) 540 switch (overlay_format)
536 { 541 {
550 ConvertRGBtoIYUV(MooseFrame[i], overlay, 0, 100); 555 ConvertRGBtoIYUV(MooseFrame[i], overlay, 0, 100);
551 break; 556 break;
552 } 557 }
553 558
554 SDL_DisplayYUVOverlay(overlay, &overlayrect); 559 SDL_DisplayYUVOverlay(overlay, &overlayrect);
555 i++; 560 if (!resized)
556 if (i==10) 561 {
557 { 562 i++;
558 i=0; 563 if (i==10)
564 {
565 i=0;
566 }
567 }
568 else
569 {
570 resized=0;
559 } 571 }
560 } 572 }
561 } 573 }
562 /* kind of timeslice to OS */ 574 /* kind of timeslice to OS */
563 SDL_Delay(1); 575 SDL_Delay(1);