comparison src/video/gem/SDL_gemvideo.c @ 920:bbefeed8134d

Use SDL_SetError instead of fprintf
author Patrice Mandin <patmandin@gmail.com>
date Thu, 05 Aug 2004 19:34:44 +0000
parents 17822f1f9674
children 6126849e59a6
comparison
equal deleted inserted replaced
919:4b1dd7691f05 920:bbefeed8134d
603 } 603 }
604 604
605 if (use_shadow1) { 605 if (use_shadow1) {
606 GEM_buffer1 = Atari_SysMalloc(screensize, MX_PREFTTRAM); 606 GEM_buffer1 = Atari_SysMalloc(screensize, MX_PREFTTRAM);
607 if (GEM_buffer1==NULL) { 607 if (GEM_buffer1==NULL) {
608 fprintf(stderr,"Unable to allocate shadow buffer\n"); 608 SDL_SetError("Unable to allocate shadow buffer");
609 return NULL; 609 return NULL;
610 } 610 }
611 memset(GEM_buffer1, 0, screensize); 611 memset(GEM_buffer1, 0, screensize);
612 #ifdef DEBUG_VIDEO_GEM 612 #ifdef DEBUG_VIDEO_GEM
613 printf("sdl:video:gem: setvideomode(): allocated buffer 1\n"); 613 printf("sdl:video:gem: setvideomode(): allocated buffer 1\n");
615 } 615 }
616 616
617 if (use_shadow2) { 617 if (use_shadow2) {
618 GEM_buffer2 = Atari_SysMalloc(screensize, MX_PREFTTRAM); 618 GEM_buffer2 = Atari_SysMalloc(screensize, MX_PREFTTRAM);
619 if (GEM_buffer2==NULL) { 619 if (GEM_buffer2==NULL) {
620 fprintf(stderr,"Unable to allocate shadow buffer\n"); 620 SDL_SetError("Unable to allocate shadow buffer");
621 return NULL; 621 return NULL;
622 } 622 }
623 memset(GEM_buffer2, 0, screensize); 623 memset(GEM_buffer2, 0, screensize);
624 #ifdef DEBUG_VIDEO_GEM 624 #ifdef DEBUG_VIDEO_GEM
625 printf("sdl:video:gem: setvideomode(): allocated buffer 2\n"); 625 printf("sdl:video:gem: setvideomode(): allocated buffer 2\n");
669 modeflags |= SDL_NOFRAME; 669 modeflags |= SDL_NOFRAME;
670 } 670 }
671 671
672 if (!wind_calc(0, GEM_win_type, posx, posy, width, height, &x2, &y2, &w2, &h2)) { 672 if (!wind_calc(0, GEM_win_type, posx, posy, width, height, &x2, &y2, &w2, &h2)) {
673 GEM_FreeBuffers(this); 673 GEM_FreeBuffers(this);
674 fprintf(stderr,"Can not calculate window attributes\n"); 674 SDL_SetError("Can not calculate window attributes\n");
675 return NULL; 675 return NULL;
676 } 676 }
677 677
678 /* Create window */ 678 /* Create window */
679 GEM_handle=wind_create(GEM_win_type, x2, y2, w2, h2); 679 GEM_handle=wind_create(GEM_win_type, x2, y2, w2, h2);
680 if (GEM_handle<0) { 680 if (GEM_handle<0) {
681 GEM_FreeBuffers(this); 681 GEM_FreeBuffers(this);
682 fprintf(stderr,"Can not create window\n"); 682 SDL_SetError("Can not create window\n");
683 return NULL; 683 return NULL;
684 } 684 }
685 685
686 #ifdef DEBUG_VIDEO_GEM 686 #ifdef DEBUG_VIDEO_GEM
687 printf("sdl:video:gem: handle=%d\n", GEM_handle); 687 printf("sdl:video:gem: handle=%d\n", GEM_handle);