Skip to content

Commit d1f49eb

Browse files
committed
Cleanup
1 parent e68ee96 commit d1f49eb

4 files changed

Lines changed: 92 additions & 81 deletions

File tree

source/engine/engine.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ namespace text
6464
// A rendered text label, ready to be drawn
6565
class Label
6666
{
67-
GLuint tex;
6867
int w, h;
6968
int ox, oy; // offsets
69+
GLuint tex;
7070
_PangoLayout *layout;
7171
int *map_markup_to_text;
7272
int *map_text_to_markup;
@@ -97,11 +97,10 @@ namespace text
9797
};
9898

9999
// measure text before creating the label
100-
// TODO: consider removing in favor of `Label::prepare()`
101100
void measure(const char *str, int maxw, int &w, int &h,
102101
int align = -1,
103102
int justify = 0,
104-
const char *lang = NULL,
103+
const char *lang = nullptr,
105104
bool no_fallback = false
106105
);
107106

@@ -112,7 +111,7 @@ namespace text
112111
bvec4 ol_color = bvec4(0, 0, 0, 0),
113112
int align = -1,
114113
int justify = 0,
115-
const char *lang = NULL, // language code, used for text shaping
114+
const char *lang = nullptr, // language code, used for text shaping
116115
bool no_fallback = false, // don't use fallback fonts for unavailable glyphs
117116
bool keep_layout = false, // use only if you need to call `xy_to_index()`
118117
bool reserve_cursor = false // reserve space for the cursor, even if the cursor is absent
@@ -122,17 +121,17 @@ namespace text
122121
bvec color = bvec(255, 255, 255),
123122
double outline = 0,
124123
bvec4 ol_color = bvec4(0, 0, 0, 0),
125-
const char *lang = NULL,
124+
const char *lang = nullptr,
126125
bool no_fallback = false
127126
);
128127

129128
void draw(const char *str, double left, double top,
130129
bvec color = bvec(255, 255, 255),
131-
int a = 255,
130+
int alpha = 255,
132131
int maxw = 0,
133132
int align = -1,
134133
int justify = 0,
135-
const char *lang = NULL,
134+
const char *lang = nullptr,
136135
bool no_fallback = false
137136
);
138137
static inline void draw_fmt(const char *fstr, double left, double top, ...)
@@ -154,13 +153,13 @@ namespace text
154153
int visible(const char *str, float hitx, float hity, int maxw,
155154
int align = -1,
156155
int justify = 0,
157-
const char *lang = NULL,
156+
const char *lang = nullptr,
158157
bool no_fallback = false
159158
);
160159
void pos(const char *str, int cursor, int &cx, int &cy, int maxw,
161160
int align = -1,
162161
int justify = 0,
163-
const char *lang = NULL,
162+
const char *lang = nullptr,
164163
bool no_fallback = false
165164
);
166165
}

0 commit comments

Comments
 (0)