Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5928903
Keep master matching strategy, add packed sparse v6 with v5 compatibi…
mkalkbrenner Mar 13, 2026
01a6a5a
adjsuted AGENTS.md
mkalkbrenner Mar 13, 2026
ced9885
fixed build
mkalkbrenner Mar 13, 2026
40709d2
adaptive bitpacking
mkalkbrenner Mar 13, 2026
b229c3f
diabled bitpacking on shadows
mkalkbrenner Mar 13, 2026
87e3e08
fixed checks
mkalkbrenner Mar 15, 2026
3e36d2f
removed fallbacks
mkalkbrenner Mar 15, 2026
399d795
ficed checks
mkalkbrenner Mar 15, 2026
e233b69
added profiling
mkalkbrenner Mar 15, 2026
226534e
scene triplet keys
mkalkbrenner Mar 15, 2026
e2d38c7
removed obsolete code
mkalkbrenner Mar 15, 2026
39ef6b6
color rataion lookups and scene fix
mkalkbrenner Mar 15, 2026
305c589
more efficient shadows, LRU cache for sparse vector
mkalkbrenner Mar 15, 2026
7733963
new sprite matching
mkalkbrenner Mar 15, 2026
cc3d326
fixed sprite shape mode
mkalkbrenner Mar 16, 2026
600163b
Merge branch 'master' into bitpacking
mkalkbrenner Mar 16, 2026
139444c
added basic lookahead support
mkalkbrenner Mar 16, 2026
9a31cf8
GetRuntimeMetadata
mkalkbrenner Mar 17, 2026
f0a4a66
debug tracing
mkalkbrenner Mar 17, 2026
fbd0b32
more debug
mkalkbrenner Mar 17, 2026
3b7c0cb
more logging
mkalkbrenner Mar 18, 2026
f41ab7f
in depth sprite debugging
mkalkbrenner Mar 18, 2026
ac406a9
scene debugging
mkalkbrenner Mar 18, 2026
049efc4
AFM sprite 43 fix
mkalkbrenner Mar 19, 2026
e502753
profiling
mkalkbrenner Mar 19, 2026
df96311
avoid memory peak on loading
mkalkbrenner Mar 19, 2026
f2a58fc
removed lookahead support
mkalkbrenner Mar 19, 2026
b5dbbab
added peak memory usage
mkalkbrenner Mar 19, 2026
1d7eef9
removed SERUM_DISABLE_DYNAMIC_PACKED_READS
mkalkbrenner Mar 19, 2026
dd0d09a
storage
mkalkbrenner Mar 19, 2026
98f918d
fixed v5 sprites
mkalkbrenner Mar 19, 2026
7bd6d9d
Merge remote-tracking branch 'origin/master' into bitpacking
mkalkbrenner Mar 19, 2026
74374d9
fixed platform independent LUT
mkalkbrenner Mar 19, 2026
8ae1d06
scene test
mkalkbrenner Mar 19, 2026
5142747
next test
mkalkbrenner Mar 19, 2026
1f1db6c
next try
mkalkbrenner Mar 19, 2026
16cbcee
fixed scene rotation timing
mkalkbrenner Mar 19, 2026
96e2d34
critical path
mkalkbrenner Mar 20, 2026
88b9c09
more profiling
mkalkbrenner Mar 20, 2026
12ee881
more profiling
mkalkbrenner Mar 20, 2026
22d1587
better profiling
mkalkbrenner Mar 20, 2026
6809238
log guards
mkalkbrenner Mar 20, 2026
b7fedeb
full dynamic fix
mkalkbrenner Mar 20, 2026
e6b6da6
changed constructor noData for legacy source dynamic value vectors fr…
mkalkbrenner Mar 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
450 changes: 450 additions & 0 deletions AGENTS.md

Large diffs are not rendered by default.

72 changes: 56 additions & 16 deletions src/SceneGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,58 @@ bool SceneGenerator::getSceneInfo(uint16_t sceneId, uint16_t &frameCount,
return true;
}

