|
@@ -2,9 +2,9 @@
|
2
|
2
|
#include <esp_now.h>
|
3
|
3
|
#include <TFT_eSPI.h>
|
4
|
4
|
#include "config.h"
|
5
|
|
-#include "shalom.h"
|
|
5
|
+//#include "shalom.h"
|
6
|
6
|
#include "shalombg.h"
|
7
|
|
-#include "salam.h"
|
|
7
|
+//#include "salam.h"
|
8
|
8
|
#include "salambg.h"
|
9
|
9
|
#include "togetherbg.h"
|
10
|
10
|
#include "talis.h"
|
|
@@ -77,21 +77,16 @@ frameType frames[NUM_FRAMES] = {
|
77
|
77
|
};
|
78
|
78
|
|
79
|
79
|
const unsigned short *frame2image(frameType frame, bool is_salam, bool metta_from_me, bool metta_from_you) {
|
80
|
|
- if (!metta_from_you) {
|
81
|
|
- if (metta_from_me) {
|
|
80
|
+ if (!metta_from_me || !metta_from_you) {
|
|
81
|
+ return is_salam ? salambg : shalombg;
|
|
82
|
+ }
|
|
83
|
+ switch (frame) {
|
|
84
|
+ case FRAME_ME:
|
82
|
85
|
return is_salam ? salambg : shalombg;
|
83
|
|
- } else {
|
84
|
|
- return is_salam ? salam : shalom;
|
85
|
|
- }
|
86
|
|
- } else { // metta_from_you
|
87
|
|
- switch (frame) {
|
88
|
|
- case FRAME_ME:
|
89
|
|
- return metta_from_me ? (is_salam ? salambg : shalombg) : (is_salam ? salam : shalom);
|
90
|
|
- case FRAME_US:
|
91
|
|
- return metta_from_me ? togetherbg : (is_salam ? salam : shalom);
|
92
|
|
- case FRAME_U:
|
93
|
|
- return (metta_from_me) ? (is_salam ? shalombg : salambg) : (is_salam ? salam : shalom);
|
94
|
|
- }
|
|
86
|
+ case FRAME_US:
|
|
87
|
+ return togetherbg;
|
|
88
|
+ case FRAME_U:
|
|
89
|
+ return is_salam ? shalombg : salambg;
|
95
|
90
|
}
|
96
|
91
|
}
|
97
|
92
|
|
|
@@ -270,12 +265,12 @@ void loop() {
|
270
|
265
|
frame2image(frames[current_frame], is_salam, metta_from_me_since, metta_from_you));
|
271
|
266
|
|
272
|
267
|
// mybird (steady, pulse if metta_from_me_Since)
|
273
|
|
- if (!metta_from_me_since || frames[current_frame] == FRAME_ME || frames[current_frame] == FRAME_US) {
|
|
268
|
+ if (!metta_from_me_since || frames[current_frame] == FRAME_ME) {
|
274
|
269
|
mybirdSprite.pushToSprite(&background, MYBIRD_X, MYBIRD_Y, TFT_BLACK);
|
275
|
270
|
}
|
276
|
271
|
|
277
|
272
|
// yourbird (steady if nearby, heart beat if metta_from_you)
|
278
|
|
- if (nearby && (!metta_from_you || frames[current_frame] == FRAME_U || frames[current_frame] == FRAME_US)) {
|
|
273
|
+ if (nearby && (!metta_from_you || frames[current_frame] == FRAME_U)) {
|
279
|
274
|
yourbirdSprite.pushToSprite(&background, YOURBIRD_X, YOURBIRD_Y, TFT_BLACK);
|
280
|
275
|
}
|
281
|
276
|
|