gcc3 fixes & other minor tweaks

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3619 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shadow303 2003-06-23 02:54:52 +00:00
parent 3368f55060
commit b511995b2f
25 changed files with 163 additions and 157 deletions

View File

@ -35,6 +35,8 @@
#include <graphic_driver.h>
#include <malloc.h>
#include <dirent.h>
#include <sys/ioctl.h>
#include <unistd.h>
#define RUN_UNDER_R5
@ -210,7 +212,7 @@ bool AccelerantDriver::Initialize(void)
accelerant_image = -1;
for (i=0; i<3; i++)
{
if (find_directory (dirs[i], -1, false, path, PATH_MAX) != B_OK)
if ( find_directory(dirs[i], -1, false, path, PATH_MAX) != B_OK )
continue;
strcat(path,"/accelerants/");
strcat(path,signature);
@ -344,7 +346,7 @@ void AccelerantDriver::DrawBitmap(ServerBitmap *bmp, BRect src, BRect dest, Laye
\param d Data structure containing any other data necessary for the call. Always non-NULL.
\param delta Extra character padding
*/
void AccelerantDriver::DrawString(const char *string, int32 length, BPoint pt, LayerData *d, escapement_delta *edelta=NULL)
void AccelerantDriver::DrawString(const char *string, int32 length, BPoint pt, LayerData *d, escapement_delta *edelta)
{
if(!string || !d || !d->font)
return;
@ -586,13 +588,13 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
}
if ( useQuad1 && CHECK_Y(yc-y) && (CHECK_X(xc) || CHECK_X(xc+x)) )
HLine(CLIP_X(xc),CLIP_X(xc+x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+x)),ROUND(yc-y),&pattern);
if ( useQuad2 && CHECK_Y(yc-y) && (CHECK_X(xc) || CHECK_X(xc-x)) )
HLine(CLIP_X(xc),CLIP_X(xc-x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc-x)),ROUND(yc-y),&pattern);
if ( useQuad3 && CHECK_Y(yc+y) && (CHECK_X(xc) || CHECK_X(xc-x)) )
HLine(CLIP_X(xc),CLIP_X(xc-x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc-x)),ROUND(yc+y),&pattern);
if ( useQuad4 && CHECK_Y(yc+y) && (CHECK_X(xc) || CHECK_X(xc+x)) )
HLine(CLIP_X(xc),CLIP_X(xc+x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
if ( (!shortspan && (((startQuad == 1) && (x <= startx)) || ((endQuad == 1) && (x >= endx)))) ||
(shortspan && (startQuad == 1) && (x <= startx) && (x >= endx)) )
StrokeLine(BPoint(xc+x,yc-y),center,d,pat);
@ -621,13 +623,13 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
}
if ( useQuad1 && CHECK_Y(yc-y) && (CHECK_X(xc) || CHECK_X(xc+x)) )
HLine(CLIP_X(xc),CLIP_X(xc+x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+x)),ROUND(yc-y),&pattern);
if ( useQuad2 && CHECK_Y(yc-y) && (CHECK_X(xc) || CHECK_X(xc-x)) )
HLine(CLIP_X(xc),CLIP_X(xc-x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc-x)),ROUND(yc-y),&pattern);
if ( useQuad3 && CHECK_Y(yc+y) && (CHECK_X(xc) || CHECK_X(xc-x)) )
HLine(CLIP_X(xc),CLIP_X(xc-x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc-x)),ROUND(yc+y),&pattern);
if ( useQuad4 && CHECK_Y(yc+y) && (CHECK_X(xc) || CHECK_X(xc+x)) )
HLine(CLIP_X(xc),CLIP_X(xc+x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
if ( !shortspan )
{
if ( startQuad == 1 )
@ -637,13 +639,13 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( x <= startx )
{
if ( CHECK_X(xc) || CHECK_X(xc+x) )
HLine(CLIP_X(xc),CLIP_X(xc+x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+x)),ROUND(yc-y),&pattern);
}
else
{
xclip = ROUND(y*startx/(double)starty);
if ( CHECK_X(xc) || CHECK_X(xc+xclip) )
HLine(CLIP_X(xc),CLIP_X(xc+xclip),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+xclip)),ROUND(yc-y),&pattern);
}
}
}
@ -655,7 +657,7 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
{
xclip = ROUND(y*startx/(double)starty);
if ( CHECK_X(xc-x) || CHECK_X(xc-xclip) )
HLine(CLIP_X(xc-x),CLIP_X(xc-xclip),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc-xclip)),ROUND(yc-y),&pattern);
}
}
}
@ -666,13 +668,13 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( x <= startx )
{
if ( CHECK_X(xc-x) || CHECK_X(xc) )
HLine(CLIP_X(xc-x),CLIP_X(xc),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc)),ROUND(yc+y),&pattern);
}
else
{
xclip = ROUND(y*startx/(double)starty);
if ( CHECK_X(xc-xclip) || CHECK_X(xc) )
HLine(CLIP_X(xc-xclip),CLIP_X(xc),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-xclip)),ROUND(CLIP_X(xc)),ROUND(yc+y),&pattern);
}
}
}
@ -684,7 +686,7 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
{
xclip = ROUND(y*startx/(double)starty);
if ( CHECK_X(xc+xclip) || CHECK_X(xc+x) )
HLine(CLIP_X(xc+xclip),CLIP_X(xc+x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc+xclip)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
}
}
}
@ -697,7 +699,7 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
{
xclip = ROUND(y*endx/(double)endy);
if ( CHECK_X(xc+xclip) || CHECK_X(xc+x) )
HLine(CLIP_X(xc+xclip),CLIP_X(xc+x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc+xclip)),ROUND(CLIP_X(xc+x)),ROUND(yc-y),&pattern);
}
}
}
@ -708,13 +710,13 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( x <= endx )
{
if ( CHECK_X(xc-x) || CHECK_X(xc) )
HLine(CLIP_X(xc-x),CLIP_X(xc),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc)),ROUND(yc-y),&pattern);
}
else
{
xclip = ROUND(y*endx/(double)endy);
if ( CHECK_X(xc-xclip) || CHECK_X(xc) )
HLine(CLIP_X(xc-xclip),CLIP_X(xc),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-xclip)),ROUND(CLIP_X(xc)),ROUND(yc-y),&pattern);
}
}
}
@ -726,7 +728,7 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
{
xclip = ROUND(y*endx/(double)endy);
if ( CHECK_X(xc-x) || CHECK_X(xc-xclip) )
HLine(CLIP_X(xc-x),CLIP_X(xc-xclip),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc-xclip)),ROUND(yc+y),&pattern);
}
}
}
@ -737,13 +739,13 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( x <= endx )
{
if ( CHECK_X(xc) || CHECK_X(xc+x) )
HLine(CLIP_X(xc),CLIP_X(xc+x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
}
else
{
xclip = ROUND(y*endx/(double)endy);
if ( CHECK_X(xc) || CHECK_X(xc+xclip) )
HLine(CLIP_X(xc),CLIP_X(xc+xclip),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+xclip)),ROUND(yc+y),&pattern);
}
}
}
@ -759,12 +761,12 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( (x <= startx) && (x >= endx) )
{
if ( CHECK_X(xc+endclip) || CHECK_X(xc+x) )
HLine(CLIP_X(xc+endclip),CLIP_X(xc+x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc+endclip)),ROUND(CLIP_X(xc+x)),ROUND(yc-y),&pattern);
}
else
{
if ( CHECK_X(xc+endclip) || CHECK_X(xc+startclip) )
HLine(CLIP_X(xc+endclip),CLIP_X(xc+startclip),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc+endclip)),ROUND(CLIP_X(xc+startclip)),ROUND(yc-y),&pattern);
}
}
}
@ -775,12 +777,12 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( (x <= startx) && (x >= endx) )
{
if ( CHECK_X(xc-x) || CHECK_X(xc-startclip) )
HLine(CLIP_X(xc-x),CLIP_X(xc-startclip),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc-startclip)),ROUND(yc-y),&pattern);
}
else
{
if ( CHECK_X(xc-endclip) || CHECK_X(xc-startclip) )
HLine(CLIP_X(xc-endclip),CLIP_X(xc-startclip),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-endclip)),ROUND(CLIP_X(xc-startclip)),ROUND(yc-y),&pattern);
}
}
}
@ -791,12 +793,12 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( (x <= startx) && (x >= endx) )
{
if ( CHECK_X(xc-x) || CHECK_X(xc-endclip) )
HLine(CLIP_X(xc-x),CLIP_X(xc-endclip),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc-endclip)),ROUND(yc+y),&pattern);
}
else
{
if ( CHECK_X(xc-startclip) || CHECK_X(xc-endclip) )
HLine(CLIP_X(xc-startclip),CLIP_X(xc-endclip),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-startclip)),ROUND(CLIP_X(xc-endclip)),ROUND(yc+y),&pattern);
}
}
}
@ -807,12 +809,12 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( (x <= startx) && (x >= endx) )
{
if ( CHECK_X(xc+startclip) || CHECK_X(xc+x) )
HLine(CLIP_X(xc+startclip),CLIP_X(xc+x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc+startclip)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
}
else
{
if ( CHECK_X(xc+startclip) || CHECK_X(xc+endclip) )
HLine(CLIP_X(xc+startclip),CLIP_X(xc+endclip),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc+startclip)),ROUND(CLIP_X(xc+endclip)),ROUND(yc+y),&pattern);
}
}
}
@ -834,13 +836,13 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
}
if ( useQuad1 && CHECK_Y(yc-y) && (CHECK_X(xc) || CHECK_X(xc+x)) )
HLine(CLIP_X(xc),CLIP_X(xc+x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+x)),ROUND(yc-y),&pattern);
if ( useQuad2 && CHECK_Y(yc-y) && (CHECK_X(xc) || CHECK_X(xc-x)) )
HLine(CLIP_X(xc),CLIP_X(xc-x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc-x)),ROUND(yc-y),&pattern);
if ( useQuad3 && CHECK_Y(yc+y) && (CHECK_X(xc) || CHECK_X(xc-x)) )
HLine(CLIP_X(xc),CLIP_X(xc-x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc-x)),ROUND(yc+y),&pattern);
if ( useQuad4 && CHECK_Y(yc+y) && (CHECK_X(xc) || CHECK_X(xc+x)) )
HLine(CLIP_X(xc),CLIP_X(xc+x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
if ( !shortspan )
{
if ( startQuad == 1 )
@ -850,13 +852,13 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( x <= startx )
{
if ( CHECK_X(xc) || CHECK_X(xc+x) )
HLine(CLIP_X(xc),CLIP_X(xc+x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+x)),ROUND(yc-y),&pattern);
}
else
{
xclip = ROUND(y*startx/(double)starty);
if ( CHECK_X(xc) || CHECK_X(xc+xclip) )
HLine(CLIP_X(xc),CLIP_X(xc+xclip),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+xclip)),ROUND(yc-y),&pattern);
}
}
}
@ -868,7 +870,7 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
{
xclip = ROUND(y*startx/(double)starty);
if ( CHECK_X(xc-x) || CHECK_X(xc-xclip) )
HLine(CLIP_X(xc-x),CLIP_X(xc-xclip),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc-xclip)),ROUND(yc-y),&pattern);
}
}
}
@ -879,13 +881,13 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( x <= startx )
{
if ( CHECK_X(xc-x) || CHECK_X(xc) )
HLine(CLIP_X(xc-x),CLIP_X(xc),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc)),ROUND(yc+y),&pattern);
}
else
{
xclip = ROUND(y*startx/(double)starty);
if ( CHECK_X(xc-xclip) || CHECK_X(xc) )
HLine(CLIP_X(xc-xclip),CLIP_X(xc),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-xclip)),ROUND(CLIP_X(xc)),ROUND(yc+y),&pattern);
}
}
}
@ -897,7 +899,7 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
{
xclip = ROUND(y*startx/(double)starty);
if ( CHECK_X(xc+xclip) || CHECK_X(xc+x) )
HLine(CLIP_X(xc+xclip),CLIP_X(xc+x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc+xclip)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
}
}
}
@ -910,7 +912,7 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
{
xclip = ROUND(y*endx/(double)endy);
if ( CHECK_X(xc+xclip) || CHECK_X(xc+x) )
HLine(CLIP_X(xc+xclip),CLIP_X(xc+x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc+xclip)),ROUND(CLIP_X(xc+x)),ROUND(yc-y),&pattern);
}
}
}
@ -921,13 +923,13 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( x <= endx )
{
if ( CHECK_X(xc-x) || CHECK_X(xc) )
HLine(CLIP_X(xc-x),CLIP_X(xc),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc)),ROUND(yc-y),&pattern);
}
else
{
xclip = ROUND(y*endx/(double)endy);
if ( CHECK_X(xc-xclip) || CHECK_X(xc) )
HLine(CLIP_X(xc-xclip),CLIP_X(xc),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-xclip)),ROUND(CLIP_X(xc)),ROUND(yc-y),&pattern);
}
}
}
@ -939,7 +941,7 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
{
xclip = ROUND(y*endx/(double)endy);
if ( CHECK_X(xc-x) || CHECK_X(xc-xclip) )
HLine(CLIP_X(xc-x),CLIP_X(xc-xclip),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc-xclip)),ROUND(yc+y),&pattern);
}
}
}
@ -950,13 +952,13 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( x <= endx )
{
if ( CHECK_X(xc) || CHECK_X(xc+x) )
HLine(CLIP_X(xc),CLIP_X(xc+x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
}
else
{
xclip = ROUND(y*endx/(double)endy);
if ( CHECK_X(xc) || CHECK_X(xc+xclip) )
HLine(CLIP_X(xc),CLIP_X(xc+xclip),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc)),ROUND(CLIP_X(xc+xclip)),ROUND(yc+y),&pattern);
}
}
}
@ -972,12 +974,12 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( (x <= startx) && (x >= endx) )
{
if ( CHECK_X(xc+endclip) || CHECK_X(xc+x) )
HLine(CLIP_X(xc+endclip),CLIP_X(xc+x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc+endclip)),ROUND(CLIP_X(xc+x)),ROUND(yc-y),&pattern);
}
else
{
if ( CHECK_X(xc+endclip) || CHECK_X(xc+startclip) )
HLine(CLIP_X(xc+endclip),CLIP_X(xc+startclip),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc+endclip)),ROUND(CLIP_X(xc+startclip)),ROUND(yc-y),&pattern);
}
}
}
@ -988,12 +990,12 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( (x <= startx) && (x >= endx) )
{
if ( CHECK_X(xc-x) || CHECK_X(xc-startclip) )
HLine(CLIP_X(xc-x),CLIP_X(xc-startclip),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc-startclip)),ROUND(yc-y),&pattern);
}
else
{
if ( CHECK_X(xc-endclip) || CHECK_X(xc-startclip) )
HLine(CLIP_X(xc-endclip),CLIP_X(xc-startclip),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-endclip)),ROUND(CLIP_X(xc-startclip)),ROUND(yc-y),&pattern);
}
}
}
@ -1004,12 +1006,12 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( (x <= startx) && (x >= endx) )
{
if ( CHECK_X(xc-x) || CHECK_X(xc-endclip) )
HLine(CLIP_X(xc-x),CLIP_X(xc-endclip),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc-endclip)),ROUND(yc+y),&pattern);
}
else
{
if ( CHECK_X(xc-startclip) || CHECK_X(xc-endclip) )
HLine(CLIP_X(xc-startclip),CLIP_X(xc-endclip),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-startclip)),ROUND(CLIP_X(xc-endclip)),ROUND(yc+y),&pattern);
}
}
}
@ -1020,12 +1022,12 @@ void AccelerantDriver::FillArc(BRect r, float angle, float span, LayerData *d, i
if ( (x <= startx) && (x >= endx) )
{
if ( CHECK_X(xc+startclip) || CHECK_X(xc+x) )
HLine(CLIP_X(xc+startclip),CLIP_X(xc+x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc+startclip)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
}
else
{
if ( CHECK_X(xc+startclip) || CHECK_X(xc+endclip) )
HLine(CLIP_X(xc+startclip),CLIP_X(xc+endclip),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc+startclip)),ROUND(CLIP_X(xc+endclip)),ROUND(yc+y),&pattern);
}
}
}
@ -1149,9 +1151,9 @@ void AccelerantDriver::FillEllipse(BRect r, LayerData *d, int8 *pat)
if ( CHECK_X(xc) )
{
if ( CHECK_Y(yc-y) )
SetPixel(xc,yc-y,pattern.GetColor(xc,yc-y));
SetPixel(ROUND(xc),ROUND(yc-y),pattern.GetColor(xc,yc-y));
if ( CHECK_Y(yc+y) )
SetPixel(xc,yc+y,pattern.GetColor(xc,yc+y));
SetPixel(ROUND(xc),ROUND(yc+y),pattern.GetColor(xc,yc+y));
}
p = ROUND (Ry2 - (Rx2 * ry) + (.25 * Rx2));
@ -1171,9 +1173,9 @@ void AccelerantDriver::FillEllipse(BRect r, LayerData *d, int8 *pat)
if ( CHECK_X(xc-x) || CHECK_X(xc+x) )
{
if ( CHECK_Y(yc-y) )
HLine(CLIP_X(xc-x),CLIP_X(xc+x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc+x)),ROUND(yc-y),&pattern);
if ( CHECK_Y(yc+y) )
HLine(CLIP_X(xc-x),CLIP_X(xc+x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
}
}
@ -1194,9 +1196,9 @@ void AccelerantDriver::FillEllipse(BRect r, LayerData *d, int8 *pat)
if ( CHECK_X(xc-x) || CHECK_X(xc+x) )
{
if ( CHECK_Y(yc-y) )
HLine(CLIP_X(xc-x),CLIP_X(xc+x),yc-y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc+x)),ROUND(yc-y),&pattern);
if ( CHECK_Y(yc+y) )
HLine(CLIP_X(xc-x),CLIP_X(xc+x),yc+y,&pattern);
HLine(ROUND(CLIP_X(xc-x)),ROUND(CLIP_X(xc+x)),ROUND(yc+y),&pattern);
}
}
_Unlock();
@ -1515,11 +1517,11 @@ void AccelerantDriver::FillRoundRect(BRect r, float xrad, float yrad, LayerData
{
arc_x = xrad*sqrt(1-i*i/yrad2);
if ( CHECK_Y(r.top+yrad-i) )
HLine(CLIP_X(r.left+xrad-arc_x), CLIP_X(r.right-xrad+arc_x),
r.top+yrad-i, &pattern);
HLine(ROUND(CLIP_X(r.left+xrad-arc_x)), ROUND(CLIP_X(r.right-xrad+arc_x)),
ROUND(r.top+yrad-i), &pattern);
if ( CHECK_Y(r.bottom-yrad+i) )
HLine(CLIP_X(r.left+xrad-arc_x), CLIP_X(r.right-xrad+arc_x),
r.bottom-yrad+i, &pattern);
HLine(ROUND(CLIP_X(r.left+xrad-arc_x)), ROUND(CLIP_X(r.right-xrad+arc_x)),
ROUND(r.bottom-yrad+i), &pattern);
}
FillRect(BRect(CLIP_X(r.left),CLIP_Y(r.top+yrad),
CLIP_X(r.right),CLIP_Y(r.bottom-yrad)), d, pat);
@ -1595,7 +1597,7 @@ void AccelerantDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pa
start.x=MIN(first.x,MIN(second.x,third.x));
end.x=MAX(first.x,MAX(second.x,third.x));
if ( CHECK_Y(start.y) && (CHECK_X(start.x) || CHECK_X(end.x)) )
HLine(CLIP_X(start.x), CLIP_X(end.x), start.y, &pattern);
HLine(ROUND(CLIP_X(start.x)), ROUND(CLIP_X(end.x)), ROUND(start.y), &pattern);
_Unlock();
return;
}
@ -1609,10 +1611,10 @@ void AccelerantDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pa
AccLineCalc lineB(second, third);
if ( CHECK_Y(first.y) && (CHECK_X(first.x) || CHECK_X(second.x)) )
HLine(CLIP_X(first.x), CLIP_X(second.x), first.y, &pattern);
HLine(ROUND(CLIP_X(first.x)), ROUND(CLIP_X(second.x)), ROUND(first.y), &pattern);
for(i=(int32)first.y+1; i<=third.y; i++)
if ( CHECK_Y(i) && (CHECK_X(lineA.GetX(i)) || CHECK_X(lineB.GetX(i))) )
HLine(CLIP_X(lineA.GetX(i)), CLIP_X(lineB.GetX(i)), i, &pattern);
HLine(ROUND(CLIP_X(lineA.GetX(i))), ROUND(CLIP_X(lineB.GetX(i))), i, &pattern);
_Unlock();
return;
}
@ -1624,10 +1626,10 @@ void AccelerantDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pa
AccLineCalc lineB(first, third);
if ( CHECK_Y(second.y) && (CHECK_X(second.x) || CHECK_X(third.x)) )
HLine(CLIP_X(second.x), CLIP_X(third.x), second.y, &pattern);
HLine(ROUND(CLIP_X(second.x)), ROUND(CLIP_X(third.x)), ROUND(second.y), &pattern);
for(i=(int32)first.y; i<third.y; i++)
if ( CHECK_Y(i) && (CHECK_X(lineA.GetX(i)) || CHECK_X(lineB.GetX(i))) )
HLine(CLIP_X(lineA.GetX(i)), CLIP_X(lineB.GetX(i)), i, &pattern);
HLine(ROUND(CLIP_X(lineA.GetX(i))), ROUND(CLIP_X(lineB.GetX(i))), i, &pattern);
_Unlock();
return;
}
@ -1639,11 +1641,11 @@ void AccelerantDriver::FillTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pa
for(i=(int32)first.y; i<(int32)second.y; i++)
if ( CHECK_Y(i) && (CHECK_X(lineA.GetX(i)) || CHECK_X(lineB.GetX(i))) )
HLine(CLIP_X(lineA.GetX(i)), CLIP_X(lineB.GetX(i)), i, &pattern);
HLine(ROUND(CLIP_X(lineA.GetX(i))), ROUND(CLIP_X(lineB.GetX(i))), i, &pattern);
for(i=(int32)second.y; i<=third.y; i++)
if ( CHECK_Y(i) && (CHECK_X(lineC.GetX(i)) || CHECK_X(lineB.GetX(i))) )
HLine(CLIP_X(lineC.GetX(i)), CLIP_X(lineB.GetX(i)), i, &pattern);
HLine(ROUND(CLIP_X(lineC.GetX(i))), ROUND(CLIP_X(lineB.GetX(i))), i, &pattern);
_Unlock();
}
@ -2002,19 +2004,19 @@ void AccelerantDriver::SetCursor(ServerCursor *csr)
if ( useQuad1 ||
(!shortspan && (((startQuad == 1) && (x <= startx)) || ((endQuad == 1) && (x >= endx)))) ||
(shortspan && (startQuad == 1) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc+x,yc-y,thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc-y),thick,&pattern);
if ( useQuad2 ||
(!shortspan && (((startQuad == 2) && (x >= startx)) || ((endQuad == 2) && (x <= endx)))) ||
(shortspan && (startQuad == 2) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc-x,yc-y,thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc-y),thick,&pattern);
if ( useQuad3 ||
(!shortspan && (((startQuad == 3) && (x <= startx)) || ((endQuad == 3) && (x >= endx)))) ||
(shortspan && (startQuad == 3) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc-x,yc+y,thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc+y),thick,&pattern);
if ( useQuad4 ||
(!shortspan && (((startQuad == 4) && (x >= startx)) || ((endQuad == 4) && (x <= endx)))) ||
(shortspan && (startQuad == 4) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc+x,yc+y,thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,&pattern);
p = ROUND (Ry2 - (Rx2 * ry) + (.25 * Rx2));
while (px < py)
@ -2033,19 +2035,19 @@ void AccelerantDriver::SetCursor(ServerCursor *csr)
if ( useQuad1 ||
(!shortspan && (((startQuad == 1) && (x <= startx)) || ((endQuad == 1) && (x >= endx)))) ||
(shortspan && (startQuad == 1) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc+x,yc-y,thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc-y),thick,&pattern);
if ( useQuad2 ||
(!shortspan && (((startQuad == 2) && (x >= startx)) || ((endQuad == 2) && (x <= endx)))) ||
(shortspan && (startQuad == 2) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc-x,yc-y,thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc-y),thick,&pattern);
if ( useQuad3 ||
(!shortspan && (((startQuad == 3) && (x <= startx)) || ((endQuad == 3) && (x >= endx)))) ||
(shortspan && (startQuad == 3) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc-x,yc+y,thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc+y),thick,&pattern);
if ( useQuad4 ||
(!shortspan && (((startQuad == 4) && (x >= startx)) || ((endQuad == 4) && (x <= endx)))) ||
(shortspan && (startQuad == 4) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc+x,yc+y,thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,&pattern);
}
p = ROUND(Ry2*(x+.5)*(x+.5) + Rx2*(y-1)*(y-1) - Rx2*Ry2);
@ -2065,19 +2067,19 @@ void AccelerantDriver::SetCursor(ServerCursor *csr)
if ( useQuad1 ||
(!shortspan && (((startQuad == 1) && (x <= startx)) || ((endQuad == 1) && (x >= endx)))) ||
(shortspan && (startQuad == 1) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc+x,yc-y,thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc-y),thick,&pattern);
if ( useQuad2 ||
(!shortspan && (((startQuad == 2) && (x >= startx)) || ((endQuad == 2) && (x <= endx)))) ||
(shortspan && (startQuad == 2) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc-x,yc-y,thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc-y),thick,&pattern);
if ( useQuad3 ||
(!shortspan && (((startQuad == 3) && (x <= startx)) || ((endQuad == 3) && (x >= endx)))) ||
(shortspan && (startQuad == 3) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc-x,yc+y,thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc+y),thick,&pattern);
if ( useQuad4 ||
(!shortspan && (((startQuad == 4) && (x >= startx)) || ((endQuad == 4) && (x <= endx)))) ||
(shortspan && (startQuad == 4) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc+x,yc+y,thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,&pattern);
}
_Unlock();
}
@ -2136,7 +2138,7 @@ void AccelerantDriver::StrokeBezier(BPoint *pts, LayerData *d, int8 *pat)
y = ROUND(Y);
/* SetThickPixel does bounds checking, so we don't have to worry about it */
if ( (x!=lastx) || (y!=lasty) )
SetThickPixel(x,y,d->pensize,&pattern);
SetThickPixel(x,y,ROUND(d->pensize),&pattern);
lastx = x;
lasty = y;
@ -2183,10 +2185,10 @@ void AccelerantDriver::StrokeEllipse(BRect r, LayerData *d, int8 *pat)
/* SetThickPixel does bounds checking, so we don't have to worry about it */
SetThickPixel(xc+x,yc-y,thick,&pattern);
SetThickPixel(xc-x,yc-y,thick,&pattern);
SetThickPixel(xc-x,yc+y,thick,&pattern);
SetThickPixel(xc+x,yc+y,thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc-y),thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc-y),thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc+y),thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,&pattern);
p = ROUND (Ry2 - (Rx2 * ry) + (.25 * Rx2));
while (px < py)
@ -2202,10 +2204,10 @@ void AccelerantDriver::StrokeEllipse(BRect r, LayerData *d, int8 *pat)
p += Ry2 + px - py;
}
SetThickPixel(xc+x,yc-y,thick,&pattern);
SetThickPixel(xc-x,yc-y,thick,&pattern);
SetThickPixel(xc-x,yc+y,thick,&pattern);
SetThickPixel(xc+x,yc+y,thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc-y),thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc-y),thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc+y),thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,&pattern);
}
p = ROUND(Ry2*(x+.5)*(x+.5) + Rx2*(y-1)*(y-1) - Rx2*Ry2);
@ -2222,10 +2224,10 @@ void AccelerantDriver::StrokeEllipse(BRect r, LayerData *d, int8 *pat)
p += Rx2 - py +px;
}
SetThickPixel(xc+x,yc-y,thick,&pattern);
SetThickPixel(xc-x,yc-y,thick,&pattern);
SetThickPixel(xc-x,yc+y,thick,&pattern);
SetThickPixel(xc+x,yc+y,thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc-y),thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc-y),thick,&pattern);
SetThickPixel(ROUND(xc-x),ROUND(yc+y),thick,&pattern);
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,&pattern);
}
_Unlock();
}
@ -2289,7 +2291,7 @@ void AccelerantDriver::StrokeLine(BPoint start, BPoint end, LayerData *d, int8 *
The points in the array are not guaranteed to be within the framebuffer's
coordinate range.
*/
void AccelerantDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed=true)
void AccelerantDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed)
{
/* Bounds checking is handled by StrokeLine and the functions it uses */
_Lock();
@ -2314,9 +2316,9 @@ void AccelerantDriver::StrokeRect(BRect r, LayerData *d, int8 *pat)
PatternHandler pattern(pat);
pattern.SetColors(d->highcolor, d->lowcolor);
HLineThick(r.left, r.right, r.top, thick, &pattern);
HLineThick(ROUND(r.left), ROUND(r.right), ROUND(r.top), thick, &pattern);
StrokeLine(r.RightTop(), r.RightBottom(), d, pat);
HLineThick(r.right, r.left, r.bottom, thick, &pattern);
HLineThick(ROUND(r.right), ROUND(r.left), ROUND(r.bottom), thick, &pattern);
StrokeLine(r.LeftTop(), r.LeftBottom(), d, pat);
_Unlock();
}
@ -2351,13 +2353,13 @@ void AccelerantDriver::StrokeRoundRect(BRect r, float xrad, float yrad, LayerDat
bTop = vTop + yrad;
bBottom = vBottom - yrad;
StrokeArc(BRect(bRight, r.top, r.right, bTop), 0, 90, d, pat);
HLineThick(hRight, hLeft, r.top, thick, &pattern);
HLineThick(ROUND(hRight), ROUND(hLeft), ROUND(r.top), thick, &pattern);
StrokeArc(BRect(r.left,r.top,bLeft,bTop), 90, 90, d, pat);
StrokeLine(BPoint(r.left,vTop),BPoint(r.left,vBottom),d,pat);
StrokeArc(BRect(r.left,bBottom,bLeft,r.bottom), 180, 90, d, pat);
HLineThick(hLeft, hRight, r.bottom, thick, &pattern);
HLineThick(ROUND(hLeft), ROUND(hRight), ROUND(r.bottom), thick, &pattern);
StrokeArc(BRect(bRight,bBottom,r.right,r.bottom), 270, 90, d, pat);
StrokeLine(BPoint(r.right,vBottom),BPoint(r.right,vTop),d,pat);
@ -2947,7 +2949,7 @@ void AccelerantDriver::HLineThick(int32 x1, int32 x2, int32 y, int32 thick, Patt
\param mode The drawing mode to use when blitting the bitmap
The bitmap and the screen must have the same color depth, or this will do nothing.
*/
void AccelerantDriver::BlitBitmap(ServerBitmap *sourcebmp, BRect sourcerect, BRect destrect, drawing_mode mode=B_OP_COPY)
void AccelerantDriver::BlitBitmap(ServerBitmap *sourcebmp, BRect sourcerect, BRect destrect, drawing_mode mode)
{
/* TODO: Need to check for hardware support for this. */
if(!sourcebmp)

View File

@ -25,6 +25,7 @@
//
//------------------------------------------------------------------------------
#include "Angle.h"
#include <math.h>
#ifndef ANGLE_PI
#define ANGLE_PI 3.14159265358979323846
@ -163,7 +164,7 @@ Angle Angle::InvCosine(float value)
\brief Obtains the tangent of the angle
\return The tangent of the angle
*/
float Angle::Tangent(int *status=NULL)
float Angle::Tangent(int *status)
{
if(angle_value==90 || angle_value==270)
{

View File

@ -26,6 +26,7 @@
//------------------------------------------------------------------------------
#include <AppDefs.h>
#include <Entry.h>
#include <PortMessage.h>
#include "AppServer.h"
#include "ColorSet.h"
#include "Desktop.h"

View File

@ -695,19 +695,19 @@ void BitmapDriver::StrokeArc(BRect r, float angle, float span, LayerData *d, int
if ( useQuad1 ||
(!shortspan && (((startQuad == 1) && (x <= startx)) || ((endQuad == 1) && (x >= endx)))) ||
(shortspan && (startQuad == 1) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc+x,yc-y,thick,d->highcolor);
SetThickPixel(ROUND(xc+x),ROUND(yc-y),thick,d->highcolor);
if ( useQuad2 ||
(!shortspan && (((startQuad == 2) && (x >= startx)) || ((endQuad == 2) && (x <= endx)))) ||
(shortspan && (startQuad == 2) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc-x,yc-y,thick,d->highcolor);
SetThickPixel(ROUND(xc-x),ROUND(yc-y),thick,d->highcolor);
if ( useQuad3 ||
(!shortspan && (((startQuad == 3) && (x <= startx)) || ((endQuad == 3) && (x >= endx)))) ||
(shortspan && (startQuad == 3) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc-x,yc+y,thick,d->highcolor);
SetThickPixel(ROUND(xc-x),ROUND(yc+y),thick,d->highcolor);
if ( useQuad4 ||
(!shortspan && (((startQuad == 4) && (x >= startx)) || ((endQuad == 4) && (x <= endx)))) ||
(shortspan && (startQuad == 4) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc+x,yc+y,thick,d->highcolor);
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,d->highcolor);
p = ROUND (Ry2 - (Rx2 * ry) + (.25 * Rx2));
while (px < py)
@ -726,19 +726,19 @@ void BitmapDriver::StrokeArc(BRect r, float angle, float span, LayerData *d, int
if ( useQuad1 ||
(!shortspan && (((startQuad == 1) && (x <= startx)) || ((endQuad == 1) && (x >= endx)))) ||
(shortspan && (startQuad == 1) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc+x,yc-y,thick,d->highcolor);
SetThickPixel(ROUND(xc+x),ROUND(yc-y),thick,d->highcolor);
if ( useQuad2 ||
(!shortspan && (((startQuad == 2) && (x >= startx)) || ((endQuad == 2) && (x <= endx)))) ||
(shortspan && (startQuad == 2) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc-x,yc-y,thick,d->highcolor);
SetThickPixel(ROUND(xc-x),ROUND(yc-y),thick,d->highcolor);
if ( useQuad3 ||
(!shortspan && (((startQuad == 3) && (x <= startx)) || ((endQuad == 3) && (x >= endx)))) ||
(shortspan && (startQuad == 3) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc-x,yc+y,thick,d->highcolor);
SetThickPixel(ROUND(xc-x),ROUND(yc+y),thick,d->highcolor);
if ( useQuad4 ||
(!shortspan && (((startQuad == 4) && (x >= startx)) || ((endQuad == 4) && (x <= endx)))) ||
(shortspan && (startQuad == 4) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc+x,yc+y,thick,d->highcolor);
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,d->highcolor);
}
p = ROUND(Ry2*(x+.5)*(x+.5) + Rx2*(y-1)*(y-1) - Rx2*Ry2);
@ -758,19 +758,19 @@ void BitmapDriver::StrokeArc(BRect r, float angle, float span, LayerData *d, int
if ( useQuad1 ||
(!shortspan && (((startQuad == 1) && (x <= startx)) || ((endQuad == 1) && (x >= endx)))) ||
(shortspan && (startQuad == 1) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc+x,yc-y,thick,d->highcolor);
SetThickPixel(ROUND(xc+x),ROUND(yc-y),thick,d->highcolor);
if ( useQuad2 ||
(!shortspan && (((startQuad == 2) && (x >= startx)) || ((endQuad == 2) && (x <= endx)))) ||
(shortspan && (startQuad == 2) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc-x,yc-y,thick,d->highcolor);
SetThickPixel(ROUND(xc-x),ROUND(yc-y),thick,d->highcolor);
if ( useQuad3 ||
(!shortspan && (((startQuad == 3) && (x <= startx)) || ((endQuad == 3) && (x >= endx)))) ||
(shortspan && (startQuad == 3) && (x <= startx) && (x >= endx)) )
SetThickPixel(xc-x,yc+y,thick,d->highcolor);
SetThickPixel(ROUND(xc-x),ROUND(yc+y),thick,d->highcolor);
if ( useQuad4 ||
(!shortspan && (((startQuad == 4) && (x >= startx)) || ((endQuad == 4) && (x <= endx)))) ||
(shortspan && (startQuad == 4) && (x >= startx) && (x <= endx)) )
SetThickPixel(xc+x,yc+y,thick,d->highcolor);
SetThickPixel(ROUND(xc+x),ROUND(yc+y),thick,d->highcolor);
}
}
@ -824,7 +824,7 @@ void BitmapDriver::StrokeBezier(BPoint *pts, LayerData *d, int8 *pat)
x = ROUND(X);
y = ROUND(Y);
if ( (x!=lastx) || (y!=lasty) )
SetThickPixel(x,y,d->pensize,d->highcolor);
SetThickPixel(x,y,ROUND(d->pensize),d->highcolor);
lastx = x;
lasty = y;
@ -1008,7 +1008,7 @@ void BitmapDriver::StrokeLine(BPoint start, BPoint end, LayerData *d, int8 *pat)
The points in the array are not guaranteed to be within the framebuffer's
coordinate range.
*/
void BitmapDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed=true)
void BitmapDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed)
{
_Lock();
if(_target)
@ -1246,7 +1246,7 @@ void BitmapDriver::HLine(int32 x1, int32 x2, int32 y, RGBColor color)
// This function is intended to eventually take care of most of the heavy lifting for
// DrawBitmap in 32-bit mode, with others coming later. Right now, it is *just* used for
// the
void BitmapDriver::BlitBitmap(ServerBitmap *sourcebmp,BRect sourcerect, BRect destrect, drawing_mode mode=B_OP_COPY)
void BitmapDriver::BlitBitmap(ServerBitmap *sourcebmp,BRect sourcerect, BRect destrect, drawing_mode mode)
{
// Another internal function called from other functions.
@ -1644,7 +1644,7 @@ float BitmapDriver::StringHeight(const char *string, int32 length, LayerData *d)
performed by the driver itself.
\param d Data structure containing any other data necessary for the call. Always non-NULL.
*/
void BitmapDriver::DrawString(const char *string, int32 length, BPoint pt, LayerData *d, escapement_delta *edelta=NULL)
void BitmapDriver::DrawString(const char *string, int32 length, BPoint pt, LayerData *d, escapement_delta *edelta)
{
if(!string || !d || !d->font)
return;
@ -1989,7 +1989,7 @@ void BitmapDriver::BlitGray2RGB32(FT_Bitmap *src, BPoint pt, LayerData *d)
}
}
rgb_color BitmapDriver::GetBlitColor(rgb_color src, rgb_color dest, LayerData *d, bool use_high=true)
rgb_color BitmapDriver::GetBlitColor(rgb_color src, rgb_color dest, LayerData *d, bool use_high)
{
rgb_color returncolor={0,0,0,0};
int16 value;

View File

@ -113,7 +113,7 @@ BitmapManager::~BitmapManager(void)
\return A new ServerBitmap or NULL if unable to allocate one.
*/
ServerBitmap * BitmapManager::CreateBitmap(BRect bounds, color_space space, int32 flags,
int32 bytes_per_row=-1, screen_id screen=B_MAIN_SCREEN_ID)
int32 bytes_per_row, screen_id screen)
{
acquire_sem(lock);
ServerBitmap *bmp=new ServerBitmap(bounds, space, flags, bytes_per_row);

View File

@ -29,6 +29,7 @@
#include "CursorManager.h"
#include "ServerCursor.h"
#include <Errors.h>
#include <string.h>
//! The global cursor manager object. Allocated and freed by AppServer class
CursorManager *cursormanager;

View File

@ -329,7 +329,7 @@ void Decorator::MoveBy(BPoint pt)
necessarily reflect _tabrect offset by the amount given - few people want to
slide a tab right off the window - that would be a Bad Thing (TM).
*/
BRect Decorator::SlideTab(float dx, float dy=0)
BRect Decorator::SlideTab(float dx, float dy)
{
return BRect(0,0,0,0);
}

View File

@ -184,7 +184,7 @@ printf("Desktop: ShutdownDesktop\n");
the workspace at the list's end. Note that it is possible to insert a workspace
in the list simply by specifying an index.
*/
void AddWorkspace(int32 index=-1)
void AddWorkspace(int32 index)
{
#ifdef DEBUG_DESKTOP
printf("Desktop: AddWorkspace(%ld)\n",index+1);
@ -405,7 +405,7 @@ DisplayDriver *GetGfxDriver(screen_id screen)
Because of the lack of outside multimonitor support, the screen ID is ignored for now.
*/
status_t SetSpace(int32 index, int32 res, screen_id screen, bool stick=true)
status_t SetSpace(int32 index, int32 res, screen_id screen, bool stick)
{
#ifdef DEBUG_DESKTOP
printf("Desktop: SetSpace(%ld,%ld,%s,%ld)\n",index+1,res,

View File

@ -121,7 +121,7 @@ void DisplayDriver::DrawBitmap(ServerBitmap *bmp, BRect src, BRect dest, LayerDa
performed by the driver itself.
\param d Data structure containing any other data necessary for the call. Always non-NULL.
*/
void DisplayDriver::DrawString(const char *string, int32 length, BPoint pt, LayerData *d, escapement_delta *delta=NULL)
void DisplayDriver::DrawString(const char *string, int32 length, BPoint pt, LayerData *d, escapement_delta *delta)
{
}
@ -392,7 +392,7 @@ void DisplayDriver::StrokeLine(BPoint start, BPoint end, LayerData *d, int8 *pat
The points in the array are not guaranteed to be within the framebuffer's
coordinate range.
*/
void DisplayDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed=true)
void DisplayDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed)
{
}

View File

@ -132,7 +132,7 @@ int16 FontStyle::ConvertToUnicode(uint16 c)
\param shear shear (slant) in degrees. 45 <= shear <= 135. 90 is vertical
\return The new ServerFont object
*/
ServerFont *FontStyle::Instantiate(float size, float rotation=0.0, float shear=90.0)
ServerFont *FontStyle::Instantiate(float size, float rotation, float shear)
{
ServerFont *f=new ServerFont(this, size, rotation, shear);
instances->AddItem(f);

View File

@ -123,7 +123,7 @@ public:
const char *GetPath(void);
int16 ConvertToUnicode(uint16 c);
protected:
friend FontFamily;
friend class FontFamily;
FontFamily *family;
uint16 glyphcount, charmapcount;
BString *name, *path;

View File

@ -129,7 +129,7 @@ printf("Layer: %s: ~Layer()\n",_name->String());
\param before Add the child in front of this layer
\param rebuild Flag to fully rebuild all visibility regions
*/
void Layer::AddChild(Layer *layer, Layer *before=NULL, bool rebuild)
void Layer::AddChild(Layer *layer, Layer *before, bool rebuild)
{
#ifdef DEBUG_LAYER
printf("Layer: %s: Add Child (%s, %s, %s) - Incomplete\n",_name->String(),layer?layer->_name->String():"NULL",
@ -272,7 +272,7 @@ printf("Layer: %s: RemoveSelf(%s)\n",_name->String(),rebuild?"rebuild":"no rebui
which has no children, i.e. a layer that is at the top of its 'branch' in
the layer tree
*/
Layer *Layer::GetChildAt(BPoint pt, bool recursive=false)
Layer *Layer::GetChildAt(BPoint pt, bool recursive)
{
#ifdef DEBUG_LAYER
printf("Layer: %s: Get Child At (%.1f,%.1f)\n",_name->String(),pt.x,pt.y);
@ -731,7 +731,7 @@ printf("Layer: %s: Rezize By (%.1f,%.1f) - Incomplete\n",_name->String(),x,y);
\brief Rebuilds visibility regions
\param include_children Flag to rebuild all children and subchildren
*/
void Layer::RebuildRegions(bool include_children=true)
void Layer::RebuildRegions(bool include_children)
{
#ifdef DEBUG_LAYER
printf("Layer: %s: Rebuild Regions (%s)\n",_name->String(),include_children?"include children":

View File

@ -66,6 +66,7 @@ public:
Layer *GetChildAt(BPoint pt, bool recursive=false);
PortLink *GetLink(void);
const char *GetName(void) { return (_name)?_name->String():NULL; }
LayerData *GetLayerData(void) { return _layerdata; }
void Invalidate(BRect rect);
void Invalidate(BRegion region);
@ -101,8 +102,8 @@ public:
void PruneTree(void);
protected:
friend RootLayer;
friend WinBorder;
friend class RootLayer;
friend class WinBorder;
BRect _frame;

View File

@ -52,7 +52,7 @@ RGBColor::RGBColor(uint8 r, uint8 g, uint8 b, uint8 a)
\param blue blue
\param alpha alpha, defaults to 255
*/
RGBColor::RGBColor(int r, int g, int b, int a=255)
RGBColor::RGBColor(int r, int g, int b, int a)
{
SetColor(r,g,b,a);
}
@ -137,7 +137,7 @@ rgb_color RGBColor::GetColor32(void)
\param blue blue
\param alpha alpha, defaults to 255
*/
void RGBColor::SetColor(uint8 r, uint8 g, uint8 b, uint8 a=255)
void RGBColor::SetColor(uint8 r, uint8 g, uint8 b, uint8 a)
{
color32.red=r;
color32.green=g;
@ -152,7 +152,7 @@ void RGBColor::SetColor(uint8 r, uint8 g, uint8 b, uint8 a=255)
\param blue blue
\param alpha alpha, defaults to 255
*/
void RGBColor::SetColor(int r, int g, int b, int a=255)
void RGBColor::SetColor(int r, int g, int b, int a)
{
color32.red=(uint8)r;
color32.green=(uint8)g;

View File

@ -63,7 +63,7 @@ SDWIN_SETCURSOR,
//TODO: Remove the need for these
int64 patsolidhigh64=0xFFFFFFFFLL;
int8 *patsolidhigh=(int8*)patsolidhigh64;
int8 *patsolidhigh=(int8*)&patsolidhigh64;
extern RGBColor workspace_default_color;
@ -775,7 +775,7 @@ printf("ScreenDriver:: StrokeLineArray unimplemented\n");
#endif
}
void ScreenDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed=true)
void ScreenDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed)
{
if(!pat || !ptlist)
return;
@ -851,7 +851,7 @@ void ScreenDriver::StrokeTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
}
void ScreenDriver::SetLayerData(LayerData *d, bool set_font_data=false)
void ScreenDriver::SetLayerData(LayerData *d, bool set_font_data)
{
if(!d)
return;
@ -1004,7 +1004,7 @@ float ScreenDriver::StringHeight(const char *string, int32 length, LayerData *d)
return returnval;
}
void ScreenDriver::DrawString(const char *string, int32 length, BPoint pt, LayerData *d, escapement_delta *edelta=NULL)
void ScreenDriver::DrawString(const char *string, int32 length, BPoint pt, LayerData *d, escapement_delta *edelta)
{
if(!string || !d || !d->font)
return;
@ -1345,7 +1345,7 @@ void ScreenDriver::BlitGray2RGB32(FT_Bitmap *src, BPoint pt, LayerData *d)
}
}
rgb_color ScreenDriver::GetBlitColor(rgb_color src, rgb_color dest, LayerData *d, bool use_high=true)
rgb_color ScreenDriver::GetBlitColor(rgb_color src, rgb_color dest, LayerData *d, bool use_high)
{
rgb_color returncolor={0,0,0,0};
int16 value;

View File

@ -62,7 +62,7 @@ public:
void Invalidate(const BRect &r);
graphics_card_info gcinfo;
protected:
friend ScreenDriver;
friend class ScreenDriver;
bool is_connected;
PortLink *serverlink;

View File

@ -69,8 +69,8 @@ public:
void PostMessage(int32 code, size_t size=0, int8 *buffer=NULL);
protected:
friend AppServer;
friend ServerWindow;
friend class AppServer;
friend class ServerWindow;
void _DispatchMessage(int32 code, int8 *buffer);
ServerBitmap *_FindBitmap(int32 token);

View File

@ -37,7 +37,7 @@
\param screen Screen assigned to the bitmap.
*/
ServerBitmap::ServerBitmap(BRect rect,color_space space, int32 flags,
int32 bytesperline=-1, screen_id screen=B_MAIN_SCREEN_ID)
int32 bytesperline, screen_id screen)
{
_initialized=false;
@ -127,7 +127,7 @@ void ServerBitmap::_FreeBuffer(void)
\param space Color space for the bitmap.
\param bytesperline Number of bytes per row.
*/
void ServerBitmap::_HandleSpace(color_space space, int32 bytesperline=-1)
void ServerBitmap::_HandleSpace(color_space space, int32 bytesperline)
{
// Big convoluted mess just to handle every color space and dword align
// the buffer

View File

@ -89,7 +89,7 @@ public:
int32 Token(void) { return _token; }
protected:
friend BitmapManager;
friend class BitmapManager;
//! Internal function used by the BitmapManager.
void _SetArea(area_id ID) { _area=ID; }

View File

@ -36,7 +36,7 @@
\param bytesperline Bytes per row for the cursor. See ServerBitmap::ServerBitmap()
*/
ServerCursor::ServerCursor(BRect r, color_space cspace, int32 flags, BPoint hotspot, int32 bytesperrow=-1, screen_id screen=B_MAIN_SCREEN_ID)
ServerCursor::ServerCursor(BRect r, color_space cspace, int32 flags, BPoint hotspot, int32 bytesperrow, screen_id screen)
: ServerBitmap(r,cspace,flags,bytesperrow,screen)
{
_hotspot=hotspot;

View File

@ -59,7 +59,7 @@ public:
//! Returns the cursor's ID
int32 ID(void) { return _token; }
private:
friend CursorManager;
friend class CursorManager;
BPoint _hotspot;
char *_app_signature;

View File

@ -66,7 +66,7 @@ public:
BRect BoundingBox(void);
void Height(font_height *fh);
protected:
friend FontStyle;
friend class FontStyle;
FontStyle *fstyle;
font_height fheight;
edge_info fedges;

View File

@ -98,8 +98,8 @@ public:
//! Returns the window's title
const char *Title(void) { return _title->String(); }
protected:
friend ServerApp;
friend WinBorder;
friend class ServerApp;
friend class WinBorder;
friend class Screen;
BString *_title;

View File

@ -967,7 +967,7 @@ printf("ViewDriver:: StrokeLineArray unimplemented\n");
#endif
}
void ViewDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed=true)
void ViewDriver::StrokePolygon(BPoint *ptlist, int32 numpts, BRect rect, LayerData *d, int8 *pat, bool is_closed)
{
if(!pat || !ptlist)
return;
@ -1043,7 +1043,7 @@ void ViewDriver::StrokeTriangle(BPoint *pts, BRect r, LayerData *d, int8 *pat)
}
void ViewDriver::SetLayerData(LayerData *d, bool set_font_data=false)
void ViewDriver::SetLayerData(LayerData *d, bool set_font_data)
{
if(!d)
return;
@ -1196,7 +1196,7 @@ float ViewDriver::StringHeight(const char *string, int32 length, LayerData *d)
return returnval;
}
void ViewDriver::DrawString(const char *string, int32 length, BPoint pt, LayerData *d, escapement_delta *edelta=NULL)
void ViewDriver::DrawString(const char *string, int32 length, BPoint pt, LayerData *d, escapement_delta *edelta)
{
if(!string || !d || !d->font)
return;
@ -1537,7 +1537,7 @@ void ViewDriver::BlitGray2RGB32(FT_Bitmap *src, BPoint pt, LayerData *d)
}
}
rgb_color ViewDriver::GetBlitColor(rgb_color src, rgb_color dest, LayerData *d, bool use_high=true)
rgb_color ViewDriver::GetBlitColor(rgb_color src, rgb_color dest, LayerData *d, bool use_high)
{
rgb_color returncolor={0,0,0,0};
int16 value;

View File

@ -1224,4 +1224,4 @@ int main()
}
#endif
#endif /* DoTestProg */
#endif /* DoTestProg */