Skip to content

Commit 37ad4b1

Browse files
committed
fix tile to be pointer instead of reference
1 parent 09b7d93 commit 37ad4b1

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

libraries/pico_graphics/pico_graphics_pen_rgb565.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ namespace pimoroni {
4444
buf[p.y * bounds.w + p.x] = blended;
4545
};
4646

47-
bool PicoGraphics_PenRGB565::render_pico_vector_tile(const pp_tile_t &tile) {
47+
bool PicoGraphics_PenRGB565::render_pico_vector_tile(const pp_tile_t *tile) {
4848
// fix pico vector clipping here
4949

50-
for(int y = tile.y; y < tile.y + tile.h; y++) {
51-
uint8_t *palpha = &tile.data[((y - tile.y) * tile.stride)];
52-
uint16_t *pdest = &((uint16_t *)frame_buffer)[tile.x + (tile.y * bounds.w)];
53-
for(int x = tile.x; x < tile.x + tile.w; x++) {
50+
for(int y = tile->y; y < tile->y + tile->h; y++) {
51+
uint8_t *palpha = &tile.data[((y - tile->y) * tile.stride)];
52+
uint16_t *pdest = &((uint16_t *)frame_buffer)[tile->x + (tile->y * bounds.w)];
53+
for(int x = tile->x; x < tile->x + tile->w; x++) {
5454
uint16_t dest = *pdest;
5555
uint8_t alpha = *palpha >> 3;
5656

libraries/pico_vector/pretty-poly.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -353,26 +353,26 @@ void add_line_segment_to_nodes(const pp_point_t start, const pp_point_t end) {
353353
x += xinc * xjump;
354354
}
355355

356-
#ifdef USE_RP2040_INTERP
357-
interp1->base[1] = full_tile_width;
358-
interp1->accum[0] = x;
359-
360-
// loop over scanlines
361-
while(count--) {
362-
// consume accumulated error
363-
while(e > dy) {e -= dy; interp1->add_raw[0] = xinc;}
364-
365-
// clamp node x value to tile bounds
366-
const int nx = interp1->peek[0];
367-
debug(" + adding node at %d, %d\n", x, y);
368-
// add node to node list
369-
nodes[y][node_counts[y]++] = nx;
370-
371-
// step to next scanline and accumulate error
372-
y++;
373-
e += einc;
374-
}
375-
#else
356+
// #ifdef USE_RP2040_INTERP
357+
// interp1->base[1] = full_tile_width;
358+
// interp1->accum[0] = x;
359+
360+
// // loop over scanlines
361+
// while(count--) {
362+
// // consume accumulated error
363+
// while(e > dy) {e -= dy; interp1->add_raw[0] = xinc;}
364+
365+
// // clamp node x value to tile bounds
366+
// const int nx = interp1->peek[0];
367+
// debug(" + adding node at %d, %d\n", x, y);
368+
// // add node to node list
369+
// nodes[y][node_counts[y]++] = nx;
370+
371+
// // step to next scanline and accumulate error
372+
// y++;
373+
// e += einc;
374+
// }
375+
// #else
376376
// loop over scanlines
377377
while(count--) {
378378
// consume accumulated error
@@ -388,7 +388,7 @@ void add_line_segment_to_nodes(const pp_point_t start, const pp_point_t end) {
388388
y++;
389389
e += einc;
390390
}
391-
#endif
391+
//#endif
392392
}
393393

394394
void build_nodes(pp_path_t *contour, pp_rect_t *bounds) {
@@ -427,7 +427,7 @@ pp_rect_t render_nodes(pp_rect_t *tb) {
427427

428428
debug(" + render tile %d, %d - %d, %d\n", tb->x, tb->y, tb->w, tb->h);
429429

430-
for(uint32_t y = 0; y < (PP_TILE_BUFFER_SIZE << _pp_antialias); y++) {
430+
for(uint32_t y = 0; y < ((uint32_t)PP_TILE_BUFFER_SIZE << _pp_antialias); y++) {
431431

432432
// debug(" : row %d node count %d\n", y, node_counts[y]);
433433

0 commit comments

Comments
 (0)