Date:2014-07-17 17:58:48 (4 months 9 days ago)
Author:Maarten ter Huurne
Commit:86ee9955d68dd035732487594470f84900a2a3dc
Message:Removed dedicated horizontal line routine

Just draw a 1-pixel-high box instead.
Files: src/surface.cpp (1 diff)
src/surface.h (1 diff)
src/textdialog.cpp (1 diff)

Change Details

src/surface.cpp
172172    return rectangle(re.x, re.y, re.w, re.h, c.r, c.g, c.b, c.a);
173173}
174174
175int Surface::hline(Sint16 x, Sint16 y, Uint16 w, Uint8 r, Uint8 g, Uint8 b, Uint8 a) {
176    return hlineRGBA(raw, x, x + w - 1, y, r, g, b, a);
177}
178
179175void Surface::clearClipRect() {
180176    SDL_SetClipRect(raw,NULL);
181177}
src/surface.h
7979    int rectangle(Sint16, Sint16, Uint16, Uint16, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
8080    int rectangle(Sint16, Sint16, Uint16, Uint16, RGBAColor);
8181    int rectangle(SDL_Rect, RGBAColor);
82    int hline(Sint16 x, Sint16 y, Uint16 h, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
8382
8483private:
8584    Surface(SDL_Surface *raw, bool freeWhenDone);
src/textdialog.cpp
8787        int rowY = y + (i - firstRow) * fontHeight;
8888        if (line == "----") { // horizontal ruler
8989            rowY += fontHeight / 2;
90            gmenu2x->s->hline(5, rowY, gmenu2x->resX - 16, 255, 255, 255, 130);
91            gmenu2x->s->hline(5, rowY+1, gmenu2x->resX - 16, 0, 0, 0, 130);
90            gmenu2x->s->box(5, rowY, gmenu2x->resX - 16, 1, 255, 255, 255, 130);
91            gmenu2x->s->box(5, rowY+1, gmenu2x->resX - 16, 1, 0, 0, 0, 130);
9292        } else {
9393            gmenu2x->font->write(gmenu2x->s, line, 5, rowY);
9494        }

Archive Download the corresponding diff file



interactive