Hi
I am unsure about using pointers,so I usually stick to array[index]
but now I want to make a function effecient by passing pointers and loop thru char's and do some math and if too big result pass 255 instead,do I really need if,or (char) does it for me?
also unsure about change adress,or the data inside the adress
Code:
int blend(char *ptr1, char *ptr2,int tsize) {	int i, j,texture3;
	
	for (i = 0; i < tsize; i++) {
		texture3 = (*ptr1 + *ptr2) / 2;//simplest blend together 50/50%
		if (texture3 > 255) texture3 = 255;//max255
		*(ptr1) =(char)texture3;//
		++ptr1; ++ptr2;
	}
	return 1;
}