Skip to content

Commit 179d527

Browse files
committed
Remove dead draw below code
1 parent cd59a1e commit 179d527

File tree

5 files changed

+0
-141
lines changed

5 files changed

+0
-141
lines changed

src/animation.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,19 +1036,6 @@ void game::draw_vpart_override( const tripoint_bub_ms &, const vpart_id &, const
10361036
}
10371037
#endif
10381038

1039-
#if defined(TILES)
1040-
void game::draw_below_override( const tripoint_bub_ms &p, const bool draw )
1041-
{
1042-
if( use_tiles ) {
1043-
tilecontext->init_draw_below_override( p, draw );
1044-
}
1045-
}
1046-
#else
1047-
void game::draw_below_override( const tripoint_bub_ms &, const bool )
1048-
{
1049-
}
1050-
#endif
1051-
10521039
#if defined(TILES)
10531040
void game::draw_monster_override( const tripoint_bub_ms &p, const mtype_id &id, const int count,
10541041
const bool more, const Creature::Attitude att )

src/cata_tiles.cpp

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,6 @@ void cata_tiles::draw( const point &dest, const tripoint_bub_ms &center, int wid
18431843
void_field_override();
18441844
void_item_override();
18451845
void_vpart_override();
1846-
void_draw_below_override();
18471846
void_monster_override();
18481847

18491848
//Memorize everything the character just saw even if it wasn't displayed.
@@ -3259,50 +3258,6 @@ void cata_tiles::draw_square_below( const point_bub_ms &p, const nc_color &col,
32593258
geometry->rect( renderer, sdlrect, sdlcol );
32603259
}
32613260

3262-
bool cata_tiles::draw_terrain_below( const tripoint_bub_ms &p, const lit_level, int &,
3263-
const std::array<bool, 5> &invisible, const bool memorize_only )
3264-
{
3265-
if( memorize_only ) {
3266-
return false;
3267-
}
3268-
3269-
map &here = get_map();
3270-
const auto low_override = draw_below_override.find( p );
3271-
const bool low_overridden = low_override != draw_below_override.end();
3272-
if( low_overridden ? !low_override->second :
3273-
( invisible[0] || here.dont_draw_lower_floor( p ) ) ) {
3274-
return false;
3275-
}
3276-
3277-
tripoint_bub_ms pbelow = p + tripoint::below;
3278-
nc_color col = c_dark_gray;
3279-
3280-
const ter_t &curr_ter = here.ter( pbelow ).obj();
3281-
const furn_t &curr_furn = here.furn( pbelow ).obj();
3282-
int part_below;
3283-
int sizefactor = 2;
3284-
if( curr_furn.has_flag( ter_furn_flag::TFLAG_SEEN_FROM_ABOVE ) || curr_furn.movecost < 0 ) {
3285-
col = curr_furn.color();
3286-
} else if( const vehicle *veh = here.veh_at_internal( pbelow, part_below ) ) {
3287-
const int roof = veh->roof_at_part( part_below );
3288-
const auto vpobst = vpart_position( const_cast<vehicle &>( *veh ),
3289-
part_below ).obstacle_at_part();
3290-
col = ( roof >= 0 || vpobst ) ? c_light_gray : c_magenta;
3291-
sizefactor = ( roof >= 0 || vpobst ) ? 4 : 2;
3292-
} else if( curr_ter.has_flag( ter_furn_flag::TFLAG_SEEN_FROM_ABOVE ) ||
3293-
curr_ter.has_flag( ter_furn_flag::TFLAG_NO_FLOOR ) ||
3294-
curr_ter.has_flag( ter_furn_flag::TFLAG_NO_FLOOR_WATER ) ||
3295-
curr_ter.movecost == 0 ) {
3296-
col = curr_ter.color();
3297-
} else {
3298-
sizefactor = 4;
3299-
col = curr_ter.color();
3300-
}
3301-
3302-
draw_square_below( pbelow.xy(), col, sizefactor );
3303-
return true;
3304-
}
3305-
33063261
bool cata_tiles::draw_terrain( const tripoint_bub_ms &p, const lit_level ll, int &height_3d,
33073262
const std::array<bool, 5> &invisible, const bool memorize_only )
33083263
{
@@ -3878,28 +3833,6 @@ bool cata_tiles::draw_field_or_item( const tripoint_bub_ms &p, const lit_level l
38783833
return ret_draw_field && ret_draw_items;
38793834
}
38803835

3881-
bool cata_tiles::draw_vpart_below( const tripoint_bub_ms &p, const lit_level /*ll*/,
3882-
int &/*height_3d*/,
3883-
const std::array<bool, 5> &invisible, const bool memorize_only )
3884-
{
3885-
if( memorize_only ) {
3886-
return false;
3887-
}
3888-
3889-
const auto low_override = draw_below_override.find( p );
3890-
const bool low_overridden = low_override != draw_below_override.end();
3891-
if( low_overridden ? !low_override->second : ( invisible[0] ||
3892-
get_map().dont_draw_lower_floor( p ) ) ) {
3893-
return false;
3894-
}
3895-
tripoint_bub_ms pbelow( p + tripoint::below );
3896-
int height_3d_below = 0;
3897-
std::array<bool, 5> below_invisible;
3898-
std::fill( below_invisible.begin(), below_invisible.end(), false );
3899-
return draw_vpart_no_roof( pbelow, lit_level::LOW, height_3d_below, below_invisible,
3900-
memorize_only );
3901-
}
3902-
39033836
bool cata_tiles::draw_vpart_no_roof( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
39043837
const std::array<bool, 5> &invisible, const bool memorize_only )
39053838
{
@@ -4003,45 +3936,6 @@ bool cata_tiles::draw_vpart( const tripoint_bub_ms &p, lit_level ll, int &height
40033936
return false;
40043937
}
40053938

4006-
bool cata_tiles::draw_critter_at_below( const tripoint_bub_ms &p, const lit_level, int &,
4007-
const std::array<bool, 5> &invisible, const bool memorize_only )
4008-
{
4009-
const map &here = get_map();
4010-
4011-
if( memorize_only ) {
4012-
return false;
4013-
}
4014-
4015-
// Check if we even need to draw below. If not, bail.
4016-
const auto low_override = draw_below_override.find( p );
4017-
const bool low_overridden = low_override != draw_below_override.end();
4018-
if( low_overridden ? !low_override->second : ( invisible[0] ||
4019-
here.dont_draw_lower_floor( p ) ) ) {
4020-
return false;
4021-
}
4022-
4023-
tripoint_bub_ms pbelow( p + tripoint::below );
4024-
4025-
// Get the critter at the location below. If there isn't one,
4026-
// we can bail.
4027-
const Creature *critter = get_creature_tracker().creature_at( pbelow, true );
4028-
if( critter == nullptr ) {
4029-
return false;
4030-
}
4031-
4032-
Character &you = get_player_character();
4033-
// Check if the player can actually see the critter. We don't care if
4034-
// it's via infrared or not, just whether or not they're seen. If not,
4035-
// we can bail.
4036-
if( !you.sees( here, *critter ) && !you.sees_with_specials( *critter ) ) {
4037-
return false;
4038-
}
4039-
4040-
draw_square_below( pbelow.xy(), c_red, 2 );
4041-
4042-
return true;
4043-
}
4044-
40453939
bool cata_tiles::draw_critter_at( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
40463940
const std::array<bool, 5> &invisible, const bool memorize_only )
40473941
{
@@ -4609,10 +4503,6 @@ void cata_tiles::init_draw_vpart_override( const tripoint_bub_ms &p, const vpart
46094503
{
46104504
vpart_override.emplace( p, std::make_tuple( id, part_mod, veh_dir, hilite, mount ) );
46114505
}
4612-
void cata_tiles::init_draw_below_override( const tripoint_bub_ms &p, const bool draw )
4613-
{
4614-
draw_below_override.emplace( p, draw );
4615-
}
46164506
void cata_tiles::init_draw_monster_override( const tripoint_bub_ms &p, const mtype_id &id,
46174507
const int count,
46184508
const bool more, const Creature::Attitude att )
@@ -4713,10 +4603,6 @@ void cata_tiles::void_vpart_override()
47134603
{
47144604
vpart_override.clear();
47154605
}
4716-
void cata_tiles::void_draw_below_override()
4717-
{
4718-
draw_below_override.clear();
4719-
}
47204606
void cata_tiles::void_monster_override()
47214607
{
47224608
monster_override.clear();
@@ -4732,7 +4618,6 @@ bool cata_tiles::has_draw_override( const tripoint_bub_ms &p ) const
47324618
field_override.find( p ) != field_override.end() ||
47334619
item_override.find( p ) != item_override.end() ||
47344620
vpart_override.find( p ) != vpart_override.end() ||
4735-
draw_below_override.find( p ) != draw_below_override.end() ||
47364621
monster_override.find( p ) != monster_override.end();
47374622
}
47384623

src/cata_tiles.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,6 @@ class cata_tiles
589589
void draw_square_below( const point_bub_ms &p, const nc_color &col, int sizefactor );
590590
bool draw_terrain( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
591591
const std::array<bool, 5> &invisible, bool memorize_only );
592-
bool draw_terrain_below( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
593-
const std::array<bool, 5> &invisible, bool memorize_only );
594592
bool draw_furniture( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
595593
const std::array<bool, 5> &invisible, bool memorize_only );
596594
bool draw_graffiti( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
@@ -607,12 +605,8 @@ class cata_tiles
607605
const std::array<bool, 5> &invisible, bool memorize_only );
608606
bool draw_vpart_roof( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
609607
const std::array<bool, 5> &invisible, bool memorize_only );
610-
bool draw_vpart_below( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
611-
const std::array<bool, 5> &invisible, bool memorize_only );
612608
bool draw_critter_at( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
613609
const std::array<bool, 5> &invisible, bool memorize_only );
614-
bool draw_critter_at_below( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
615-
const std::array<bool, 5> &invisible, bool memorize_only );
616610
bool draw_critter_above( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
617611
const std::array<bool, 5> &invisible );
618612
bool draw_zone_mark( const tripoint_bub_ms &p, lit_level ll, int &height_3d,
@@ -709,9 +703,6 @@ class cata_tiles
709703
const units::angle &veh_dir, bool hilite, const point_rel_ms &mount );
710704
void void_vpart_override();
711705

712-
void init_draw_below_override( const tripoint_bub_ms &p, bool draw );
713-
void void_draw_below_override();
714-
715706
void init_draw_monster_override( const tripoint_bub_ms &p, const mtype_id &id, int count,
716707
bool more, Creature::Attitude att );
717708
void void_monster_override();
@@ -880,7 +871,6 @@ class cata_tiles
880871
// point represents the mount direction
881872
std::map<tripoint_bub_ms, std::tuple<vpart_id, int, units::angle, bool, point_rel_ms>>
882873
vpart_override;
883-
std::map<tripoint_bub_ms, bool> draw_below_override;
884874
// int represents spawn count
885875
std::map<tripoint_bub_ms, std::tuple<mtype_id, int, bool, Creature::Attitude>> monster_override;
886876

src/editmap.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,6 @@ void editmap::draw_main_ui_overlay()
676676
} else {
677677
g->draw_vpart_override( map_p, vpart_id::NULL_ID(), 0, 0_degrees, false, point_rel_ms::zero );
678678
}
679-
g->draw_below_override( tripoint_bub_ms( map_p ),
680-
tmpmap.ter( tmp_p ).obj().has_flag( ter_furn_flag::TFLAG_NO_FLOOR ) );
681679
}
682680
}
683681
// int: count, bool: more than 1 spawn data

src/game.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,6 @@ class game
853853
bool hilite );
854854
void draw_vpart_override( const tripoint_bub_ms &p, const vpart_id &id, int part_mod,
855855
const units::angle &veh_dir, bool hilite, const point_rel_ms &mount );
856-
void draw_below_override( const tripoint_bub_ms &p, bool draw );
857856
void draw_monster_override( const tripoint_bub_ms &p, const mtype_id &id, int count,
858857
bool more, Creature::Attitude att );
859858

0 commit comments

Comments
 (0)