comparison src/video/quartz/SDL_QuartzWM.m @ 1756:eed7a3f396ce

Using the SDL C runtime functions
author Sam Lantinga <slouken@libsdl.org>
date Mon, 01 May 2006 11:07:04 +0000
parents ef4a796e7f24
children 9c882e94b545
comparison
equal deleted inserted replaced
1755:91063c450171 1756:eed7a3f396ce
39 int w, int h, int hot_x, int hot_y) { 39 int w, int h, int hot_x, int hot_y) {
40 WMcursor *cursor; 40 WMcursor *cursor;
41 int row, bytes; 41 int row, bytes;
42 42
43 /* Allocate the cursor memory */ 43 /* Allocate the cursor memory */
44 cursor = (WMcursor *)malloc(sizeof(WMcursor)); 44 cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
45 if ( cursor == NULL ) { 45 if ( cursor == NULL ) {
46 SDL_OutOfMemory(); 46 SDL_OutOfMemory();
47 return(NULL); 47 return(NULL);
48 } 48 }
49 memset(cursor, 0, sizeof(*cursor)); 49 SDL_memset(cursor, 0, sizeof(*cursor));
50 50
51 if (w > 16) 51 if (w > 16)
52 w = 16; 52 w = 16;
53 53
54 if (h > 16) 54 if (h > 16)
55 h = 16; 55 h = 16;
56 56
57 bytes = (w+7)/8; 57 bytes = (w+7)/8;
58 58
59 for ( row=0; row<h; ++row ) { 59 for ( row=0; row<h; ++row ) {
60 memcpy(&cursor->curs.data[row], data, bytes); 60 SDL_memcpy(&cursor->curs.data[row], data, bytes);
61 data += bytes; 61 data += bytes;
62 } 62 }
63 for ( row=0; row<h; ++row ) { 63 for ( row=0; row<h; ++row ) {
64 memcpy(&cursor->curs.mask[row], mask, bytes); 64 SDL_memcpy(&cursor->curs.mask[row], mask, bytes);
65 mask += bytes; 65 mask += bytes;
66 } 66 }
67 cursor->curs.hotSpot.h = hot_x; 67 cursor->curs.hotSpot.h = hot_x;
68 cursor->curs.hotSpot.v = hot_y; 68 cursor->curs.hotSpot.v = hot_y;
69 69