comparison src/video/photon/SDL_ph_mouse.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
47 } 47 }
48 48
49 SDL_Unlock_EventThread(); 49 SDL_Unlock_EventThread();
50 } 50 }
51 51
52 free(cursor); 52 SDL_free(cursor);
53 } 53 }
54 54
55 WMcursor *ph_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y) 55 WMcursor *ph_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
56 { 56 {
57 WMcursor* cursor; 57 WMcursor* cursor;
58 int clen, i; 58 int clen, i;
59 unsigned char bit, databit, maskbit; 59 unsigned char bit, databit, maskbit;
60 60
61 /* Allocate and initialize the cursor memory */ 61 /* Allocate and initialize the cursor memory */
62 if ((cursor = (WMcursor*)malloc(sizeof(WMcursor))) == NULL) 62 if ((cursor = (WMcursor*)SDL_malloc(sizeof(WMcursor))) == NULL)
63 { 63 {
64 SDL_OutOfMemory(); 64 SDL_OutOfMemory();
65 return(NULL); 65 return(NULL);
66 } 66 }
67 memset(cursor,0,sizeof(WMcursor)); 67 SDL_memset(cursor,0,sizeof(WMcursor));
68 68
69 cursor->ph_cursor = (PhCursorDef_t *) malloc(sizeof(PhCursorDef_t) + 32*4*2); 69 cursor->ph_cursor = (PhCursorDef_t *) SDL_malloc(sizeof(PhCursorDef_t) + 32*4*2);
70 70
71 if (cursor->ph_cursor == NULL) 71 if (cursor->ph_cursor == NULL)
72 { 72 {
73 SDL_SetError("ph_CreateWMCursor(): cursor malloc failed !\n"); 73 SDL_SetError("ph_CreateWMCursor(): cursor malloc failed !\n");
74 return NULL; 74 return NULL;
75 } 75 }
76 76
77 memset(cursor->ph_cursor,0,(sizeof(PhCursorDef_t) + 32*4*2)); 77 SDL_memset(cursor->ph_cursor,0,(sizeof(PhCursorDef_t) + 32*4*2));
78 78
79 cursor->ph_cursor->hdr.type =Ph_RDATA_CURSOR; 79 cursor->ph_cursor->hdr.type =Ph_RDATA_CURSOR;
80 cursor->ph_cursor->size1.x = (short)w; 80 cursor->ph_cursor->size1.x = (short)w;
81 cursor->ph_cursor->size1.y = (short)h; 81 cursor->ph_cursor->size1.y = (short)h;
82 cursor->ph_cursor->offset1.x = (short)hot_x; 82 cursor->ph_cursor->offset1.x = (short)hot_x;