diff --git a/Aquaria/WorldMapRender.cpp b/Aquaria/WorldMapRender.cpp index 6b2d13b..d282c3b 100644 --- a/Aquaria/WorldMapRender.cpp +++ b/Aquaria/WorldMapRender.cpp @@ -468,7 +468,8 @@ static void tileDataToVis(WorldMapTile *tile, Array2d& vis) { const float a = tile->prerevealed ? 0.4f : baseMapSegAlpha; Vector *gp = vis.data(); - for(size_t i = 0; i < vis.linearsize(); ++i) + const size_t n = vis.linearsize(); + for(size_t i = 0; i < n; ++i) gp[i].z = a; } } @@ -565,6 +566,7 @@ void WorldMapRender::setVis(WorldMapTile *tile) RenderGrid *g = tile->q->setSegs(MAPVIS_SUBDIV, MAPVIS_SUBDIV, 0, 0, 0, 0, 2.0, 1); if(g) { + g->gridType = GRID_UNDEFINED; g->drawOrder = GRID_DRAW_WORLDMAP; tileDataToVis(tile, g->array2d()); } diff --git a/BBGE/RenderGrid.h b/BBGE/RenderGrid.h index c8a4169..1c0b8fb 100644 --- a/BBGE/RenderGrid.h +++ b/BBGE/RenderGrid.h @@ -8,19 +8,19 @@ struct RenderState; enum GridDrawOrder { - GRID_DRAW_WORLDMAP = -1, // LRTB order, uses grid.z as alpha GRID_DRAW_LRTB = 0, // the default. ignores grid.z GRID_DRAW_LRBT = 1, // Y axis inverted + GRID_DRAW_WORLDMAP = 2, // LRTB order, uses grid.z as alpha GRID_DRAW_DEFAULT = GRID_DRAW_LRTB }; enum GridType { - GRID_UNDEFINED = -1, - GRID_WAVY = 0, - GRID_STRIP = 1, // quad is in strip mode - GRID_INTERP = 2, // quad is in grid mode + GRID_UNDEFINED = 0, + GRID_WAVY = 1, + GRID_STRIP = 2, // quad is in strip mode + GRID_INTERP = 3, // quad is in grid mode }; class RenderGrid