Star dumping work.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1838 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2005-07-10 02:46:56 +00:00
parent bf6f1f8889
commit db210d04f1
5 changed files with 22 additions and 5 deletions
+2 -1
View File
@@ -40,7 +40,8 @@ listed below:
Outputs information on all stars to a FILE.
With the 'flags' variable, the amount of detail can be specified.
At this time this function will only work when called from the top of
ExploreSolarSys().
ExploreSolarSys(). Defining DUMP_STARS in sc2code/uqmdebug.h
will make this happen.
- the function uio_debugInteractive()
This function is not defined in sc2code/uqmdebug.h, but in libs/uio.h.
This function can interactively (tty-based) display information on
+5
View File
@@ -30,6 +30,7 @@
#include "settings.h"
#include "setup.h"
#include "sounds.h"
#include "uqmdebug.h"
#include "libs/graphics/drawable.h"
#include "libs/graphics/gfx_common.h"
#include "libs/mathlib.h"
@@ -2085,6 +2086,10 @@ InitCommunication (RESOURCE which_comm)
MEM_HANDLE hOldIndex, hIndex;
LOCDATAPTR LocDataPtr;
#ifdef DUMP_STARS
return 0;
#endif
last_subtitle = NULL;
LockMutex (GraphicsLock);
+4 -3
View File
@@ -1891,15 +1891,16 @@ ExploreSolarSys (void)
{
SOLARSYS_STATE SolarSysState;
#if 0
#ifdef DUMP_STARS
{
FILE *out;
// Write the star and planet info to a file in the current
// directory (which currently is the content/ directory).
// Write the star and planet info to a file in the current directory.
out = fopen("PlanetInfo", "w");
if (out == NULL)
exit(1);
TFB_DEBUG_HALT = 1;
// Disable drawing.
dumpStars(out, DUMP_PLANETS);
fclose(out);
fprintf(stdout, "*** Star dump complete. You can terminate the "
+5 -1
View File
@@ -29,6 +29,8 @@
#include "globdata.h"
#include "races.h"
#include "setup.h"
#include "state.h"
#include "libs/misc.h"
#include <stdio.h>
@@ -596,10 +598,12 @@ dumpPlanet (FILE *out, const PLANET_DESC *planet, UWORD flags)
{
PLANET_DESC *oldPlanetDesc;
oldPlanetDesc= pSolarSysState->pBaseDesc;
oldPlanetDesc = pSolarSysState->pBaseDesc;
// For now, only the name is printed. Other data may be added later.
pSolarSysState->pBaseDesc = (PLANET_DESC *) planet;
//GetPlanetInfo ();
//(*pSolarSysState->GenFunc) (GENERATE_ORBITAL);
(*pSolarSysState->GenFunc) (GENERATE_NAME);
fprintf (out, "- %-37s %s\n", GLOBAL_SIS (PlanetName),
planetTypeString (planet->data_index));
+6
View File
@@ -24,6 +24,12 @@
#include <stdio.h>
// Define DUMP_STARS to dump a list of stars to ./PlanetInfo.
// The list is generated when a new game is started. Normal
// gameplay is not available in this situation.
//#define DUMP_STARS
// Called when the debug key (symbol 'Debug' in the keys.cfg) is pressed.
extern void debugKeyPressed (void);