+#else
+ PixMapHandle pm = (PixMapHandle) NewHandleClear( sizeof (PixMap)) ;
+ short extent = 16 ;
+ short bytesPerPixel = 1 ;
+ short depth = 8 ;
+ Rect bounds = { 0 , 0 , extent , extent } ;
+ CCrsrHandle ch = (CCrsrHandle) NewHandleClear ( sizeof( CCrsr ) ) ;
+ CTabHandle newColors = GetCTable( 8 ) ;
+ HandToHand((Handle *) &newColors);
+ // set the values to the indices
+ for ( int i = 0 ; i < (**newColors).ctSize ; ++i )
+ {
+ (**newColors).ctTable[i].value = i ;
+ }
+ HLock( (Handle) ch) ;
+ (**ch).crsrType = 0x8001 ; // color cursors
+ (**ch).crsrMap = pm ;
+ short bytesPerRow = bytesPerPixel * extent ;
+
+ (**pm).baseAddr = 0;
+ (**pm).rowBytes = bytesPerRow | 0x8000;
+ (**pm).bounds = bounds;
+ (**pm).pmVersion = 0;
+ (**pm).packType = 0;
+ (**pm).packSize = 0;
+ (**pm).hRes = 0x00480000; /* 72 DPI default res */
+ (**pm).vRes = 0x00480000; /* 72 DPI default res */
+ (**pm).pixelSize = depth;
+ (**pm).pixelType = 0;
+ (**pm).cmpCount = 1;
+ (**pm).cmpSize = depth;
+ (**pm).pmTable = newColors;
+
+ (**ch).crsrData = NewHandleClear( extent * bytesPerRow ) ;
+ (**ch).crsrXData = NULL ;
+ (**ch).crsrXValid = 0;
+ (**ch).crsrXHandle = NULL;
+
+ (**ch).crsrHotSpot.h = hotSpotX ;
+ (**ch).crsrHotSpot.v = hotSpotY ;
+ (**ch).crsrXTable = NULL ;
+ (**ch).crsrID = GetCTSeed() ;
+
+ memset( (**ch).crsr1Data , 0 , sizeof( Bits16 ) ) ;
+ memset( (**ch).crsrMask , 0 , sizeof( Bits16 ) ) ;
+
+ unsigned char mr = image16.GetMaskRed() ;
+ unsigned char mg = image16.GetMaskGreen() ;
+ unsigned char mb = image16.GetMaskBlue() ;
+ for ( int y = 0 ; y < h ; ++y )
+ {
+ short rowbits = 0 ;
+ short maskbits = 0 ;
+
+ for ( int x = 0 ; x < w ; ++x )
+ {
+ long pos = (y * w + x) * 3;
+
+ unsigned char r = rgbBits[pos] ;
+ unsigned char g = rgbBits[pos+1] ;
+ unsigned char b = rgbBits[pos+2] ;
+ RGBColor col = { 0xFFFF ,0xFFFF, 0xFFFF } ;
+
+ if ( bHasMask && r==mr && g==mg && b==mb )
+ {
+ // masked area, does not appear anywhere
+ }
+ else
+ {
+ if ( (int)r + (int)g + (int)b < 0x0200 )
+ {
+ rowbits |= ( 1 << (15-x) ) ;
+ }
+ maskbits |= ( 1 << (15-x) ) ;
+
+ col = *((RGBColor*) wxColor( r , g , b ).GetPixel()) ;
+ }
+ *((*(**ch).crsrData) + y * bytesPerRow + x) =
+ GetCTabIndex( newColors , &col) ;
+ }
+ (**ch).crsr1Data[y] = rowbits ;
+ (**ch).crsrMask[y] = maskbits ;
+ }
+ if ( !bHasMask )
+ {
+ memcpy( (**ch).crsrMask , (**ch).crsr1Data , sizeof( Bits16) ) ;
+ }
+
+ HUnlock((Handle) ch) ;
+ M_CURSORDATA->m_hCursor = ch ;
+ M_CURSORDATA->m_isColorCursor = true ;
+#endif