|
@@ -10,9 +10,12 @@
|
|
|
enum blocType {WATER, MOUNTAIN, GRASS, DESERT};
|
|
|
|
|
|
void putBloc(blocType bloc, float world[HEIGHT][WIDTH][BLOC_TOTAL], int y, int x, float level = 1.0f) {
|
|
|
+ int dist;
|
|
|
for (int j(0); j < HEIGHT; j++)
|
|
|
- for (int i(0); i < WIDTH; i++)
|
|
|
- world[j][i][bloc] += level / ((j - y)*(j - y) + 1 + (i - x)*(i - x));
|
|
|
+ for (int i(0); i < WIDTH; i++) {
|
|
|
+ dist = (j - y)*(j - y) + 1 + (i - x)*(i - x);
|
|
|
+ world[j][i][bloc] += level / dist;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void drawWorld(float world[HEIGHT][WIDTH][BLOC_TOTAL], SDL_Surface* tileSet[], SDL_Surface* out) {
|