Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appease clang-tidy check readability-static-accessed-through-instance #69233

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ void draw_sct_curses( const game &g )
continue;
}

const bool is_old = text.getStep() >= SCT.iMaxSteps / 2;
const bool is_old = text.getStep() >= scrollingcombattext::iMaxSteps / 2;

nc_color const col1 = msgtype_to_color( text.getMsgType( "first" ), is_old );
nc_color const col2 = msgtype_to_color( text.getMsgType( "second" ), is_old );
Expand Down
14 changes: 7 additions & 7 deletions src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4812,19 +4812,19 @@ void cata_tiles::draw_sct_frame( std::multimap<point, formatted_text> &overlay_s
const bool use_font = get_option<bool>( "ANIMATION_SCT_USE_FONT" );
tripoint player_pos = get_player_character().pos();

for( auto iter = SCT.vSCT.begin(); iter != SCT.vSCT.end(); ++iter ) {
const point iD( iter->getPosX(), iter->getPosY() );
const int full_text_length = utf8_width( iter->getText() );
for( const scrollingcombattext::cSCT &sct : SCT.vSCT ) {
const point iD( sct.getPosX(), sct.getPosY() );
const int full_text_length = utf8_width( sct.getText() );

point iOffset;

for( int j = 0; j < 2; ++j ) {
std::string sText = iter->getText( ( j == 0 ) ? "first" : "second" );
int FG = msgtype_to_tilecolor( iter->getMsgType( ( j == 0 ) ? "first" : "second" ),
iter->getStep() >= SCT.iMaxSteps / 2 );
std::string sText = sct.getText( ( j == 0 ) ? "first" : "second" );
int FG = msgtype_to_tilecolor( sct.getMsgType( ( j == 0 ) ? "first" : "second" ),
sct.getStep() >= scrollingcombattext::iMaxSteps / 2 );

if( use_font ) {
const direction direction = iter->getDirection();
const direction direction = sct.getDirection();
// Compensate for string length offset added at SCT creation
// (it will be readded using font size and proper encoding later).
const int direction_offset = ( -displace_XY( direction ).x + 1 ) *
Expand Down
2 changes: 1 addition & 1 deletion src/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3113,7 +3113,7 @@ void scrollingcombattext::advanceAllSteps()
std::vector<cSCT>::iterator iter = vSCT.begin();

while( iter != vSCT.end() ) {
if( iter->advanceStep() > this->iMaxSteps ) {
if( iter->advanceStep() > iMaxSteps ) {
iter = vSCT.erase( iter );
} else {
++iter;
Expand Down
2 changes: 1 addition & 1 deletion src/output.h
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ class scrolling_text_view
class scrollingcombattext
{
public:
enum : int { iMaxSteps = 8 };
static constexpr int iMaxSteps = 8;

scrollingcombattext() = default;

Expand Down
Loading