comparison src/video/maccommon/SDL_macmouse.c @ 168:e92aa316c517

Added Max's patches for building MacOS X apps on command line
author Sam Lantinga <slouken@libsdl.org>
date Tue, 04 Sep 2001 23:18:45 +0000
parents 74212992fb08
children e8157fcb3114
comparison
equal deleted inserted replaced
167:cb384ef627f6 168:e92aa316c517
65 if ( cursor == NULL ) { 65 if ( cursor == NULL ) {
66 SDL_OutOfMemory(); 66 SDL_OutOfMemory();
67 return(NULL); 67 return(NULL);
68 } 68 }
69 memset(cursor, 0, sizeof(*cursor)); 69 memset(cursor, 0, sizeof(*cursor));
70 70
71 bytes = (w/8); 71 if (w > 16)
72 if ( bytes > 2 ) { 72 w = 16;
73 bytes = 2; 73
74 if (h > 16)
75 h = 16;
76
77 bytes = (w+7)/8;
78
79 for ( row=0; row<h; ++row ) {
80 memcpy(&cursor->curs.data[row], data, bytes);
81 data += bytes;
74 } 82 }
75 for ( row=0; row<h && (row < 16); ++row ) { 83 for ( row=0; row<h; ++row ) {
76 memcpy(&cursor->curs.data[row], data, bytes);
77 data += w/8;
78 }
79 for ( row=0; row<h && (row < 16); ++row ) {
80 memcpy(&cursor->curs.mask[row], mask, bytes); 84 memcpy(&cursor->curs.mask[row], mask, bytes);
81 mask += w/8; 85 mask += bytes;
82 } 86 }
83 cursor->curs.hotSpot.h = hot_x; 87 cursor->curs.hotSpot.h = hot_x;
84 cursor->curs.hotSpot.v = hot_y; 88 cursor->curs.hotSpot.v = hot_y;
85 89
86 /* That was easy. :) */ 90 /* That was easy. :) */