comparison src/video/photon/SDL_phyuv.c @ 1338:604d73db6802

Removed uses of stdlib.h and string.h
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 09:29:18 +0000
parents 3692456e7b0f
children c71e05b4dc2e
comparison
equal deleted inserted replaced
1337:c687f06c7473 1338:604d73db6802
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 /* This is the QNX Realtime Platform version of SDL YUV video overlays */ 23 /* This is the QNX Realtime Platform version of SDL YUV video overlays */
24 24
25 #include <stdlib.h>
26 #include <string.h>
27 #include <errno.h> 25 #include <errno.h>
28 26
29 #include <Ph.h> 27 #include <Ph.h>
30 #include <Pt.h> 28 #include <Pt.h>
31 29
30 #include "SDL_stdlib.h"
31 #include "SDL_string.h"
32 #include "SDL_error.h" 32 #include "SDL_error.h"
33 #include "SDL_video.h" 33 #include "SDL_video.h"
34 #include "SDL_phyuv_c.h" 34 #include "SDL_phyuv_c.h"
35 #include "SDL_yuvfuncs.h" 35 #include "SDL_yuvfuncs.h"
36 36
79 int planes; 79 int planes;
80 int i=0; 80 int i=0;
81 PhPoint_t pos; 81 PhPoint_t pos;
82 82
83 /* Create the overlay structure */ 83 /* Create the overlay structure */
84 overlay = calloc(1, sizeof(SDL_Overlay)); 84 overlay = SDL_calloc(1, sizeof(SDL_Overlay));
85 85
86 if (overlay == NULL) 86 if (overlay == NULL)
87 { 87 {
88 SDL_OutOfMemory(); 88 SDL_OutOfMemory();
89 return NULL; 89 return NULL;
97 97
98 /* Set up the YUV surface function structure */ 98 /* Set up the YUV surface function structure */
99 overlay->hwfuncs = &ph_yuvfuncs; 99 overlay->hwfuncs = &ph_yuvfuncs;
100 100
101 /* Create the pixel data and lookup tables */ 101 /* Create the pixel data and lookup tables */
102 hwdata = calloc(1, sizeof(struct private_yuvhwdata)); 102 hwdata = SDL_calloc(1, sizeof(struct private_yuvhwdata));
103 103
104 if (hwdata == NULL) 104 if (hwdata == NULL)
105 { 105 {
106 SDL_OutOfMemory(); 106 SDL_OutOfMemory();
107 SDL_FreeYUVOverlay(overlay); 107 SDL_FreeYUVOverlay(overlay);
130 overlay->hwdata->CurrentViewPort.pos.x = 0; 130 overlay->hwdata->CurrentViewPort.pos.x = 0;
131 overlay->hwdata->CurrentViewPort.pos.y = 0; 131 overlay->hwdata->CurrentViewPort.pos.y = 0;
132 overlay->hwdata->CurrentViewPort.size.w = width; 132 overlay->hwdata->CurrentViewPort.size.w = width;
133 overlay->hwdata->CurrentViewPort.size.h = height; 133 overlay->hwdata->CurrentViewPort.size.h = height;
134 overlay->hwdata->State = OVERLAY_STATE_UNINIT; 134 overlay->hwdata->State = OVERLAY_STATE_UNINIT;
135 overlay->hwdata->FrameData0 = (FRAMEDATA *) calloc(1, sizeof(FRAMEDATA)); 135 overlay->hwdata->FrameData0 = (FRAMEDATA *) SDL_calloc(1, sizeof(FRAMEDATA));
136 overlay->hwdata->FrameData1 = (FRAMEDATA *) calloc(1, sizeof(FRAMEDATA)); 136 overlay->hwdata->FrameData1 = (FRAMEDATA *) SDL_calloc(1, sizeof(FRAMEDATA));
137 137
138 vidport = -1; 138 vidport = -1;
139 i=0; 139 i=0;
140 140
141 overlay->hwdata->ischromakey=0; 141 overlay->hwdata->ischromakey=0;
244 overlay->hwdata->locked = 1; 244 overlay->hwdata->locked = 1;
245 */ 245 */
246 246
247 /* Find the pitch and offset values for the overlay */ 247 /* Find the pitch and offset values for the overlay */
248 overlay->planes = planes; 248 overlay->planes = planes;
249 overlay->pitches = calloc(overlay->planes, sizeof(Uint16)); 249 overlay->pitches = SDL_calloc(overlay->planes, sizeof(Uint16));
250 overlay->pixels = calloc(overlay->planes, sizeof(Uint8*)); 250 overlay->pixels = SDL_calloc(overlay->planes, sizeof(Uint8*));
251 if (!overlay->pitches || !overlay->pixels) 251 if (!overlay->pitches || !overlay->pixels)
252 { 252 {
253 SDL_OutOfMemory(); 253 SDL_OutOfMemory();
254 SDL_FreeYUVOverlay(overlay); 254 SDL_FreeYUVOverlay(overlay);
255 return(NULL); 255 return(NULL);