diff options
author | Erich Eckner <git@eckner.net> | 2018-10-27 18:15:43 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-10-27 18:15:43 +0200 |
commit | 34926e7122cff74d0eef01a908a4488897b5e7c1 (patch) | |
tree | 1e3637c7a703ddbec2fdde51baeda6b57e593dc6 | |
parent | 3dc6603ce56951f3868cdffeb9bb99cb8db2e4bf (diff) | |
download | anzeige-34926e7122cff74d0eef01a908a4488897b5e7c1.tar.xz |
Text weich einscrollen lassen
-rw-r--r-- | anzeige.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -95,13 +95,17 @@ int main(int argc, char **argv) scroll_buffers[0].scroll_len = render(text_buffer, TEXT_BUFFER_LENGTH, scroll_buffers[0].buf, sizeof(scroll_buffers[0].buf), 1); - i=0; + i=-40; while (display_data.keep_running) { usleep(100000); for (j=0; j<40; j++) - display_data.buf[(display_data.should_buf+1)%3][j] = scroll_buffers[0].buf[(i+j) % scroll_buffers[0].scroll_len]; + if (i+j<0) + display_data.buf[(display_data.should_buf+1)%3][j] = 0; + else + display_data.buf[(display_data.should_buf+1)%3][j] = scroll_buffers[0].buf[(i+j) % scroll_buffers[0].scroll_len]; display_data.should_buf = (display_data.should_buf+1)%3; i++; + i = i % scroll_buffers[0].scroll_len; } free(text_buffer); |