Skip to content

Misc optimizations in InGameUI #1070

Open
@xezon

Description

@xezon

1

InGameUI::InGameUI()
...
    m_placeIcon = new Drawable *[g_theWriteableGlobalData->m_maxLineBuildObjects];

    for (int i = 0; i < g_theWriteableGlobalData->m_maxLineBuildObjects; i++) {
        m_placeIcon[i] = nullptr;
    }

Can be rewritten as.

    m_placeIcon = new Drawable *[g_theWriteableGlobalData->m_maxLineBuildObjects]();

2

InGameUI::InGameUI()
...
    m_currentlyPlayingMovie.Clear();
...
    for (int i = 0; i < MAX_UI_MESSAGES; i++) {
        m_uiMessages[i].full_text.Clear();
        m_uiMessages[i].display_string = nullptr;
        m_uiMessages[i].timestamp = 0;
        m_uiMessages[i].color = 0;
    }
FloatingTextData::FloatingTextData()
...
    m_text.Clear();

Clear() in constructors are obsolete.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions