comparison src/video/qnxgf/SDL_qnxgf.c @ 3124:d7174e9f65ce

More checks for current GF state were added.
author Mike Gorchak <lestat@i.com.ua>
date Thu, 14 May 2009 11:51:42 +0000
parents b17f1ae7ad66
children d71d8ceda8b3
comparison
equal deleted inserted replaced
3123:60301ed80050 3124:d7174e9f65ce
206 206
207 /* Detach from graphics device driver, if it was initialized */ 207 /* Detach from graphics device driver, if it was initialized */
208 if (gfdata->gfinitialized!=SDL_FALSE) 208 if (gfdata->gfinitialized!=SDL_FALSE)
209 { 209 {
210 gf_dev_detach(gfdata->gfdev); 210 gf_dev_detach(gfdata->gfdev);
211 gfdata->gfdev=NULL;
211 } 212 }
212 213
213 if (device->driverdata!=NULL) 214 if (device->driverdata!=NULL)
214 { 215 {
215 device->driverdata=NULL; 216 device->driverdata=NULL;
527 return 1; 528 return 1;
528 } 529 }
529 530
530 void qnxgf_videoquit(_THIS) 531 void qnxgf_videoquit(_THIS)
531 { 532 {
532 SDL_DisplayData* didata; 533 SDL_DisplayData* didata=NULL;
533 uint32_t it; 534 uint32_t it;
534 535
535 /* Stop collecting mouse events */ 536 /* Stop collecting mouse events */
536 hiddi_disable_mouse(); 537 hiddi_disable_mouse();
537 /* Delete GF input devices */ 538 /* Delete GF input devices */
544 545
545 /* Free cursor image */ 546 /* Free cursor image */
546 if (didata->cursor.cursor.bitmap.image0!=NULL) 547 if (didata->cursor.cursor.bitmap.image0!=NULL)
547 { 548 {
548 SDL_free((void*)didata->cursor.cursor.bitmap.image0); 549 SDL_free((void*)didata->cursor.cursor.bitmap.image0);
550 didata->cursor.cursor.bitmap.image0=NULL;
549 } 551 }
550 if (didata->cursor.cursor.bitmap.image1!=NULL) 552 if (didata->cursor.cursor.bitmap.image1!=NULL)
551 { 553 {
552 SDL_free((void*)didata->cursor.cursor.bitmap.image1); 554 SDL_free((void*)didata->cursor.cursor.bitmap.image1);
555 didata->cursor.cursor.bitmap.image1=NULL;
553 } 556 }
554 557
555 /* Free main surface */ 558 /* Free main surface */
556 if (didata->surface[0]!=NULL) 559 if (didata->surface[0]!=NULL)
557 { 560 {
579 /* Disable layer if hardware supports this */ 582 /* Disable layer if hardware supports this */
580 gf_layer_disable(didata->layer); 583 gf_layer_disable(didata->layer);
581 584
582 /* Detach from layer, free it for others */ 585 /* Detach from layer, free it for others */
583 gf_layer_detach(didata->layer); 586 gf_layer_detach(didata->layer);
587 didata->layer=NULL;
584 588
585 /* Mark it as detached */ 589 /* Mark it as detached */
586 didata->layer_attached=SDL_FALSE; 590 didata->layer_attached=SDL_FALSE;
587 } 591 }
588 592
589 /* Detach from selected display */ 593 /* Detach from selected display */
590 gf_display_detach(didata->display); 594 gf_display_detach(didata->display);
595 didata->display=NULL;
591 } 596 }
592 } 597 }
593 598
594 void qnxgf_getdisplaymodes(_THIS) 599 void qnxgf_getdisplaymodes(_THIS)
595 { 600 {