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. Outputs information on all stars to a FILE.
With the 'flags' variable, the amount of detail can be specified. 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 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() - the function uio_debugInteractive()
This function is not defined in sc2code/uqmdebug.h, but in libs/uio.h. This function is not defined in sc2code/uqmdebug.h, but in libs/uio.h.
This function can interactively (tty-based) display information on This function can interactively (tty-based) display information on
+5
View File
@@ -30,6 +30,7 @@
#include "settings.h" #include "settings.h"
#include "setup.h" #include "setup.h"
#include "sounds.h" #include "sounds.h"
#include "uqmdebug.h"
#include "libs/graphics/drawable.h" #include "libs/graphics/drawable.h"
#include "libs/graphics/gfx_common.h" #include "libs/graphics/gfx_common.h"
#include "libs/mathlib.h" #include "libs/mathlib.h"
@@ -2085,6 +2086,10 @@ InitCommunication (RESOURCE which_comm)
MEM_HANDLE hOldIndex, hIndex; MEM_HANDLE hOldIndex, hIndex;
LOCDATAPTR LocDataPtr; LOCDATAPTR LocDataPtr;
#ifdef DUMP_STARS
return 0;
#endif
last_subtitle = NULL; last_subtitle = NULL;
LockMutex (GraphicsLock); LockMutex (GraphicsLock);
+4 -3
View File
@@ -1891,15 +1891,16 @@ ExploreSolarSys (void)
{ {
SOLARSYS_STATE SolarSysState; SOLARSYS_STATE SolarSysState;
#if 0 #ifdef DUMP_STARS
{ {
FILE *out; FILE *out;
// Write the star and planet info to a file in the current // Write the star and planet info to a file in the current directory.
// directory (which currently is the content/ directory).
out = fopen("PlanetInfo", "w"); out = fopen("PlanetInfo", "w");
if (out == NULL) if (out == NULL)
exit(1); exit(1);
TFB_DEBUG_HALT = 1;
// Disable drawing.
dumpStars(out, DUMP_PLANETS); dumpStars(out, DUMP_PLANETS);
fclose(out); fclose(out);
fprintf(stdout, "*** Star dump complete. You can terminate the " fprintf(stdout, "*** Star dump complete. You can terminate the "
+4
View File
@@ -29,6 +29,8 @@
#include "globdata.h" #include "globdata.h"
#include "races.h" #include "races.h"
#include "setup.h" #include "setup.h"
#include "state.h"
#include "libs/misc.h"
#include <stdio.h> #include <stdio.h>
@@ -600,6 +602,8 @@ dumpPlanet (FILE *out, const PLANET_DESC *planet, UWORD flags)
// For now, only the name is printed. Other data may be added later. // For now, only the name is printed. Other data may be added later.
pSolarSysState->pBaseDesc = (PLANET_DESC *) planet; pSolarSysState->pBaseDesc = (PLANET_DESC *) planet;
//GetPlanetInfo ();
//(*pSolarSysState->GenFunc) (GENERATE_ORBITAL);
(*pSolarSysState->GenFunc) (GENERATE_NAME); (*pSolarSysState->GenFunc) (GENERATE_NAME);
fprintf (out, "- %-37s %s\n", GLOBAL_SIS (PlanetName), fprintf (out, "- %-37s %s\n", GLOBAL_SIS (PlanetName),
planetTypeString (planet->data_index)); planetTypeString (planet->data_index));
+6
View File
@@ -24,6 +24,12 @@
#include <stdio.h> #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. // Called when the debug key (symbol 'Debug' in the keys.cfg) is pressed.
extern void debugKeyPressed (void); extern void debugKeyPressed (void);