Skip to content

Commit

Permalink
Removed obsolete and unneeded function.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Apr 26, 2024
1 parent 1ae3176 commit 0448b88
Showing 1 changed file with 0 additions and 77 deletions.
77 changes: 0 additions & 77 deletions src/space.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ static void system_init( StarSystem *sys );
static int systems_load( void );
static int system_parse( StarSystem *system, const char *filename );
static int system_parseJumpPoint( const xmlNodePtr node, StarSystem *sys );
static int system_parseJumpPointDiff( const xmlNodePtr node, StarSystem *sys );
static int system_parseJumps( StarSystem *sys );
static int system_parseAsteroidField( const xmlNodePtr node, StarSystem *sys );
static int system_parseAsteroidExclusion( const xmlNodePtr node,
Expand Down Expand Up @@ -3301,82 +3300,6 @@ void system_setFaction( StarSystem *sys )
}
}

/**
* @brief Parses a single jump point for a system, from unidiff.
*
* @param node Parent node containing jump point information.
* @param sys System to which the jump point belongs.
* @return 0 on success.
*/
static int system_parseJumpPointDiff( const xmlNodePtr node, StarSystem *sys )
{
JumpPoint *j;
char *buf;
double x, y;
StarSystem *target;

/* Get target. */
xmlr_attr_strd( node, "target", buf );
if ( buf == NULL ) {
WARN( _( "JumpPoint node for system '%s' has no target attribute." ),
sys->name );
return -1;
}
target = system_get( buf );
if ( target == NULL ) {
WARN( _( "JumpPoint node for system '%s' has invalid target '%s'." ),
sys->name, buf );
free( buf );
return -1;
}
free( buf );

#ifdef DEBUGGING
for ( int i = 0; i < array_size( sys->jumps ); i++ ) {
JumpPoint *jp = &sys->jumps[i];
if ( jp->targetid != target->id )
continue;

WARN( _( "Star System '%s' has duplicate jump point to '%s'." ),
sys->name, target->name );
break;
}
#endif /* DEBUGGING */

/* Allocate more space. */
j = &array_grow( &sys->jumps );
memset( j, 0, sizeof( JumpPoint ) );

/* Handle jump point position. We want both x and y, or we autoposition the
* jump point. */
xmlr_attr_float_def( node, "x", x, HUGE_VAL );
xmlr_attr_float_def( node, "y", y, HUGE_VAL );

/* Handle jump point type. */
xmlr_attr_strd( node, "type", buf );
if ( buf == NULL )
;
else if ( strcmp( buf, "hidden" ) == 0 )
jp_setFlag( j, JP_HIDDEN );
else if ( strcmp( buf, "exitonly" ) == 0 )
jp_setFlag( j, JP_EXITONLY );
free( buf );

xmlr_attr_float_def( node, "hide", j->hide, HIDE_DEFAULT_JUMP );

/* Set some stuff. */
j->target = target;
j->targetid = j->target->id;
j->radius = 200.;

if ( x < HUGE_VAL && y < HUGE_VAL )
vec2_cset( &j->pos, x, y );
else
jp_setFlag( j, JP_AUTOPOS );

return 0;
}

/**
* @brief Parses a single jump point for a system.
*
Expand Down

0 comments on commit 0448b88

Please sign in to comment.