- for(;col < texWidth;col++,p+=4)
- buf[p+0] = buf[p+1] = buf[p+2] = buf[p+3] = 0;
+ } else {
+ jint *data = elements((JArray<jint>*) data_);
+ buf = new unsigned char[texWidth*texHeight*4];
+ p=0;
+ for(row=0;row<height;row++) {
+ for(col=0;col<width;col++) {
+ jint pixel = data[row*width+col];
+ buf[p+0] = (pixel >> 16) & 0xff;
+ buf[p+1] = (pixel >> 8) & 0xff;
+ buf[p+2] = (pixel >> 0) & 0xff;
+ buf[p+3] = (pixel >> 24) & 0xff;
+ p+=4;
+ }
+ for(;col < texWidth;col++,p+=4)
+ buf[p+0] = buf[p+1] = buf[p+2] = buf[p+3] = 0;
+ }
+ for(;row < texHeight;row++)
+ for(col=0;col<texWidth;col++,p+=4)
+ buf[p+0] = buf[p+1] = buf[p+2] = buf[p+3] = 0;