Skip to content

Commit

Permalink
pqoi variable evaluation bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
profezzorn committed Jun 23, 2024
1 parent 24c2378 commit 2d9aceb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion display/rgb565frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ class PQOILayer : public BufferedFileReader, public LayerControl {
} else if (variable == 'R') {
p = random(100);
}
int N = (label >> 16) - '0' * 10 + (label >> 24) - '0';
int N = (label >> 16) - '0' * 0x101;
N = (N & 0xFF) * 10 + (N >> 8);
PVLOG_VERBOSE << " VAR=" << ((char)variable ) << " = " << p
<< " OP=" << ((char)((label >> 8) & 0xff))
<< " N=" << N
<< " N1=" << ((char)((label >> 16) & 0xff))
<< " N2=" << ((char)((label >> 24) & 0xff))
<< "\n";
switch ((label >> 8) & 0xff) {
case '<': return p < N;
case '>': return p > N;
Expand Down Expand Up @@ -312,6 +319,7 @@ class PQOILayer : public BufferedFileReader, public LayerControl {

// Returns true when done.
bool Apply(OutputBuffer<WIDTH>* output_buffer, uint16_t* &out) {
SCOPED_PROFILER();
TRACE2(RGB565_DATA, "Apply", TELL());
if (!play_) return true;
if (!transparent_) {
Expand Down

0 comments on commit 2d9aceb

Please sign in to comment.