Skip to content

Commit

Permalink
Updated facial animation classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Mar 19, 2024
1 parent a6e2107 commit 534b04c
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 120 deletions.
13 changes: 7 additions & 6 deletions src/scenes/tomo_blink.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#include <scenes/tomo_blink.h>
#include <scenes/tomo_closing_eyes.h>
#include <scenes/tomo_interrupt.h>
#include <scenes/tomo_opening_eyes.h>

#include <tomo_scene.h>

TomoBlinkScene::TomoBlinkScene() {
this->hasNoInterrupt();
}
TomoBlinkScene::TomoBlinkScene() { }

void TomoBlinkScene::rendition() {
if(TomoScene::renderScene<TomoClosingEyesScene>(1))
if(TomoScene::renderScene<TomoClosingEyesScene>())
return;

if(TomoScene::renderScene<TomoOpeningEyesScene>(1))
if(TomoScene::renderScene<TomoOpeningEyesScene>())
return;
}

void TomoBlinkScene::onInteract() { }
void TomoBlinkScene::onInteract() {
TomoScene::renderScene<TomoInterruptScene>();
}
25 changes: 12 additions & 13 deletions src/scenes/tomo_closing_eyes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,20 +538,19 @@ const uint8_t tomo_closing_eyes_8[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

TomoClosingEyesScene::TomoClosingEyesScene() { }
TomoClosingEyesScene::TomoClosingEyesScene() {
this->hasNoInterrupt();
}

void TomoClosingEyesScene::rendition() {
TomoDisplay::renderBitmap(tomo_closing_eyes_1), delay(1000);
TomoDisplay::renderBitmap(tomo_closing_eyes_2), delay(5);
TomoDisplay::renderBitmap(tomo_closing_eyes_3), delay(5);
TomoDisplay::renderBitmap(tomo_closing_eyes_4), delay(5);
TomoDisplay::renderBitmap(tomo_closing_eyes_5), delay(5);
TomoDisplay::renderBitmap(tomo_closing_eyes_6), delay(5);
TomoDisplay::renderBitmap(tomo_closing_eyes_7), delay(5);
TomoDisplay::renderBitmap(tomo_closing_eyes_8), delay(5);
TomoDisplay::renderBitmap(tomo_closing_eyes_1, 1000);
TomoDisplay::renderBitmap(tomo_closing_eyes_2);
TomoDisplay::renderBitmap(tomo_closing_eyes_3);
TomoDisplay::renderBitmap(tomo_closing_eyes_4);
TomoDisplay::renderBitmap(tomo_closing_eyes_5);
TomoDisplay::renderBitmap(tomo_closing_eyes_6);
TomoDisplay::renderBitmap(tomo_closing_eyes_7);
TomoDisplay::renderBitmap(tomo_closing_eyes_8);
}

void TomoClosingEyesScene::onInteract() {
TomoScene::renderScene<TomoOpeningEyesScene>(1, false);
TomoScene::renderScene<TomoInterruptScene>(1);
}
void TomoClosingEyesScene::onInteract() { }
26 changes: 13 additions & 13 deletions src/scenes/tomo_exhausted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,19 +206,19 @@ TomoExhaustedScene::TomoExhaustedScene() {
}

void TomoExhaustedScene::rendition() {
TomoDisplay::renderBitmap(tomo_exhausted_1), delay(5);
TomoDisplay::renderBitmap(tomo_exhausted_2), delay(50);
TomoDisplay::renderBitmap(tomo_exhausted_3), delay(400);
TomoDisplay::renderBitmap(tomo_exhausted_2), delay(50);
TomoDisplay::renderBitmap(tomo_exhausted_1), delay(5);
TomoDisplay::renderBitmap(tomo_exhausted_2), delay(50);
TomoDisplay::renderBitmap(tomo_exhausted_3), delay(800);
TomoDisplay::renderBitmap(tomo_exhausted_2), delay(50);
TomoDisplay::renderBitmap(tomo_exhausted_1), delay(5);
TomoDisplay::renderBitmap(tomo_exhausted_2), delay(50);
TomoDisplay::renderBitmap(tomo_exhausted_3), delay(1000);
TomoDisplay::renderBitmap(tomo_exhausted_2), delay(50);
TomoDisplay::renderBitmap(tomo_exhausted_1), delay(5);
TomoDisplay::renderBitmap(tomo_exhausted_1);
TomoDisplay::renderBitmap(tomo_exhausted_2, 50);
TomoDisplay::renderBitmap(tomo_exhausted_3, 400);
TomoDisplay::renderBitmap(tomo_exhausted_2, 50);
TomoDisplay::renderBitmap(tomo_exhausted_1);
TomoDisplay::renderBitmap(tomo_exhausted_2, 50);
TomoDisplay::renderBitmap(tomo_exhausted_3, 800);
TomoDisplay::renderBitmap(tomo_exhausted_2, 50);
TomoDisplay::renderBitmap(tomo_exhausted_1);
TomoDisplay::renderBitmap(tomo_exhausted_2, 50);
TomoDisplay::renderBitmap(tomo_exhausted_3, 1000);
TomoDisplay::renderBitmap(tomo_exhausted_2, 50);
TomoDisplay::renderBitmap(tomo_exhausted_1);
}

void TomoExhaustedScene::onInteract() { }
13 changes: 9 additions & 4 deletions src/scenes/tomo_interrupt.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <scenes/tomo_angry.h>
#include <scenes/tomo_interrupt.h>
#include <scenes/tomo_interrupta.h>
#include <scenes/tomo_left_lift.h>
Expand All @@ -11,17 +12,21 @@ TomoInterruptScene::TomoInterruptScene() {
}

void TomoInterruptScene::rendition() {
switch(TomoRNGEngine::get(0, 2)) {
switch(TomoRNGEngine::get(0, 3)) {
case TOMO_INT_ANGRY:
TomoScene::renderScene<TomoAngryScene>();
break;

case TOMO_INT_A:
TomoScene::renderScene<TomoInterruptAScene>(1);
TomoScene::renderScene<TomoInterruptAScene>();
break;

case TOMO_INT_LEFT_LIFT:
TomoScene::renderScene<TomoLeftLiftScene>(1);
TomoScene::renderScene<TomoLeftLiftScene>();
break;

case TOMO_INT_RIGHT_LIFT:
TomoScene::renderScene<TomoRightLiftScene>(1);
TomoScene::renderScene<TomoRightLiftScene>();
break;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/scenes/tomo_interrupta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ TomoInterruptAScene::TomoInterruptAScene() {
}

void TomoInterruptAScene::rendition() {
TomoDisplay::renderBitmap(tomo_interrupta_1), delay(50);
TomoDisplay::renderBitmap(tomo_interrupta_2), delay(1000);
TomoDisplay::renderBitmap(tomo_interrupta_3), delay(60);
TomoDisplay::renderBitmap(tomo_interrupta_1), delay(50);
TomoDisplay::renderBitmap(tomo_interrupta_1, 50);
TomoDisplay::renderBitmap(tomo_interrupta_2, 1000);
TomoDisplay::renderBitmap(tomo_interrupta_3, 60);
TomoDisplay::renderBitmap(tomo_interrupta_1, 50);
}

void TomoInterruptAScene::onInteract() { }
28 changes: 14 additions & 14 deletions src/scenes/tomo_left.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,20 +541,20 @@ TomoLeftScene::TomoLeftScene() {
}

void TomoLeftScene::rendition() {
TomoDisplay::renderBitmap(tomo_left_1), delay(1000);
TomoDisplay::renderBitmap(tomo_left_2), delay(5);
TomoDisplay::renderBitmap(tomo_left_3), delay(5);
TomoDisplay::renderBitmap(tomo_left_4), delay(5);
TomoDisplay::renderBitmap(tomo_left_5), delay(5);
TomoDisplay::renderBitmap(tomo_left_6), delay(5);
TomoDisplay::renderBitmap(tomo_left_7), delay(5);
TomoDisplay::renderBitmap(tomo_left_8), delay(1000);
TomoDisplay::renderBitmap(tomo_left_7), delay(5);
TomoDisplay::renderBitmap(tomo_left_6), delay(5);
TomoDisplay::renderBitmap(tomo_left_5), delay(5);
TomoDisplay::renderBitmap(tomo_left_4), delay(5);
TomoDisplay::renderBitmap(tomo_left_3), delay(5);
TomoDisplay::renderBitmap(tomo_left_2), delay(5);
TomoDisplay::renderBitmap(tomo_left_1, 1000);
TomoDisplay::renderBitmap(tomo_left_2);
TomoDisplay::renderBitmap(tomo_left_3);
TomoDisplay::renderBitmap(tomo_left_4);
TomoDisplay::renderBitmap(tomo_left_5);
TomoDisplay::renderBitmap(tomo_left_6);
TomoDisplay::renderBitmap(tomo_left_7);
TomoDisplay::renderBitmap(tomo_left_8, 1000);
TomoDisplay::renderBitmap(tomo_left_7);
TomoDisplay::renderBitmap(tomo_left_6);
TomoDisplay::renderBitmap(tomo_left_5);
TomoDisplay::renderBitmap(tomo_left_4);
TomoDisplay::renderBitmap(tomo_left_3);
TomoDisplay::renderBitmap(tomo_left_2);
}

void TomoLeftScene::onInteract() { }
30 changes: 15 additions & 15 deletions src/scenes/tomo_left_lift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,21 +541,21 @@ TomoLeftLiftScene::TomoLeftLiftScene() {
}

void TomoLeftLiftScene::rendition() {
TomoDisplay::renderBitmap(tomo_left_lift_1), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_2), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_3), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_4), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_5), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_6), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_7), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_8), delay(1000);
TomoDisplay::renderBitmap(tomo_left_lift_7), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_6), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_5), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_4), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_3), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_2), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_1), delay(5);
TomoDisplay::renderBitmap(tomo_left_lift_1);
TomoDisplay::renderBitmap(tomo_left_lift_2);
TomoDisplay::renderBitmap(tomo_left_lift_3);
TomoDisplay::renderBitmap(tomo_left_lift_4);
TomoDisplay::renderBitmap(tomo_left_lift_5);
TomoDisplay::renderBitmap(tomo_left_lift_6);
TomoDisplay::renderBitmap(tomo_left_lift_7);
TomoDisplay::renderBitmap(tomo_left_lift_8, 1000);
TomoDisplay::renderBitmap(tomo_left_lift_7);
TomoDisplay::renderBitmap(tomo_left_lift_6);
TomoDisplay::renderBitmap(tomo_left_lift_5);
TomoDisplay::renderBitmap(tomo_left_lift_4);
TomoDisplay::renderBitmap(tomo_left_lift_3);
TomoDisplay::renderBitmap(tomo_left_lift_2);
TomoDisplay::renderBitmap(tomo_left_lift_1);
}

