Misc. code fixes.

This commit is contained in:
Steve 2018-02-25 17:32:29 +00:00
parent df6bda4629
commit 5282345dc6
4 changed files with 6 additions and 31 deletions

View File

@ -37,6 +37,7 @@ extern void clearControls(void);
extern void restoreGameState(void);
extern void initWorld(void);
extern void initTitle(void);
extern void awardTrophy(char *id);
extern App app;
extern Colors colors;

View File

@ -24,6 +24,7 @@ void initAtlasTest(void)
{
int test;
dev.debug = 1;
dev.cheatStatic = 0;
dev.cheatBlind = 0;
dev.cheatNoEnemies = 0;
@ -34,6 +35,8 @@ void initAtlasTest(void)
loadGame();
saveGame();
test = 1;
switch (test)

View File

@ -23,9 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern void initWorld(void);
extern void initHub(void);
extern void loadGame(void);
extern void saveGame(void);
extern void initOptions(void);
extern void initPostMission(void);
extern void stopMusic(void);
extern App app;
extern Dev dev;
extern Game game;

View File

@ -21,8 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "player.h"
static void doDebugControls(void);
static void compareQuadtree(void);
static int last = 0;
void doPlayer(void)
{
@ -67,31 +65,4 @@ static void doDebugControls(void)
app.keyboard[SDL_SCANCODE_0] = 0;
}
if (last < SDL_GetTicks())
{
compareQuadtree();
last = SDL_GetTicks() + 1000;
}
}
static void compareQuadtree(void)
{
Entity **candidates, *e;
int numCandidates, numEnts;
candidates = getAllEntsWithin(0, 0, MAP_WIDTH * MAP_TILE_SIZE, MAP_HEIGHT * MAP_TILE_SIZE, NULL);
numEnts = 0;
/* counting entities to draw */
for (numCandidates = 0, e = candidates[numCandidates] ; e != NULL ; e = candidates[++numCandidates]) {};
for (e = world.entityHead.next ; e != NULL ; e = e->next) {numEnts++;}
if (numCandidates > numEnts)
{
printf("WARNING: numEnts=%d, numCandidates=%d\n", numEnts, numCandidates);
}
}