@@ -63,13 +63,13 @@ void SSD1306Ui::setInactiveSymbole(const char* symbole) {
6363void SSD1306Ui::setFrameAnimation (AnimationDirection dir) {
6464 this ->frameAnimationDirection = dir;
6565}
66- void SSD1306Ui::setFrames (bool (*frameFunctions[])(SSD1306 *display, SSD1306UiState* state, int x, int y) , int frameCount) {
66+ void SSD1306Ui::setFrames (FrameCallback* frameFunctions , int frameCount) {
6767 this ->frameCount = frameCount;
6868 this ->frameFunctions = frameFunctions;
6969}
7070
7171// -/----- Overlays ------\-
72- void SSD1306Ui::setOverlays (bool (*overlayFunctions[])(SSD1306 *display, SSD1306UiState* state) , int overlayCount){
72+ void SSD1306Ui::setOverlays (OverlayCallback* overlayFunctions , int overlayCount){
7373 this ->overlayCount = overlayCount;
7474 this ->overlayFunctions = overlayFunctions;
7575}
@@ -176,12 +176,12 @@ void SSD1306Ui::drawFrame(){
176176 int dir = frameTransitionDirection >= 0 ? 1 : -1 ;
177177 x *= dir; y *= dir; x1 *= dir; y1 *= dir;
178178
179- this ->dirty |= (* this ->frameFunctions [this ->state .currentFrame ])(this ->display , &this ->state , x, y);
180- this ->dirty |= (* this ->frameFunctions [this ->getNextFrameNumber ()])(this ->display , &this ->state , x1, y1);
179+ this ->dirty |= (this ->frameFunctions [this ->state .currentFrame ])(this ->display , &this ->state , x, y);
180+ this ->dirty |= (this ->frameFunctions [this ->getNextFrameNumber ()])(this ->display , &this ->state , x1, y1);
181181 break ;
182182 }
183183 case FIXED:
184- this ->dirty |= (* this ->frameFunctions [this ->state .currentFrame ])(this ->display , &this ->state , 0 , 0 );
184+ this ->dirty |= (this ->frameFunctions [this ->state .currentFrame ])(this ->display , &this ->state , 0 , 0 );
185185 break ;
186186 }
187187}
@@ -200,12 +200,12 @@ void SSD1306Ui::drawIndicator() {
200200
201201 for (byte i = 0 ; i < this ->frameCount ; i++) {
202202
203- const char *xbm ;
203+ const char *image ;
204204
205205 if (posOfCurrentFrame == i) {
206- xbm = this ->activeSymbole ;
206+ image = this ->activeSymbole ;
207207 } else {
208- xbm = this ->inactiveSymbole ;
208+ image = this ->inactiveSymbole ;
209209 }
210210
211211 int x,y;
@@ -228,13 +228,13 @@ void SSD1306Ui::drawIndicator() {
228228 break ;
229229 }
230230
231- this ->display ->drawXbm (x, y, 8 , 8 , xbm );
231+ this ->display ->drawFastImage (x, y, 8 , 8 , image );
232232 }
233233}
234234
235235void SSD1306Ui::drawOverlays () {
236236 for (int i=0 ;i<this ->overlayCount ;i++){
237- this ->dirty |= (* this ->overlayFunctions [i])(this ->display , &this ->state );
237+ this ->dirty |= (this ->overlayFunctions [i])(this ->display , &this ->state );
238238 }
239239}
240240
0 commit comments