void TomoLeftLiftScene::onInteract() { }
24 changes: 12 additions & 12 deletions src/scenes/tomo_opening_eyes.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <scenes/tomo_opening_eyes.h>
#include <scenes/tomo_interrupta.h>
#include <scenes/tomo_interrupt.h>

#include <tomo_scene.h>

const uint8_t tomo_opening_eyes_1[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -542,16 +544,14 @@ TomoOpeningEyesScene::TomoOpeningEyesScene() {
}

void TomoOpeningEyesScene::rendition() {
TomoDisplay::renderBitmap(tomo_opening_eyes_1), delay(5);
TomoDisplay::renderBitmap(tomo_opening_eyes_2), delay(5);
TomoDisplay::renderBitmap(tomo_opening_eyes_3), delay(5);
TomoDisplay::renderBitmap(tomo_opening_eyes_4), delay(5);
TomoDisplay::renderBitmap(tomo_opening_eyes_5), delay(5);
TomoDisplay::renderBitmap(tomo_opening_eyes_6), delay(5);
TomoDisplay::renderBitmap(tomo_opening_eyes_7), delay(5);
TomoDisplay::renderBitmap(tomo_opening_eyes_8), delay(1000);
TomoDisplay::renderBitmap(tomo_opening_eyes_1);
TomoDisplay::renderBitmap(tomo_opening_eyes_2);
TomoDisplay::renderBitmap(tomo_opening_eyes_3);
TomoDisplay::renderBitmap(tomo_opening_eyes_4);
TomoDisplay::renderBitmap(tomo_opening_eyes_5);
TomoDisplay::renderBitmap(tomo_opening_eyes_6);
TomoDisplay::renderBitmap(tomo_opening_eyes_7);
TomoDisplay::renderBitmap(tomo_opening_eyes_8, 1000);
}

void TomoOpeningEyesScene::onInteract() {
TomoScene::renderScene<TomoInterruptAScene>(1);
}
void TomoOpeningEyesScene::onInteract() { }
9 changes: 5 additions & 4 deletions src/scenes/tomo_rest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@
#include <scenes/tomo_rest.h>
#include <scenes/tomo_sleeping.h>

#include <tomo_rng_engine.h>
#include <tomo_scene.h>

TomoRestScene::TomoRestScene() {
this->hasNoInterrupt();
}

void TomoRestScene::rendition() {
if(TomoScene::renderScene<TomoClosingEyesScene>(1))
if(TomoScene::renderScene<TomoClosingEyesScene>())
return;

if(TomoScene::renderScene<TomoExhaustedScene>(1))
if(TomoScene::renderScene<TomoExhaustedScene>())
return;

if(TomoScene::renderScene<TomoSleepingScene>(12))
if(TomoScene::renderScene<TomoSleepingScene>(TomoRNGEngine::get(0, 12)))
return;

if(TomoScene::renderScene<TomoOpeningEyesScene>(1))
if(TomoScene::renderScene<TomoOpeningEyesScene>())
return;
}

Expand Down
28 changes: 14 additions & 14 deletions src/scenes/tomo_right.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,20 +541,20 @@ TomoRightScene::TomoRightScene() {
}

void TomoRightScene::rendition() {
TomoDisplay::renderBitmap(tomo_right_1), delay(1000);
TomoDisplay::renderBitmap(tomo_right_2), delay(5);
TomoDisplay::renderBitmap(tomo_right_3), delay(5);
TomoDisplay::renderBitmap(tomo_right_4), delay(5);
TomoDisplay::renderBitmap(tomo_right_5), delay(5);
TomoDisplay::renderBitmap(tomo_right_6), delay(5);
TomoDisplay::renderBitmap(tomo_right_7), delay(5);
TomoDisplay::renderBitmap(tomo_right_8), delay(1000);
TomoDisplay::renderBitmap(tomo_right_7), delay(5);
TomoDisplay::renderBitmap(tomo_right_6), delay(5);
TomoDisplay::renderBitmap(tomo_right_5), delay(5);
TomoDisplay::renderBitmap(tomo_right_4), delay(5);
TomoDisplay::renderBitmap(tomo_right_3), delay(5);
TomoDisplay::renderBitmap(tomo_right_2), delay(5);
TomoDisplay::renderBitmap(tomo_right_1, 1000);
TomoDisplay::renderBitmap(tomo_right_2);
TomoDisplay::renderBitmap(tomo_right_3);
TomoDisplay::renderBitmap(tomo_right_4);
TomoDisplay::renderBitmap(tomo_right_5);
TomoDisplay::renderBitmap(tomo_right_6);
TomoDisplay::renderBitmap(tomo_right_7);
TomoDisplay::renderBitmap(tomo_right_8, 1000);
TomoDisplay::renderBitmap(tomo_right_7);
TomoDisplay::renderBitmap(tomo_right_6);
TomoDisplay::renderBitmap(tomo_right_5);
TomoDisplay::renderBitmap(tomo_right_4);
TomoDisplay::renderBitmap(tomo_right_3);
TomoDisplay::renderBitmap(tomo_right_2);
}

void TomoRightScene::onInteract() { }
30 changes: 15 additions & 15 deletions src/scenes/tomo_right_lift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,21 +541,21 @@ TomoRightLiftScene::TomoRightLiftScene() {
}

void TomoRightLiftScene::rendition() {
TomoDisplay::renderBitmap(tomo_right_lift_1), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_2), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_3), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_4), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_5), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_6), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_7), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_8), delay(1000);
TomoDisplay::renderBitmap(tomo_right_lift_7), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_6), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_5), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_4), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_3), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_2), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_1), delay(5);
TomoDisplay::renderBitmap(tomo_right_lift_1);
TomoDisplay::renderBitmap(tomo_right_lift_2);
TomoDisplay::renderBitmap(tomo_right_lift_3);
TomoDisplay::renderBitmap(tomo_right_lift_4);
TomoDisplay::renderBitmap(tomo_right_lift_5);
TomoDisplay::renderBitmap(tomo_right_lift_6);
TomoDisplay::renderBitmap(tomo_right_lift_7);
TomoDisplay::renderBitmap(tomo_right_lift_8, 1000);
TomoDisplay::renderBitmap(tomo_right_lift_7);
TomoDisplay::renderBitmap(tomo_right_lift_6);
TomoDisplay::renderBitmap(tomo_right_lift_5);
TomoDisplay::renderBitmap(tomo_right_lift_4);
TomoDisplay::renderBitmap(tomo_right_lift_3);
TomoDisplay::renderBitmap(tomo_right_lift_2);
TomoDisplay::renderBitmap(tomo_right_lift_1);
}

