but the way is long:

an sdl_surface pixel have 3 colors to blend with nearest

so I have a question:

Is this script too slow?

start<<<

#include

using namespace std;

int main(){

char a[16][10]={

{’ ‘,’ ‘,’ ‘,’ ‘,’#’,’#’,’ ‘,’ ‘,’ ‘,’ ‘},

{’ ‘,’ ‘,’ ‘,’#’,’#’,’#’,’#’,’ ‘,’ ‘,’ ‘},

{’ ‘,’ ‘,’ ‘,’#’,’#’,’#’,’#’,’ ‘,’ ‘,’ ‘},

{’ ‘,’ ‘,’#’,’#’,’#’,’#’,’#’,’#’,’ ‘,’ ‘},

{’ ‘,’ ‘,’#’,’#’,’#’,’#’,’#’,’#’,’ ‘,’ ‘},

{’ ‘,’ ‘,’#’,’#’,’ ‘,’ ‘,’#’,’#’,’ ‘,’ ‘},

{’ ‘,’ ‘,’#’,’#’,’ ‘,’ ‘,’#’,’#’,’ ‘,’ ‘},

{’ ‘,’#’,’#’,’#’,’ ‘,’ ‘,’#’,’#’,’#’,’ ‘},

{’ ‘,’#’,’#’,’#’,’#’,’#’,’#’,’#’,’#’,’ ‘},

{’ ‘,’#’,’#’,’#’,’#’,’#’,’#’,’#’,’#’,’ ‘},

{’ ‘,’#’,’#’,’ ‘,’ ‘,’ ‘,’ ‘,’#’,’#’,’ ‘},

{’#’,’#’,’#’,’ ‘,’ ‘,’ ‘,’ ‘,’#’,’#’,’#’},

{’#’,’#’,’ ‘,’ ‘,’ ‘,’ ‘,’ ‘,’ ‘,’#’,’#’},

{’#’,’#’,’ ‘,’ ‘,’ ‘,’ ‘,’ ‘,’ ‘,’#’,’#’},

{’#’,’#’,’ ‘,’ ‘,’ ‘,’ ‘,’ ‘,’ ‘,’#’,’#’},

{’ ‘,’ ‘,’ ‘,’ ‘,’ ‘,’ ‘,’ ‘,’ ‘,’ ‘,’ '},

};

for (int y=0; y<16; y++){

for (int x=0; x<10; x++){

```
cout << a[y][x];
```

}

cout << ‘\n’;

}

int b[8][5]={{0}};

for (int y=0; y<8; y++){

for (int x=0; x<5; x++){

if (a[y*2][x*2] == ‘#’)

b[y][x]=10;

```
if ( x>0 && a[y*2][x*2-1] == '#') {
if (b[y][x-1] == 0)
b[y][x-1]=1;
else
b[y][x-1]++;
}
if ( x<5 && a[y*2][x*2+1] == '#') {
if (b[y][x+1] == 0)
b[y][x+1]=1;
else
b[y][x+1]++;
}
if ( y>0 && a[y*2-1][x*2] == '#') {
if (b[y-1][x] == 0)
b[y-1][x]=1;
else
b[y-1][x]++;
}
if ( y<8 && a[y*2+1][x*2] == '#') {
if (b[y+1][x] == 0)
b[y+1][x]=1;
else
b[y+1][x]++;
}
```

}

}

for (int y=0; y<8; y++){

for (int x=0; x<5; x++){

if (b[y][x]>7)

cout << ‘#’;

else if (b[y][x]>1)

cout << ‘+’;

else

cout << ’ ';

}

cout << ‘\n’;

}

}

end

-------------- next part --------------

A non-text attachment was scrubbed…

Name: not available

Type: application/pgp-signature

Size: 189 bytes

Desc: not available

URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030128/425e35c2/attachment.pgp