#include "stdafx.h" #include "rmgen.h" #include "map.h" using namespace std; Map::Map(int size, string baseTerrain) { if(size<0 || size>1024) { JS_ReportError(cx, "init: map size out of range"); } if(size%16 != 0) { JS_ReportError(cx, "init: map size must be divisble by 16"); } this->size = size; int baseId = getId(baseTerrain); terrain = new TerrainId*[size]; for(int i=0; i