All pastes #109669 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-08-01 07:34 UTC
rendered paste body
    texSize = 26;
    sqSize = 4;
    res::CImage *img2 = new res::CImage(res::ECF_A8R8G8B8, core::dimension2d<s32>(texSize,texSize),false);
    s32 *li2 = (s32 *)img2->lock();
    drawColor = core::CColorI(255,255,255,255);

	for(i=0; i<texSize; i++)
	  for (j=0;j<texSize;j++) {
	    c = 255;
        if(((i-1)/sqSize) % 2 == 0){
            c=192;
        }
        if(((j-1)/sqSize) % 2 == 0){
            c=192;
        }
        if(((j-1)/sqSize) % 2 == 0 && ((i-1)/sqSize) % 2 == 0){
            c=255;
        }
        if(j==0 || j==texSize-1 || i==0 || i==texSize-1) {
            c=0;
        }
        drawColor = core::CColorI(c,c,c,255);
        li2[i + j * texSize] = drawColor.getAsS32();
	}
    img2->unlock();

    cgt2 = new res::CTexture("Checker2",img2,0,false);