[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdegames/kgoldrunner/src
From: Ian Wadham <ianw2 () optusnet ! com ! au>
Date: 2009-06-01 21:56:54
Message-ID: 1243893414.387016.31948.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 976527 by ianw:
Clean up some TODOs and debugging code.
M +0 -38 kgrlevelgrid.cpp
M +0 -3 kgrrulebook.cpp
M +0 -4 kgrrulebook.h
--- trunk/KDE/kdegames/kgoldrunner/src/kgrlevelgrid.cpp #976526:976527
@@ -134,7 +134,6 @@
{
Flags access = 0;
char here = cellType (i, j);
- // TODO - Maybe we can just RETURN if this cell is CONCRETE. Always works?
if (here == CONCRETE) {
// If edge-cell or other CONCRETE, no calculation (avoid index errors).
return;
@@ -167,16 +166,6 @@
access |= dFlag [UP];
}
- int enter = (access & ENTERABLE) ? 1 : 0;
- int stand = (access & dFlag [STAND]) ? 1 : 0;
- int u = (access & dFlag [UP]) ? 1 : 0;
- int d = (access & dFlag [DOWN]) ? 1 : 0;
- int l = (access & dFlag [LEFT]) ? 1 : 0;
- int r = (access & dFlag [RIGHT]) ? 1 : 0;
- // if (below == HOLE)
- // fprintf (stderr, "[%02d,%02d] %c %02x E %d S %d U %d D %d L %d R %d ***\n",
- // i, j, here, access, enter, stand, u, d, l, r);
-
// Mask out directions that are blocked above, below, L or R, but not for
// concrete/brick at edge of grid (or elsewhere) to avoid indexing errors.
if (access != 0) {
@@ -196,24 +185,7 @@
}
}
- enter = (access & ENTERABLE) ? 1 : 0;
- stand = (access & dFlag [STAND]) ? 1 : 0;
- u = (access & dFlag [UP]) ? 1 : 0;
- d = (access & dFlag [DOWN]) ? 1 : 0;
- l = (access & dFlag [LEFT]) ? 1 : 0;
- r = (access & dFlag [RIGHT]) ? 1 : 0;
- // if (below == HOLE)
- // fprintf (stderr, "[%02d,%02d] %c %02x E %d S %d U %d D %d L %d R %d ***\n",
- // i, j, here, access, enter, stand, u, d, l, r);
heroAccess [index (i, j)] = access;
- enter = (access & ENTERABLE) ? 1 : 0;
- stand = (access & dFlag [STAND]) ? 1 : 0;
- u = (access & dFlag [UP]) ? 1 : 0;
- d = (access & dFlag [DOWN]) ? 1 : 0;
- l = (access & dFlag [LEFT]) ? 1 : 0;
- r = (access & dFlag [RIGHT]) ? 1 : 0;
- // fprintf (stderr, "[%02d,%02d] %c %02x E %d S %d U %d D %d L %d R %d\n",
- // i, j, here, access, enter, stand, u, d, l, r);
// Enemy access is the same as the hero's when no holes are open.
enemyAccess [index (i, j)] = heroAccess [index (i, j)];
@@ -227,16 +199,6 @@
mask = (cellType (i + 1, j) == HOLE) ? (dFlag [RIGHT] | mask) : mask;
enemyAccess [index (i, j)] &= ~mask; // Block access to holes at L/R.
}
- // TODO - Remove the debugging code below.
- access = enemyAccess [index (i, j)];
- enter = (access & ENTERABLE) ? 1 : 0;
- stand = (access & dFlag [STAND]) ? 1 : 0;
- u = (access & dFlag [UP]) ? 1 : 0;
- d = (access & dFlag [DOWN]) ? 1 : 0;
- l = (access & dFlag [LEFT]) ? 1 : 0;
- r = (access & dFlag [RIGHT]) ? 1 : 0;
- // fprintf (stderr, "[%02d,%02d] %c %02x E %d S %d U %d D %d L %d R %d Enem\n",
- // i, j, here, access, enter, stand, u, d, l, r);
}
void KGrLevelGrid::placeHiddenLadders()
--- trunk/KDE/kdegames/kgoldrunner/src/kgrrulebook.cpp #976526:976527
@@ -85,7 +85,6 @@
const int hI, const int hJ,
KGrLevelGrid * pGrid,
bool /* leftRightSearch unused */)
-// TODO - Should be const ... const KGrLevelGrid * pGrid)
{
grid = pGrid;
if (grid->cellType (eI, eJ) == USEDHOLE) { // Could not get out of hole
@@ -507,7 +506,6 @@
const int hI, const int hJ,
KGrLevelGrid * pGrid,
bool leftRightSearch)
-// TODO - Should be const ... const KGrLevelGrid * pGrid)
{
dbk2 << eI << eJ << hI << hJ;
grid = pGrid;
@@ -700,7 +698,6 @@
const int hI, const int hJ,
KGrLevelGrid * pGrid,
bool /* leftRightSearch unused */)
-// TODO - Should be const ... const KGrLevelGrid * pGrid)
{
dbk2 << eI << eJ << hI << hJ;
grid = pGrid;
--- trunk/KDE/kdegames/kgoldrunner/src/kgrrulebook.h #976526:976527
@@ -64,7 +64,6 @@
const int hI, const int hJ,
KGrLevelGrid * pGrid,
bool leftRightSearch = true) = 0;
-// TODO - Make const ... const KGrLevelGrid * pGrid) = 0;
protected:
char mRules; ///< The type of rules and enemy search method.
@@ -98,7 +97,6 @@
const int hI, const int hJ,
KGrLevelGrid * pGrid,
bool leftRightSearch = true);
-// TODO - Make const ... const KGrLevelGrid * pGrid);
private:
Direction searchUp (int eI, int eJ, int hJ);
@@ -128,7 +126,6 @@
const int hI, const int hJ,
KGrLevelGrid * pGrid,
bool leftRightSearch = true);
-// TODO - Make const ... const KGrLevelGrid * pGrid);
private:
Direction findWayUp (const int eI, const int eJ);
@@ -153,7 +150,6 @@
const int hI, const int hJ,
KGrLevelGrid * pGrid,
bool leftRightSearch = true);
-// TODO - Make const ... const KGrLevelGrid * pGrid);
};
#endif // KGRRULEBOOK_H
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic