comparison src/video/photon/SDL_phyuv.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 8bedd6d61642
children b8d311d90021
comparison
equal deleted inserted replaced
752:4bb432a0f6e0 753:b14fdadd8311
180 overlay->hwdata->props.format = format; 180 overlay->hwdata->props.format = format;
181 overlay->hwdata->props.size = sizeof(PgScalerProps_t); 181 overlay->hwdata->props.size = sizeof(PgScalerProps_t);
182 overlay->hwdata->props.src_dim.w = width; 182 overlay->hwdata->props.src_dim.w = width;
183 overlay->hwdata->props.src_dim.h = height; 183 overlay->hwdata->props.src_dim.h = height;
184 184
185 overlay->hwdata->chromakey = PgGetOverlayChromaColor(); 185 /* overlay->hwdata->chromakey = PgGetOverlayChromaColor(); */
186 overlay->hwdata->chromakey = PgRGB(12, 6, 12); /* very dark pink color */
187 overlay->hwdata->props.color_key = overlay->hwdata->chromakey;
186 188
187 PhAreaToRect(&overlay->hwdata->CurrentViewPort, &overlay->hwdata->props.viewport); 189 PhAreaToRect(&overlay->hwdata->CurrentViewPort, &overlay->hwdata->props.viewport);
188 190
189 overlay->hwdata->props.flags = Pg_SCALER_PROP_DOUBLE_BUFFER; 191 overlay->hwdata->props.flags = Pg_SCALER_PROP_DOUBLE_BUFFER;
190 192
191 if ((overlay->hwdata->ischromakey)&&(overlay->hwdata->chromakey)) 193 if ((overlay->hwdata->ischromakey)&&(overlay->hwdata->chromakey))
192 { 194 {
193 overlay->hwdata->props.flags |= Pg_SCALER_PROP_CHROMA_ENABLE; 195 overlay->hwdata->props.flags |= Pg_SCALER_PROP_CHROMA_ENABLE;
196 overlay->hwdata->props.flags |= Pg_SCALER_PROP_CHROMA_SPECIFY_KEY_MASK;
194 } 197 }
195 else 198 else
196 { 199 {
197 overlay->hwdata->props.flags &= ~Pg_SCALER_PROP_CHROMA_ENABLE; 200 overlay->hwdata->props.flags &= ~Pg_SCALER_PROP_CHROMA_ENABLE;
198 } 201 }
284 287
285 int ph_LockYUVOverlay(_THIS, SDL_Overlay* overlay) 288 int ph_LockYUVOverlay(_THIS, SDL_Overlay* overlay)
286 { 289 {
287 if (overlay == NULL) 290 if (overlay == NULL)
288 { 291 {
289 return 0; 292 return -1;
290 } 293 }
291 294
292 overlay->hwdata->locked = 1; 295 overlay->hwdata->locked = 1;
293 296
294 /* overlay->hwdata->current = PgNextVideoFrame(overlay->hwdata->channel); 297 /* overlay->hwdata->current = PgNextVideoFrame(overlay->hwdata->channel);
330 333
331 void ph_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay) 334 void ph_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay)
332 { 335 {
333 if (overlay == NULL) 336 if (overlay == NULL)
334 { 337 {
335 return; 338 return;
336 } 339 }
337 340
338 overlay->hwdata->locked = 0; 341 overlay->hwdata->locked = 0;
339 } 342 }
340 343
404 rtncode = PgConfigScalerChannel(overlay->hwdata->channel, &(overlay->hwdata->props)); 407 rtncode = PgConfigScalerChannel(overlay->hwdata->channel, &(overlay->hwdata->props));
405 408
406 switch(rtncode) 409 switch(rtncode)
407 { 410 {
408 case -1: 411 case -1:
409 SDL_SetError("PgConfigScalerChannel failed\n"); 412 SDL_SetError("PgConfigScalerChannel() function failed\n");
410 SDL_FreeYUVOverlay(overlay); 413 SDL_FreeYUVOverlay(overlay);
411 return (0); 414 return -1;
412 case 1: 415 case 1:
413 grab_ptrs2(overlay->hwdata->channel, overlay->hwdata->FrameData0, overlay->hwdata->FrameData1); 416 grab_ptrs2(overlay->hwdata->channel, overlay->hwdata->FrameData0, overlay->hwdata->FrameData1);
414 break; 417 break;
415 case 0: 418 case 0:
416 default: 419 default: