Quote:
I have a linear array [Size of image * Size of Image] to hold the height data because you cant create a 2D array with
Code:
char *map = new char [Size][Size];
'Size' being a variable
|
Sure you can:
Code:
char **map = new char[Size];
for(int a=0; a < Size; a++)
map[a] = new char[Size];
This makes it significantly easier to find exact coordinates in the array.
Quote:
|
I'm trying to write the Brush tool to paint with right now and how would I go about finding the pixels to modify if I knew the diameter of the Brush's circle? I want the user to use the "Tool Box" to select the brush width and use a circle with that diameter to paint on my map, I can get the X,Y of the mouse simple but how do i find the points around it?
|
There's a few good ways to do this. Since I'm no adept at circle-drawing, I refer you to Google instead. Plenty of good material on circle drawing algorithms.