55#include " Face.h"
66
77namespace m5avatar {
8- Balloon b;
9- Effect h;
10- BatteryIcon battery;
118BoundingRect br;
129
1310Face::Face ()
@@ -54,6 +51,9 @@ Face::~Face() {
5451 delete eyeblowLPos;
5552 delete sprite;
5653 delete boundingRect;
54+ delete b;
55+ delete h;
56+ delete battery;
5757}
5858
5959void Face::setMouth (Drawable *mouth) { this ->mouth = mouth; }
@@ -106,9 +106,9 @@ void Face::draw(DrawContext *ctx) {
106106 eyeblowL->draw (sprite, rect, ctx);
107107
108108 // TODO(meganetaaan): make balloons and effects selectable
109- b. draw (sprite, br, ctx);
110- h. draw (sprite, br, ctx);
111- battery. draw (sprite, br, ctx);
109+ b-> draw (sprite, br, ctx);
110+ h-> draw (sprite, br, ctx);
111+ battery-> draw (sprite, br, ctx);
112112 // drawAccessory(sprite, position, ctx);
113113
114114 // TODO(meganetaaan): rethink responsibility for transform function
@@ -117,7 +117,7 @@ void Face::draw(DrawContext *ctx) {
117117
118118 if (scale != 1.0 || rotation != 0 ) {
119119 tmpSprite->setColorDepth (ctx->getColorDepth ());
120- tmpSprite->createSprite ((int32_t )((float )M5. Display . width () * scale), (int32_t )((float )M5. Display . height () * scale));
120+ tmpSprite->createSprite ((int32_t )((float )320 * scale), (int32_t )((float )240 * scale));
121121 tmpSprite->setBitmapColor (ctx->getColorPalette ()->get (COLOR_PRIMARY),
122122 ctx->getColorPalette ()->get (COLOR_BACKGROUND));
123123 if (ctx->getColorDepth () != 1 ) {
0 commit comments