-Fixes issue 152 (color picker cursor)

-Switches FreeBSD to cumulated update method, they shouldn't need macosX tricks for that they are using X11 :)


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@767 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2009-05-03 13:02:25 +00:00
parent a216785b59
commit 780bf3a751
3 changed files with 31 additions and 21 deletions

BIN
gfx2.cfg

Binary file not shown.

View File

@ -40,7 +40,7 @@
// UPDATE_METHOD can be set from makefile, otherwise it's selected here // UPDATE_METHOD can be set from makefile, otherwise it's selected here
// depending on the platform : // depending on the platform :
#ifndef UPDATE_METHOD #ifndef UPDATE_METHOD
#if defined(__macosx__) || defined(__FreeBSD__) #if defined(__macosx__)
#define UPDATE_METHOD UPDATE_METHOD_FULL_PAGE #define UPDATE_METHOD UPDATE_METHOD_FULL_PAGE
#else #else
#define UPDATE_METHOD UPDATE_METHOD_CUMULATED #define UPDATE_METHOD UPDATE_METHOD_CUMULATED

View File

@ -1635,24 +1635,28 @@ void Display_cursor(void)
} }
else else
{ {
DEBUG("B",0);
temp=(Config.Cursor)?CURSOR_SHAPE_THIN_COLORPICKER:CURSOR_SHAPE_COLORPICKER; temp=(Config.Cursor)?CURSOR_SHAPE_THIN_COLORPICKER:CURSOR_SHAPE_COLORPICKER;
start_x=Mouse_X-Cursor_offset_X[temp]; start_x=Mouse_X-Cursor_offset_X[temp];
start_y=Mouse_Y-Cursor_offset_Y[temp]; start_y=Mouse_Y-Cursor_offset_Y[temp];
for (x_pos=start_x,counter_x=0;counter_x<15;x_pos++,counter_x++) for (x_pos=start_x,counter_x=0;counter_x<15;x_pos++,counter_x++)
for (y_pos=start_y,counter_y=0;counter_y<15;y_pos++,counter_y++) {
{ if(x_pos<0) continue;
color=GFX_cursor_sprite[temp][counter_y][counter_x]; if(x_pos>=Screen_width) break;
if ( (x_pos>=0) && (x_pos<Screen_width) for (y_pos=start_y,counter_y=0;counter_y<15;y_pos++,counter_y++)
&& (y_pos>=0) && (y_pos<Screen_height) ) {
{ if(y_pos<0) continue;
CURSOR_BACKGROUND[counter_y][counter_x]=Read_pixel(x_pos,y_pos); if(y_pos>=Screen_height) break;
if (color!=MC_Trans) color=GFX_cursor_sprite[temp][counter_y][counter_x];
Pixel(x_pos,y_pos,color); // On sauvegarde dans CURSOR_BACKGROUND pour restaurer plus tard
} CURSOR_BACKGROUND[counter_y][counter_x]=Read_pixel(x_pos,y_pos);
} if (color!=MC_Trans)
Update_rect(start_x,start_y,16,16); Pixel(x_pos,y_pos,color);
} }
}
Update_rect(Max(start_x,0),Max(start_y,0),counter_x,counter_y);
}
} }
break; break;
@ -1941,12 +1945,18 @@ void Hide_cursor(void)
start_x=Mouse_X-Cursor_offset_X[temp]; start_x=Mouse_X-Cursor_offset_X[temp];
start_y=Mouse_Y-Cursor_offset_Y[temp]; start_y=Mouse_Y-Cursor_offset_Y[temp];
for (x_pos=start_x,counter_x=0;counter_x<15;x_pos++,counter_x++) for (x_pos=start_x,counter_x=0;counter_x<15;x_pos++,counter_x++)
for (y_pos=start_y,counter_y=0;counter_y<15;y_pos++,counter_y++) {
if ( (x_pos>=0) && (x_pos<Screen_width) && (y_pos>=0) && (y_pos<Screen_height) ) if(x_pos<0) continue;
Pixel(x_pos,y_pos,CURSOR_BACKGROUND[counter_y][counter_x]); if(x_pos>=Screen_width) break;
for (y_pos=start_y,counter_y=0;counter_y<15;y_pos++,counter_y++)
Update_rect(Max(start_x,0),Max(start_y,0),16,16); {
if(y_pos<0) continue;
if(y_pos>=Screen_height) break;
Pixel(x_pos,y_pos,CURSOR_BACKGROUND[counter_y][counter_x]);
}
}
Update_rect(Max(start_x,0),Max(start_y,0),counter_x,counter_y);
} }
} }
if (!Paintbrush_hidden) if (!Paintbrush_hidden)