Mercurial > sdl-ios-xcode
diff 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 |
line wrap: on
line diff
--- a/src/video/maccommon/SDL_macmouse.c Tue Sep 04 22:53:46 2001 +0000 +++ b/src/video/maccommon/SDL_macmouse.c Tue Sep 04 23:18:45 2001 +0000 @@ -67,18 +67,22 @@ return(NULL); } memset(cursor, 0, sizeof(*cursor)); - - bytes = (w/8); - if ( bytes > 2 ) { - bytes = 2; + + if (w > 16) + w = 16; + + if (h > 16) + h = 16; + + bytes = (w+7)/8; + + for ( row=0; row<h; ++row ) { + memcpy(&cursor->curs.data[row], data, bytes); + data += bytes; } - for ( row=0; row<h && (row < 16); ++row ) { - memcpy(&cursor->curs.data[row], data, bytes); - data += w/8; - } - for ( row=0; row<h && (row < 16); ++row ) { + for ( row=0; row<h; ++row ) { memcpy(&cursor->curs.mask[row], mask, bytes); - mask += w/8; + mask += bytes; } cursor->curs.hotSpot.h = hot_x; cursor->curs.hotSpot.v = hot_y;