|
@@ -32,10 +32,10 @@ using namespace Framework;
|
|
|
|
|
|
|
|
|
Bild::Bild( bool options )
|
|
|
- : fc( 0 ),
|
|
|
+ : ReferenceCounter(),
|
|
|
+ fc( 0 ),
|
|
|
delFc( 1 ),
|
|
|
size( 0, 0 ),
|
|
|
- ref( 1 ),
|
|
|
drawOff( options ? new Punkt[ 2000 ] : new Punkt[ 1 ] ),
|
|
|
dPosA( options ? new Punkt[ 2000 ] : new Punkt[ 1 ] ),
|
|
|
dSizeA( options ? new Punkt[ 2000 ] : new Punkt[ 1 ] ),
|
|
@@ -75,8 +75,8 @@ inline void Bild::alphaPixelP3D( int x, int y, 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 ) );
|
|
|
if( a == 0 )
|
|
@@ -94,7 +94,7 @@ 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 ) |
|
|
|
+ ( ( ( ( na * ( fc & 0x00FF00 ) ) >> 8 ) + ( ( alpha * ( colorb & 0x00FF00 ) ) >> 8 ) ) & 0x00FF00 ) |
|
|
|
( ( fc & 0xFF000000 ) ) ) * ( fc != 0 ) | ( fc == 0 ) * colorb;
|
|
|
|
|
|
|
|
@@ -112,7 +112,7 @@ 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 ) |
|
|
|
+ ( ( ( ( na * ( fc & 0x00FF00 ) ) >> 8 ) + ( ( alpha * ( colorb & 0x00FF00 ) ) >> 8 ) ) & 0x00FF00 ) |
|
|
|
( ( fc & 0xFF000000 ) ) );
|
|
|
|
|
|
|
|
@@ -151,7 +151,7 @@ void Bild::drawFlatDreieck( int y1, int y2, float m1, float b1, float m2, float
|
|
|
}
|
|
|
|
|
|
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 );
|
|
@@ -191,7 +191,7 @@ 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 );
|
|
@@ -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;
|
|
@@ -253,7 +253,7 @@ void Bild::drawLinieHTextur( Vec2< double > p, double len, Vec2< double > ta, Ve
|
|
|
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;
|
|
@@ -297,7 +297,7 @@ void Bild::drawLinieHTexturAlpha( Vec2< double > p, double len, Vec2< double > t
|
|
|
f = buffer[ (int)( (int)( x + 0.5 ) + (int)( y + 0.5 ) * txtBr ) ];
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)& f;
|
|
|
+ unsigned char *cf = (unsigned char *)&f;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
}
|
|
|
alphaPixelP3D( *fc, f );
|
|
@@ -311,7 +311,7 @@ void Bild::drawLinieHTexturAlpha( Vec2< double > p, double len, Vec2< double > t
|
|
|
f = buffer[ (int)( (int)( x + 0.5 ) + (int)( y + 0.5 ) * txtBr ) ];
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)& f;
|
|
|
+ unsigned char *cf = (unsigned char *)&f;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
}
|
|
|
alphaPixelP( *fc, f );
|
|
@@ -403,7 +403,7 @@ void Bild::setFarbe( int f )
|
|
|
else
|
|
|
{
|
|
|
for( int *i = fc, *end = i + size.x * size.y; i < end; i++ )
|
|
|
- * i = f;
|
|
|
+ *i = f;
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
@@ -442,7 +442,7 @@ void Bild::fillRegion( int x, int y, int b, int h, int ff )
|
|
|
for( int i = 0; i < h; pixel += size.x - b, ++i, rowEnd += size.x )
|
|
|
{
|
|
|
for( ; pixel < rowEnd; ++pixel )
|
|
|
- * pixel = ff;
|
|
|
+ *pixel = ff;
|
|
|
}
|
|
|
rend = 1;
|
|
|
}
|
|
@@ -473,7 +473,7 @@ void Bild::alphaRegion( int x, int y, int b, int h, int ff )
|
|
|
h = ( y + h ) >= dgy ? ( dgy - y ) : h;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)& ff;
|
|
|
+ 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;
|
|
@@ -489,7 +489,7 @@ 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 ) |
|
|
|
+ ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
( ( *pixel & 0xFF000000 ) ) ) * ( *pixel != 0 ) | ( *pixel == 0 ) * ff;
|
|
|
}
|
|
|
}
|
|
@@ -501,7 +501,7 @@ 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 ) |
|
|
|
+ ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
( ( *pixel & 0xFF000000 ) ) );
|
|
|
}
|
|
|
}
|
|
@@ -513,9 +513,9 @@ void Bild::alphaPixel2D( int i, int f )
|
|
|
{
|
|
|
if( !alpha[ alphaAnzahl ] )
|
|
|
alphaPixelP( fc[ i ], f );
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)& f;
|
|
|
+ unsigned char *cf = (unsigned char *)&f;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
alphaPixelP( fc[ i ], f );
|
|
|
rend = 1;
|
|
@@ -526,9 +526,9 @@ void Bild::alphaPixel3D( int i, int f )
|
|
|
{
|
|
|
if( !alpha[ alphaAnzahl ] )
|
|
|
alphaPixelP3D( fc[ i ], f );
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)& f;
|
|
|
+ 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,7 +541,7 @@ 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;
|
|
|
+ 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,7 +554,7 @@ 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;
|
|
|
+ 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,7 +573,7 @@ void Bild::alphaPixelDP2D( int x, int y, int f )
|
|
|
return;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)& f;
|
|
|
+ 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 );
|
|
@@ -592,7 +592,7 @@ void Bild::alphaPixelDP3D( int x, int y, int f )
|
|
|
return;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)& f;
|
|
|
+ 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 );
|
|
@@ -680,7 +680,7 @@ void Bild::drawLinieH( int x, int y, int len, int f )
|
|
|
int pval = len < 0 ? -1 : 1;
|
|
|
len = len > 0 ? len : -len;
|
|
|
for( int i = 0; i < len; ++i, fc += pval )
|
|
|
- * fc = f;
|
|
|
+ *fc = f;
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
@@ -719,7 +719,7 @@ void Bild::drawLinieV( int x, int y, int len, int f )
|
|
|
int pval = len < 0 ? -br : br;
|
|
|
len = len > 0 ? len : -len;
|
|
|
for( int i = 0; i < len; ++i, fc += pval )
|
|
|
- * fc = f;
|
|
|
+ *fc = f;
|
|
|
rend = 1;
|
|
|
}
|
|
|
|
|
@@ -754,7 +754,7 @@ void Bild::drawLinieHAlpha( int x, int y, int len, int f )
|
|
|
int end = 0;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)& f;
|
|
|
+ unsigned char *cf = (unsigned char *)&f;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
}
|
|
|
int alpha = ( ( f >> 24 ) & 0xFF );
|
|
@@ -764,7 +764,7 @@ void Bild::drawLinieHAlpha( int x, int y, int len, int f )
|
|
|
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 ) |
|
|
|
+ ( ( ( ( na * ( fc[ i ] & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
( ( fc[ i ] & 0xFF000000 ) ) ) * ( fc[ i ] != 0 || !alpha3D ) | ( fc[ i ] == 0 && alpha3D ) * f;
|
|
|
}
|
|
|
rend = 1;
|
|
@@ -801,7 +801,7 @@ void Bild::drawLinieVAlpha( int x, int y, int len, int f )
|
|
|
int end = 0;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)& f;
|
|
|
+ unsigned char *cf = (unsigned char *)&f;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
}
|
|
|
int alpha = ( ( f >> 24 ) & 0xFF );
|
|
@@ -811,7 +811,7 @@ void Bild::drawLinieVAlpha( int x, int y, int len, int f )
|
|
|
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 ) |
|
|
|
+ ( ( ( ( na * ( fc[ i ] & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
( fc[ i ] & 0xFF000000 ) ) * ( fc[ i ] != 0 || !alpha3D ) | ( fc[ i ] == 0 && alpha3D ) * f;
|
|
|
}
|
|
|
rend = 1;
|
|
@@ -987,7 +987,7 @@ 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;
|
|
|
+ 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 );
|
|
@@ -1008,28 +1008,28 @@ void Bild::drawLinieBorderedAlpha( Punkt a, Punkt b, int bc, int fc )
|
|
|
{
|
|
|
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 ) |
|
|
|
+ ( ( ( ( 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 )
|
|
|
{
|
|
|
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 ) |
|
|
|
+ ( ( ( ( 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 )
|
|
|
{
|
|
|
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 ) |
|
|
|
+ ( ( ( ( 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 )
|
|
|
{
|
|
|
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 ) |
|
|
|
+ ( ( ( ( na2 * ( pixel & 0x00FF00 ) ) >> 8 ) + j2 ) & 0x00FF00 ) |
|
|
|
( pixel & 0xFF000000 ) ) * ( pixel != 0 || !alpha3D ) | ( pixel == 0 && alpha3D ) * bc;
|
|
|
}
|
|
|
x += xf, y += yf;
|
|
@@ -1040,7 +1040,7 @@ void Bild::drawLinieBorderedAlpha( Punkt a, Punkt b, int bc, int fc )
|
|
|
++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 ) |
|
|
|
+ ( ( ( ( na * ( pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
( pixel & 0xFF000000 ) ) * ( pixel != 0 || !alpha3D ) | ( pixel == 0 && alpha3D ) * fc;
|
|
|
x += xf, y += yf;
|
|
|
}
|
|
@@ -1205,7 +1205,7 @@ 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;
|
|
|
+ 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 );
|
|
@@ -1219,7 +1219,7 @@ void Bild::drawLinieAlpha( Punkt a, Punkt b, int fc )
|
|
|
++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 ) |
|
|
|
+ ( ( ( ( na * ( pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
( pixel & 0xFF000000 ) ) * ( pixel != 0 || !alpha3D ) | ( pixel == 0 && alpha3D ) * fc;
|
|
|
x += xf, y += yf;
|
|
|
}
|
|
@@ -1289,7 +1289,7 @@ void Bild::drawKreisAlpha( int xOff, int yOff, int r, int fc )
|
|
|
return;
|
|
|
if( alpha[ alphaAnzahl ] < 0xFF )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)& fc;
|
|
|
+ unsigned char *cf = (unsigned char *)&fc;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
}
|
|
|
int alpha = ( ( fc >> 24 ) & 0xFF );
|
|
@@ -1304,63 +1304,63 @@ void Bild::drawKreisAlpha( int xOff, int yOff, int r, int fc )
|
|
|
{
|
|
|
pixel = &this->fc[ xOff + a + ( yOff + b ) * size.x ];
|
|
|
*pixel = ( ( ( ( ( na * ( *pixel & 0xFF00FF ) ) >> 8 ) + i1 ) & 0xFF00FF ) |
|
|
|
- ( ( ( ( na * ( *pixel & 0x00FF00 ) ) >> 8 ) + i2 ) & 0x00FF00 ) |
|
|
|
+ ( ( ( ( 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 ) |
|
|
|
+ ( ( ( ( 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 ) |
|
|
|
+ ( ( ( ( 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 ) |
|
|
|
+ ( ( ( ( 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 ) |
|
|
|
+ ( ( ( ( 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 ) |
|
|
|
+ ( ( ( ( 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 ) |
|
|
|
+ ( ( ( ( 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 ) |
|
|
|
+ ( ( ( ( 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;
|
|
@@ -1398,7 +1398,7 @@ void Bild::drawBild( int x, int y, int br, int hi, Bild & zBild )
|
|
|
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;
|
|
@@ -1441,7 +1441,7 @@ void Bild::alphaBildAssoz( int x, int y, int br, int hi, Bild & zBild )
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
int fc = ff[ ( xx - xst2 + xst ) + ygr2 ];
|
|
|
- unsigned char *cf = (unsigned char *)& fc;
|
|
|
+ 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;
|
|
@@ -1512,7 +1512,7 @@ void Bild::alphaBild( int x, int y, int br, int hi, Bild & zBild )
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
int fc = ff[ ( xx - xst2 + xst ) + ygr2 ];
|
|
|
- unsigned char *cf = (unsigned char *)& fc;
|
|
|
+ unsigned char *cf = (unsigned char *)&fc;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
alphaPixelP( this->fc[ xx + ygr ], fc );
|
|
|
}
|
|
@@ -1527,7 +1527,7 @@ void Bild::alphaBild( int x, int y, int br, int hi, Bild & zBild )
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
int fc = ff[ ( xx - xst2 + xst ) + ygr2 ];
|
|
|
- unsigned char *cf = (unsigned char *)& fc;
|
|
|
+ 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;
|
|
@@ -1574,7 +1574,7 @@ void Bild::drawBild90( int x, int y, int br, int hi, Bild & zBild )
|
|
|
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;
|
|
@@ -1629,7 +1629,7 @@ void Bild::alphaBild90( int x, int y, int br, int hi, Bild & zBild )
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
int fc = ff[ ( yy - yst2 + yst ) + xbb ];
|
|
|
- unsigned char *cf = (unsigned char *)& fc;
|
|
|
+ unsigned char *cf = (unsigned char *)&fc;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
alphaPixelP3D( xx, yy, fc );
|
|
|
}
|
|
@@ -1643,7 +1643,7 @@ void Bild::alphaBild90( int x, int y, int br, int hi, Bild & zBild )
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
int fc = ff[ ( yy - yst2 + yst ) + xbb ];
|
|
|
- unsigned char *cf = (unsigned char *)& fc;
|
|
|
+ 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;
|
|
@@ -1691,7 +1691,7 @@ void Bild::drawBild180( int x, int y, int br, int hi, Bild & zBild )
|
|
|
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;
|
|
@@ -1749,7 +1749,7 @@ void Bild::alphaBild180( int x, int y, int br, int hi, Bild & zBild )
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
int fc = ff[ ( bb - ( xx - xst2 + xst + 1 ) ) + ybb ];
|
|
|
- unsigned char *cf = (unsigned char *)& fc;
|
|
|
+ unsigned char *cf = (unsigned char *)&fc;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
alphaPixelP3D( this->fc[ xx + ygr ], fc );
|
|
|
}
|
|
@@ -1764,7 +1764,7 @@ void Bild::alphaBild180( int x, int y, int br, int hi, Bild & zBild )
|
|
|
for( xx = xst2; xx < dgx; ++xx )
|
|
|
{
|
|
|
int fc = ff[ ( bb - ( xx - xst2 + xst + 1 ) ) + ybb ];
|
|
|
- unsigned char *cf = (unsigned char *)& fc;
|
|
|
+ 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;
|
|
@@ -1811,7 +1811,7 @@ void Bild::drawBild270( int x, int y, int br, int hi, Bild & zBild )
|
|
|
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;
|
|
@@ -1866,7 +1866,7 @@ void Bild::alphaBild270( int x, int y, int br, int hi, Bild & zBild )
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
int fc = ff[ ( bb - ( yy - yst2 + yst + 1 ) ) + xbb ];
|
|
|
- unsigned char *cf = (unsigned char *)& fc;
|
|
|
+ unsigned char *cf = (unsigned char *)&fc;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
alphaPixelP3D( xx, yy, fc );
|
|
|
}
|
|
@@ -1880,7 +1880,7 @@ void Bild::alphaBild270( int x, int y, int br, int hi, Bild & zBild )
|
|
|
for( yy = yst2; yy < dgy; ++yy )
|
|
|
{
|
|
|
int fc = ff[ ( bb - ( yy - yst2 + yst + 1 ) ) + xbb ];
|
|
|
- unsigned char *cf = (unsigned char *)& fc;
|
|
|
+ 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;
|
|
@@ -1929,7 +1929,7 @@ void Bild::drawBildSkall( int x, int y, int br, int hi, Bild & zBild )
|
|
|
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;
|
|
@@ -1962,7 +1962,7 @@ void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild & zBild )
|
|
|
for( xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo )
|
|
|
{
|
|
|
int f = ff[ (int)xb + ygr2 ];
|
|
|
- unsigned char *cf = (unsigned char *)& f;
|
|
|
+ unsigned char *cf = (unsigned char *)&f;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
alphaPixelP3D( fc[ xx + ygr ], f );
|
|
|
}
|
|
@@ -1977,7 +1977,7 @@ void Bild::alphaBildSkall( int x, int y, int br, int hi, Bild & zBild )
|
|
|
for( xx = xst2, xb = xst * xo; xx < dgx; ++xx, xb += xo )
|
|
|
{
|
|
|
int f = ff[ (int)xb + ygr2 ];
|
|
|
- unsigned char *cf = (unsigned char *)& f;
|
|
|
+ unsigned char *cf = (unsigned char *)&f;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
alphaPixelP( fc[ xx + ygr ], f );
|
|
|
}
|
|
@@ -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;
|
|
@@ -2210,7 +2210,7 @@ void Bild::drawDreieckAlpha( Punkt a, Punkt b, Punkt c, int farbe )
|
|
|
return;
|
|
|
if( alpha[ alphaAnzahl ] )
|
|
|
{
|
|
|
- unsigned char *cf = (unsigned char *)& farbe;
|
|
|
+ unsigned char *cf = (unsigned char *)&farbe;
|
|
|
cf[ 3 ] = (unsigned char)( ( cf[ 3 ] > alpha[ alphaAnzahl ] ) * ( cf[ 3 ] - alpha[ alphaAnzahl ] ) );
|
|
|
}
|
|
|
if( b.y < a.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;
|
|
@@ -2410,7 +2410,7 @@ 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 ] );
|
|
|
+ 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;
|
|
@@ -2419,7 +2419,7 @@ void Bild::replaceColorWithAlpha( int color )
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-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 )
|
|
@@ -2573,21 +2573,6 @@ bool Bild::hasAlpha3D()
|
|
|
return alpha3D;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-Bild *Bild::getThis()
|
|
|
-{
|
|
|
- ++ref;
|
|
|
- return this;
|
|
|
-}
|
|
|
-
|
|
|
-Bild *Bild::release()
|
|
|
-{
|
|
|
- --ref;
|
|
|
- if( ref < 1 )
|
|
|
- delete this;
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
@@ -2628,7 +2613,7 @@ void BildZ::doMausEreignis( MausEreignis &me, bool userRet )
|
|
|
}
|
|
|
|
|
|
|
|
|
-void BildZ::setBildZ( Bild * b )
|
|
|
+void BildZ::setBildZ( Bild *b )
|
|
|
{
|
|
|
if( bild )
|
|
|
bild->release();
|
|
@@ -2645,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();
|
|
@@ -2666,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 ) )
|
|
|
{
|
|
@@ -2724,7 +2709,7 @@ void BildZ::render( Bild & zRObj )
|
|
|
Bild *BildZ::getBild() const
|
|
|
{
|
|
|
if( bild )
|
|
|
- return bild->getThis();
|
|
|
+ return (Bild *)bild->getThis();
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -2751,15 +2736,15 @@ Zeichnung *BildZ::dublizieren() const
|
|
|
if( rahmen )
|
|
|
obj->setRahmenZ( (Rahmen *)rahmen->dublizieren() );
|
|
|
if( hintergrundBild )
|
|
|
- obj->setHintergrundBild( hintergrundBild->getThis() );
|
|
|
+ obj->setHintergrundBild( (Bild *)hintergrundBild->getThis() );
|
|
|
if( bild )
|
|
|
- obj->setBild( bild->getThis() );
|
|
|
+ obj->setBild( (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 ) );
|
|
@@ -2779,7 +2764,7 @@ 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();
|
|
|
for( unsigned int i = 0; i < bitmap.GetWidth() * bitmap.GetHeight(); i++ )
|