|
@@ -73,29 +73,29 @@ inline void Bild::alphaPixelP3D( int x, int y, int f )
|
|
|
alphaPixelP3D( fc[ x + y * size.x ], f );
|
|
|
}
|
|
|
|
|
|
-inline void Bild::alphaPixelAssozP( int &fc, int f )
|
|
|
+inline void Bild::alphaPixelAssozP( int& fc, int f )
|
|
|
{
|
|
|
- unsigned char *fc1 = (unsigned char *)&fc;
|
|
|
- unsigned char *fc2 = (unsigned char *)&f;
|
|
|
+ unsigned char* fc1 = (unsigned char*)&fc;
|
|
|
+ unsigned char* fc2 = (unsigned char*)&f;
|
|
|
unsigned char na = (unsigned char)~fc2[ 3 ];
|
|
|
- unsigned char a = (unsigned char)( fc2[ 3 ] + ( ( na * fc1[ 3 ] ) >> 8 ) );
|
|
|
+ unsigned char a = (unsigned char)(fc2[ 3 ] + ((na * fc1[ 3 ]) >> 8));
|
|
|
if( a == 0 )
|
|
|
return;
|
|
|
- fc1[ 2 ] = (unsigned char)( ( fc2[ 2 ] * fc2[ 3 ] + ( ( fc1[ 2 ] * na * fc1[ 3 ] ) >> 8 ) ) / a );
|
|
|
- fc1[ 1 ] = (unsigned char)( ( fc2[ 1 ] * fc2[ 3 ] + ( ( fc1[ 1 ] * na * fc1[ 3 ] ) >> 8 ) ) / a );
|
|
|
- fc1[ 0 ] = (unsigned char)( ( fc2[ 0 ] * fc2[ 3 ] + ( ( fc1[ 0 ] * na * fc1[ 3 ] ) >> 8 ) ) / a );
|
|
|
+ fc1[ 2 ] = (unsigned char)((fc2[ 2 ] * fc2[ 3 ] + ((fc1[ 2 ] * na * fc1[ 3 ]) >> 8)) / a);
|
|
|
+ fc1[ 1 ] = (unsigned char)((fc2[ 1 ] * fc2[ 3 ] + ((fc1[ 1 ] * na * fc1[ 3 ]) >> 8)) / a);
|
|
|
+ fc1[ 0 ] = (unsigned char)((fc2[ 0 ] * fc2[ 3 ] + ((fc1[ 0 ] * na * fc1[ 3 ]) >> 8)) / a);
|
|
|
fc1[ 3 ] = a;
|
|
|
}
|
|
|
|
|
|
-inline void Bild::alphaPixelP3D( int &fc, int colorb )
|
|
|
+inline void Bild::alphaPixelP3D( int& fc, int colorb )
|
|
|
{
|
|
|
|
|
|
|
|
|
- int alpha = ( ( colorb >> 24 ) & 0xFF );
|
|
|
- int na = ( 0x100 - alpha );
|
|
|
- fc = ( ( ( ( ( na * ( fc & 0xFF00FF ) ) >> 8 ) + ( ( alpha * ( colorb & 0xFF00FF ) ) >> 8 ) ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( fc & 0x00FF00 ) ) >> 8 ) + ( ( alpha * ( colorb & 0x00FF00 ) ) >> 8 ) ) & 0x00FF00 ) |
|
|
|
- ( ( fc & 0xFF000000 ) ) ) * ( fc != 0 ) | ( fc == 0 ) * colorb;
|
|
|
+ int alpha = ((colorb >> 24) & 0xFF);
|
|
|
+ int na = (0x100 - alpha);
|
|
|
+ fc = (((((na * (fc & 0xFF00FF)) >> 8) + ((alpha * (colorb & 0xFF00FF)) >> 8)) & 0xFF00FF) |
|
|
|
+ ((((na * (fc & 0x00FF00)) >> 8) + ((alpha * (colorb & 0x00FF00)) >> 8)) & 0x00FF00) |
|
|
|
+ ((fc & 0xFF000000))) * (fc != 0) | (fc == 0) * colorb;
|
|
|
|
|
|
|
|
|
|
|
@@ -105,15 +105,15 @@ inline void Bild::alphaPixelP3D( int &fc, int colorb )
|
|
|
|
|
|
}
|
|
|
|
|
|
-inline void Bild::alphaPixelP( int &fc, int colorb )
|
|
|
+inline void Bild::alphaPixelP( int& fc, int colorb )
|
|
|
{
|
|
|
|
|
|
|
|
|
- int alpha = ( ( colorb >> 24 ) & 0xFF );
|
|
|
- int na = ( 0x100 - alpha );
|
|
|
- fc = ( ( ( ( ( na * ( fc & 0xFF00FF ) ) >> 8 ) + ( ( alpha * ( colorb & 0xFF00FF ) ) >> 8 ) ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( fc & 0x00FF00 ) ) >> 8 ) + ( ( alpha * ( colorb & 0x00FF00 ) ) >> 8 ) ) & 0x00FF00 ) |
|
|
|
- ( ( fc & 0xFF000000 ) ) );
|
|
|
+ int alpha = ((colorb >> 24) & 0xFF);
|
|
|
+ int na = (0x100 - alpha);
|
|
|
+ fc = (((((na * (fc & 0xFF00FF)) >> 8) + ((alpha * (colorb & 0xFF00FF)) >> 8)) & 0xFF00FF) |
|
|
|
+ ((((na * (fc & 0x00FF00)) >> 8) + ((alpha * (colorb & 0x00FF00)) >> 8)) & 0x00FF00) |
|
|
|
+ ((fc & 0xFF000000)));
|
|
|
|
|
|
|
|
|
|
|
@@ -143,19 +143,19 @@ void Bild::drawFlatDreieck( int y1, int y2, float m1, float b1, float m2, float
|
|
|
const int yEnd = min( y2, dSizeA[ doa ].y );
|
|
|
for( int y = yStart; y < yEnd; y++ )
|
|
|
{
|
|
|
- const int xStart = max( (int)( m1 * (float)y + b1 + 0.5f ), dPosA[ doa ].x );
|
|
|
- const int xEnd = min( (int)( m2 * (float)y + b2 + 0.5f ), dSizeA[ doa ].x );
|
|
|
+ const int xStart = max( (int)(m1 * (float)y + b1 + 0.5f), dPosA[ doa ].x );
|
|
|
+ const int xEnd = min( (int)(m2 * (float)y + b2 + 0.5f), dSizeA[ doa ].x );
|
|
|
for( int x = xStart; x < xEnd; x++ )
|
|
|
fc[ x + y * size.x ] = farbe;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void Bild::drawFlatDreieckTextur( int y1, int y2, double m1, double b1, double m2, double b2, double tx1, double ty1, double tx2, double ty2,
|
|
|
- double tx_1o, double ty_1o, double tx_2o, double ty_2o, double txf, double tyf, Bild &textur )
|
|
|
+ double tx_1o, double ty_1o, double tx_2o, double ty_2o, double txf, double tyf, Bild& textur )
|
|
|
{
|
|
|
const double yStart = max( y1, dPosA[ doa ].y );
|
|
|
const double yEnd = min( y2, dSizeA[ doa ].y );
|
|
|
- double tx_1 = tx1 + tx_1o * ( yStart - y1 ), ty_1 = ty1 + ty_1o * ( yStart - y1 ), tx_2 = tx2 + tx_2o * ( yStart - y1 ), ty_2 = ty2 + ty_2o * ( yStart - y1 );
|
|
|
+ double tx_1 = tx1 + tx_1o * (yStart - y1), ty_1 = ty1 + ty_1o * (yStart - y1), tx_2 = tx2 + tx_2o * (yStart - y1), ty_2 = ty2 + ty_2o * (yStart - y1);
|
|
|
for( double y = yStart; y < yEnd; y++, tx_1 += tx_1o, ty_1 += ty_1o, tx_2 += tx_2o, ty_2 += ty_2o )
|
|
|
{
|
|
|
const double xStart = m1 * y + b1;
|
|
@@ -166,14 +166,14 @@ void Bild::drawFlatDreieckTextur( int y1, int y2, double m1, double b1, double m
|
|
|
|
|
|
void Bild::drawFlatDreieckAlpha( int y1, int y2, float m1, float b1, float m2, float b2, int farbe )
|
|
|
{
|
|
|
- const int yStart = max( (int)( y1 + 0.5 ), dPosA[ doa ].y );
|
|
|
- const int yEnd = min( (int)( y2 + 0.5 ), dSizeA[ doa ].y );
|
|
|
+ const int yStart = max( (int)(y1 + 0.5), dPosA[ doa ].y );
|
|
|
+ const int yEnd = min( (int)(y2 + 0.5), dSizeA[ doa ].y );
|
|
|
if( alpha3D )
|
|
|
{
|
|
|
for( int y = yStart; y < yEnd; y++ )
|
|
|
{
|
|
|
- const int xStart = max( (int)( m1 * ( (float)y + 0.5f ) + b1 + 0.5f ), dPosA[ doa ].x );
|
|
|
- const int xEnd = min( (int)( m2 * ( (float)y + 0.5 ) + b2 + 0.5f ), dSizeA[ doa ].x );
|
|
|
+ const int xStart = max( (int)(m1 * ((float)y + 0.5f) + b1 + 0.5f), dPosA[ doa ].x );
|
|
|
+ const int xEnd = min( (int)(m2 * ((float)y + 0.5) + b2 + 0.5f), dSizeA[ doa ].x );
|
|
|
for( int x = xStart; x < xEnd; x++ )
|
|
|
alphaPixelP3D( fc[ x + y * size.x ], farbe );
|
|
|
}
|
|
@@ -182,8 +182,8 @@ void Bild::drawFlatDreieckAlpha( int y1, int y2, float m1, float b1, float m2, f
|
|
|
{
|
|
|
for( int y = yStart; y < yEnd; y++ )
|
|
|
{
|
|
|
- const int xStart = max( (int)( m1 * ( (float)y + 0.5f ) + b1 + 0.5f ), dPosA[ doa ].x );
|
|
|
- const int xEnd = min( (int)( m2 * ( (float)y + 0.5 ) + b2 + 0.5f ), dSizeA[ doa ].x );
|
|
|
+ const int xStart = max( (int)(m1 * ((float)y + 0.5f) + b1 + 0.5f), dPosA[ doa ].x );
|
|
|
+ const int xEnd = min( (int)(m2 * ((float)y + 0.5) + b2 + 0.5f), dSizeA[ doa ].x );
|
|
|
for( int x = xStart; x < xEnd; x++ )
|
|
|
alphaPixelP( fc[ x + y * size.x ], farbe );
|
|
|
}
|
|
@@ -191,11 +191,11 @@ void Bild::drawFlatDreieckAlpha( int y1, int y2, float m1, float b1, float m2, f
|
|
|
}
|
|
|
|
|
|
void Bild::drawFlatDreieckTexturAlpha( int y1, int y2, double m1, double b1, double m2, double b2, double tx1, double ty1, double tx2, double ty2,
|
|
|
- double tx_1o, double ty_1o, double tx_2o, double ty_2o, double txf, double tyf, Bild &textur )
|
|
|
+ double tx_1o, double ty_1o, double tx_2o, double ty_2o, double txf, double tyf, Bild& textur )
|
|
|
{
|
|
|
const double yStart = max( y1, dPosA[ doa ].y );
|
|
|
const double yEnd = min( y2, dSizeA[ doa ].y );
|
|
|
- double tx_1 = tx1 + tx_1o * ( yStart - y1 ), ty_1 = ty1 + ty_1o * ( yStart - y1 ), tx_2 = tx2 + tx_2o * ( yStart - y1 ), ty_2 = ty2 + ty_2o * ( yStart - y1 );
|
|
|
+ double tx_1 = tx1 + tx_1o * (yStart - y1), ty_1 = ty1 + ty_1o * (yStart - y1), tx_2 = tx2 + tx_2o * (yStart - y1), ty_2 = ty2 + ty_2o * (yStart - y1);
|
|
|
for( double y = yStart; y < yEnd; y++, tx_1 += tx_1o, ty_1 += ty_1o, tx_2 += tx_2o, ty_2 += ty_2o )
|
|
|
{
|
|
|
const double xStart = m1 * y + b1;
|
|
@@ -204,7 +204,7 @@ void Bild::drawFlatDreieckTexturAlpha( int y1, int y2, double m1, double b1, dou
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void Bild::drawLinieHTextur( Vec2< double > p, double len, Vec2< double > ta, Vec2< double > tb, double txo, double tyo, Bild &textur )
|
|
|
+void Bild::drawLinieHTextur( Vec2< double > p, double len, Vec2< double > ta, Vec2< double > tb, double txo, double tyo, Bild& textur )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -241,19 +241,19 @@ void Bild::drawLinieHTextur( Vec2< double > p, double len, Vec2< double > ta, Ve
|
|
|
return;
|
|
|
}
|
|
|
int br = size.x;
|
|
|
- int *fc = this->fc + (int)( p.x + (int)p.y * br );
|
|
|
+ int* fc = this->fc + (int)(p.x + (int)p.y * br);
|
|
|
double x = ta.x + txo * off, y = ta.y + tyo * off;
|
|
|
- int *buffer = textur.getBuffer();
|
|
|
+ int* buffer = textur.getBuffer();
|
|
|
int txtBr = textur.getBreite();
|
|
|
for( int i = 0; i < len; ++i, ++fc )
|
|
|
{
|
|
|
- *fc = buffer[ (int)( (int)( x + 0.5 ) + (int)( y + 0.5 ) * txtBr ) ];
|
|
|
+ *fc = buffer[ (int)((int)(x + 0.5) + (int)(y + 0.5) * txtBr) ];
|
|
|
x += txo, y += tyo;
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::drawLinieHTexturAlpha( Vec2< double > p, double len, Vec2< double > ta, Vec2< double > tb, double txo, double tyo, Bild &textur )
|
|
|
+void Bild::drawLinieHTexturAlpha( Vec2< double > p, double len, Vec2< double > ta, Vec2< double > tb, double txo, double tyo, Bild& textur )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -285,20 +285,20 @@ void Bild::drawLinieHTexturAlpha( Vec2< double > p, double len, Vec2< double > t
|
|
|
return;
|
|
|
}
|
|
|
int br = size.x;
|
|
|
- int *fc = this->fc + (int)( p.x + (int)p.y * br );
|
|
|
+ int* fc = this->fc + (int)(p.x + (int)p.y * br);
|
|
|
double x = ta.x + txo * off, y = ta.y + tyo * off;
|
|
|
- int *buffer = textur.getBuffer();
|
|
|
+ int* buffer = textur.getBuffer();
|
|
|
int txtBr = textur.getBreite();
|
|
|
int f;
|
|
|
if( alpha3D )
|
|
|
{
|
|
|
for( int i = 0; i < len; ++i, ++fc )
|
|
|
{
|
|
|
- f = buffer[ (int)( (int)( x + 0.5 ) + (int)( y + 0.5 ) * txtBr ) ];
|
|
|
+ f = buffer[ (int)((int)(x + 0.5) + (int)(y + 0.5) * txtBr) ];
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
}
|
|
|
alphaPixelP3D( *fc, f );
|
|
|
x += txo, y += tyo;
|
|
@@ -308,11 +308,11 @@ void Bild::drawLinieHTexturAlpha( Vec2< double > p, double len, Vec2< double > t
|
|
|
{
|
|
|
for( int i = 0; i < len; ++i, ++fc )
|
|
|
{
|
|
|
- f = buffer[ (int)( (int)( x + 0.5 ) + (int)( y + 0.5 ) * txtBr ) ];
|
|
|
+ f = buffer[ (int)((int)(x + 0.5) + (int)(y + 0.5) * txtBr) ];
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
}
|
|
|
alphaPixelP( *fc, f );
|
|
|
x += txo, y += tyo;
|
|
@@ -350,7 +350,7 @@ void Bild::setAlpha( unsigned char alpha )
|
|
|
int last = this->alpha[ alphaAnzahl ];
|
|
|
++alphaAnzahl;
|
|
|
assert( alphaAnzahl < 1000 );
|
|
|
- this->alpha[ alphaAnzahl ] = (unsigned char)( ( 255 - alpha ) > last ? ( 255 - alpha ) : last );
|
|
|
+ this->alpha[ alphaAnzahl ] = (unsigned char)((255 - alpha) > last ? (255 - alpha) : last);
|
|
|
}
|
|
|
|
|
|
void Bild::releaseAlpha()
|
|
@@ -358,7 +358,7 @@ void Bild::releaseAlpha()
|
|
|
--alphaAnzahl;
|
|
|
}
|
|
|
|
|
|
-void Bild::setPixelBuffer( int *buffer, bool deleteBuffer, int breite, int height )
|
|
|
+void Bild::setPixelBuffer( int* buffer, bool deleteBuffer, int breite, int height )
|
|
|
{
|
|
|
if( delFc )
|
|
|
delete[]fc;
|
|
@@ -398,11 +398,11 @@ void Bild::neuBild( int breite, int height, int fillColor )
|
|
|
|
|
|
void Bild::setFarbe( int f )
|
|
|
{
|
|
|
- if( ( f & 0xFF ) == ( ( f >> 8 ) & 0xFF ) && ( f & 0xFF ) == ( ( f >> 16 ) & 0xFF ) && ( f & 0xFF ) == ( ( f >> 24 ) & 0xFF ) )
|
|
|
+ if( (f & 0xFF) == ((f >> 8) & 0xFF) && (f & 0xFF) == ((f >> 16) & 0xFF) && (f & 0xFF) == ((f >> 24) & 0xFF) )
|
|
|
memset( fc, f, size.x * size.y * 4 );
|
|
|
else
|
|
|
{
|
|
|
- for( int *i = fc, *end = i + size.x * size.y; i < end; i++ )
|
|
|
+ for( int* i = fc, *end = i + size.x * size.y; i < end; i++ )
|
|
|
*i = f;
|
|
|
}
|
|
|
rend = 1;
|
|
@@ -435,10 +435,10 @@ void Bild::fillRegion( int x, int y, int b, int h, int ff )
|
|
|
h -= dpy - y;
|
|
|
y = dpy;
|
|
|
}
|
|
|
- b = ( x + b ) >= dgx ? ( dgx - x ) : b;
|
|
|
- h = ( y + h ) >= dgy ? ( dgy - y ) : h;
|
|
|
- int *pixel = fc + y * size.x + x;
|
|
|
- int *rowEnd = pixel + b;
|
|
|
+ b = (x + b) >= dgx ? (dgx - x) : b;
|
|
|
+ h = (y + h) >= dgy ? (dgy - y) : h;
|
|
|
+ int* pixel = fc + y * size.x + x;
|
|
|
+ int* rowEnd = pixel + b;
|
|
|
for( int i = 0; i < h; pixel += size.x - b, ++i, rowEnd += size.x )
|
|
|
{
|
|
|
for( ; pixel < rowEnd; ++pixel )
|
|
@@ -469,28 +469,28 @@ void Bild::alphaRegion( int x, int y, int b, int h, int ff )
|
|
|
h -= dpy - y;
|
|
|
y = dpy;
|
|
|
}
|
|
|
- b = ( x + b ) >= dgx ? ( dgx - x ) : b;
|
|
|
- h = ( y + h ) >= dgy ? ( dgy - y ) : h;
|
|
|
+ b = (x + b) >= dgx ? (dgx - x) : b;
|
|
|
+ h = (y + h) >= dgy ? (dgy - y) : h;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&ff;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&ff;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
}
|
|
|
- int *pixel = fc + y * size.x + x;
|
|
|
- int *rowEnd = pixel + b;
|
|
|
- int alpha = ( ( ff >> 24 ) & 0xFF );
|
|
|
- int na = ( 0x100 - alpha );
|
|
|
- int i1 = ( alpha * ( ff & 0xFF00FF ) ) >> 8;
|
|
|
- int i2 = ( alpha * ( ff & 0x00FF00 ) ) >> 8;
|
|
|
+ int* pixel = fc + y * size.x + x;
|
|
|
+ int* rowEnd = pixel + b;
|
|
|
+ int alpha = ((ff >> 24) & 0xFF);
|
|
|
+ int na = (0x100 - alpha);
|
|
|
+ int i1 = (alpha * (ff & 0xFF00FF)) >> 8;
|
|
|
+ int i2 = (alpha * (ff & 0x00FF00)) >> 8;
|
|
|
if( alpha3D )
|
|
|
{
|
|
|
for( int i = 0; i < h; pixel += size.x - b, ++i, rowEnd += size.x )
|
|
|
{
|
|
|
for( ; pixel < rowEnd; ++pixel )
|
|
|
{
|
|
|
- *pixel = ( ( ( ( ( na * ( *pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( ( *pixel & 0xFF000000 ) ) ) * ( *pixel != 0 ) | ( *pixel == 0 ) * ff;
|
|
|
+ *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ ((*pixel & 0xFF000000))) * (*pixel != 0) | (*pixel == 0) * ff;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -500,9 +500,9 @@ void Bild::alphaRegion( int x, int y, int b, int h, int ff )
|
|
|
{
|
|
|
for( ; pixel < rowEnd; ++pixel )
|
|
|
{
|
|
|
- *pixel = ( ( ( ( ( na * ( *pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( ( *pixel & 0xFF000000 ) ) );
|
|
|
+ *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ ((*pixel & 0xFF000000)));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -515,8 +515,8 @@ void Bild::alphaPixel2D( int i, int f )
|
|
|
alphaPixelP( fc[ i ], f );
|
|
|
else
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP( fc[ i ], f );
|
|
|
rend = 1;
|
|
|
}
|
|
@@ -528,8 +528,8 @@ void Bild::alphaPixel3D( int i, int f )
|
|
|
alphaPixelP3D( fc[ i ], f );
|
|
|
else
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP3D( fc[ i ], f );
|
|
|
rend = 1;
|
|
|
}
|
|
@@ -541,8 +541,8 @@ void Bild::alphaPixel2D( int x, int y, int f )
|
|
|
alphaPixelP( fc[ x + y * size.x ], f );
|
|
|
if( alpha[ alphaAnzahl ] < 0xFF )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP( fc[ x + y * size.x ], f );
|
|
|
rend = 1;
|
|
|
}
|
|
@@ -554,8 +554,8 @@ void Bild::alphaPixel3D( int x, int y, int f )
|
|
|
alphaPixelP3D( fc[ x + y * size.x ], f );
|
|
|
if( alpha[ alphaAnzahl ] < 0xFF )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP3D( fc[ x + y * size.x ], f );
|
|
|
rend = 1;
|
|
|
}
|
|
@@ -573,8 +573,8 @@ void Bild::alphaPixelDP2D( int x, int y, int f )
|
|
|
return;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
}
|
|
|
alphaPixelP( fc[ x + y * size.x ], f );
|
|
|
rend = 1;
|
|
@@ -592,8 +592,8 @@ void Bild::alphaPixelDP3D( int x, int y, int f )
|
|
|
return;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
}
|
|
|
alphaPixelP3D( fc[ x + y * size.x ], f );
|
|
|
rend = 1;
|
|
@@ -676,7 +676,7 @@ void Bild::drawLinieH( int x, int y, int len, int f )
|
|
|
return;
|
|
|
}
|
|
|
int br = size.x;
|
|
|
- int *fc = this->fc + x + y * br;
|
|
|
+ int* fc = this->fc + x + y * br;
|
|
|
int pval = len < 0 ? -1 : 1;
|
|
|
len = len > 0 ? len : -len;
|
|
|
for( int i = 0; i < len; ++i, fc += pval )
|
|
@@ -715,7 +715,7 @@ void Bild::drawLinieV( int x, int y, int len, int f )
|
|
|
return;
|
|
|
}
|
|
|
int br = size.x;
|
|
|
- int *fc = this->fc + x + y * br;
|
|
|
+ int* fc = this->fc + x + y * br;
|
|
|
int pval = len < 0 ? -br : br;
|
|
|
len = len > 0 ? len : -len;
|
|
|
for( int i = 0; i < len; ++i, fc += pval )
|
|
@@ -754,18 +754,18 @@ void Bild::drawLinieHAlpha( int x, int y, int len, int f )
|
|
|
int end = 0;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
}
|
|
|
- int alpha = ( ( f >> 24 ) & 0xFF );
|
|
|
- int na = ( 0x100 - alpha );
|
|
|
- int i1 = ( alpha * ( f & 0xFF00FF ) ) >> 8;
|
|
|
- int i2 = ( alpha * ( f & 0x00FF00 ) ) >> 8;
|
|
|
+ int alpha = ((f >> 24) & 0xFF);
|
|
|
+ int na = (0x100 - alpha);
|
|
|
+ int i1 = (alpha * (f & 0xFF00FF)) >> 8;
|
|
|
+ int i2 = (alpha * (f & 0x00FF00)) >> 8;
|
|
|
for( int i = x + y * br; end < len; ++end, i += pval )
|
|
|
{
|
|
|
- fc[ i ] = ( ( ( ( ( na * ( fc[ i ] & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( fc[ i ] & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( ( fc[ i ] & 0xFF000000 ) ) ) * ( fc[ i ] != 0 || !alpha3D ) | ( fc[ i ] == 0 && alpha3D ) * f;
|
|
|
+ fc[ i ] = (((((na * (fc[ i ] & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (fc[ i ] & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ ((fc[ i ] & 0xFF000000))) * (fc[ i ] != 0 || !alpha3D) | (fc[ i ] == 0 && alpha3D) * f;
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
@@ -801,18 +801,18 @@ void Bild::drawLinieVAlpha( int x, int y, int len, int f )
|
|
|
int end = 0;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
}
|
|
|
- int alpha = ( ( f >> 24 ) & 0xFF );
|
|
|
- int na = ( 0x100 - alpha );
|
|
|
- int i1 = ( alpha * ( f & 0xFF00FF ) ) >> 8;
|
|
|
- int i2 = ( alpha * ( f & 0x00FF00 ) ) >> 8;
|
|
|
+ int alpha = ((f >> 24) & 0xFF);
|
|
|
+ int na = (0x100 - alpha);
|
|
|
+ int i1 = (alpha * (f & 0xFF00FF)) >> 8;
|
|
|
+ int i2 = (alpha * (f & 0x00FF00)) >> 8;
|
|
|
for( int i = x + y * br; end < len; ++end, i += pval )
|
|
|
{
|
|
|
- fc[ i ] = ( ( ( ( ( na * ( fc[ i ] & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( fc[ i ] & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( fc[ i ] & 0xFF000000 ) ) * ( fc[ i ] != 0 || !alpha3D ) | ( fc[ i ] == 0 && alpha3D ) * f;
|
|
|
+ fc[ i ] = (((((na * (fc[ i ] & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (fc[ i ] & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ (fc[ i ] & 0xFF000000)) * (fc[ i ] != 0 || !alpha3D) | (fc[ i ] == 0 && alpha3D) * f;
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
@@ -835,7 +835,7 @@ void Bild::drawLinieBordered( Punkt a, Punkt b, int bc, int fc )
|
|
|
{
|
|
|
int xMax = dSizeA[ doa ].x - 1;
|
|
|
int yMax = dSizeA[ doa ].y - 1;
|
|
|
- if( !( outCode1 | outCode2 ) )
|
|
|
+ if( !(outCode1 | outCode2) )
|
|
|
{
|
|
|
ok = 1;
|
|
|
break;
|
|
@@ -848,22 +848,22 @@ void Bild::drawLinieBordered( Punkt a, Punkt b, int bc, int fc )
|
|
|
char outCodeOut = outCode1 ? outCode1 : outCode2;
|
|
|
if( outCodeOut & 8 )
|
|
|
{
|
|
|
- x = (int)( a.x + ( b.x - a.x ) * ( yMax - a.y ) / ( b.y - a.y ) + 0.5 );
|
|
|
+ x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
|
|
|
y = yMax;
|
|
|
}
|
|
|
else if( outCodeOut & 4 )
|
|
|
{
|
|
|
- x = (int)( a.x + ( b.x - a.x ) * ( dPosA[ doa ].y - a.y ) / ( b.y - a.y ) + 0.5 );
|
|
|
+ x = (int)(a.x + (b.x - a.x) * (dPosA[ doa ].y - a.y) / (b.y - a.y) + 0.5);
|
|
|
y = dPosA[ doa ].y;
|
|
|
}
|
|
|
else if( outCodeOut & 2 )
|
|
|
{
|
|
|
- y = (int)( a.y + ( b.y - a.y ) * ( xMax - a.x ) / ( b.x - a.x ) + 0.5 );
|
|
|
+ y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
|
|
|
x = xMax;
|
|
|
}
|
|
|
else if( outCodeOut & 1 )
|
|
|
{
|
|
|
- y = (int)( a.y + ( b.y - a.y ) * ( dPosA[ doa ].x - a.x ) / ( b.x - a.x ) + 0.5 );
|
|
|
+ y = (int)(a.y + (b.y - a.y) * (dPosA[ doa ].x - a.x) / (b.x - a.x) + 0.5);
|
|
|
x = dPosA[ doa ].x;
|
|
|
}
|
|
|
if( outCodeOut == outCode1 )
|
|
@@ -884,32 +884,32 @@ void Bild::drawLinieBordered( Punkt a, Punkt b, int bc, int fc )
|
|
|
{
|
|
|
int xlen = b.x - a.x, axlen = abs( xlen );
|
|
|
int ylen = b.y - a.y, aylen = abs( ylen );
|
|
|
- double xf = (double)xlen / ( aylen ? aylen : 1 );
|
|
|
- double yf = (double)ylen / ( axlen ? axlen : 1 );
|
|
|
+ double xf = (double)xlen / (aylen ? aylen : 1);
|
|
|
+ double yf = (double)ylen / (axlen ? axlen : 1);
|
|
|
if( axlen > aylen )
|
|
|
xf = xf < 0 ? -1 : 1;
|
|
|
else
|
|
|
yf = yf < 0 ? -1 : 1;
|
|
|
double x = (double)a.x, y = (double)a.y;
|
|
|
- int maxP = (int)( sqrt( (float)( xlen * xlen + ylen * ylen ) ) + 0.5 );
|
|
|
+ int maxP = (int)(sqrt( (float)(xlen * xlen + ylen * ylen) ) + 0.5);
|
|
|
int count = 0;
|
|
|
int maxPixel = size.x * size.y;
|
|
|
- while( !( (int)( x + 0.5 ) == b.x && (int)( y + 0.5 ) == b.y ) && count < maxP )
|
|
|
+ while( !((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP )
|
|
|
{
|
|
|
++count;
|
|
|
- this->fc[ (int)( (int)( x + 0.5 ) + (int)( y + 0.5 ) * size.x ) ] = fc;
|
|
|
- if( (int)( (int)( x - 0.5 ) + (int)( y + 0.5 ) * size.x ) < maxPixel &&
|
|
|
- this->fc[ (int)( (int)( x - 0.5 ) + (int)( y + 0.5 ) * size.x ) ] != fc )
|
|
|
- this->fc[ (int)( (int)( x - 0.5 ) + (int)( y + 0.5 ) * size.x ) ] = bc;
|
|
|
- if( (int)( (int)( x + 1.5 ) + (int)( y + 0.5 ) * size.x ) < maxPixel &&
|
|
|
- this->fc[ (int)( (int)( x + 1.5 ) + (int)( y + 0.5 ) * size.x ) ] != fc )
|
|
|
- this->fc[ (int)( (int)( x + 1.5 ) + (int)( y + 0.5 ) * size.x ) ] = bc;
|
|
|
- if( (int)( (int)( x + 0.5 ) + (int)( y - 0.5 ) * size.x ) < maxPixel &&
|
|
|
- this->fc[ (int)( (int)( x + 0.5 ) + (int)( y - 0.5 ) * size.x ) ] != fc )
|
|
|
- this->fc[ (int)( (int)( x + 0.5 ) + (int)( y - 0.5 ) * size.x ) ] = bc;
|
|
|
- if( (int)( (int)( x + 0.5 ) + (int)( y + 1.5 ) * size.x ) < maxPixel &&
|
|
|
- this->fc[ (int)( (int)( x + 0.5 ) + (int)( y + 1.5 ) * size.x ) ] != fc )
|
|
|
- this->fc[ (int)( (int)( x + 0.5 ) + (int)( y + 1.5 ) * size.x ) ] = bc;
|
|
|
+ this->fc[ (int)((int)(x + 0.5) + (int)(y + 0.5) * size.x) ] = fc;
|
|
|
+ if( (int)((int)(x - 0.5) + (int)(y + 0.5) * size.x) < maxPixel &&
|
|
|
+ this->fc[ (int)((int)(x - 0.5) + (int)(y + 0.5) * size.x) ] != fc )
|
|
|
+ this->fc[ (int)((int)(x - 0.5) + (int)(y + 0.5) * size.x) ] = bc;
|
|
|
+ if( (int)((int)(x + 1.5) + (int)(y + 0.5) * size.x) < maxPixel &&
|
|
|
+ this->fc[ (int)((int)(x + 1.5) + (int)(y + 0.5) * size.x) ] != fc )
|
|
|
+ this->fc[ (int)((int)(x + 1.5) + (int)(y + 0.5) * size.x) ] = bc;
|
|
|
+ if( (int)((int)(x + 0.5) + (int)(y - 0.5) * size.x) < maxPixel &&
|
|
|
+ this->fc[ (int)((int)(x + 0.5) + (int)(y - 0.5) * size.x) ] != fc )
|
|
|
+ this->fc[ (int)((int)(x + 0.5) + (int)(y - 0.5) * size.x) ] = bc;
|
|
|
+ if( (int)((int)(x + 0.5) + (int)(y + 1.5) * size.x) < maxPixel &&
|
|
|
+ this->fc[ (int)((int)(x + 0.5) + (int)(y + 1.5) * size.x) ] != fc )
|
|
|
+ this->fc[ (int)((int)(x + 0.5) + (int)(y + 1.5) * size.x) ] = bc;
|
|
|
x += xf, y += yf;
|
|
|
}
|
|
|
rend = 1;
|
|
@@ -929,7 +929,7 @@ void Bild::drawLinieBorderedAlpha( Punkt a, Punkt b, int bc, int fc )
|
|
|
{
|
|
|
int xMax = dSizeA[ doa ].x - 1;
|
|
|
int yMax = dSizeA[ doa ].y - 1;
|
|
|
- if( !( outCode1 | outCode2 ) )
|
|
|
+ if( !(outCode1 | outCode2) )
|
|
|
{
|
|
|
ok = 1;
|
|
|
break;
|
|
@@ -942,22 +942,22 @@ void Bild::drawLinieBorderedAlpha( Punkt a, Punkt b, int bc, int fc )
|
|
|
char outCodeOut = outCode1 ? outCode1 : outCode2;
|
|
|
if( outCodeOut & 8 )
|
|
|
{
|
|
|
- x = (int)( a.x + ( b.x - a.x ) * ( yMax - a.y ) / ( b.y - a.y ) + 0.5 );
|
|
|
+ x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
|
|
|
y = yMax;
|
|
|
}
|
|
|
else if( outCodeOut & 4 )
|
|
|
{
|
|
|
- x = (int)( a.x + ( b.x - a.x ) * ( dPosA[ doa ].y - a.y ) / ( b.y - a.y ) + 0.5 );
|
|
|
+ x = (int)(a.x + (b.x - a.x) * (dPosA[ doa ].y - a.y) / (b.y - a.y) + 0.5);
|
|
|
y = dPosA[ doa ].y;
|
|
|
}
|
|
|
else if( outCodeOut & 2 )
|
|
|
{
|
|
|
- y = (int)( a.y + ( b.y - a.y ) * ( xMax - a.x ) / ( b.x - a.x ) + 0.5 );
|
|
|
+ y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
|
|
|
x = xMax;
|
|
|
}
|
|
|
else if( outCodeOut & 1 )
|
|
|
{
|
|
|
- y = (int)( a.y + ( b.y - a.y ) * ( dPosA[ doa ].x - a.x ) / ( b.x - a.x ) + 0.5 );
|
|
|
+ y = (int)(a.y + (b.y - a.y) * (dPosA[ doa ].x - a.x) / (b.x - a.x) + 0.5);
|
|
|
x = dPosA[ doa ].x;
|
|
|
}
|
|
|
if( outCodeOut == outCode1 )
|
|
@@ -978,8 +978,8 @@ void Bild::drawLinieBorderedAlpha( Punkt a, Punkt b, int bc, int fc )
|
|
|
{
|
|
|
int xlen = b.x - a.x, axlen = abs( xlen );
|
|
|
int ylen = b.y - a.y, aylen = abs( ylen );
|
|
|
- double xf = (double)xlen / ( aylen ? aylen : 1 );
|
|
|
- double yf = (double)ylen / ( axlen ? axlen : 1 );
|
|
|
+ double xf = (double)xlen / (aylen ? aylen : 1);
|
|
|
+ double yf = (double)ylen / (axlen ? axlen : 1);
|
|
|
if( axlen > aylen )
|
|
|
xf = xf < 0 ? -1 : 1;
|
|
|
else
|
|
@@ -987,61 +987,61 @@ void Bild::drawLinieBorderedAlpha( Punkt a, Punkt b, int bc, int fc )
|
|
|
double x = (double)a.x, y = (double)a.y;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
- }
|
|
|
- int maxP = (int)( sqrt( (float)( xlen * xlen + ylen * ylen ) ) + 0.5 );
|
|
|
- int alpha = ( ( fc >> 24 ) & 0xFF );
|
|
|
- int alpha2 = ( ( bc >> 24 ) & 0xFF );
|
|
|
- int na = ( 0x100 - alpha );
|
|
|
- int na2 = ( 0x100 - alpha2 );
|
|
|
- int i1 = ( alpha * ( fc & 0xFF00FF ) ) >> 8;
|
|
|
- int i2 = ( alpha * ( fc & 0x00FF00 ) ) >> 8;
|
|
|
- int j1 = ( alpha2 * ( bc & 0xFF00FF ) ) >> 8;
|
|
|
- int j2 = ( alpha2 * ( bc & 0x00FF00 ) ) >> 8;
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
+ }
|
|
|
+ int maxP = (int)(sqrt( (float)(xlen * xlen + ylen * ylen) ) + 0.5);
|
|
|
+ int alpha = ((fc >> 24) & 0xFF);
|
|
|
+ int alpha2 = ((bc >> 24) & 0xFF);
|
|
|
+ int na = (0x100 - alpha);
|
|
|
+ int na2 = (0x100 - alpha2);
|
|
|
+ int i1 = (alpha * (fc & 0xFF00FF)) >> 8;
|
|
|
+ int i2 = (alpha * (fc & 0x00FF00)) >> 8;
|
|
|
+ int j1 = (alpha2 * (bc & 0xFF00FF)) >> 8;
|
|
|
+ int j2 = (alpha2 * (bc & 0x00FF00)) >> 8;
|
|
|
int count = 0;
|
|
|
int maxPixel = size.x * size.y;
|
|
|
- while( !( (int)( x + 0.5 ) == b.x && (int)( y + 0.5 ) == b.y ) && count < maxP )
|
|
|
+ while( !((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP )
|
|
|
{
|
|
|
++count;
|
|
|
- if( (int)( (int)( x - 0.5 ) + (int)( y + 0.5 ) * size.x ) < maxPixel )
|
|
|
+ if( (int)((int)(x - 0.5) + (int)(y + 0.5) * size.x) < maxPixel )
|
|
|
{
|
|
|
- int &pixel = this->fc[ (int)( x - 0.5 ) + (int)( y + 0.5 ) * size.x ];
|
|
|
- pixel = ( ( ( ( ( na2 * ( pixel & 0xFF00FF ) ) >> 8 ) + j1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na2 * ( pixel & 0x00FF00 ) ) >> 8 ) + j2 ) & 0x00FF00 ) |
|
|
|
- ( pixel & 0xFF000000 ) ) * ( pixel != 0 || !alpha3D ) | ( pixel == 0 && alpha3D ) * bc;
|
|
|
+ int& pixel = this->fc[ (int)(x - 0.5) + (int)(y + 0.5) * size.x ];
|
|
|
+ pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
|
|
|
+ ((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
|
|
|
+ (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
|
|
|
}
|
|
|
- if( (int)( (int)( x + 1.5 ) + (int)( y + 0.5 ) * size.x ) < maxPixel )
|
|
|
+ if( (int)((int)(x + 1.5) + (int)(y + 0.5) * size.x) < maxPixel )
|
|
|
{
|
|
|
- int &pixel = this->fc[ (int)( x + 1.5 ) + (int)( y + 0.5 ) * size.x ];
|
|
|
- pixel = ( ( ( ( ( na2 * ( pixel & 0xFF00FF ) ) >> 8 ) + j1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na2 * ( pixel & 0x00FF00 ) ) >> 8 ) + j2 ) & 0x00FF00 ) |
|
|
|
- ( pixel & 0xFF000000 ) ) * ( pixel != 0 || !alpha3D ) | ( pixel == 0 && alpha3D ) * bc;
|
|
|
+ int& pixel = this->fc[ (int)(x + 1.5) + (int)(y + 0.5) * size.x ];
|
|
|
+ pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
|
|
|
+ ((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
|
|
|
+ (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
|
|
|
}
|
|
|
- if( (int)( (int)( x + 0.5 ) + (int)( y - 0.5 ) * size.x ) < maxPixel )
|
|
|
+ if( (int)((int)(x + 0.5) + (int)(y - 0.5) * size.x) < maxPixel )
|
|
|
{
|
|
|
- int &pixel = this->fc[ (int)( x + 0.5 ) + (int)( y - 0.5 ) * size.x ];
|
|
|
- pixel = ( ( ( ( ( na2 * ( pixel & 0xFF00FF ) ) >> 8 ) + j1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na2 * ( pixel & 0x00FF00 ) ) >> 8 ) + j2 ) & 0x00FF00 ) |
|
|
|
- ( pixel & 0xFF000000 ) ) * ( pixel != 0 || !alpha3D ) | ( pixel == 0 && alpha3D ) * bc;
|
|
|
+ int& pixel = this->fc[ (int)(x + 0.5) + (int)(y - 0.5) * size.x ];
|
|
|
+ pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
|
|
|
+ ((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
|
|
|
+ (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
|
|
|
}
|
|
|
- if( (int)( (int)( x + 0.5 ) + (int)( y + 1.5 ) * size.x ) < maxPixel )
|
|
|
+ if( (int)((int)(x + 0.5) + (int)(y + 1.5) * size.x) < maxPixel )
|
|
|
{
|
|
|
- int &pixel = this->fc[ (int)( x + 0.5 ) + (int)( y + 1.5 ) * size.x ];
|
|
|
- pixel = ( ( ( ( ( na2 * ( pixel & 0xFF00FF ) ) >> 8 ) + j1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na2 * ( pixel & 0x00FF00 ) ) >> 8 ) + j2 ) & 0x00FF00 ) |
|
|
|
- ( pixel & 0xFF000000 ) ) * ( pixel != 0 || !alpha3D ) | ( pixel == 0 && alpha3D ) * bc;
|
|
|
+ int& pixel = this->fc[ (int)(x + 0.5) + (int)(y + 1.5) * size.x ];
|
|
|
+ pixel = (((((na2 * (pixel & 0xFF00FF)) >> 8) + j1) & 0xFF00FF) |
|
|
|
+ ((((na2 * (pixel & 0x00FF00)) >> 8) + j2) & 0x00FF00) |
|
|
|
+ (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * bc;
|
|
|
}
|
|
|
x += xf, y += yf;
|
|
|
}
|
|
|
count = 0;
|
|
|
- while( !( (int)( x + 0.5 ) == b.x && (int)( y + 0.5 ) == b.y ) && count < maxP )
|
|
|
+ while( !((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP )
|
|
|
{
|
|
|
++count;
|
|
|
- int &pixel = this->fc[ (int)( x + 0.5 ) + (int)( y + 0.5 ) * size.x ];
|
|
|
- pixel = ( ( ( ( ( na * ( pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( pixel & 0xFF000000 ) ) * ( pixel != 0 || !alpha3D ) | ( pixel == 0 && alpha3D ) * fc;
|
|
|
+ int& pixel = this->fc[ (int)(x + 0.5) + (int)(y + 0.5) * size.x ];
|
|
|
+ pixel = (((((na * (pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * fc;
|
|
|
x += xf, y += yf;
|
|
|
}
|
|
|
rend = 1;
|
|
@@ -1066,7 +1066,7 @@ void Bild::drawLinie( Punkt a, Punkt b, int fc )
|
|
|
{
|
|
|
int xMax = dSizeA[ doa ].x - 1;
|
|
|
int yMax = dSizeA[ doa ].y - 1;
|
|
|
- if( !( outCode1 | outCode2 ) )
|
|
|
+ if( !(outCode1 | outCode2) )
|
|
|
{
|
|
|
ok = 1;
|
|
|
break;
|
|
@@ -1079,22 +1079,22 @@ void Bild::drawLinie( Punkt a, Punkt b, int fc )
|
|
|
char outCodeOut = outCode1 ? outCode1 : outCode2;
|
|
|
if( outCodeOut & 8 )
|
|
|
{
|
|
|
- x = (int)( a.x + ( b.x - a.x ) * ( yMax - a.y ) / ( b.y - a.y ) + 0.5 );
|
|
|
+ x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
|
|
|
y = yMax;
|
|
|
}
|
|
|
else if( outCodeOut & 4 )
|
|
|
{
|
|
|
- x = (int)( a.x + ( b.x - a.x ) * ( dPosA[ doa ].y - a.y ) / ( b.y - a.y ) + 0.5 );
|
|
|
+ x = (int)(a.x + (b.x - a.x) * (dPosA[ doa ].y - a.y) / (b.y - a.y) + 0.5);
|
|
|
y = dPosA[ doa ].y;
|
|
|
}
|
|
|
else if( outCodeOut & 2 )
|
|
|
{
|
|
|
- y = (int)( a.y + ( b.y - a.y ) * ( xMax - a.x ) / ( b.x - a.x ) + 0.5 );
|
|
|
+ y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
|
|
|
x = xMax;
|
|
|
}
|
|
|
else if( outCodeOut & 1 )
|
|
|
{
|
|
|
- y = (int)( a.y + ( b.y - a.y ) * ( dPosA[ doa ].x - a.x ) / ( b.x - a.x ) + 0.5 );
|
|
|
+ y = (int)(a.y + (b.y - a.y) * (dPosA[ doa ].x - a.x) / (b.x - a.x) + 0.5);
|
|
|
x = dPosA[ doa ].x;
|
|
|
}
|
|
|
if( outCodeOut == outCode1 )
|
|
@@ -1115,19 +1115,19 @@ void Bild::drawLinie( Punkt a, Punkt b, int fc )
|
|
|
{
|
|
|
int xlen = b.x - a.x, axlen = abs( xlen );
|
|
|
int ylen = b.y - a.y, aylen = abs( ylen );
|
|
|
- double xf = (double)xlen / ( aylen ? aylen : 1 );
|
|
|
- double yf = (double)ylen / ( axlen ? axlen : 1 );
|
|
|
+ double xf = (double)xlen / (aylen ? aylen : 1);
|
|
|
+ double yf = (double)ylen / (axlen ? axlen : 1);
|
|
|
if( axlen > aylen )
|
|
|
xf = xf < 0 ? -1 : 1;
|
|
|
else
|
|
|
yf = yf < 0 ? -1 : 1;
|
|
|
double x = (double)a.x, y = (double)a.y;
|
|
|
- int maxP = (int)( sqrt( (float)( xlen * xlen + ylen * ylen ) ) + 0.5 );
|
|
|
+ int maxP = (int)(sqrt( (float)(xlen * xlen + ylen * ylen) ) + 0.5);
|
|
|
int count = 0;
|
|
|
- while( !( (int)( x + 0.5 ) == b.x && (int)( y + 0.5 ) == b.y ) && count < maxP )
|
|
|
+ while( !((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP )
|
|
|
{
|
|
|
++count;
|
|
|
- this->fc[ (int)( (int)( x + 0.5 ) + (int)( y + 0.5 ) * size.x ) ] = fc;
|
|
|
+ this->fc[ (int)((int)(x + 0.5) + (int)(y + 0.5) * size.x) ] = fc;
|
|
|
x += xf, y += yf;
|
|
|
}
|
|
|
rend = 1;
|
|
@@ -1147,7 +1147,7 @@ void Bild::drawLinieAlpha( Punkt a, Punkt b, int fc )
|
|
|
{
|
|
|
int xMax = dSizeA[ doa ].x - 1;
|
|
|
int yMax = dSizeA[ doa ].y - 1;
|
|
|
- if( !( outCode1 | outCode2 ) )
|
|
|
+ if( !(outCode1 | outCode2) )
|
|
|
{
|
|
|
ok = 1;
|
|
|
break;
|
|
@@ -1160,22 +1160,22 @@ void Bild::drawLinieAlpha( Punkt a, Punkt b, int fc )
|
|
|
char outCodeOut = outCode1 ? outCode1 : outCode2;
|
|
|
if( outCodeOut & 8 )
|
|
|
{
|
|
|
- x = (int)( a.x + ( b.x - a.x ) * ( yMax - a.y ) / ( b.y - a.y ) + 0.5 );
|
|
|
+ x = (int)(a.x + (b.x - a.x) * (yMax - a.y) / (b.y - a.y) + 0.5);
|
|
|
y = yMax;
|
|
|
}
|
|
|
else if( outCodeOut & 4 )
|
|
|
{
|
|
|
- x = (int)( a.x + ( b.x - a.x ) * ( dPosA[ doa ].y - a.y ) / ( b.y - a.y ) + 0.5 );
|
|
|
+ x = (int)(a.x + (b.x - a.x) * (dPosA[ doa ].y - a.y) / (b.y - a.y) + 0.5);
|
|
|
y = dPosA[ doa ].y;
|
|
|
}
|
|
|
else if( outCodeOut & 2 )
|
|
|
{
|
|
|
- y = (int)( a.y + ( b.y - a.y ) * ( xMax - a.x ) / ( b.x - a.x ) + 0.5 );
|
|
|
+ y = (int)(a.y + (b.y - a.y) * (xMax - a.x) / (b.x - a.x) + 0.5);
|
|
|
x = xMax;
|
|
|
}
|
|
|
else if( outCodeOut & 1 )
|
|
|
{
|
|
|
- y = (int)( a.y + ( b.y - a.y ) * ( dPosA[ doa ].x - a.x ) / ( b.x - a.x ) + 0.5 );
|
|
|
+ y = (int)(a.y + (b.y - a.y) * (dPosA[ doa ].x - a.x) / (b.x - a.x) + 0.5);
|
|
|
x = dPosA[ doa ].x;
|
|
|
}
|
|
|
if( outCodeOut == outCode1 )
|
|
@@ -1196,8 +1196,8 @@ void Bild::drawLinieAlpha( Punkt a, Punkt b, int fc )
|
|
|
{
|
|
|
int xlen = b.x - a.x, axlen = abs( xlen );
|
|
|
int ylen = b.y - a.y, aylen = abs( ylen );
|
|
|
- double xf = (double)xlen / ( aylen ? aylen : 1 );
|
|
|
- double yf = (double)ylen / ( axlen ? axlen : 1 );
|
|
|
+ double xf = (double)xlen / (aylen ? aylen : 1);
|
|
|
+ double yf = (double)ylen / (axlen ? axlen : 1);
|
|
|
if( axlen > aylen )
|
|
|
xf = xf < 0 ? -1 : 1;
|
|
|
else
|
|
@@ -1205,22 +1205,22 @@ void Bild::drawLinieAlpha( Punkt a, Punkt b, int fc )
|
|
|
double x = (double)a.x, y = (double)a.y;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
}
|
|
|
- int maxP = (int)( sqrt( (float)( xlen * xlen + ylen * ylen ) ) + 0.5 );
|
|
|
+ int maxP = (int)(sqrt( (float)(xlen * xlen + ylen * ylen) ) + 0.5);
|
|
|
int count = 0;
|
|
|
- int alpha = ( ( fc >> 24 ) & 0xFF );
|
|
|
- int na = ( 0x100 - alpha );
|
|
|
- int i1 = ( alpha * ( fc & 0xFF00FF ) ) >> 8;
|
|
|
- int i2 = ( alpha * ( fc & 0x00FF00 ) ) >> 8;
|
|
|
- while( !( (int)( x + 0.5 ) == b.x && (int)( y + 0.5 ) == b.y ) && count < maxP )
|
|
|
+ int alpha = ((fc >> 24) & 0xFF);
|
|
|
+ int na = (0x100 - alpha);
|
|
|
+ int i1 = (alpha * (fc & 0xFF00FF)) >> 8;
|
|
|
+ int i2 = (alpha * (fc & 0x00FF00)) >> 8;
|
|
|
+ while( !((int)(x + 0.5) == b.x && (int)(y + 0.5) == b.y) && count < maxP )
|
|
|
{
|
|
|
++count;
|
|
|
- int &pixel = this->fc[ (int)( x + 0.5 ) + (int)( y + 0.5 ) * size.x ];
|
|
|
- pixel = ( ( ( ( ( na * ( pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( pixel & 0xFF000000 ) ) * ( pixel != 0 || !alpha3D ) | ( pixel == 0 && alpha3D ) * fc;
|
|
|
+ int& pixel = this->fc[ (int)(x + 0.5) + (int)(y + 0.5) * size.x ];
|
|
|
+ pixel = (((((na * (pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ (pixel & 0xFF000000)) * (pixel != 0 || !alpha3D) | (pixel == 0 && alpha3D) * fc;
|
|
|
x += xf, y += yf;
|
|
|
}
|
|
|
rend = 1;
|
|
@@ -1254,23 +1254,23 @@ void Bild::drawKreis( int xOff, int yOff, int r, int fc )
|
|
|
return;
|
|
|
for( int a = 0; a < r; ++a )
|
|
|
{
|
|
|
- int b = (int)( sqrt( (float)(long)( r * r - a * a ) ) + 0.5 );
|
|
|
+ int b = (int)(sqrt( (float)(long)(r * r - a * a) ) + 0.5);
|
|
|
if( xOff + a < dgx && xOff + a > dpx && yOff + b < dgy && yOff + b > dpy )
|
|
|
- this->fc[ xOff + a + ( yOff + b ) * size.x ] = fc;
|
|
|
+ this->fc[ xOff + a + (yOff + b) * size.x ] = fc;
|
|
|
if( xOff - a < dgx && xOff - a > dpx && yOff + b < dgy && yOff + b > dpy )
|
|
|
- this->fc[ xOff - a + ( yOff + b ) * size.x ] = fc;
|
|
|
+ this->fc[ xOff - a + (yOff + b) * size.x ] = fc;
|
|
|
if( xOff + a < dgx && xOff + a > dpx && yOff - b < dgy && yOff - b > dpy )
|
|
|
- this->fc[ xOff + a + ( yOff - b ) * size.x ] = fc;
|
|
|
+ this->fc[ xOff + a + (yOff - b) * size.x ] = fc;
|
|
|
if( xOff - a < dgx && xOff - a > dpx && yOff - b < dgy && yOff - b > dpy )
|
|
|
- this->fc[ xOff - a + ( yOff - b ) * size.x ] = fc;
|
|
|
+ this->fc[ xOff - a + (yOff - b) * size.x ] = fc;
|
|
|
if( xOff + b < dgx && xOff + b > dpx && yOff + a < dgy && yOff + a > dpy )
|
|
|
- this->fc[ xOff + b + ( yOff + a ) * size.x ] = fc;
|
|
|
+ this->fc[ xOff + b + (yOff + a) * size.x ] = fc;
|
|
|
if( xOff - b < dgx && xOff - b > dpx && yOff + a < dgy && yOff + a > dpy )
|
|
|
- this->fc[ xOff - b + ( yOff + a ) * size.x ] = fc;
|
|
|
+ this->fc[ xOff - b + (yOff + a) * size.x ] = fc;
|
|
|
if( xOff + b < dgx && xOff + b > dpx && yOff - a < dgy && yOff - a > dpy )
|
|
|
- this->fc[ xOff + b + ( yOff - a ) * size.x ] = fc;
|
|
|
+ this->fc[ xOff + b + (yOff - a) * size.x ] = fc;
|
|
|
if( xOff - b < dgx && xOff - b > dpx && yOff - a < dgy && yOff - a > dpy )
|
|
|
- this->fc[ xOff - b + ( yOff - a ) * size.x ] = fc;
|
|
|
+ this->fc[ xOff - b + (yOff - a) * size.x ] = fc;
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
@@ -1289,78 +1289,78 @@ void Bild::drawKreisAlpha( int xOff, int yOff, int r, int fc )
|
|
|
return;
|
|
|
if( alpha[ alphaAnzahl ] < 0xFF )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
}
|
|
|
- int alpha = ( ( fc >> 24 ) & 0xFF );
|
|
|
- int na = ( 0x100 - alpha );
|
|
|
- int i1 = ( alpha * ( fc & 0xFF00FF ) ) >> 8;
|
|
|
- int i2 = ( alpha * ( fc & 0x00FF00 ) ) >> 8;
|
|
|
+ int alpha = ((fc >> 24) & 0xFF);
|
|
|
+ int na = (0x100 - alpha);
|
|
|
+ int i1 = (alpha * (fc & 0xFF00FF)) >> 8;
|
|
|
+ int i2 = (alpha * (fc & 0x00FF00)) >> 8;
|
|
|
for( int a = 0; a < r; ++a )
|
|
|
{
|
|
|
- int b = (int)( sqrt( (float)(long)( r * r - a * a ) ) + 0.5 );
|
|
|
- int *pixel = 0;
|
|
|
+ int b = (int)(sqrt( (float)(long)(r * r - a * a) ) + 0.5);
|
|
|
+ int* pixel = 0;
|
|
|
if( xOff + a < dgx && xOff + a > dpx && yOff + b < dgy && yOff + b > dpy )
|
|
|
{
|
|
|
- pixel = &this->fc[ xOff + a + ( yOff + b ) * size.x ];
|
|
|
- *pixel = ( ( ( ( ( na * ( *pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( *pixel & 0xFF000000 ) ) * ( *pixel != 0 || !alpha3D ) | ( *pixel == 0 && alpha3D ) * fc;
|
|
|
+ pixel = &this->fc[ xOff + a + (yOff + b) * size.x ];
|
|
|
+ *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
|
|
|
}
|
|
|
if( xOff - a < dgx && xOff - a > dpx && yOff + b < dgy && yOff + b > dpy )
|
|
|
{
|
|
|
- pixel = &this->fc[ xOff - a + ( yOff + b ) * size.x ];
|
|
|
- *pixel = ( ( ( ( ( na * ( *pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( *pixel & 0xFF000000 ) ) * ( *pixel != 0 || !alpha3D ) | ( *pixel == 0 && alpha3D ) * fc;
|
|
|
+ pixel = &this->fc[ xOff - a + (yOff + b) * size.x ];
|
|
|
+ *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
|
|
|
}
|
|
|
if( xOff + a < dgx && xOff + a > dpx && yOff - b < dgy && yOff - b > dpy )
|
|
|
{
|
|
|
- pixel = &this->fc[ xOff + a + ( yOff - b ) * size.x ];
|
|
|
- *pixel = ( ( ( ( ( na * ( *pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( *pixel & 0xFF000000 ) ) * ( *pixel != 0 || !alpha3D ) | ( *pixel == 0 && alpha3D ) * fc;
|
|
|
+ pixel = &this->fc[ xOff + a + (yOff - b) * size.x ];
|
|
|
+ *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
|
|
|
}
|
|
|
if( xOff - a < dgx && xOff - a > dpx && yOff - b < dgy && yOff - b > dpy )
|
|
|
{
|
|
|
- pixel = &this->fc[ xOff - a + ( yOff - b ) * size.x ];
|
|
|
- *pixel = ( ( ( ( ( na * ( *pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( *pixel & 0xFF000000 ) ) * ( *pixel != 0 || !alpha3D ) | ( *pixel == 0 && alpha3D ) * fc;
|
|
|
+ pixel = &this->fc[ xOff - a + (yOff - b) * size.x ];
|
|
|
+ *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
|
|
|
}
|
|
|
if( xOff + b < dgx && xOff + b > dpx && yOff + a < dgy && yOff + a > dpy )
|
|
|
{
|
|
|
- pixel = &this->fc[ xOff + b + ( yOff + a ) * size.x ];
|
|
|
- *pixel = ( ( ( ( ( na * ( *pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( *pixel & 0xFF000000 ) ) * ( *pixel != 0 || !alpha3D ) | ( *pixel == 0 && alpha3D ) * fc;
|
|
|
+ pixel = &this->fc[ xOff + b + (yOff + a) * size.x ];
|
|
|
+ *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
|
|
|
}
|
|
|
if( xOff - b < dgx && xOff - b > dpx && yOff + a < dgy && yOff + a > dpy )
|
|
|
{
|
|
|
- pixel = &this->fc[ xOff - b + ( yOff + a ) * size.x ];
|
|
|
- *pixel = ( ( ( ( ( na * ( *pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( *pixel & 0xFF000000 ) ) * ( *pixel != 0 || !alpha3D ) | ( *pixel == 0 && alpha3D ) * fc;
|
|
|
+ pixel = &this->fc[ xOff - b + (yOff + a) * size.x ];
|
|
|
+ *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
|
|
|
}
|
|
|
if( xOff + b < dgx && xOff + b > dpx && yOff - a < dgy && yOff - a > dpy )
|
|
|
{
|
|
|
- pixel = &this->fc[ xOff + b + ( yOff - a ) * size.x ];
|
|
|
- *pixel = ( ( ( ( ( na * ( *pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( *pixel & 0xFF000000 ) ) * ( *pixel != 0 || !alpha3D ) | ( *pixel == 0 && alpha3D ) * fc;
|
|
|
+ pixel = &this->fc[ xOff + b + (yOff - a) * size.x ];
|
|
|
+ *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
|
|
|
}
|
|
|
if( xOff - b < dgx && xOff - b > dpx && yOff - a < dgy && yOff - a > dpy )
|
|
|
{
|
|
|
- pixel = &this->fc[ xOff - b + ( yOff - a ) * size.x ];
|
|
|
- *pixel = ( ( ( ( ( na * ( *pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
- ( *pixel & 0xFF000000 ) ) * ( *pixel != 0 || !alpha3D ) | ( *pixel == 0 && alpha3D ) * fc;
|
|
|
+ pixel = &this->fc[ xOff - b + (yOff - a) * size.x ];
|
|
|
+ *pixel = (((((na * (*pixel & 0xFF00FF)) >> 8) + i1) & 0xFF00FF) |
|
|
|
+ ((((na * (*pixel & 0x00FF00)) >> 8) + i2) & 0x00FF00) |
|
|
|
+ (*pixel & 0xFF000000)) * (*pixel != 0 || !alpha3D) | (*pixel == 0 && alpha3D) * fc;
|
|
|
}
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::drawBild( int x, int y, int br, int hi, Bild &zBild )
|
|
|
+void Bild::drawBild( int x, int y, int br, int hi, Bild& zBild )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -1386,19 +1386,19 @@ void Bild::drawBild( int x, int y, int br, int hi, Bild &zBild )
|
|
|
dgx = minInt( x + br, dgx );
|
|
|
dgy = minInt( y + hi, dgy );
|
|
|
int bb = zBild.getBreite();
|
|
|
- int *ff = zBild.getBuffer();
|
|
|
+ int* ff = zBild.getBuffer();
|
|
|
int xx, ygr, ygr2;
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ygr2 = ( yy - yst2 + yst ) * bb;
|
|
|
+ ygr2 = (yy - yst2 + yst) * bb;
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
- fc[ xx + ygr ] = ff[ ( xx - xst2 + xst ) + ygr2 ];
|
|
|
+ fc[ xx + ygr ] = ff[ (xx - xst2 + xst) + ygr2 ];
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::alphaBildAssoz( int x, int y, int br, int hi, Bild &zBild )
|
|
|
+void Bild::alphaBildAssoz( int x, int y, int br, int hi, Bild& zBild )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -1419,16 +1419,16 @@ void Bild::alphaBildAssoz( int x, int y, int br, int hi, Bild &zBild )
|
|
|
dgx = minInt( x + br, dgx );
|
|
|
dgy = minInt( y + hi, dgy );
|
|
|
int bb = zBild.getBreite();
|
|
|
- int *ff = zBild.getBuffer();
|
|
|
+ int* ff = zBild.getBuffer();
|
|
|
if( !alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
int xx, ygr, ygr2;
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ygr2 = ( yy - yst2 + yst ) * bb;
|
|
|
+ ygr2 = (yy - yst2 + yst) * bb;
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
- alphaPixelAssozP( fc[ xx + ygr ], ff[ ( xx - xst2 + xst ) + ygr2 ] );
|
|
|
+ alphaPixelAssozP( fc[ xx + ygr ], ff[ (xx - xst2 + xst) + ygr2 ] );
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -1437,12 +1437,12 @@ void Bild::alphaBildAssoz( int x, int y, int br, int hi, Bild &zBild )
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ygr2 = ( yy - yst2 + yst ) * bb;
|
|
|
+ ygr2 = (yy - yst2 + yst) * bb;
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- int fc = ff[ ( xx - xst2 + xst ) + ygr2 ];
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ int fc = ff[ (xx - xst2 + xst) + ygr2 ];
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelAssozP( this->fc[ xx + ygr ], fc );
|
|
|
}
|
|
|
}
|
|
@@ -1450,7 +1450,7 @@ void Bild::alphaBildAssoz( int x, int y, int br, int hi, Bild &zBild )
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::alphaBild( int x, int y, int br, int hi, Bild &zBild )
|
|
|
+void Bild::alphaBild( int x, int y, int br, int hi, Bild& zBild )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -1471,7 +1471,7 @@ void Bild::alphaBild( int x, int y, int br, int hi, Bild &zBild )
|
|
|
dgx = minInt( x + br, dgx );
|
|
|
dgy = minInt( y + hi, dgy );
|
|
|
int bb = zBild.getBreite();
|
|
|
- int *ff = zBild.getBuffer();
|
|
|
+ int* ff = zBild.getBuffer();
|
|
|
if( !alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
int xx, ygr, ygr2;
|
|
@@ -1480,7 +1480,7 @@ void Bild::alphaBild( int x, int y, int br, int hi, Bild &zBild )
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ygr2 = ( yy - yst2 + yst ) * bb;
|
|
|
+ ygr2 = (yy - yst2 + yst) * bb;
|
|
|
int fci = xst2 + ygr;
|
|
|
int ffi = xst + ygr2;
|
|
|
for( xx = xst2; xx < dgx; ++xx, ++fci, ++ffi )
|
|
@@ -1492,7 +1492,7 @@ void Bild::alphaBild( int x, int y, int br, int hi, Bild &zBild )
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ygr2 = ( yy - yst2 + yst ) * bb;
|
|
|
+ ygr2 = (yy - yst2 + yst) * bb;
|
|
|
int fci = xst2 + ygr;
|
|
|
int ffi = xst + ygr2;
|
|
|
for( xx = xst2; xx < dgx; ++xx, ++fci, ++ffi )
|
|
@@ -1508,12 +1508,12 @@ void Bild::alphaBild( int x, int y, int br, int hi, Bild &zBild )
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ygr2 = ( yy - yst2 + yst ) * bb;
|
|
|
+ ygr2 = (yy - yst2 + yst) * bb;
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- int fc = ff[ ( xx - xst2 + xst ) + ygr2 ];
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ int fc = ff[ (xx - xst2 + xst) + ygr2 ];
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP( this->fc[ xx + ygr ], fc );
|
|
|
}
|
|
|
}
|
|
@@ -1523,12 +1523,12 @@ void Bild::alphaBild( int x, int y, int br, int hi, Bild &zBild )
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ygr2 = ( yy - yst2 + yst ) * bb;
|
|
|
+ ygr2 = (yy - yst2 + yst) * bb;
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- int fc = ff[ ( xx - xst2 + xst ) + ygr2 ];
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ int fc = ff[ (xx - xst2 + xst) + ygr2 ];
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP3D( this->fc[ xx + ygr ], fc );
|
|
|
}
|
|
|
}
|
|
@@ -1537,7 +1537,7 @@ void Bild::alphaBild( int x, int y, int br, int hi, Bild &zBild )
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::drawBild90( int x, int y, int br, int hi, Bild &zBild )
|
|
|
+void Bild::drawBild90( int x, int y, int br, int hi, Bild& zBild )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -1563,18 +1563,18 @@ void Bild::drawBild90( int x, int y, int br, int hi, Bild &zBild )
|
|
|
dgx = minInt( x + br, dgx );
|
|
|
dgy = minInt( y + hi, dgy );
|
|
|
int bb = zBild.getBreite();
|
|
|
- int *ff = zBild.getBuffer();
|
|
|
+ int* ff = zBild.getBuffer();
|
|
|
int yy, xbb;
|
|
|
for( int xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- xbb = ( zBild.getHeight() - ( xx - xst2 + xst + 1 ) ) * bb;
|
|
|
+ xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
- fc[ xx + yy * size.x ] = ff[ ( yy - yst2 + yst ) + xbb ];
|
|
|
+ fc[ xx + yy * size.x ] = ff[ (yy - yst2 + yst) + xbb ];
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::alphaBild90( int x, int y, int br, int hi, Bild &zBild )
|
|
|
+void Bild::alphaBild90( int x, int y, int br, int hi, Bild& zBild )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -1595,7 +1595,7 @@ void Bild::alphaBild90( int x, int y, int br, int hi, Bild &zBild )
|
|
|
dgx = minInt( x + br, dgx );
|
|
|
dgy = minInt( y + hi, dgy );
|
|
|
int bb = zBild.getBreite();
|
|
|
- int *ff = zBild.getBuffer();
|
|
|
+ int* ff = zBild.getBuffer();
|
|
|
if( !alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
int yy, xbb;
|
|
@@ -1603,18 +1603,18 @@ void Bild::alphaBild90( int x, int y, int br, int hi, Bild &zBild )
|
|
|
{
|
|
|
for( int xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- xbb = ( zBild.getHeight() - ( xx - xst2 + xst + 1 ) ) * bb;
|
|
|
+ xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
- alphaPixelP3D( xx, yy, ff[ ( yy - yst2 + yst ) + xbb ] );
|
|
|
+ alphaPixelP3D( xx, yy, ff[ (yy - yst2 + yst) + xbb ] );
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
for( int xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- xbb = ( zBild.getHeight() - ( xx - xst2 + xst + 1 ) ) * bb;
|
|
|
+ xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
- alphaPixelP( xx, yy, ff[ ( yy - yst2 + yst ) + xbb ] );
|
|
|
+ alphaPixelP( xx, yy, ff[ (yy - yst2 + yst) + xbb ] );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1625,12 +1625,12 @@ void Bild::alphaBild90( int x, int y, int br, int hi, Bild &zBild )
|
|
|
{
|
|
|
for( int xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- xbb = ( zBild.getHeight() - ( xx - xst2 + xst + 1 ) ) * bb;
|
|
|
+ xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
- int fc = ff[ ( yy - yst2 + yst ) + xbb ];
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ int fc = ff[ (yy - yst2 + yst) + xbb ];
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP3D( xx, yy, fc );
|
|
|
}
|
|
|
}
|
|
@@ -1639,12 +1639,12 @@ void Bild::alphaBild90( int x, int y, int br, int hi, Bild &zBild )
|
|
|
{
|
|
|
for( int xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- xbb = ( zBild.getHeight() - ( xx - xst2 + xst + 1 ) ) * bb;
|
|
|
+ xbb = (zBild.getHeight() - (xx - xst2 + xst + 1)) * bb;
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
- int fc = ff[ ( yy - yst2 + yst ) + xbb ];
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ int fc = ff[ (yy - yst2 + yst) + xbb ];
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP( xx, yy, fc );
|
|
|
}
|
|
|
}
|
|
@@ -1653,7 +1653,7 @@ void Bild::alphaBild90( int x, int y, int br, int hi, Bild &zBild )
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::drawBild180( int x, int y, int br, int hi, Bild &zBild )
|
|
|
+void Bild::drawBild180( int x, int y, int br, int hi, Bild& zBild )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -1679,19 +1679,19 @@ void Bild::drawBild180( int x, int y, int br, int hi, Bild &zBild )
|
|
|
dgx = minInt( x + br, dgx );
|
|
|
dgy = minInt( y + hi, dgy );
|
|
|
int bb = zBild.getBreite();
|
|
|
- int *ff = zBild.getBuffer();
|
|
|
+ int* ff = zBild.getBuffer();
|
|
|
int xx, ygr, ybb;
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ybb = ( zBild.getHeight() - ( yy - yst2 + yst + 1 ) ) * bb;
|
|
|
+ ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
- fc[ xx + ygr ] = ff[ ( bb - ( xx - xst2 + xst + 1 ) ) + ybb ];
|
|
|
+ fc[ xx + ygr ] = ff[ (bb - (xx - xst2 + xst + 1)) + ybb ];
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::alphaBild180( int x, int y, int br, int hi, Bild &zBild )
|
|
|
+void Bild::alphaBild180( int x, int y, int br, int hi, Bild& zBild )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -1712,7 +1712,7 @@ void Bild::alphaBild180( int x, int y, int br, int hi, Bild &zBild )
|
|
|
dgx = minInt( x + br, dgx );
|
|
|
dgy = minInt( y + hi, dgy );
|
|
|
int bb = zBild.getBreite();
|
|
|
- int *ff = zBild.getBuffer();
|
|
|
+ int* ff = zBild.getBuffer();
|
|
|
if( !alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
int xx, ygr, ybb;
|
|
@@ -1721,9 +1721,9 @@ void Bild::alphaBild180( int x, int y, int br, int hi, Bild &zBild )
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ybb = ( zBild.getHeight() - ( yy - yst2 + yst + 1 ) ) * bb;
|
|
|
+ ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
- alphaPixelP3D( fc[ xx + ygr ], ff[ ( bb - ( xx - xst2 + xst + 1 ) ) + ybb ] );
|
|
|
+ alphaPixelP3D( fc[ xx + ygr ], ff[ (bb - (xx - xst2 + xst + 1)) + ybb ] );
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -1731,9 +1731,9 @@ void Bild::alphaBild180( int x, int y, int br, int hi, Bild &zBild )
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ybb = ( zBild.getHeight() - ( yy - yst2 + yst + 1 ) ) * bb;
|
|
|
+ ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
- alphaPixelP( fc[ xx + ygr ], ff[ ( bb - ( xx - xst2 + xst + 1 ) ) + ybb ] );
|
|
|
+ alphaPixelP( fc[ xx + ygr ], ff[ (bb - (xx - xst2 + xst + 1)) + ybb ] );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1745,12 +1745,12 @@ void Bild::alphaBild180( int x, int y, int br, int hi, Bild &zBild )
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ybb = ( zBild.getHeight() - ( yy - yst2 + yst + 1 ) ) * bb;
|
|
|
+ ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- int fc = ff[ ( bb - ( xx - xst2 + xst + 1 ) ) + ybb ];
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ int fc = ff[ (bb - (xx - xst2 + xst + 1)) + ybb ];
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP3D( this->fc[ xx + ygr ], fc );
|
|
|
}
|
|
|
}
|
|
@@ -1760,12 +1760,12 @@ void Bild::alphaBild180( int x, int y, int br, int hi, Bild &zBild )
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ybb = ( zBild.getHeight() - ( yy - yst2 + yst + 1 ) ) * bb;
|
|
|
+ ybb = (zBild.getHeight() - (yy - yst2 + yst + 1)) * bb;
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- int fc = ff[ ( bb - ( xx - xst2 + xst + 1 ) ) + ybb ];
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ int fc = ff[ (bb - (xx - xst2 + xst + 1)) + ybb ];
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP( this->fc[ xx + ygr ], fc );
|
|
|
}
|
|
|
}
|
|
@@ -1774,7 +1774,7 @@ void Bild::alphaBild180( int x, int y, int br, int hi, Bild &zBild )
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::drawBild270( int x, int y, int br, int hi, Bild &zBild )
|
|
|
+void Bild::drawBild270( int x, int y, int br, int hi, Bild& zBild )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -1800,18 +1800,18 @@ void Bild::drawBild270( int x, int y, int br, int hi, Bild &zBild )
|
|
|
dgx = minInt( x + br, dgx );
|
|
|
dgy = minInt( y + hi, dgy );
|
|
|
int bb = zBild.getBreite();
|
|
|
- int *ff = zBild.getBuffer();
|
|
|
+ int* ff = zBild.getBuffer();
|
|
|
int yy, xbb;
|
|
|
for( int xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- xbb = ( xx - xst2 + xst ) * bb;
|
|
|
+ xbb = (xx - xst2 + xst) * bb;
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
- fc[ xx + yy * size.x ] = ff[ ( bb - ( yy - yst2 + yst + 1 ) ) + xbb ];
|
|
|
+ fc[ xx + yy * size.x ] = ff[ (bb - (yy - yst2 + yst + 1)) + xbb ];
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::alphaBild270( int x, int y, int br, int hi, Bild &zBild )
|
|
|
+void Bild::alphaBild270( int x, int y, int br, int hi, Bild& zBild )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -1832,7 +1832,7 @@ void Bild::alphaBild270( int x, int y, int br, int hi, Bild &zBild )
|
|
|
dgx = minInt( x + br, dgx );
|
|
|
dgy = minInt( y + hi, dgy );
|
|
|
int bb = zBild.getBreite();
|
|
|
- int *ff = zBild.getBuffer();
|
|
|
+ int* ff = zBild.getBuffer();
|
|
|
if( !alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
int yy, xbb;
|
|
@@ -1840,18 +1840,18 @@ void Bild::alphaBild270( int x, int y, int br, int hi, Bild &zBild )
|
|
|
{
|
|
|
for( int xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- xbb = ( xx - xst2 + xst ) * bb;
|
|
|
+ xbb = (xx - xst2 + xst) * bb;
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
- alphaPixelP3D( xx, yy, ff[ ( bb - ( yy - yst2 + yst + 1 ) ) + xbb ] );
|
|
|
+ alphaPixelP3D( xx, yy, ff[ (bb - (yy - yst2 + yst + 1)) + xbb ] );
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
for( int xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- xbb = ( xx - xst2 + xst ) * bb;
|
|
|
+ xbb = (xx - xst2 + xst) * bb;
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
- alphaPixelP( xx, yy, ff[ ( bb - ( yy - yst2 + yst + 1 ) ) + xbb ] );
|
|
|
+ alphaPixelP( xx, yy, ff[ (bb - (yy - yst2 + yst + 1)) + xbb ] );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1862,12 +1862,12 @@ void Bild::alphaBild270( int x, int y, int br, int hi, Bild &zBild )
|
|
|
{
|
|
|
for( int xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- xbb = ( xx - xst2 + xst ) * bb;
|
|
|
+ xbb = (xx - xst2 + xst) * bb;
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
- int fc = ff[ ( bb - ( yy - yst2 + yst + 1 ) ) + xbb ];
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ int fc = ff[ (bb - (yy - yst2 + yst + 1)) + xbb ];
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP3D( xx, yy, fc );
|
|
|
}
|
|
|
}
|
|
@@ -1876,12 +1876,12 @@ void Bild::alphaBild270( int x, int y, int br, int hi, Bild &zBild )
|
|
|
{
|
|
|
for( int xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
- xbb = ( xx - xst2 + xst ) * bb;
|
|
|
+ xbb = (xx - xst2 + xst) * bb;
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
- int fc = ff[ ( bb - ( yy - yst2 + yst + 1 ) ) + xbb ];
|
|
|
- unsigned char *cf = (unsigned char *)&fc;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ int fc = ff[ (bb - (yy - yst2 + yst + 1)) + xbb ];
|
|
|
+ unsigned char* cf = (unsigned char*)&fc;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP( xx, yy, fc );
|
|
|
}
|
|
|
}
|
|
@@ -1890,7 +1890,7 @@ void Bild::alphaBild270( int x, int y, int br, int hi, Bild &zBild )
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::drawBildSkall( int x, int y, int br, int hi, Bild &zBild )
|
|
|
+void Bild::drawBildSkall( int x, int y, int br, int hi, Bild& zBild )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -1916,20 +1916,20 @@ void Bild::drawBildSkall( int x, int y, int br, int hi, Bild &zBild )
|
|
|
dgx = minInt( x + br, dgx );
|
|
|
dgy = minInt( y + hi, dgy );
|
|
|
int bb = zBild.getBreite();
|
|
|
- int *ff = zBild.getBuffer();
|
|
|
+ int* ff = zBild.getBuffer();
|
|
|
int xx, ygr, ygr2;
|
|
|
double xb = 0, yb = yst * yo;
|
|
|
for( int yy = yst2; yy < dgy; ++yy, yb += yo )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ygr2 = (int)( ( yy - yst2 + yst ) * yo ) * bb;
|
|
|
+ ygr2 = (int)((yy - yst2 + yst) * yo) * bb;
|
|
|
for( xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo )
|
|
|
fc[ xx + ygr ] = ff[ (int)xb + ygr2 ];
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild &zBild )
|
|
|
+void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild& zBild )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -1950,7 +1950,7 @@ void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild &zBild )
|
|
|
dgx = minInt( x + br, dgx );
|
|
|
dgy = minInt( y + hi, dgy );
|
|
|
int bb = zBild.getBreite();
|
|
|
- int *ff = zBild.getBuffer();
|
|
|
+ int* ff = zBild.getBuffer();
|
|
|
int xx, ygr, ygr2;
|
|
|
double xb = 0;
|
|
|
if( alpha3D )
|
|
@@ -1958,12 +1958,12 @@ void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild &zBild )
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ygr2 = (int)( ( yy - yst2 + yst ) * yo ) * bb;
|
|
|
+ ygr2 = (int)((yy - yst2 + yst) * yo) * bb;
|
|
|
for( xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo )
|
|
|
{
|
|
|
int f = ff[ (int)xb + ygr2 ];
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP3D( fc[ xx + ygr ], f );
|
|
|
}
|
|
|
}
|
|
@@ -1973,12 +1973,12 @@ void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild &zBild )
|
|
|
for( int yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
ygr = yy * size.x;
|
|
|
- ygr2 = (int)( ( yy - yst2 + yst ) * yo ) * bb;
|
|
|
+ ygr2 = (int)((yy - yst2 + yst) * yo) * bb;
|
|
|
for( xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo )
|
|
|
{
|
|
|
int f = ff[ (int)xb + ygr2 ];
|
|
|
- unsigned char *cf = (unsigned char *)&f;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&f;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
alphaPixelP( fc[ xx + ygr ], f );
|
|
|
}
|
|
|
}
|
|
@@ -2002,8 +2002,8 @@ void Bild::drawDreieck( Punkt a, Punkt b, Punkt c, int farbe )
|
|
|
a += drawOff[ doa ];
|
|
|
b += drawOff[ doa ];
|
|
|
c += drawOff[ doa ];
|
|
|
- if( ( a.x < dpx && b.x < dpx && c.x < dpx ) || ( a.y < dpy && b.y < dpy && c.y < dpy ) ||
|
|
|
- ( a.x > dgx && b.x > dgx && c.x > dgx ) || ( a.y > dgy && b.y > dgy && c.y > dgy ) )
|
|
|
+ if( (a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
|
|
|
+ (a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy) )
|
|
|
return;
|
|
|
if( b.y < a.y )
|
|
|
a.Swap( b );
|
|
@@ -2015,8 +2015,8 @@ void Bild::drawDreieck( Punkt a, Punkt b, Punkt c, int farbe )
|
|
|
{
|
|
|
if( b.x < a.x )
|
|
|
a.Swap( b );
|
|
|
- const float m2 = (float)( a.x - c.x ) / (float)( a.y - c.y );
|
|
|
- const float m3 = (float)( b.x - c.x ) / (float)( b.y - c.y );
|
|
|
+ const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
|
|
|
+ const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
|
|
|
float b2 = (float)a.x - m2 * (float)a.y;
|
|
|
float b3 = (float)b.x - m3 * (float)b.y;
|
|
|
drawFlatDreieck( b.y, c.y, m2, b2, m3, b3, farbe );
|
|
@@ -2025,17 +2025,17 @@ void Bild::drawDreieck( Punkt a, Punkt b, Punkt c, int farbe )
|
|
|
{
|
|
|
if( c.x < b.x )
|
|
|
b.Swap( c );
|
|
|
- const float m1 = (float)( a.x - b.x ) / (float)( a.y - b.y );
|
|
|
- const float m2 = (float)( a.x - c.x ) / (float)( a.y - c.y );
|
|
|
+ const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
|
|
|
+ const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
|
|
|
float b1 = (float)a.x - m1 * (float)a.y;
|
|
|
float b2 = (float)a.x - m2 * (float)a.y;
|
|
|
drawFlatDreieck( a.y, b.y, m1, b1, m2, b2, farbe );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- const float m1 = (float)( a.x - b.x ) / (float)( a.y - b.y );
|
|
|
- const float m2 = (float)( a.x - c.x ) / (float)( a.y - c.y );
|
|
|
- const float m3 = (float)( b.x - c.x ) / (float)( b.y - c.y );
|
|
|
+ const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
|
|
|
+ const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
|
|
|
+ const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
|
|
|
float b1 = (float)a.x - m1 * (float)a.y;
|
|
|
float b2 = (float)a.x - m2 * (float)a.y;
|
|
|
float b3 = (float)b.x - m3 * (float)b.y;
|
|
@@ -2054,7 +2054,7 @@ void Bild::drawDreieck( Punkt a, Punkt b, Punkt c, int farbe )
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Punkt tc, Bild &textur )
|
|
|
+void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Punkt tc, Bild& textur )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -2070,8 +2070,8 @@ void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Pun
|
|
|
a += drawOff[ doa ];
|
|
|
b += drawOff[ doa ];
|
|
|
c += drawOff[ doa ];
|
|
|
- if( ( a.x < dpx && b.x < dpx && c.x < dpx ) || ( a.y < dpy && b.y < dpy && c.y < dpy ) ||
|
|
|
- ( a.x > dgx && b.x > dgx && c.x > dgx ) || ( a.y > dgy && b.y > dgy && c.y > dgy ) )
|
|
|
+ if( (a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
|
|
|
+ (a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy) )
|
|
|
return;
|
|
|
if( b.y < a.y )
|
|
|
{
|
|
@@ -2088,9 +2088,9 @@ void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Pun
|
|
|
a.Swap( b );
|
|
|
ta.Swap( tb );
|
|
|
}
|
|
|
- const double m1 = (double)( a.x - b.x ) / ( a.y - b.y );
|
|
|
- const double m2 = (double)( a.x - c.x ) / ( a.y - c.y );
|
|
|
- const double m3 = (double)( b.x - c.x ) / ( b.y - c.y );
|
|
|
+ const double m1 = (double)(a.x - b.x) / (a.y - b.y);
|
|
|
+ const double m2 = (double)(a.x - c.x) / (a.y - c.y);
|
|
|
+ const double m3 = (double)(b.x - c.x) / (b.y - c.y);
|
|
|
double b1 = a.x - m1 * a.y;
|
|
|
double b2 = a.x - m2 * a.y;
|
|
|
double b3 = b.x - m3 * b.y;
|
|
@@ -2100,8 +2100,8 @@ void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Pun
|
|
|
double tx1o, ty1o, tx2o, ty2o;
|
|
|
if( c.y - a.y )
|
|
|
{
|
|
|
- tx1o = (double)( tc.x - ta.x ) / ( c.y - a.y );
|
|
|
- ty1o = (double)( tc.y - ta.y ) / ( c.y - a.y );
|
|
|
+ tx1o = (double)(tc.x - ta.x) / (c.y - a.y);
|
|
|
+ ty1o = (double)(tc.y - ta.y) / (c.y - a.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2110,20 +2110,20 @@ void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Pun
|
|
|
}
|
|
|
if( b.y - a.y )
|
|
|
{
|
|
|
- tx2o = (double)( tb.x - ta.x ) / ( b.y - a.y );
|
|
|
- ty2o = (double)( tb.y - ta.y ) / ( b.y - a.y );
|
|
|
+ tx2o = (double)(tb.x - ta.x) / (b.y - a.y);
|
|
|
+ ty2o = (double)(tb.y - ta.y) / (b.y - a.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
tx2o = 0;
|
|
|
ty2o = 0;
|
|
|
}
|
|
|
- Vec2< double > q( ta.x + tx1o * ( b.y - a.y ), ta.y + ty1o * ( b.y - a.y ) );
|
|
|
+ Vec2< double > q( ta.x + tx1o * (b.y - a.y), ta.y + ty1o * (b.y - a.y) );
|
|
|
double txf, tyf;
|
|
|
if( b.x - qx )
|
|
|
{
|
|
|
- txf = ( tb.x - q.x ) / ( b.x - qx );
|
|
|
- tyf = ( tb.y - q.y ) / ( b.x - qx );
|
|
|
+ txf = (tb.x - q.x) / (b.x - qx);
|
|
|
+ tyf = (tb.y - q.y) / (b.x - qx);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2133,8 +2133,8 @@ void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Pun
|
|
|
drawFlatDreieckTextur( a.y, b.y, m2, b2, m1, b1, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
|
|
|
if( c.y - b.y )
|
|
|
{
|
|
|
- tx2o = (double)( tc.x - tb.x ) / ( c.y - b.y );
|
|
|
- ty2o = (double)( tc.y - tb.y ) / ( c.y - b.y );
|
|
|
+ tx2o = (double)(tc.x - tb.x) / (c.y - b.y);
|
|
|
+ ty2o = (double)(tc.y - tb.y) / (c.y - b.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2148,8 +2148,8 @@ void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Pun
|
|
|
double tx1o, ty1o, tx2o, ty2o;
|
|
|
if( b.y - a.y )
|
|
|
{
|
|
|
- tx1o = (double)( tb.x - ta.x ) / ( b.y - a.y );
|
|
|
- ty1o = (double)( tb.y - ta.y ) / ( b.y - a.y );
|
|
|
+ tx1o = (double)(tb.x - ta.x) / (b.y - a.y);
|
|
|
+ ty1o = (double)(tb.y - ta.y) / (b.y - a.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2158,20 +2158,20 @@ void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Pun
|
|
|
}
|
|
|
if( c.y - a.y )
|
|
|
{
|
|
|
- tx2o = (double)( tc.x - ta.x ) / ( c.y - a.y );
|
|
|
- ty2o = (double)( tc.y - ta.y ) / ( c.y - a.y );
|
|
|
+ tx2o = (double)(tc.x - ta.x) / (c.y - a.y);
|
|
|
+ ty2o = (double)(tc.y - ta.y) / (c.y - a.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
tx2o = 0;
|
|
|
ty2o = 0;
|
|
|
}
|
|
|
- Vec2< double > q( ta.x + tx2o * ( b.y - a.y ), ta.y + ty2o * ( b.y - a.y ) );
|
|
|
+ Vec2< double > q( ta.x + tx2o * (b.y - a.y), ta.y + ty2o * (b.y - a.y) );
|
|
|
double txf, tyf;
|
|
|
if( qx - b.x )
|
|
|
{
|
|
|
- txf = ( q.x - tb.x ) / ( qx - b.x );
|
|
|
- tyf = ( q.y - tb.y ) / ( qx - b.x );
|
|
|
+ txf = (q.x - tb.x) / (qx - b.x);
|
|
|
+ tyf = (q.y - tb.y) / (qx - b.x);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2181,8 +2181,8 @@ void Bild::drawDreieckTextur( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Pun
|
|
|
drawFlatDreieckTextur( a.y, b.y, m1, b1, m2, b2, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
|
|
|
if( c.y - b.y )
|
|
|
{
|
|
|
- tx1o = (double)( tc.x - tb.x ) / ( c.y - b.y );
|
|
|
- ty1o = (double)( tc.y - tb.y ) / ( c.y - b.y );
|
|
|
+ tx1o = (double)(tc.x - tb.x) / (c.y - b.y);
|
|
|
+ ty1o = (double)(tc.y - tb.y) / (c.y - b.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2205,13 +2205,13 @@ void Bild::drawDreieckAlpha( Punkt a, Punkt b, Punkt c, int farbe )
|
|
|
a += drawOff[ doa ];
|
|
|
b += drawOff[ doa ];
|
|
|
c += drawOff[ doa ];
|
|
|
- if( ( a.x < dpx && b.x < dpx && c.x < dpx ) || ( a.y < dpy && b.y < dpy && c.y < dpy ) ||
|
|
|
- ( a.x > dgx && b.x > dgx && c.x > dgx ) || ( a.y > dgy && b.y > dgy && c.y > dgy ) )
|
|
|
+ if( (a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
|
|
|
+ (a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy) )
|
|
|
return;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&farbe;
|
|
|
- cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&farbe;
|
|
|
+ cf[ 3 ] = (unsigned char)((cf[ 3 ] > alpha[ alphaAnzahl ]) * (cf[ 3 ] - alpha[ alphaAnzahl ]));
|
|
|
}
|
|
|
if( b.y < a.y )
|
|
|
a.Swap( b );
|
|
@@ -2223,8 +2223,8 @@ void Bild::drawDreieckAlpha( Punkt a, Punkt b, Punkt c, int farbe )
|
|
|
{
|
|
|
if( b.x < a.x )
|
|
|
a.Swap( b );
|
|
|
- const float m2 = (float)( a.x - c.x ) / (float)( a.y - c.y );
|
|
|
- const float m3 = (float)( b.x - c.x ) / (float)( b.y - c.y );
|
|
|
+ const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
|
|
|
+ const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
|
|
|
float b2 = (float)a.x - m2 * (float)a.y;
|
|
|
float b3 = (float)b.x - m3 * (float)b.y;
|
|
|
drawFlatDreieckAlpha( b.y, c.y, m2, b2, m3, b3, farbe );
|
|
@@ -2233,17 +2233,17 @@ void Bild::drawDreieckAlpha( Punkt a, Punkt b, Punkt c, int farbe )
|
|
|
{
|
|
|
if( c.x < b.x )
|
|
|
b.Swap( c );
|
|
|
- const float m1 = (float)( a.x - b.x ) / (float)( a.y - b.y );
|
|
|
- const float m2 = (float)( a.x - c.x ) / (float)( a.y - c.y );
|
|
|
+ const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
|
|
|
+ const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
|
|
|
float b1 = (float)a.x - m1 * (float)a.y;
|
|
|
float b2 = (float)a.x - m2 * (float)a.y;
|
|
|
drawFlatDreieckAlpha( a.y, b.y, m1, b1, m2, b2, farbe );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- const float m1 = (float)( a.x - b.x ) / (float)( a.y - b.y );
|
|
|
- const float m2 = (float)( a.x - c.x ) / (float)( a.y - c.y );
|
|
|
- const float m3 = (float)( b.x - c.x ) / (float)( b.y - c.y );
|
|
|
+ const float m1 = (float)(a.x - b.x) / (float)(a.y - b.y);
|
|
|
+ const float m2 = (float)(a.x - c.x) / (float)(a.y - c.y);
|
|
|
+ const float m3 = (float)(b.x - c.x) / (float)(b.y - c.y);
|
|
|
float b1 = (float)a.x - m1 * (float)a.y;
|
|
|
float b2 = (float)a.x - m2 * (float)a.y;
|
|
|
float b3 = (float)b.x - m3 * (float)b.y;
|
|
@@ -2262,7 +2262,7 @@ void Bild::drawDreieckAlpha( Punkt a, Punkt b, Punkt c, int farbe )
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Punkt tc, Bild &textur )
|
|
|
+void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb, Punkt tc, Bild& textur )
|
|
|
{
|
|
|
if( alpha[ alphaAnzahl ] == 0xFF )
|
|
|
return;
|
|
@@ -2273,8 +2273,8 @@ void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb
|
|
|
a += drawOff[ doa ];
|
|
|
b += drawOff[ doa ];
|
|
|
c += drawOff[ doa ];
|
|
|
- if( ( a.x < dpx && b.x < dpx && c.x < dpx ) || ( a.y < dpy && b.y < dpy && c.y < dpy ) ||
|
|
|
- ( a.x > dgx && b.x > dgx && c.x > dgx ) || ( a.y > dgy && b.y > dgy && c.y > dgy ) )
|
|
|
+ if( (a.x < dpx && b.x < dpx && c.x < dpx) || (a.y < dpy && b.y < dpy && c.y < dpy) ||
|
|
|
+ (a.x > dgx && b.x > dgx && c.x > dgx) || (a.y > dgy && b.y > dgy && c.y > dgy) )
|
|
|
return;
|
|
|
if( b.y < a.y )
|
|
|
{
|
|
@@ -2291,9 +2291,9 @@ void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb
|
|
|
a.Swap( b );
|
|
|
ta.Swap( tb );
|
|
|
}
|
|
|
- const double m1 = (double)( a.x - b.x ) / ( a.y - b.y );
|
|
|
- const double m2 = (double)( a.x - c.x ) / ( a.y - c.y );
|
|
|
- const double m3 = (double)( b.x - c.x ) / ( b.y - c.y );
|
|
|
+ const double m1 = (double)(a.x - b.x) / (a.y - b.y);
|
|
|
+ const double m2 = (double)(a.x - c.x) / (a.y - c.y);
|
|
|
+ const double m3 = (double)(b.x - c.x) / (b.y - c.y);
|
|
|
double b1 = a.x - m1 * a.y;
|
|
|
double b2 = a.x - m2 * a.y;
|
|
|
double b3 = b.x - m3 * b.y;
|
|
@@ -2303,8 +2303,8 @@ void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb
|
|
|
double tx1o, ty1o, tx2o, ty2o;
|
|
|
if( c.y - a.y )
|
|
|
{
|
|
|
- tx1o = (double)( tc.x - ta.x ) / ( c.y - a.y );
|
|
|
- ty1o = (double)( tc.y - ta.y ) / ( c.y - a.y );
|
|
|
+ tx1o = (double)(tc.x - ta.x) / (c.y - a.y);
|
|
|
+ ty1o = (double)(tc.y - ta.y) / (c.y - a.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2313,20 +2313,20 @@ void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb
|
|
|
}
|
|
|
if( b.y - a.y )
|
|
|
{
|
|
|
- tx2o = (double)( tb.x - ta.x ) / ( b.y - a.y );
|
|
|
- ty2o = (double)( tb.y - ta.y ) / ( b.y - a.y );
|
|
|
+ tx2o = (double)(tb.x - ta.x) / (b.y - a.y);
|
|
|
+ ty2o = (double)(tb.y - ta.y) / (b.y - a.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
tx2o = 0;
|
|
|
ty2o = 0;
|
|
|
}
|
|
|
- Vec2< double > q( ta.x + tx1o * ( b.y - a.y ), ta.y + ty1o * ( b.y - a.y ) );
|
|
|
+ Vec2< double > q( ta.x + tx1o * (b.y - a.y), ta.y + ty1o * (b.y - a.y) );
|
|
|
double txf, tyf;
|
|
|
if( b.x - qx )
|
|
|
{
|
|
|
- txf = ( tb.x - q.x ) / ( b.x - qx );
|
|
|
- tyf = ( tb.y - q.y ) / ( b.x - qx );
|
|
|
+ txf = (tb.x - q.x) / (b.x - qx);
|
|
|
+ tyf = (tb.y - q.y) / (b.x - qx);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2336,8 +2336,8 @@ void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb
|
|
|
drawFlatDreieckTexturAlpha( a.y, b.y, m2, b2, m1, b1, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
|
|
|
if( c.y - b.y )
|
|
|
{
|
|
|
- tx2o = (double)( tc.x - tb.x ) / ( c.y - b.y );
|
|
|
- ty2o = (double)( tc.y - tb.y ) / ( c.y - b.y );
|
|
|
+ tx2o = (double)(tc.x - tb.x) / (c.y - b.y);
|
|
|
+ ty2o = (double)(tc.y - tb.y) / (c.y - b.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2351,8 +2351,8 @@ void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb
|
|
|
double tx1o, ty1o, tx2o, ty2o;
|
|
|
if( b.y - a.y )
|
|
|
{
|
|
|
- tx1o = (double)( tb.x - ta.x ) / ( b.y - a.y );
|
|
|
- ty1o = (double)( tb.y - ta.y ) / ( b.y - a.y );
|
|
|
+ tx1o = (double)(tb.x - ta.x) / (b.y - a.y);
|
|
|
+ ty1o = (double)(tb.y - ta.y) / (b.y - a.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2361,20 +2361,20 @@ void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb
|
|
|
}
|
|
|
if( c.y - a.y )
|
|
|
{
|
|
|
- tx2o = (double)( tc.x - ta.x ) / ( c.y - a.y );
|
|
|
- ty2o = (double)( tc.y - ta.y ) / ( c.y - a.y );
|
|
|
+ tx2o = (double)(tc.x - ta.x) / (c.y - a.y);
|
|
|
+ ty2o = (double)(tc.y - ta.y) / (c.y - a.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
tx2o = 0;
|
|
|
ty2o = 0;
|
|
|
}
|
|
|
- Vec2< double > q( ta.x + tx2o * ( b.y - a.y ), ta.y + ty2o * ( b.y - a.y ) );
|
|
|
+ Vec2< double > q( ta.x + tx2o * (b.y - a.y), ta.y + ty2o * (b.y - a.y) );
|
|
|
double txf, tyf;
|
|
|
if( qx - b.x )
|
|
|
{
|
|
|
- txf = ( q.x - tb.x ) / ( qx - b.x );
|
|
|
- tyf = ( q.y - tb.y ) / ( qx - b.x );
|
|
|
+ txf = (q.x - tb.x) / (qx - b.x);
|
|
|
+ tyf = (q.y - tb.y) / (qx - b.x);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2384,8 +2384,8 @@ void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb
|
|
|
drawFlatDreieckTexturAlpha( a.y, b.y, m1, b1, m2, b2, ta.x, ta.y, ta.x, ta.y, tx1o, ty1o, tx2o, ty2o, txf, tyf, textur );
|
|
|
if( c.y - b.y )
|
|
|
{
|
|
|
- tx1o = (double)( tc.x - tb.x ) / ( c.y - b.y );
|
|
|
- ty1o = (double)( tc.y - tb.y ) / ( c.y - b.y );
|
|
|
+ tx1o = (double)(tc.x - tb.x) / (c.y - b.y);
|
|
|
+ ty1o = (double)(tc.y - tb.y) / (c.y - b.y);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2399,8 +2399,8 @@ void Bild::drawDreieckTexturAlpha( Punkt a, Punkt b, Punkt c, Punkt ta, Punkt tb
|
|
|
|
|
|
void Bild::replaceColorWithAlpha( int color )
|
|
|
{
|
|
|
- int r = ( color & 0xFF0000 ) >> 16;
|
|
|
- int g = ( color & 0xFF00 ) >> 8;
|
|
|
+ int r = (color & 0xFF0000) >> 16;
|
|
|
+ int g = (color & 0xFF00) >> 8;
|
|
|
int b = color & 0xFF;
|
|
|
int dx = drawOff[ doa ].x, dy = drawOff[ doa ].y;
|
|
|
int xx = dPosA[ doa ].x, yy = dPosA[ doa ].y;
|
|
@@ -2410,16 +2410,16 @@ void Bild::replaceColorWithAlpha( int color )
|
|
|
int ygr = y * size.x;
|
|
|
for( int x = dx + xx; x < bb; x++ )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)&( fc[ x + ygr ] );
|
|
|
- int abstand = (int)sqrt( (float)( ( r - cf[ 2 ] ) * ( r - cf[ 2 ] ) + ( g - cf[ 1 ] ) * ( g - cf[ 1 ] ) + ( b - cf[ 0 ] ) * ( b - cf[ 0 ] ) ) );
|
|
|
+ unsigned char* cf = (unsigned char*)&(fc[ x + ygr ]);
|
|
|
+ int abstand = (int)sqrt( (float)((r - cf[ 2 ]) * (r - cf[ 2 ]) + (g - cf[ 1 ]) * (g - cf[ 1 ]) + (b - cf[ 0 ]) * (b - cf[ 0 ])) );
|
|
|
if( abstand > 255 )
|
|
|
abstand = 255;
|
|
|
- cf[ 3 ] = (unsigned char)( abstand );
|
|
|
+ cf[ 3 ] = (unsigned char)(abstand);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-bool Bild::setDrawOptions( const Punkt &pos, const Punkt &gr )
|
|
|
+bool Bild::setDrawOptions( const Punkt& pos, const Punkt& gr )
|
|
|
{
|
|
|
int dx = drawOff[ doa ].x, dy = drawOff[ doa ].y;
|
|
|
int xx = dPosA[ doa ].x, yy = dPosA[ doa ].y;
|
|
@@ -2459,7 +2459,7 @@ bool Bild::setDrawOptions( int x, int y, int br, int hi )
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-bool Bild::setDrawOptionsErzwingen( const Punkt &pos, const Punkt &gr )
|
|
|
+bool Bild::setDrawOptionsErzwingen( const Punkt& pos, const Punkt& gr )
|
|
|
{
|
|
|
int dx = drawOff[ doa ].x, dy = drawOff[ doa ].y;
|
|
|
if( dx + pos.x + gr.x < 0 || dy + pos.y + gr.y < 0 || dx + pos.x >= size.x || dy + pos.y >= size.y )
|
|
@@ -2521,7 +2521,7 @@ bool Bild::getRend()
|
|
|
}
|
|
|
|
|
|
|
|
|
-int *Bild::getBuffer()const
|
|
|
+int* Bild::getBuffer()const
|
|
|
{
|
|
|
return fc;
|
|
|
}
|
|
@@ -2533,7 +2533,7 @@ int Bild::getPixel( int x, int y ) const
|
|
|
return fc[ x + y * size.x ];
|
|
|
}
|
|
|
|
|
|
-const Punkt &Bild::getSize() const
|
|
|
+const Punkt& Bild::getSize() const
|
|
|
{
|
|
|
return size;
|
|
|
}
|
|
@@ -2550,20 +2550,20 @@ int Bild::getHeight() const
|
|
|
|
|
|
unsigned char Bild::getAlpha() const
|
|
|
{
|
|
|
- return (unsigned char)( 255 - alpha[ alphaAnzahl ] );
|
|
|
+ return (unsigned char)(255 - alpha[ alphaAnzahl ]);
|
|
|
}
|
|
|
|
|
|
-const Punkt &Bild::getDrawPos() const
|
|
|
+const Punkt& Bild::getDrawPos() const
|
|
|
{
|
|
|
return dPosA[ doa ];
|
|
|
}
|
|
|
|
|
|
-const Punkt &Bild::getDrawGr() const
|
|
|
+const Punkt& Bild::getDrawGr() const
|
|
|
{
|
|
|
return dSizeA[ doa ];
|
|
|
}
|
|
|
|
|
|
-const Punkt &Bild::getDrawOff() const
|
|
|
+const Punkt& Bild::getDrawOff() const
|
|
|
{
|
|
|
return drawOff[ doa ];
|
|
|
}
|
|
@@ -2591,7 +2591,7 @@ BildZ::~BildZ()
|
|
|
bild->release();
|
|
|
}
|
|
|
|
|
|
-void BildZ::doMausEreignis( MausEreignis &me, bool userRet )
|
|
|
+void BildZ::doMausEreignis( MausEreignis& me, bool userRet )
|
|
|
{
|
|
|
if( userRet )
|
|
|
{
|
|
@@ -2613,7 +2613,7 @@ void BildZ::doMausEreignis( MausEreignis &me, bool userRet )
|
|
|
}
|
|
|
|
|
|
|
|
|
-void BildZ::setBildZ( Bild *b )
|
|
|
+void BildZ::setBildZ( Bild* b )
|
|
|
{
|
|
|
if( bild )
|
|
|
bild->release();
|
|
@@ -2630,7 +2630,7 @@ void BildZ::setBildZ( Bild *b )
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
|
-void BildZ::setBild( Bild *b )
|
|
|
+void BildZ::setBild( Bild* b )
|
|
|
{
|
|
|
if( !bild )
|
|
|
bild = new Bild();
|
|
@@ -2651,7 +2651,7 @@ bool BildZ::tick( double tickVal )
|
|
|
return ZeichnungHintergrund::tick( tickVal );
|
|
|
}
|
|
|
|
|
|
-void BildZ::render( Bild &zRObj )
|
|
|
+void BildZ::render( Bild& zRObj )
|
|
|
{
|
|
|
if( hatStyle( Style::Sichtbar ) )
|
|
|
{
|
|
@@ -2668,7 +2668,7 @@ void BildZ::render( Bild &zRObj )
|
|
|
int y = 0;
|
|
|
int br = innenSize.x;
|
|
|
int hi = innenSize.y;
|
|
|
- if( !( vertikalScrollBar && hatStyle( Style::VScroll ) ) && !( horizontalScrollBar && hatStyle( Style::HScroll ) ) )
|
|
|
+ if( !(vertikalScrollBar && hatStyle( Style::VScroll )) && !(horizontalScrollBar && hatStyle( Style::HScroll )) )
|
|
|
{
|
|
|
if( hatStyle( Style::Alpha ) )
|
|
|
{
|
|
@@ -2706,21 +2706,21 @@ void BildZ::render( Bild &zRObj )
|
|
|
}
|
|
|
|
|
|
|
|
|
-Bild *BildZ::getBild() const
|
|
|
+Bild* BildZ::getBild() const
|
|
|
{
|
|
|
if( bild )
|
|
|
- return dynamic_cast<Bild *>( bild->getThis() );
|
|
|
+ return dynamic_cast<Bild*>(bild->getThis());
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-Bild *BildZ::zBild() const
|
|
|
+Bild* BildZ::zBild() const
|
|
|
{
|
|
|
return bild;
|
|
|
}
|
|
|
|
|
|
-Zeichnung *BildZ::dublizieren() const
|
|
|
+Zeichnung* BildZ::dublizieren() const
|
|
|
{
|
|
|
- BildZ *obj = new BildZ();
|
|
|
+ BildZ* obj = new BildZ();
|
|
|
obj->setPosition( pos );
|
|
|
obj->setSize( gr );
|
|
|
obj->setMausEreignisParameter( makParam );
|
|
@@ -2728,34 +2728,34 @@ Zeichnung *BildZ::dublizieren() const
|
|
|
obj->setMausEreignis( mak );
|
|
|
obj->setTastaturEreignis( tak );
|
|
|
if( toolTip )
|
|
|
- obj->setToolTipZ( (ToolTip *)toolTip->dublizieren() );
|
|
|
+ obj->setToolTipZ( (ToolTip*)toolTip->dublizieren() );
|
|
|
obj->setStyle( style );
|
|
|
obj->setHintergrundFarbe( hintergrundFarbe );
|
|
|
if( hintergrundFeld )
|
|
|
- obj->setAlphaFeldZ( (AlphaFeld *)hintergrundFeld->dublizieren() );
|
|
|
+ obj->setAlphaFeldZ( (AlphaFeld*)hintergrundFeld->dublizieren() );
|
|
|
if( rahmen )
|
|
|
- obj->setRahmenZ( (Rahmen *)rahmen->dublizieren() );
|
|
|
+ obj->setRahmenZ( (Rahmen*)rahmen->dublizieren() );
|
|
|
if( hintergrundBild )
|
|
|
- obj->setHintergrundBild( dynamic_cast<Bild *>( hintergrundBild->getThis() ) );
|
|
|
+ obj->setHintergrundBild( dynamic_cast<Bild*>(hintergrundBild->getThis()) );
|
|
|
if( bild )
|
|
|
- obj->setBild( dynamic_cast<Bild *>( bild->getThis() ) );
|
|
|
+ obj->setBild( dynamic_cast<Bild*>(bild->getThis()) );
|
|
|
obj->setStyle( style );
|
|
|
return obj;
|
|
|
}
|
|
|
|
|
|
#ifdef WIN32
|
|
|
-Bild *Framework::ladeBild( char *pfad, Text *zError )
|
|
|
+Bild* Framework::ladeBild( char* pfad, Text* zError )
|
|
|
{
|
|
|
Text p = pfad;
|
|
|
- Text *txt = p.getTeilText( p.positionVon( '.', p.anzahlVon( '.' ) - 1 ) );
|
|
|
- if( !( txt->istGleich( ".bmp" ) || txt->istGleich( ".jpg" ) || txt->istGleich( ".gif" ) || txt->istGleich( ".png" ) ) )
|
|
|
+ Text* txt = p.getTeilText( p.positionVon( '.', p.anzahlVon( '.' ) - 1 ) );
|
|
|
+ if( !(txt->istGleich( ".bmp" ) || txt->istGleich( ".jpg" ) || txt->istGleich( ".gif" ) || txt->istGleich( ".png" )) )
|
|
|
{
|
|
|
zError->setText( "Die Angegebene Datei ist keine gueltige Bilddatei!" );
|
|
|
txt->release();
|
|
|
return 0;
|
|
|
}
|
|
|
txt->release();
|
|
|
- wchar_t *name = new wchar_t[ p.getLength() + 1 ];
|
|
|
+ wchar_t* name = new wchar_t[ p.getLength() + 1 ];
|
|
|
for( int i = 0; i < p.getLength(); i++ )
|
|
|
name[ i ] = (wchar_t)p.getText()[ i ];
|
|
|
name[ p.getLength() ] = '\0';
|
|
@@ -2764,9 +2764,9 @@ Bild *Framework::ladeBild( char *pfad, Text *zError )
|
|
|
Gdiplus::Color pix;
|
|
|
delete[]name;
|
|
|
|
|
|
- Bild *ret = new Bild();
|
|
|
+ Bild* ret = new Bild();
|
|
|
ret->neuBild( bitmap.GetWidth(), bitmap.GetHeight(), 0 );
|
|
|
- int *buff = ret->getBuffer();
|
|
|
+ int* buff = ret->getBuffer();
|
|
|
for( unsigned int i = 0; i < bitmap.GetWidth() * bitmap.GetHeight(); i++ )
|
|
|
{
|
|
|
bitmap.GetPixel( i % bitmap.GetWidth(), i / bitmap.GetWidth(), &pix );
|