Lord Nikon
2004-04-27, 17:32:30
Hi,
hier ist der Code ausschnitt
struct pixel_8
{
uchar red, green, blue;
pixel_8( void ) : red( 0 ), green( 0 ), blue( 0 ) { }
pixel_8( uchar r, uchar g, uchar b ) : red( r ), green( g ), blue( b ) { }
};
void directx_surface::set_palette( pixel_8 *colors )
{
PALETTEENTRY palette_definition[ 256 ];
memset( palette_definition, 0, 256*sizeof( PALETTEENTRY ) );
for( ushort x=0 ; x<256 ; x++ )
{
palette_definition[ x ].peRed = colors[ x ].red;
palette_definition[ x ].peGreen = colors[ x ].green;
palette_definition[ x ].peBlue = colors[ x ].blue;
palette_definition[ x ].peFlags = PC_NOCOLLAPSE;
}
Ich verstehe nicht richtig, warum man die Strukur hochzählen kann,obwohl diese kein Array ist.In c# geht dies jedenfalls nicht.
hier ist der Code ausschnitt
struct pixel_8
{
uchar red, green, blue;
pixel_8( void ) : red( 0 ), green( 0 ), blue( 0 ) { }
pixel_8( uchar r, uchar g, uchar b ) : red( r ), green( g ), blue( b ) { }
};
void directx_surface::set_palette( pixel_8 *colors )
{
PALETTEENTRY palette_definition[ 256 ];
memset( palette_definition, 0, 256*sizeof( PALETTEENTRY ) );
for( ushort x=0 ; x<256 ; x++ )
{
palette_definition[ x ].peRed = colors[ x ].red;
palette_definition[ x ].peGreen = colors[ x ].green;
palette_definition[ x ].peBlue = colors[ x ].blue;
palette_definition[ x ].peFlags = PC_NOCOLLAPSE;
}
Ich verstehe nicht richtig, warum man die Strukur hochzählen kann,obwohl diese kein Array ist.In c# geht dies jedenfalls nicht.