Changeset 11c7eb6 in git


Ignore:
Timestamp:
28/01/14 00:08:45 (6 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
614d60b
Parents:
82277dd
Message:

src/gfxcore.cc,src/gfxcore.h: No need to dynamically allocate
m_Pens.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r82277dd r11c7eb6  
     1Tue Jan 28 00:08:18 GMT 2014  Olly Betts <olly@survex.com>
     2
     3        * src/gfxcore.cc,src/gfxcore.h: No need to dynamically allocate
     4          m_Pens.
     5
    16Mon Jan 27 20:25:39 GMT 2014  Olly Betts <olly@survex.com>
    27
  • src/gfxcore.cc

    r82277dd r11c7eb6  
    163163    m_PointGrid = new list<LabelInfo*>[HITTEST_SIZE * HITTEST_SIZE];
    164164
    165     m_Pens = new GLAPen[NUM_COLOUR_BANDS + 1];
    166165    for (int pen = 0; pen < NUM_COLOUR_BANDS + 1; ++pen) {
    167166        m_Pens[pen].SetColour(REDS[pen] / 255.0,
     
    175174    TryToFreeArrays();
    176175
    177     delete[] m_Pens;
    178176    delete[] m_PointGrid;
    179177}
  • src/gfxcore.h

    r82277dd r11c7eb6  
    191191    long drawtime;
    192192
    193     GLAPen * m_Pens;
     193    GLAPen m_Pens[NUM_COLOUR_BANDS + 1];
    194194
    195195#define PLAYING 1
     
    265265    void ToggleFlag(bool* flag, int update = UPDATE_NONE);
    266266
    267     GLAPen& GetPen(int band) const {
     267    const GLAPen& GetPen(int band) const {
    268268        assert(band >= 0 && band < NUM_COLOUR_BANDS);
    269269        return m_Pens[band];
    270270    }
    271271
    272     GLAPen& GetSurfacePen() const { return m_Pens[NUM_COLOUR_BANDS]; }
     272    const GLAPen& GetSurfacePen() const { return m_Pens[NUM_COLOUR_BANDS]; }
    273273
    274274    int GetNumColourBands() const { return NUM_COLOUR_BANDS; }
Note: See TracChangeset for help on using the changeset viewer.