Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // [Dusk] Begin player spawn spot vector
- #define R MAPUNIT
- mline_t playerspawnspot_star[] = {
- { { -R, 0 }, { R, 0 } }, // horizontal line
- { { 0, -R }, { 0, R } }, // vertical line
- { { -R, -R }, { R, R } }, // nw/se diagonal line
- { { -R, R }, { R, -R } }, // sw/ne diagonal line
- };
- #undef R
- #define NUMPLAYERSPAWNSPOTLINES (sizeof(playerspawnspot_star)/sizeof(mline_t))
- // [Dusk] End player spawn spot vector
- [...]
- //=============================================================================
- //
- // [Dusk] Draw spawn spots on the map
- //
- //=============================================================================
- struct SpawnSpotStar
- {
- AMColor color;
- fixed_t x, y;
- angle_t angle;
- void CalibrateFromMapThing( FMapThing* mthing )
- {
- x = mthing->x >> FRACTOMAPBITS;
- y = mthing->y >> FRACTOMAPBITS;
- angle = mthing->angle;
- }
- };
- void AM_collectPlayerSpawnStars( const TArray<FMapThing>& starts, TArray<SpawnSpotStar>& stars, const AMColor& color )
- {
- for ( size_t i = 0; i < starts.Size(); ++i )
- {
- SpawnSpotStar star;
- FMapThing* mthing = &starts[i];
- star.CalibrateFromMapThing( mthing );
- star.color = color;
- stars.Push( star );
- }
- }
- void AM_drawPlayerSpawns( )
- {
- // Only draw these in proper automap cheat mode
- if ( am_cheat < 2 )
- return;
- TArray<SpawnSpotStar> stars;
- AMColor color;
- // Add singleplayer/cooperative starts, in light green
- {
- SpawnSpotStar star;
- star.color.FromRGB( 64, 255, 64 );
- for ( int i = 0; i < MAXPLAYERS; ++i )
- {
- for ( size_t j = 0; j < AllPlayerStarts[i].Size(); ++j )
- {
- FMapThing* mthing = &AllPlayerStarts[i][j];
- star.CalibrateFromMapThing( mthing );
- stars.Push( star );
- }
- }
- }
- // Deathmatch starts, in dark green
- color.FromRGB( 16, 64, 16 );
- AM_collectPlayerSpawnStars( deathmatchstarts, stars, color );
- // Terminator starts, in orange
- color.FromRGB( 255, 128, 0 );
- AM_collectPlayerSpawnStars( TerminatorStarts, stars, color );
- // Hellstone starts, in black
- color.FromRGB( 0, 0, 0 );
- AM_collectPlayerSpawnStars( PossessionStarts, stars, color );
- // Invasion starts, in magenta
- color.FromRGB( 0, 255, 255 );
- AM_collectPlayerSpawnStars( GenericInvasionStarts, stars, color );
- // Team starts, in their respective team color
- for ( size_t i = 0; i < teams.Size(); ++i )
- {
- SpawnSpotStar star;
- LONG lColor = teams[i].lPlayerColor;
- star.color.FromRGB( RPART( lColor ), GPART( lColor ), BPART( lColor ));
- for ( size_t j = 0; j < teams[i].TeamStarts.Size(); ++j )
- {
- FMapThing* mthing = &teams[i].TeamStarts[j];
- star.CalibrateFromMapThing( mthing );
- stars.Push( star );
- }
- }
- // Now, draw all gathered starts as stars on the map.
- for ( size_t i = 0; i < stars.Size(); ++i )
- {
- SpawnSpotStar* star = &stars[i];
- AM_drawLineCharacter( playerspawnspot_star, NUMPLAYERSPAWNSPOTLINES, 16 << MAPBITS,
- star->angle, star->color, star->x, star->y );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement