From 9c44782c5eab5635ca6adf4717409bf2ffb6c694 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Fri, 17 Aug 2012 02:29:28 +0200 Subject: new nekowatchlet and minor graphics/performance changes --- nekowatchlet/Neko.qml | 176 +++++++++++++++++++++++++++ nekowatchlet/icon.png | Bin 0 -> 177 bytes nekowatchlet/metawatch-digital.qml | 49 ++++++++ nekowatchlet/neko.png | Bin 0 -> 2485 bytes nekowatchlet/nekowatchlet.cpp | 17 +++ nekowatchlet/nekowatchlet.h | 20 +++ nekowatchlet/nekowatchlet.pro | 26 ++++ nekowatchlet/nekowatchletplugin.cpp | 38 ++++++ nekowatchlet/nekowatchletplugin.h | 25 ++++ nekowatchlet/original-resources/awake.png | Bin 0 -> 410 bytes nekowatchlet/original-resources/down1.png | Bin 0 -> 392 bytes nekowatchlet/original-resources/down2.png | Bin 0 -> 390 bytes nekowatchlet/original-resources/dtogi1.png | Bin 0 -> 388 bytes nekowatchlet/original-resources/dtogi2.png | Bin 0 -> 390 bytes nekowatchlet/original-resources/dwleft1.png | Bin 0 -> 392 bytes nekowatchlet/original-resources/dwleft2.png | Bin 0 -> 398 bytes nekowatchlet/original-resources/dwright1.png | Bin 0 -> 398 bytes nekowatchlet/original-resources/dwright2.png | Bin 0 -> 401 bytes nekowatchlet/original-resources/jare2.png | Bin 0 -> 400 bytes nekowatchlet/original-resources/kaki1.png | Bin 0 -> 400 bytes nekowatchlet/original-resources/kaki2.png | Bin 0 -> 393 bytes nekowatchlet/original-resources/left1.png | Bin 0 -> 399 bytes nekowatchlet/original-resources/left2.png | Bin 0 -> 390 bytes nekowatchlet/original-resources/ltogi1.png | Bin 0 -> 398 bytes nekowatchlet/original-resources/ltogi2.png | Bin 0 -> 397 bytes nekowatchlet/original-resources/makeatlas.sh | 32 +++++ nekowatchlet/original-resources/mati2.png | Bin 0 -> 383 bytes nekowatchlet/original-resources/mati3.png | Bin 0 -> 388 bytes nekowatchlet/original-resources/right1.png | Bin 0 -> 400 bytes nekowatchlet/original-resources/right2.png | Bin 0 -> 400 bytes nekowatchlet/original-resources/rtogi1.png | Bin 0 -> 395 bytes nekowatchlet/original-resources/rtogi2.png | Bin 0 -> 397 bytes nekowatchlet/original-resources/sleep1.png | Bin 0 -> 393 bytes nekowatchlet/original-resources/sleep2.png | Bin 0 -> 380 bytes nekowatchlet/original-resources/up1.png | Bin 0 -> 373 bytes nekowatchlet/original-resources/up2.png | Bin 0 -> 385 bytes nekowatchlet/original-resources/upleft1.png | Bin 0 -> 389 bytes nekowatchlet/original-resources/upleft2.png | Bin 0 -> 404 bytes nekowatchlet/original-resources/upright1.png | Bin 0 -> 396 bytes nekowatchlet/original-resources/upright2.png | Bin 0 -> 407 bytes nekowatchlet/original-resources/utogi1.png | Bin 0 -> 397 bytes nekowatchlet/original-resources/utogi2.png | Bin 0 -> 396 bytes nekowatchlet/res/makeatlas.sh | 32 +++++ 43 files changed, 415 insertions(+) create mode 100644 nekowatchlet/Neko.qml create mode 100644 nekowatchlet/icon.png create mode 100644 nekowatchlet/metawatch-digital.qml create mode 100644 nekowatchlet/neko.png create mode 100644 nekowatchlet/nekowatchlet.cpp create mode 100644 nekowatchlet/nekowatchlet.h create mode 100644 nekowatchlet/nekowatchlet.pro create mode 100644 nekowatchlet/nekowatchletplugin.cpp create mode 100644 nekowatchlet/nekowatchletplugin.h create mode 100644 nekowatchlet/original-resources/awake.png create mode 100644 nekowatchlet/original-resources/down1.png create mode 100644 nekowatchlet/original-resources/down2.png create mode 100644 nekowatchlet/original-resources/dtogi1.png create mode 100644 nekowatchlet/original-resources/dtogi2.png create mode 100644 nekowatchlet/original-resources/dwleft1.png create mode 100644 nekowatchlet/original-resources/dwleft2.png create mode 100644 nekowatchlet/original-resources/dwright1.png create mode 100644 nekowatchlet/original-resources/dwright2.png create mode 100644 nekowatchlet/original-resources/jare2.png create mode 100644 nekowatchlet/original-resources/kaki1.png create mode 100644 nekowatchlet/original-resources/kaki2.png create mode 100644 nekowatchlet/original-resources/left1.png create mode 100644 nekowatchlet/original-resources/left2.png create mode 100644 nekowatchlet/original-resources/ltogi1.png create mode 100644 nekowatchlet/original-resources/ltogi2.png create mode 100755 nekowatchlet/original-resources/makeatlas.sh create mode 100644 nekowatchlet/original-resources/mati2.png create mode 100644 nekowatchlet/original-resources/mati3.png create mode 100644 nekowatchlet/original-resources/right1.png create mode 100644 nekowatchlet/original-resources/right2.png create mode 100644 nekowatchlet/original-resources/rtogi1.png create mode 100644 nekowatchlet/original-resources/rtogi2.png create mode 100644 nekowatchlet/original-resources/sleep1.png create mode 100644 nekowatchlet/original-resources/sleep2.png create mode 100644 nekowatchlet/original-resources/up1.png create mode 100644 nekowatchlet/original-resources/up2.png create mode 100644 nekowatchlet/original-resources/upleft1.png create mode 100644 nekowatchlet/original-resources/upleft2.png create mode 100644 nekowatchlet/original-resources/upright1.png create mode 100644 nekowatchlet/original-resources/upright2.png create mode 100644 nekowatchlet/original-resources/utogi1.png create mode 100644 nekowatchlet/original-resources/utogi2.png create mode 100644 nekowatchlet/res/makeatlas.sh (limited to 'nekowatchlet') diff --git a/nekowatchlet/Neko.qml b/nekowatchlet/Neko.qml new file mode 100644 index 0000000..b8b08ad --- /dev/null +++ b/nekowatchlet/Neko.qml @@ -0,0 +1,176 @@ +import QtQuick 1.0 + +Item { + id: neko + height: 32 + width: 32 + clip: true + + property int targetX; + property int targetY; + property alias imageSource: sprite.source + property bool running: true + + property int maxSpeed: 6 + + property int _anim + property int _animFrames + property int _animCurFrame + + property int _distanceX: targetX - x - (width / 2) + property int _distanceY: targetY - y - (5 * height / 6) + property int _distance: Math.sqrt(_distanceX * _distanceX + _distanceY * _distanceY) + + property int _calcSpeedX: _distance < maxSpeed ? + _distanceX : + ((maxSpeed * _distanceX) / _distance) + property int _calcSpeedY: _distance < maxSpeed ? + _distanceY : + ((maxSpeed * _distanceY) / _distance) + + property real _calcAngle: Math.atan2(_calcSpeedY, _calcSpeedX) + + property int _speedX: 0 + property int _speedY: 0 + + signal arrived + + function chooseWalkAnimation(speedX, speedY, angle) { + var PiPer8 = Math.PI / 8; + + if (angle > 7 * PiPer8) { + return 6; // left + } else if (angle > 5 * PiPer8) { + return 2; // dwleft + } else if (angle > 3 * PiPer8) { + return 0; // down + } else if (angle > 1 * PiPer8) { + return 3; // dwright + } else if (angle > -1 * PiPer8) { + return 9; // right + } else if (angle > -3 * PiPer8) { + return 14; // upright + } else if (angle > -5 * PiPer8) { + return 12; // up + } else { + return 13; // upleft + } + } + + Image { + id: sprite + source: "neko.png" + + x: -(neko.width * neko._animCurFrame) + y: -(neko.height * neko._anim) + } + + Timer { + id: timer + interval: 250 + running: neko.running + repeat: true + onTriggered: { + neko._animCurFrame = (_animCurFrame + 1) % _animFrames + neko.x = neko.x + _speedX; + neko.y = neko.y + _speedY; + + if (state == "WALKING" && _distance == 0) { + neko.arrived(); + } + } + } + + Timer { + id: idleToScratchTimer + onTriggered: neko.state = "SCRATCHING" + } + + Timer { + id: idleToYawnTimer + onTriggered: neko.state = "YAWNING" + } + + Timer { + id: scrachTimer + interval: timer.interval * 2 + running: neko.running && state === "SCRATCHING" + onTriggered: neko.state = "IDLING" + } + + Timer { + id: yawnTimer + interval: timer.interval * 3 + running: neko.running && state === "YAWNING" + onTriggered: neko.state = "IDLING" + } + + onTargetXChanged: state = "WALKING" + onTargetYChanged: state = "WALKING" + + onArrived: state = "IDLING" + + states: [ + State { + name: "SLEEPING" + PropertyChanges { + target: neko + _anim: 11 // sleep + _animFrames: 2 + _speedX: 0 + _speedY: 0 + } + }, + State { + name: "IDLING" + PropertyChanges { + target: neko + _anim: 4 // jare + _animFrames: 1 + _animCurFrame: 0 + _speedX: 0 + _speedY: 0 + } + PropertyChanges { + target: idleToScratchTimer + interval: Math.random() * 10000 + running: neko.running && state == "IDLING" + } + PropertyChanges { + target: idleToYawnTimer + interval: Math.random() * 20000 + running: neko.running && state == "IDLING" + } + }, + State { + name: "SCRATCHING" + PropertyChanges { + target: neko + _anim: 5 // kaki + _animFrames: 2 + _speedX: 0 + _speedY: 0 + } + }, + State { + name: "YAWNING" + PropertyChanges { + target: neko + _anim: 8 // mati + _animFrames: 2 + _speedX: 0 + _speedY: 0 + } + }, + State { + name: "WALKING" + PropertyChanges { + target: neko + _anim: chooseWalkAnimation(_calcSpeedX, _calcSpeedY, _calcAngle) + _animFrames: 2 + _speedX: _calcSpeedX + _speedY: _calcSpeedY + } + } + ] +} diff --git a/nekowatchlet/icon.png b/nekowatchlet/icon.png new file mode 100644 index 0000000..4c5fb83 Binary files /dev/null and b/nekowatchlet/icon.png differ diff --git a/nekowatchlet/metawatch-digital.qml b/nekowatchlet/metawatch-digital.qml new file mode 100644 index 0000000..b1e16c8 --- /dev/null +++ b/nekowatchlet/metawatch-digital.qml @@ -0,0 +1,49 @@ +import QtQuick 1.0 +import com.javispedro.sowatch.metawatch 1.0 + +MWPage { + Neko { + id: neko + running: watch.active + + targetX: goal.x + targetY: goal.y + } + + Rectangle { + id: goal + width: 2 + height: 2 + color: "black" + + Behavior on x { SmoothedAnimation { velocity: 80; }} + Behavior on y { SmoothedAnimation { velocity: 80; }} + } + + function goToRandomPosition() { + goal.x = 16 + Math.floor(Math.random() * (width - 32)); + goal.y = 16 + Math.floor(Math.random() * (height - 32)); + } + + function goToSleep() { + neko.state = "SLEEPING"; + } + + Connections { + target: watch + onActiveChanged: { + if (watch.active) { + goToSleep(); + } + } + + onButtonPressed : { + switch (button) { + case 1: + case 2: + goToRandomPosition(); + break; + } + } + } +} diff --git a/nekowatchlet/neko.png b/nekowatchlet/neko.png new file mode 100644 index 0000000..45d588c Binary files /dev/null and b/nekowatchlet/neko.png differ diff --git a/nekowatchlet/nekowatchlet.cpp b/nekowatchlet/nekowatchlet.cpp new file mode 100644 index 0000000..627d127 --- /dev/null +++ b/nekowatchlet/nekowatchlet.cpp @@ -0,0 +1,17 @@ +#include "nekowatchlet.h" + +using namespace sowatch; + +const QLatin1String NekoWatchlet::myId("com.javispedro.sowatch.neko"); + +NekoWatchlet::NekoWatchlet(WatchServer* server) : + DeclarativeWatchlet(server, myId) +{ + // Workaround Qt's stupid clip region calculation when + // - There's a QML item with clip = true + // - And we are using "compat" updateRects() signal mode + setFullUpdateMode(true); + + setSource(QUrl(SOWATCH_QML_DIR "/nekowatchlet/" + server->watch()->model() + ".qml")); +} + diff --git a/nekowatchlet/nekowatchlet.h b/nekowatchlet/nekowatchlet.h new file mode 100644 index 0000000..067606a --- /dev/null +++ b/nekowatchlet/nekowatchlet.h @@ -0,0 +1,20 @@ +#ifndef NEKOWATCHLET_H +#define NEKOWATCHLET_H + +#include + +namespace sowatch +{ + +class NekoWatchlet : public DeclarativeWatchlet +{ + Q_OBJECT +public: + explicit NekoWatchlet(WatchServer* server); + + static const QLatin1String myId; +}; + +} + +#endif // NEKOWATCHLET_H diff --git a/nekowatchlet/nekowatchlet.pro b/nekowatchlet/nekowatchlet.pro new file mode 100644 index 0000000..b45979a --- /dev/null +++ b/nekowatchlet/nekowatchlet.pro @@ -0,0 +1,26 @@ +TARGET = nekowatchlet +TEMPLATE = lib +CONFIG += plugin + +SOURCES += nekowatchletplugin.cpp nekowatchlet.cpp + +HEADERS += nekowatchletplugin.h nekowatchlet.h + +qml_files.files = metawatch-digital.qml Neko.qml icon.png neko.png + +LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch +INCLUDEPATH += $$PWD/../libsowatch +DEPENDPATH += $$PWD/../libsowatch +QML_IMPORT_PATH += $$PWD/../metawatch/qml + +unix:!symbian { + !isEmpty(MEEGO_VERSION_MAJOR)|maemo5 { + QMAKE_RPATHDIR += /opt/sowatch/lib + target.path = /opt/sowatch/lib/watchlets + qml_files.path = /opt/sowatch/qml/$$TARGET + } else { + target.path = /usr/lib/sowatch/watchlets + qml_files.path = /usr/share/sowatch/qml/$$TARGET + } + INSTALLS += target qml_files +} diff --git a/nekowatchlet/nekowatchletplugin.cpp b/nekowatchlet/nekowatchletplugin.cpp new file mode 100644 index 0000000..c891530 --- /dev/null +++ b/nekowatchlet/nekowatchletplugin.cpp @@ -0,0 +1,38 @@ +#include "nekowatchlet.h" +#include "nekowatchletplugin.h" + +using namespace sowatch; + +NekoWatchletPlugin::NekoWatchletPlugin(QObject *parent) : + QObject(parent) +{ +} + +NekoWatchletPlugin::~NekoWatchletPlugin() +{ +} + +QStringList NekoWatchletPlugin::watchlets() +{ + QStringList l; + l << NekoWatchlet::myId; + return l; +} + +WatchletPluginInterface::WatchletInfo NekoWatchletPlugin::describeWatchlet(const QString &id) +{ + WatchletInfo info; + if (id != NekoWatchlet::myId) return info; + info.name = "Neko"; + info.icon = QUrl::fromLocalFile(SOWATCH_QML_DIR "/nekowatchlet/icon.png"); + return info; +} + +Watchlet* NekoWatchletPlugin::getWatchlet(const QString& driver, ConfigKey *settings, WatchServer *server) +{ + Q_UNUSED(driver); + Q_UNUSED(settings); + return new NekoWatchlet(server); +} + +Q_EXPORT_PLUGIN2(notificationswatchlet, NekoWatchletPlugin) diff --git a/nekowatchlet/nekowatchletplugin.h b/nekowatchlet/nekowatchletplugin.h new file mode 100644 index 0000000..f7f1bdf --- /dev/null +++ b/nekowatchlet/nekowatchletplugin.h @@ -0,0 +1,25 @@ +#ifndef NEKOWATCHLETPLUGIN_H +#define NEKOWATCHLETPLUGIN_H + +#include + +namespace sowatch +{ + +class NekoWatchletPlugin : public QObject, public WatchletPluginInterface +{ + Q_OBJECT + Q_INTERFACES(sowatch::WatchletPluginInterface) + +public: + explicit NekoWatchletPlugin(QObject *parent = 0); + ~NekoWatchletPlugin(); + + QStringList watchlets(); + WatchletInfo describeWatchlet(const QString &id); + Watchlet* getWatchlet(const QString& id, ConfigKey *settings, WatchServer* server); +}; + +} + +#endif // NEKOWATCHLETPLUGIN_H diff --git a/nekowatchlet/original-resources/awake.png b/nekowatchlet/original-resources/awake.png new file mode 100644 index 0000000..6eaf9c3 Binary files /dev/null and b/nekowatchlet/original-resources/awake.png differ diff --git a/nekowatchlet/original-resources/down1.png b/nekowatchlet/original-resources/down1.png new file mode 100644 index 0000000..e3f3656 Binary files /dev/null and b/nekowatchlet/original-resources/down1.png differ diff --git a/nekowatchlet/original-resources/down2.png b/nekowatchlet/original-resources/down2.png new file mode 100644 index 0000000..ad2e387 Binary files /dev/null and b/nekowatchlet/original-resources/down2.png differ diff --git a/nekowatchlet/original-resources/dtogi1.png b/nekowatchlet/original-resources/dtogi1.png new file mode 100644 index 0000000..29bbb36 Binary files /dev/null and b/nekowatchlet/original-resources/dtogi1.png differ diff --git a/nekowatchlet/original-resources/dtogi2.png b/nekowatchlet/original-resources/dtogi2.png new file mode 100644 index 0000000..03b8a17 Binary files /dev/null and b/nekowatchlet/original-resources/dtogi2.png differ diff --git a/nekowatchlet/original-resources/dwleft1.png b/nekowatchlet/original-resources/dwleft1.png new file mode 100644 index 0000000..855c779 Binary files /dev/null and b/nekowatchlet/original-resources/dwleft1.png differ diff --git a/nekowatchlet/original-resources/dwleft2.png b/nekowatchlet/original-resources/dwleft2.png new file mode 100644 index 0000000..753260f Binary files /dev/null and b/nekowatchlet/original-resources/dwleft2.png differ diff --git a/nekowatchlet/original-resources/dwright1.png b/nekowatchlet/original-resources/dwright1.png new file mode 100644 index 0000000..fa6dc8a Binary files /dev/null and b/nekowatchlet/original-resources/dwright1.png differ diff --git a/nekowatchlet/original-resources/dwright2.png b/nekowatchlet/original-resources/dwright2.png new file mode 100644 index 0000000..61ed2a3 Binary files /dev/null and b/nekowatchlet/original-resources/dwright2.png differ diff --git a/nekowatchlet/original-resources/jare2.png b/nekowatchlet/original-resources/jare2.png new file mode 100644 index 0000000..a0a0662 Binary files /dev/null and b/nekowatchlet/original-resources/jare2.png differ diff --git a/nekowatchlet/original-resources/kaki1.png b/nekowatchlet/original-resources/kaki1.png new file mode 100644 index 0000000..c499f43 Binary files /dev/null and b/nekowatchlet/original-resources/kaki1.png differ diff --git a/nekowatchlet/original-resources/kaki2.png b/nekowatchlet/original-resources/kaki2.png new file mode 100644 index 0000000..b4e0c4e Binary files /dev/null and b/nekowatchlet/original-resources/kaki2.png differ diff --git a/nekowatchlet/original-resources/left1.png b/nekowatchlet/original-resources/left1.png new file mode 100644 index 0000000..eb990ab Binary files /dev/null and b/nekowatchlet/original-resources/left1.png differ diff --git a/nekowatchlet/original-resources/left2.png b/nekowatchlet/original-resources/left2.png new file mode 100644 index 0000000..532aaa9 Binary files /dev/null and b/nekowatchlet/original-resources/left2.png differ diff --git a/nekowatchlet/original-resources/ltogi1.png b/nekowatchlet/original-resources/ltogi1.png new file mode 100644 index 0000000..30702c9 Binary files /dev/null and b/nekowatchlet/original-resources/ltogi1.png differ diff --git a/nekowatchlet/original-resources/ltogi2.png b/nekowatchlet/original-resources/ltogi2.png new file mode 100644 index 0000000..658bbe7 Binary files /dev/null and b/nekowatchlet/original-resources/ltogi2.png differ diff --git a/nekowatchlet/original-resources/makeatlas.sh b/nekowatchlet/original-resources/makeatlas.sh new file mode 100755 index 0000000..e04a50f --- /dev/null +++ b/nekowatchlet/original-resources/makeatlas.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e + +allfiles=$(echo *.png | sort) +atlasfiles="" +stems="" + +for i in $allfiles +do + echo $i + if [[ $i =~ ^([a-z]+)[1-9].png ]] + then + stem=${BASH_REMATCH[1]} + output=atlas/$stem.png + if [[ $atlasfiles != *$output* ]] + then + montage $stem?.png -geometry 32x32 $output + atlasfiles="$atlasfiles $output" + stems="$stems $stem" + fi + fi +done + +montage $atlasfiles -geometry 64x32+0+0 -gravity NorthWest -tile 1x atlas/atlas.png + +rm -f $atlasfiles + +echo $stems | tr ' ' '\n' > atlas/atlas.txt + +exit 0 + diff --git a/nekowatchlet/original-resources/mati2.png b/nekowatchlet/original-resources/mati2.png new file mode 100644 index 0000000..e2e079e Binary files /dev/null and b/nekowatchlet/original-resources/mati2.png differ diff --git a/nekowatchlet/original-resources/mati3.png b/nekowatchlet/original-resources/mati3.png new file mode 100644 index 0000000..10146b3 Binary files /dev/null and b/nekowatchlet/original-resources/mati3.png differ diff --git a/nekowatchlet/original-resources/right1.png b/nekowatchlet/original-resources/right1.png new file mode 100644 index 0000000..6e12852 Binary files /dev/null and b/nekowatchlet/original-resources/right1.png differ diff --git a/nekowatchlet/original-resources/right2.png b/nekowatchlet/original-resources/right2.png new file mode 100644 index 0000000..da40e74 Binary files /dev/null and b/nekowatchlet/original-resources/right2.png differ diff --git a/nekowatchlet/original-resources/rtogi1.png b/nekowatchlet/original-resources/rtogi1.png new file mode 100644 index 0000000..0bdf57d Binary files /dev/null and b/nekowatchlet/original-resources/rtogi1.png differ diff --git a/nekowatchlet/original-resources/rtogi2.png b/nekowatchlet/original-resources/rtogi2.png new file mode 100644 index 0000000..728ecde Binary files /dev/null and b/nekowatchlet/original-resources/rtogi2.png differ diff --git a/nekowatchlet/original-resources/sleep1.png b/nekowatchlet/original-resources/sleep1.png new file mode 100644 index 0000000..f108b22 Binary files /dev/null and b/nekowatchlet/original-resources/sleep1.png differ diff --git a/nekowatchlet/original-resources/sleep2.png b/nekowatchlet/original-resources/sleep2.png new file mode 100644 index 0000000..08d9a2f Binary files /dev/null and b/nekowatchlet/original-resources/sleep2.png differ diff --git a/nekowatchlet/original-resources/up1.png b/nekowatchlet/original-resources/up1.png new file mode 100644 index 0000000..ca4bb36 Binary files /dev/null and b/nekowatchlet/original-resources/up1.png differ diff --git a/nekowatchlet/original-resources/up2.png b/nekowatchlet/original-resources/up2.png new file mode 100644 index 0000000..0a5adf9 Binary files /dev/null and b/nekowatchlet/original-resources/up2.png differ diff --git a/nekowatchlet/original-resources/upleft1.png b/nekowatchlet/original-resources/upleft1.png new file mode 100644 index 0000000..4ae9d60 Binary files /dev/null and b/nekowatchlet/original-resources/upleft1.png differ diff --git a/nekowatchlet/original-resources/upleft2.png b/nekowatchlet/original-resources/upleft2.png new file mode 100644 index 0000000..673c7e2 Binary files /dev/null and b/nekowatchlet/original-resources/upleft2.png differ diff --git a/nekowatchlet/original-resources/upright1.png b/nekowatchlet/original-resources/upright1.png new file mode 100644 index 0000000..911201c Binary files /dev/null and b/nekowatchlet/original-resources/upright1.png differ diff --git a/nekowatchlet/original-resources/upright2.png b/nekowatchlet/original-resources/upright2.png new file mode 100644 index 0000000..d95e06e Binary files /dev/null and b/nekowatchlet/original-resources/upright2.png differ diff --git a/nekowatchlet/original-resources/utogi1.png b/nekowatchlet/original-resources/utogi1.png new file mode 100644 index 0000000..791d85b Binary files /dev/null and b/nekowatchlet/original-resources/utogi1.png differ diff --git a/nekowatchlet/original-resources/utogi2.png b/nekowatchlet/original-resources/utogi2.png new file mode 100644 index 0000000..1a5dcd1 Binary files /dev/null and b/nekowatchlet/original-resources/utogi2.png differ diff --git a/nekowatchlet/res/makeatlas.sh b/nekowatchlet/res/makeatlas.sh new file mode 100644 index 0000000..60449ae --- /dev/null +++ b/nekowatchlet/res/makeatlas.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e + +allfiles=$(echo *.png | sort) +atlasfiles="" +stems="" + +for i in $allfiles +do + echo $i + if [[ $i =~ ^([a-z]+)[1-9].png ]] + then + stem=${BASH_REMATCH[1]} + output=$stem.png.tmp + if [[ $atlasfiles != *$output* ]] + then + montage $stem?.png -geometry 32x32 $output + atlasfiles="$atlasfiles $output" + stems="$stems $stem" + fi + fi +done + +montage $atlasfiles -geometry 64x32+0+0 -gravity NorthWest -tile 1x atlas.png + +rm -f $atlasfiles + +echo $stems | tr ' ' '\n' > atlas.txt + +exit 0 + -- cgit v1.2.3