#include #include #include #include // g++ -shared anselme.cpp -o anselme.dll -I../src extern "C" void generate(Map *mapPtr) { Map &map = *mapPtr; int w = map.getWidth(); int h = map.getHeight(); int n = map.getNbTeams(); int i,j, k; int r = (w/n < h ? w/n : h)/2; int *teamCoord = new int[n*2]; for(i=0; i r+15) // mountain map[i][j].type = rand()%8 ? Pixel::ROCK : Pixel::IRON_ORE; else if(l < r-15) // plains map[i][j].type = rand()%15 ? Pixel::GRASS : Pixel::BERRIES; else // forest { l = rand()%10; map[i][j].type = l > 5 ? Pixel::TREE : l ? Pixel::GRASS : Pixel::BERRIES; } } } } } }