comparison src/video/bwindow/SDL_sysmouse.cc @ 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
58 allowed_x, allowed_y); 58 allowed_x, allowed_y);
59 return(NULL); 59 return(NULL);
60 } 60 }
61 61
62 /* Allocate the cursor */ 62 /* Allocate the cursor */
63 cursor = (WMcursor *)malloc(sizeof(WMcursor)); 63 cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
64 if ( cursor == NULL ) { 64 if ( cursor == NULL ) {
65 SDL_OutOfMemory(); 65 SDL_OutOfMemory();
66 return(NULL); 66 return(NULL);
67 } 67 }
68 cursor->bits = (char *)malloc(4+2*((allowed_x/8)*allowed_y)); 68 cursor->bits = (char *)SDL_malloc(4+2*((allowed_x/8)*allowed_y));
69 if ( cursor->bits == NULL ) { 69 if ( cursor->bits == NULL ) {
70 free(cursor); 70 SDL_free(cursor);
71 SDL_OutOfMemory(); 71 SDL_OutOfMemory();
72 return(NULL); 72 return(NULL);
73 } 73 }
74 cursor->bits[0] = allowed_y; /* Size of the cursor */ 74 cursor->bits[0] = allowed_y; /* Size of the cursor */
75 cursor->bits[1] = 1; /* Bit depth of cursor */ 75 cursor->bits[1] = 1; /* Bit depth of cursor */
79 79
80 /* Pad out to the normal cursor size */ 80 /* Pad out to the normal cursor size */
81 run = PADDED_BITS(w); 81 run = PADDED_BITS(w);
82 pad = PADDED_BITS(allowed_x)-run; 82 pad = PADDED_BITS(allowed_x)-run;
83 for ( i=0; i<h; ++i ) { 83 for ( i=0; i<h; ++i ) {
84 memcpy(cptr, data, run); 84 SDL_memcpy(cptr, data, run);
85 memset(cptr+run, 0, pad); 85 SDL_memset(cptr+run, 0, pad);
86 data += run; 86 data += run;
87 cptr += (run+pad); 87 cptr += (run+pad);
88 } 88 }
89 for ( ; i<allowed_y; ++i ) { 89 for ( ; i<allowed_y; ++i ) {
90 memset(cptr, 0, run+pad); 90 SDL_memset(cptr, 0, run+pad);
91 cptr += (run+pad); 91 cptr += (run+pad);
92 } 92 }
93 for ( i=0; i<h; ++i ) { 93 for ( i=0; i<h; ++i ) {
94 /* FIXME: The mask should be OR'd with the data to turn 94 /* FIXME: The mask should be OR'd with the data to turn
95 inverted color pixels black, since inverted color pixels 95 inverted color pixels black, since inverted color pixels
96 aren't supported under BeOS. 96 aren't supported under BeOS.
97 */ 97 */
98 memcpy(cptr, mask, run); 98 SDL_memcpy(cptr, mask, run);
99 memset(cptr+run, 0, pad); 99 SDL_memset(cptr+run, 0, pad);
100 mask += run; 100 mask += run;
101 cptr += (run+pad); 101 cptr += (run+pad);
102 } 102 }
103 for ( ; i<allowed_y; ++i ) { 103 for ( ; i<allowed_y; ++i ) {
104 memset(cptr, 0, run+pad); 104 SDL_memset(cptr, 0, run+pad);
105 cptr += (run+pad); 105 cptr += (run+pad);
106 } 106 }
107 return(cursor); 107 return(cursor);
108 } 108 }
109 109
122 return(1); 122 return(1);
123 } 123 }
124 124
125 void BE_FreeWMCursor(_THIS, WMcursor *cursor) 125 void BE_FreeWMCursor(_THIS, WMcursor *cursor)
126 { 126 {
127 free(cursor->bits); 127 SDL_free(cursor->bits);
128 free(cursor); 128 SDL_free(cursor);
129 } 129 }
130 130
131 /* Implementation by Christian Bauer <cbauer@student.physik.uni-mainz.de> */ 131 /* Implementation by Christian Bauer <cbauer@student.physik.uni-mainz.de> */
132 void BE_WarpWMCursor(_THIS, Uint16 x, Uint16 y) 132 void BE_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
133 { 133 {