public void BlitWithPalette(FURegion region, int x, int y, Color32[] palette) { int w = region.width; int h = region.height; if (x + region.width > this.width - 1) { w = (this.width - x); } if (y + region.height > this.height - 1) { h = (this.height - y); } for (int i = y; i < y + h; i++) { for (int j = x; j < x + w; j++) { if (region.indexedPixels != null) { Color32 col = palette[region.indexedPixels[(i - y) * region.width + (j - x)]]; this.pixels[i * this.width + j] = col; } } } }
public void BlitTransparent(FURegion region, int x, int y, Color32 transparent) { int w = region.width; int h = region.height; if (x + region.width > this.width - 1) { w = (this.width - x); } if (y + region.height > this.height - 1) { h = (this.height - y); } for (int i = y; i < y + h; i++) { for (int j = x; j < x + w; j++) { Color32 col = region.pixels[(i - y) * region.width + (j - x)]; if (col.r != transparent.r || col.g != transparent.g || col.b != transparent.b) { this.pixels[i * this.width + j] = col; } } } }
public void Blit(FURegion region, int x, int y) { int w = region.width; int h = region.height; if (x + region.width > this.width - 1) { w = (this.width - x); } if (y + region.height > this.height - 1) { h = (this.height - y); } for (int i = y; i < y + h; i++) { for (int j = x; j < x + w; j++) { this.pixels[i * this.width + j] = region.pixels[(i - y) * region.width + (j - x)]; } } }
public FURegion(FURegion fromRegion, int ul_x, int ul_y, int width, int height) { this.pixels = new Color32[width * height]; if (fromRegion.indexedPixels != null) { this.indexedPixels = new uint[width * height]; } this.width = width; this.height = height; for (int i = ul_y; i < ul_y + height; i++) { for (int j = ul_x; j < ul_x + width; j++) { this.pixels[(i - ul_y) * this.width + (j - ul_x)] = fromRegion.pixels[i * fromRegion.width + j]; if (fromRegion.indexedPixels != null) { this.indexedPixels[(i - ul_y) * this.width + (j - ul_x)] = fromRegion.indexedPixels[i * fromRegion.width + j]; } } } }
public void BlitWithPalette(FURegion region, int x, int y) { this.BlitWithPalette(region, x, y, this.palette); }
public void BlitWithPalette( FURegion region, int x, int y ) { this.BlitWithPalette( region, x, y, this.palette ); }
public void BlitWithPalette( FURegion region, int x, int y, Color32[] palette ) { int w = region.width; int h = region.height; if( x + region.width > this.width - 1 ) w = (this.width - x); if( y + region.height > this.height - 1 ) h = (this.height - y); for( int i = y; i < y + h; i++ ) { for( int j = x; j < x + w; j++ ) { if( region.indexedPixels != null ) { Color32 col = palette[ region.indexedPixels[ (i-y) * region.width + (j-x) ] ]; this.pixels[ i * this.width + j ] = col; } } } }
public void BlitTransparent( FURegion region, int x, int y, Color32 transparent ) { int w = region.width; int h = region.height; if( x + region.width > this.width - 1 ) w = (this.width - x); if( y + region.height > this.height - 1 ) h = (this.height - y); for( int i = y; i < y + h; i++ ) { for( int j = x; j < x + w; j++ ) { Color32 col = region.pixels[ (i-y) * region.width + (j-x) ]; if( col.r != transparent.r || col.g != transparent.g || col.b != transparent.b ) this.pixels[ i * this.width + j ] = col; } } }
public void Blit( FURegion region, int x, int y ) { int w = region.width; int h = region.height; if( x + region.width > this.width - 1 ) w = (this.width - x); if( y + region.height > this.height - 1 ) h = (this.height - y); for( int i = y; i < y + h; i++ ) { for( int j = x; j < x + w; j++ ) { this.pixels[ i * this.width + j ] = region.pixels[ (i-y) * region.width + (j-x) ]; } } }