dmap = new Tile[maxW][maxH];
for (int y = 0; y < maxH; ++y)
for (int x = 0; x < maxW; ++x)
dmap[x][y] = new Tile();
This is slow despite each Tile only having an int member which anyway is made 0. I have not written a constructor for Tile(). Can I improve or should I go back to C++?
maxW and maxH are both 255, and my environment is the Android emulator.
I don’t think it is this code that is slow anymore. My Log.i() statements have gone missing from the LogCat view… I pute one in for each y in the above initialisation code.
You don’t have to initialize the array with objects. By default it will contain null values, and you can keep it like this, if this is OK in your case.