void TomoRightLiftScene::onInteract() { }
12 changes: 6 additions & 6 deletions src/scenes/tomo_sleeping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,12 @@ const uint8_t tomo_sleeping_6[] PROGMEM = {
TomoSleepingScene::TomoSleepingScene() { }

void TomoSleepingScene::rendition() {
TomoDisplay::renderBitmap(tomo_sleeping_1), delay(100);
TomoDisplay::renderBitmap(tomo_sleeping_2), delay(100);
TomoDisplay::renderBitmap(tomo_sleeping_3), delay(100);
TomoDisplay::renderBitmap(tomo_sleeping_4), delay(100);
TomoDisplay::renderBitmap(tomo_sleeping_5), delay(100);
TomoDisplay::renderBitmap(tomo_sleeping_6), delay(100);
TomoDisplay::renderBitmap(tomo_sleeping_1, 100);
TomoDisplay::renderBitmap(tomo_sleeping_2, 100);
TomoDisplay::renderBitmap(tomo_sleeping_3, 100);
TomoDisplay::renderBitmap(tomo_sleeping_4, 100);
TomoDisplay::renderBitmap(tomo_sleeping_5, 100);
TomoDisplay::renderBitmap(tomo_sleeping_6, 100);
}

void TomoSleepingScene::onInteract() {
Expand Down

0 comments on commit 534b04c

Please sign in to comment.