Rearrange order of getting pixels when saving to data.

master
sigonasr2 1 year ago
parent 3a30d4d836
commit d08769ec83
  1. 18
      sample/PGEX_SMX.h

@ -37,7 +37,23 @@ public:
for (int pad=0;pad<2;pad++){
for(int i=0;i<9;i++){
int row=0;
for(int y=i/3*7;y<i/3*7+7;y++){
for(int y=i/3*7;y<i/3*7+7;y+=2){
int col=0;
for(int x=i%3*4;x<i%3*4+4;x++){
if(row%2==1&&col%4==0){
col++;
continue;
}
Pixel p(pge->GetDrawTarget()->GetPixel(x,y));
lightData.append(1,p.r);
lightData.append(1,p.g);
lightData.append(1,p.b);
col++;
}
row++;
}
row=0;
for(int y=i/3*7+1;y<i/3*7+7;y+=2){
int col=0;
for(int x=i%3*4;x<i%3*4+4;x++){
if(row%2==1&&col%4==0){

Loading…
Cancel
Save