comparison src/video/directfb/SDL_DirectFB_video.c @ 1336:3692456e7b0f

Use SDL_ prefixed versions of C library functions. FIXME: Change #include <stdlib.h> to #include "SDL_stdlib.h" Change #include <string.h> to #include "SDL_string.h" Make sure nothing else broke because of this...
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 06:59:48 +0000
parents c9b51268668f
children 604d73db6802
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
96 return 1; 96 return 1;
97 } 97 }
98 98
99 static void DirectFB_DeleteDevice(SDL_VideoDevice *device) 99 static void DirectFB_DeleteDevice(SDL_VideoDevice *device)
100 { 100 {
101 free(device->hidden); 101 SDL_free(device->hidden);
102 free(device); 102 SDL_free(device);
103 } 103 }
104 104
105 static SDL_VideoDevice *DirectFB_CreateDevice(int devindex) 105 static SDL_VideoDevice *DirectFB_CreateDevice(int devindex)
106 { 106 {
107 SDL_VideoDevice *device; 107 SDL_VideoDevice *device;
108 108
109 /* Initialize all variables that we clean on shutdown */ 109 /* Initialize all variables that we clean on shutdown */
110 device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice)); 110 device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
111 if (device) 111 if (device)
112 { 112 {
113 memset (device, 0, (sizeof *device)); 113 memset (device, 0, (sizeof *device));
114 device->hidden = (struct SDL_PrivateVideoData *) malloc (sizeof (*device->hidden)); 114 device->hidden = (struct SDL_PrivateVideoData *) malloc (sizeof (*device->hidden));
115 } 115 }
465 HIDDEN->initialized = 1; 465 HIDDEN->initialized = 1;
466 HIDDEN->dfb = dfb; 466 HIDDEN->dfb = dfb;
467 HIDDEN->layer = layer; 467 HIDDEN->layer = layer;
468 HIDDEN->eventbuffer = events; 468 HIDDEN->eventbuffer = events;
469 469
470 if (getenv("SDL_DIRECTFB_MGA_CRTC2") != NULL) 470 if (SDL_getenv("SDL_DIRECTFB_MGA_CRTC2") != NULL)
471 HIDDEN->enable_mga_crtc2 = 1; 471 HIDDEN->enable_mga_crtc2 = 1;
472 472
473 if (HIDDEN->enable_mga_crtc2) 473 if (HIDDEN->enable_mga_crtc2)
474 { 474 {
475 DFBDisplayLayerConfig dlc; 475 DFBDisplayLayerConfig dlc;
539 HIDDEN->c2frame->Clear(HIDDEN->c2frame, 0, 0, 0, 0xff ); 539 HIDDEN->c2frame->Clear(HIDDEN->c2frame, 0, 0, 0, 0xff );
540 540
541 HIDDEN->c2layer->SetOpacity(HIDDEN->c2layer, 0xFF ); 541 HIDDEN->c2layer->SetOpacity(HIDDEN->c2layer, 0xFF );
542 542
543 /* Check if overscan is possibly set */ 543 /* Check if overscan is possibly set */
544 if (getenv("SDL_DIRECTFB_MGA_OVERSCAN") != NULL) 544 if (SDL_getenv("SDL_DIRECTFB_MGA_OVERSCAN") != NULL)
545 { 545 {
546 float overscan = 0; 546 float overscan = 0;
547 if (sscanf(getenv("SDL_DIRECTFB_MGA_OVERSCAN"), "%f", &overscan) == 1) 547 if (SDL_sscanf(SDL_getenv("SDL_DIRECTFB_MGA_OVERSCAN"), "%f", &overscan) == 1)
548 if (overscan > 0 && overscan < 2) 548 if (overscan > 0 && overscan < 2)
549 HIDDEN->mga_crtc2_stretch_overscan = overscan; 549 HIDDEN->mga_crtc2_stretch_overscan = overscan;
550 } 550 }
551 551
552 #ifdef DIRECTFB_CRTC2_DEBUG 552 #ifdef DIRECTFB_CRTC2_DEBUG
712 HIDDEN->c2dsize.w = width; 712 HIDDEN->c2dsize.w = width;
713 HIDDEN->c2dsize.h = height; 713 HIDDEN->c2dsize.h = height;
714 714
715 HIDDEN->mga_crtc2_stretch = 0; 715 HIDDEN->mga_crtc2_stretch = 0;
716 716
717 if (getenv("SDL_DIRECTFB_MGA_STRETCH") != NULL) 717 if (SDL_getenv("SDL_DIRECTFB_MGA_STRETCH") != NULL)
718 { 718 {
719 /* Normally assume a picture aspect ratio of 4:3 */ 719 /* Normally assume a picture aspect ratio of 4:3 */
720 int zoom_aspect_x = 4, zoom_aspect_y = 3, i, j; 720 int zoom_aspect_x = 4, zoom_aspect_y = 3, i, j;
721 721
722 for (i = 1; i < 20; i++) 722 for (i = 1; i < 20; i++)