diff --git a/doomsday/client/include/world/blockmap.h b/doomsday/client/include/world/blockmap.h index 12016eee1e..05d2014a8d 100644 --- a/doomsday/client/include/world/blockmap.h +++ b/doomsday/client/include/world/blockmap.h @@ -122,9 +122,9 @@ class Blockmap bool unlink(CellBlock const &cellBlock, void *elem); - int iterate(Cell const &cell, int (*callback) (void *elem, void *context), void *context); + int iterate(Cell const &cell, int (*callback) (void *elem, void *context), void *context) const; - int iterate(CellBlock const &cellBlock, int (*callback) (void *elem, void *context), void *context); + int iterate(CellBlock const &cellBlock, int (*callback) (void *elem, void *context), void *context) const; /** * Retrieve an immutable pointer to the underlying Gridmap instance diff --git a/doomsday/client/include/world/map.h b/doomsday/client/include/world/map.h index c226c11c03..adfaec5526 100644 --- a/doomsday/client/include/world/map.h +++ b/doomsday/client/include/world/map.h @@ -284,22 +284,22 @@ class Map /** * Provides access to the mobj blockmap. */ - Blockmap /*const*/ *mobjBlockmap() const; + Blockmap const *mobjBlockmap() const; /** * Provides access to the polyobj blockmap. */ - Blockmap /*const*/ *polyobjBlockmap() const; + Blockmap const *polyobjBlockmap() const; /** * Provides access to the line blockmap. */ - Blockmap /*const*/ *lineBlockmap() const; + Blockmap const *lineBlockmap() const; /** * Provides access to the BSP leaf blockmap. */ - Blockmap /*const*/ *bspLeafBlockmap() const; + Blockmap const *bspLeafBlockmap() const; int mobjsBoxIterator(AABoxd const &box, int (*callback) (struct mobj_s *, void *), void *parameters = 0) const; diff --git a/doomsday/client/src/render/blockmapvisual.cpp b/doomsday/client/src/render/blockmapvisual.cpp index bec68cb37a..78ffca7224 100644 --- a/doomsday/client/src/render/blockmapvisual.cpp +++ b/doomsday/client/src/render/blockmapvisual.cpp @@ -148,7 +148,7 @@ static int rendBspLeaf(BspLeaf *bspLeaf, void * /*parameters*/) return false; // Continue iteration. } -static int rendCellLines(Blockmap &bmap, Blockmap::Cell const &cell, void *parameters) +static int rendCellLines(Blockmap const &bmap, Blockmap::Cell const &cell, void *parameters) { glBegin(GL_LINES); bmap.iterate(cell, (int (*)(void*,void*)) rendLine, parameters); @@ -172,7 +172,7 @@ static int rendCellPolyobjLines(void *object, void *parameters) return false; // Continue iteration. } -static int rendCellPolyobjs(Blockmap &bmap, Blockmap::Cell const &cell, void *parameters) +static int rendCellPolyobjs(Blockmap const &bmap, Blockmap::Cell const &cell, void *parameters) { glBegin(GL_LINES); bmap.iterate(cell, (int (*)(void*,void*)) rendCellPolyobjLines, parameters); @@ -180,7 +180,7 @@ static int rendCellPolyobjs(Blockmap &bmap, Blockmap::Cell const &cell, void *pa return false; // Continue iteration. } -static int rendCellMobjs(Blockmap &bmap, Blockmap::Cell const &cell, void *parameters) +static int rendCellMobjs(Blockmap const &bmap, Blockmap::Cell const &cell, void *parameters) { glBegin(GL_QUADS); bmap.iterate(cell, (int (*)(void*,void*)) rendMobj, parameters); @@ -188,13 +188,13 @@ static int rendCellMobjs(Blockmap &bmap, Blockmap::Cell const &cell, void *param return false; // Continue iteration. } -static int rendCellBspLeafs(Blockmap &bmap, Blockmap::Cell const &cell, void *parameters) +static int rendCellBspLeafs(Blockmap const &bmap, Blockmap::Cell const &cell, void *parameters) { bmap.iterate(cell, (int (*)(void*,void*)) rendBspLeaf, parameters); return false; // Continue iteration. } -static void rendBlockmapBackground(Blockmap &bmap) +static void rendBlockmapBackground(Blockmap const &bmap) { Blockmap::Cell const &bmapDimensions = bmap.dimensions(); @@ -266,7 +266,7 @@ static void drawCellInfo(Point2Raw const *_origin, char const *info) glDisable(GL_TEXTURE_2D); } -static void drawBlockmapInfo(Point2Raw const *_origin, Blockmap *blockmap) +static void drawBlockmapInfo(Point2Raw const *_origin, Blockmap const *blockmap) { DENG_ASSERT(blockmap != 0); @@ -314,7 +314,7 @@ static void drawBlockmapInfo(Point2Raw const *_origin, Blockmap *blockmap) glDisable(GL_TEXTURE_2D); } -static void drawCellInfoBox(Blockmap *blockmap, Point2Raw const *origin, +static void drawCellInfoBox(Blockmap const *blockmap, Point2Raw const *origin, char const *objectTypeName, Blockmap::Cell const &cell) { uint count = blockmap->cellElementCount(cell); @@ -329,8 +329,8 @@ static void drawCellInfoBox(Blockmap *blockmap, Point2Raw const *origin, * @param followMobj Mobj to center/focus the visual on. Can be @c NULL. * @param cellDrawer Blockmap cell content drawing callback. Can be @a NULL. */ -static void rendBlockmap(Blockmap &bmap, mobj_t *followMobj, - int (*cellDrawer) (Blockmap &bmap, Blockmap::Cell const &cell, void *parameters)) +static void rendBlockmap(Blockmap const &bmap, mobj_t *followMobj, + int (*cellDrawer) (Blockmap const &bmap, Blockmap::Cell const &cell, void *parameters)) { Blockmap::CellBlock vCellBlock; Blockmap::Cell vCell; @@ -511,10 +511,10 @@ static void rendBlockmap(Blockmap &bmap, mobj_t *followMobj, void Rend_BlockmapDebug() { - int (*cellDrawer) (Blockmap &blockmap, Blockmap::Cell const &cell, void *parameters); + int (*cellDrawer) (Blockmap const &blockmap, Blockmap::Cell const &cell, void *parameters); char const *objectTypeName; mobj_t *followMobj = 0; - Blockmap *blockmap; + Blockmap const *blockmap; Point2Raw origin; float scale; diff --git a/doomsday/client/src/world/blockmap.cpp b/doomsday/client/src/world/blockmap.cpp index 90d45a3fb9..560fd4de35 100644 --- a/doomsday/client/src/world/blockmap.cpp +++ b/doomsday/client/src/world/blockmap.cpp @@ -320,7 +320,8 @@ int Blockmap::cellElementCount(Cell const &cell) const return 0; } -int Blockmap::iterate(Cell const &cell, int (*callback) (void *elem, void *parameters), void *parameters) +int Blockmap::iterate(Cell const &cell, int (*callback) (void *elem, void *parameters), + void *parameters) const { if(!callback) return false; // Huh? if(CellData *cellData = (CellData *)d->cellData(cell)) @@ -343,7 +344,8 @@ static int cellDataIterateWorker(void *cdPtr, void *parameters) return cellData->iterate(p->callback, p->parameters); } -int Blockmap::iterate(CellBlock const &cellBlock, int (*callback) (void *elem, void *parameters), void *parameters) +int Blockmap::iterate(CellBlock const &cellBlock, int (*callback) (void *elem, void *parameters), + void *parameters) const { if(!callback) return false; // Huh? CellDataIterateWorkerParams parm; diff --git a/doomsday/client/src/world/map.cpp b/doomsday/client/src/world/map.cpp index 5017ef76bd..e0d523f6c3 100644 --- a/doomsday/client/src/world/map.cpp +++ b/doomsday/client/src/world/map.cpp @@ -1206,22 +1206,22 @@ void Map::initNodePiles() LOG_INFO(String("Completed in %1 seconds.").arg(begunAt.since(), 0, 'g', 2)); } -Blockmap *Map::mobjBlockmap() const +Blockmap const *Map::mobjBlockmap() const { return d->mobjBlockmap.data(); } -Blockmap *Map::polyobjBlockmap() const +Blockmap const *Map::polyobjBlockmap() const { return d->polyobjBlockmap.data(); } -Blockmap *Map::lineBlockmap() const +Blockmap const *Map::lineBlockmap() const { return d->lineBlockmap.data(); } -Blockmap *Map::bspLeafBlockmap() const +Blockmap const *Map::bspLeafBlockmap() const { return d->bspLeafBlockmap.data(); }