3 hours looking at some #%$! bug... < help :) >

BlitzPlus Forums/BlitzPlus Programming/3 hours looking at some #%$! bug... < help :) >

Tiger(Posted 2004) [#1]
What is the bug??
Do you get a purple square??


CS_TBL(Posted 2004) [#2]
let's hope not :)

this is the bug: createpattern(4,1,2,3,3)

just try it..

perceive the function as follows: createpattern(offset,topleftcorner, toprightcorner,bottomleftcorner,bottomrightcorner)

you send intensities to that function.. the intensities represent black, darkgrey, lightgrey and white.. So the values are 0,1,2 or 3.

The first arguement (the offset) is just a location, nothing bugs there..


Floyd(Posted 2004) [#3]
I guess you are hoping that createpattern(4,1,2,3,3) will draw this pattern of grays:

1 2
3 3

But the code which sets colors is actually doing this:

ps2 ps3
ps4 ps4

which translates to

2 3
3 3

Anyway, I think the drawing code should be something like
	SetBuffer ImageBuffer(imgcheese)

	For y=0 To 7
		For x=0 To 7
			
			c = 80*pat(x,y)
			Color c,c,c
			Rect (offset*16)+x*2,y*2,2,2,True

		Next 
	Next