bool SceneGenerator::getCurrentGroup(uint16_t sceneId, uint8_t &group) const {
auto it = std::find_if(
m_sceneData.begin(), m_sceneData.end(),
[sceneId](const SceneData &data) { return data.sceneId == sceneId; });
if (it == m_sceneData.end()) {
group = 1;
return false;
}
group = it->currentGroup > 0 ? it->currentGroup : 1;
return true;
}

bool SceneGenerator::updateAndGetCurrentGroup(uint16_t sceneId,
uint16_t frameIndex,
int requestedGroup,
uint8_t &group) {
auto it = std::find_if(
m_sceneData.begin(), m_sceneData.end(),
[sceneId](const SceneData &data) { return data.sceneId == sceneId; });
if (it == m_sceneData.end()) {
group = 1;
return false;
}

if (frameIndex >= it->frameCount) {
group = 1;
return false;
}

if (frameIndex == 0) {
if (requestedGroup == -1) {
if (it->frameGroups > 1) {
if (it->random) {
it->currentGroup = rand() % it->frameGroups + 1;
} else {
it->currentGroup++;
if (it->currentGroup > it->frameGroups) it->currentGroup = 1;
}
} else {
it->currentGroup = 1;
}
} else {
it->currentGroup = (uint8_t)requestedGroup;
}
} else if (it->currentGroup == 0) {
it->currentGroup = 1;
}

group = it->currentGroup > 0 ? it->currentGroup : 1;
return true;
}

bool SceneGenerator::getSceneEndHoldDurationMs(uint16_t sceneId,
uint32_t &durationMs) const {
auto holdIt = m_sceneEndHoldDurationMs.find(sceneId);
Expand Down Expand Up @@ -269,21 +321,9 @@ uint16_t SceneGenerator::generateFrame(uint16_t sceneId, uint16_t frameIndex,
}
lastTime = now;

if (frameIndex == 0) {
if (group == -1) {
if (it->frameGroups > 1) {
if (it->random) {
it->currentGroup = rand() % it->frameGroups + 1;
} else {
it->currentGroup++;
if (it->currentGroup > it->frameGroups) it->currentGroup = 1;
}
} else {
it->currentGroup = 1;
}
} else {
it->currentGroup = (uint8_t)group;
}
uint8_t currentGroup = 1;
if (!updateAndGetCurrentGroup(sceneId, frameIndex, group, currentGroup)) {
return 0;
}

// Copy pre-rendered template
Expand All @@ -293,7 +333,7 @@ uint16_t SceneGenerator::generateFrame(uint16_t sceneId, uint16_t frameIndex,
std::string sceneIdStr = formatNumber(sceneId, NUMBER_WIDTH);
renderString(buffer, sceneIdStr, NUM_X, SCENE_Y);

std::string groupStr = formatNumber(it->currentGroup, NUMBER_WIDTH);
std::string groupStr = formatNumber(currentGroup, NUMBER_WIDTH);
renderString(buffer, groupStr, NUM_X, GROUP_Y);

std::string frameStr = formatNumber(frameIndex + 1, NUMBER_WIDTH);
Expand Down
3 changes: 3 additions & 0 deletions src/SceneGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class SceneGenerator {
uint16_t &durationPerFrame, bool &interruptable,
bool &startImmediately, uint8_t &repeat,
uint8_t &sceneOptions) const;
bool updateAndGetCurrentGroup(uint16_t sceneId, uint16_t frameIndex,
int requestedGroup, uint8_t &group);
bool getCurrentGroup(uint16_t sceneId, uint8_t &group) const;
bool getSceneEndHoldDurationMs(uint16_t sceneId, uint32_t &durationMs) const;
bool getAutoStartSceneInfo(uint16_t &frameCount, uint16_t &durationPerFrame,
bool &interruptable, bool &startImmediately,
Expand Down
Loading
Loading