Skip to content

Commit 1760c02

Browse files
committed
Remove indirection from event attributes
1 parent cc2a018 commit 1760c02

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/screen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ bool Screen::update() {
138138
}
139139
if (fadeEnded) fadeLvl=0.0f;
140140
}
141-
return update(elapsed, *key,*ms);
141+
return update(elapsed, key, ms);
142142
}
143143

144144
void Screen::setFadeIn (int lengthInMilli, TCODColor col) {

src/screen.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public :
3131
virtual void render() = 0;
3232
virtual bool update(float elapsed, TCOD_key_t &k,TCOD_mouse_t &mouse) = 0;
3333
virtual ~Screen() {}
34-
void keyboard (TCOD_key_t &key) { this->key=&key; }
35-
void mouse (TCOD_mouse_t &ms) { this->ms=&ms; }
34+
void keyboard (TCOD_key_t &key) { this->key=key; }
35+
void mouse (TCOD_mouse_t &ms) { this->ms=ms; }
3636
bool update (void);
3737

3838
void setFadeIn (int lengthInMilli, TCODColor col = TCODColor::black); //set fade lengths in milliseconds
@@ -47,8 +47,8 @@ protected :
4747
TCODColor fadeOutColor;
4848

4949
enum { FADE_UP, FADE_DOWN, FADE_OFF, FADE_NONE } fade;
50-
TCOD_key_t *key;
51-
TCOD_mouse_t *ms;
50+
TCOD_key_t key{};
51+
TCOD_mouse_t ms{};
5252
void onInitialise();
5353
void prepareImage(TCODImage *img)const;
5454
TCODImage *loadChapterPicture(bool big=false);

src/ui_dialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ bool Dialog::update() {
222222
}
223223
if (!UmbraWidget::update()) return false;
224224
internalUpdate();
225-
return update(elapsed, *key,*ms);
225+
return update(elapsed, key, ms);
226226
}
227227

228228
void Dialog::onActivate() {

src/ui_dialog.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ protected :
123123
class Dialog : public UmbraWidget {
124124
public :
125125
Dialog() : flags(0),isMinimized(false),waitRelease(false) {}
126-
void keyboard (TCOD_key_t &key) { this->key=&key; UmbraWidget::keyboard(key); }
127-
void mouse (TCOD_mouse_t &ms) { this->ms=&ms; UmbraWidget::mouse(ms); }
126+
void keyboard (TCOD_key_t &key) { this->key=key; UmbraWidget::keyboard(key); }
127+
void mouse (TCOD_mouse_t &ms) { this->ms=ms; UmbraWidget::mouse(ms); }
128128
bool update (void);
129129
virtual bool update(float elapsed, TCOD_key_t &k, TCOD_mouse_t &mouse) = 0;
130130
void setMaximized();
@@ -141,8 +141,8 @@ public :
141141
void onDeactivate();
142142
protected :
143143
int flags;
144-
TCOD_key_t *key;
145-
TCOD_mouse_t *ms;
144+
TCOD_key_t key{};
145+
TCOD_mouse_t ms{};
146146
TCODConsole *con;
147147
bool isMinimized;
148148
bool waitRelease;

umbra

0 commit comments

Comments
 (0)