Skip to content

Commit

Permalink
Fix animation playback
Browse files Browse the repository at this point in the history
  • Loading branch information
opsnlops committed Jun 4, 2024
1 parent a721d5a commit a205447
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.25)

project(creature-server
VERSION "2.1.5"
VERSION "2.1.6"
DESCRIPTION "Server for April's Creatures"
HOMEPAGE_URL https://github.com/opsnlops/creature-server
LANGUAGES C CXX)
Expand Down
6 changes: 3 additions & 3 deletions src/server/animation/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ namespace creatures {
thisFrame->channelOffset = creature->channel_offset;

auto frameData = decodeBase64(frame);

for (uint8_t byte: frame) {
thisFrame->data.reserve(frameData.size());

#if DEBUG_ANIMATION_PLAY
trace("byte {}: 0x{:02x}", i++, byte);
debug("Player Frame: {}", vectorToHexString(frameData));
#endif
for (uint8_t byte: frameData) {
thisFrame->data.push_back(byte);
}

Expand Down
16 changes: 4 additions & 12 deletions src/server/eventloop/events/dmx.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@

#include <vector>

#include <sstream>
#include <iostream>

#include "spdlog/spdlog.h"
#include <spdlog/spdlog.h>

#include <E131Server.h>

#include "server/config.h"
#include "server/eventloop/events/types.h"
#include "server/metrics/counters.h"
#include "util/cache.h"
#include "util/helpers.h"

#include "server/namespace-stuffs.h"

Expand All @@ -28,14 +27,7 @@ namespace creatures {
metrics->incrementDMXEventsProcessed();

#if DEBUG_EVENT_DMX

std::ostringstream oss;
for (const auto& value : data) {
oss << static_cast<int>(value) << " ";
}
trace("Frame data: {}", oss.str());

debug(" -------> DMX data sent");
debug("DMX data: Offset: {}, data: {}", channelOffset, vectorToHexString(data));
#endif

}
Expand Down

0 comments on commit a205447

Please sign in to comment.