Further cleanup (or start thereof).
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3339 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -39,6 +39,8 @@ typedef struct GenerateFunctions GenerateFunctions;
|
||||
* solarSys->genFuncs->..., but use a function for this, which first
|
||||
* checks for solar system dependent handlers, and if this does not exist,
|
||||
* or returns false, calls the default function.
|
||||
* - use isNodeRetrieved, setNodeRetrieved, and setNodeNotRetrieved instead
|
||||
* of manually messing with bit shifts, etc.
|
||||
*/
|
||||
|
||||
// Any of these functions returning true means that the action has been
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "lander.h"
|
||||
#include "lifeform.h"
|
||||
#include "scan.h"
|
||||
#include "../build.h"
|
||||
#include "../cons_res.h"
|
||||
#include "../controls.h"
|
||||
@@ -1303,7 +1304,7 @@ GeneratePlanetSide (void)
|
||||
if (pSolarSysState->pOrbitalDesc->data_index & PLANET_SHIELDED)
|
||||
return;
|
||||
|
||||
memset (life_init_tab, 0, sizeof (life_init_tab));
|
||||
memset (life_init_tab, 0, sizeof life_init_tab);
|
||||
|
||||
for (scan = BIOLOGICAL_SCAN; scan >= MINERAL_SCAN; --scan)
|
||||
{
|
||||
@@ -1323,8 +1324,8 @@ GeneratePlanetSide (void)
|
||||
HELEMENT hNodeElement;
|
||||
ELEMENT *NodeElementPtr;
|
||||
|
||||
if (pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[scan]
|
||||
& (1L << num_nodes))
|
||||
if (isNodeRetrieved (&pSolarSysState->SysInfo.PlanetInfo,
|
||||
scan, num_nodes))
|
||||
continue;
|
||||
|
||||
hNodeElement = AllocElement ();
|
||||
@@ -1404,4 +1405,22 @@ GeneratePlanetSide (void)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
isNodeRetrieved (PLANET_INFO *planetInfo, BYTE scanType, BYTE nodeNr)
|
||||
{
|
||||
return (planetInfo->ScanRetrieveMask[scanType] & ((DWORD) 1 << nodeNr))
|
||||
!= 0;
|
||||
}
|
||||
|
||||
void
|
||||
setNodeRetrieved (PLANET_INFO *planetInfo, BYTE scanType, BYTE nodeNr)
|
||||
{
|
||||
planetInfo->ScanRetrieveMask[scanType] |= ((DWORD) 1 << nodeNr);
|
||||
}
|
||||
|
||||
void
|
||||
setNodeNotRetrieved (PLANET_INFO *planetInfo, BYTE scanType, BYTE nodeNr)
|
||||
{
|
||||
planetInfo->ScanRetrieveMask[scanType] &= ~((DWORD) 1 << nodeNr);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,5 +50,9 @@ extern bool callGenerateForScanType (SOLARSYS_STATE *solarSys,
|
||||
|
||||
extern void RedrawSurfaceScan (const POINT *newLoc);
|
||||
|
||||
bool isNodeRetrieved (PLANET_INFO *planetInfo, BYTE scanType, BYTE nodeNr);
|
||||
void setNodeRetrieved (PLANET_INFO *planetInfo, BYTE scanType, BYTE nodeNr);
|
||||
void setNodeNotRetrieved (PLANET_INFO *planetInfo, BYTE scanType, BYTE nodeNr);
|
||||
|
||||
#endif /* _SCAN_H */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user