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:
+2
-1
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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 "
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
@@ -596,10 +598,12 @@ dumpPlanet (FILE *out, const PLANET_DESC *planet, UWORD flags)
|
|||||||
{
|
{
|
||||||
PLANET_DESC *oldPlanetDesc;
|
PLANET_DESC *oldPlanetDesc;
|
||||||
|
|
||||||
oldPlanetDesc= pSolarSysState->pBaseDesc;
|
oldPlanetDesc = pSolarSysState->pBaseDesc;
|
||||||
|
|
||||||
// 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));
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user