aboutsummaryrefslogtreecommitdiff
path: root/host/main.c
diff options
context:
space:
mode:
authorjaseg <jaseg@jaseg.net>2014-03-04 22:49:48 +0100
committerjaseg <jaseg@jaseg.net>2014-03-04 22:49:48 +0100
commit8f86c5ac4576b36aff906b91e194e68eb343c536 (patch)
tree228749e6d71fd247a61c16c5bbad0c2c86a2ef0d /host/main.c
parentc4dd54e16fcc31c43c2ccccbb34eea07b9de735c (diff)
parent7878aa1d455ab24d0336fc68eb09f726bcba10b2 (diff)
downloadmatelight-8f86c5ac4576b36aff906b91e194e68eb343c536.tar.gz
matelight-8f86c5ac4576b36aff906b91e194e68eb343c536.tar.bz2
matelight-8f86c5ac4576b36aff906b91e194e68eb343c536.zip
Merge branch 'master' of matelight:matelight
Diffstat (limited to 'host/main.c')
-rw-r--r--host/main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/host/main.c b/host/main.c
index 9648a26..d8cb371 100644
--- a/host/main.c
+++ b/host/main.c
@@ -3,7 +3,6 @@
#include "main.h"
#include "color.h"
#include "font.h"
-#include "net.h"
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
@@ -65,7 +64,7 @@ framebuffer_t *framebuffer_render_text(char *s, glyphtable_t *glyph_table){
p += inc;
if(c > glyph_table->size){
- fprintf(stderr, "Error rendering string: Codepoint 0x%lx out of valid range (0-%ld).\n", (long int)c, glyph_table->size);
+ fprintf(stderr, "Error rendering string: Codepoint 0x%lx out of valid range (0-%zd).\n", (long int)c, glyph_table->size);
goto error;
}
@@ -87,7 +86,7 @@ framebuffer_t *framebuffer_render_text(char *s, glyphtable_t *glyph_table){
size_t gbufsize = gbufwidth*gbufheight;
gbuf = calloc(gbufsize, sizeof(color_t));
if(!gbuf){
- fprintf(stderr, "Cannot malloc() %lu bytes.\n", gbufsize*sizeof(color_t));
+ fprintf(stderr, "Cannot malloc() %zu bytes.\n", gbufsize*sizeof(color_t));
goto error;
}
memset(gbuf, 0, gbufsize*sizeof(color_t));
@@ -296,7 +295,7 @@ framebuffer_t *framebuffer_render_text(char *s, glyphtable_t *glyph_table){
}
framebuffer_t *fb = malloc(sizeof(framebuffer_t));
if(!fb){
- fprintf(stderr, "Cannot malloc() %lu bytes.\n", sizeof(framebuffer_t));
+ fprintf(stderr, "Cannot malloc() %zu bytes.\n", sizeof(framebuffer_t));
goto error;
}
fb->w = gbufwidth;
@@ -311,7 +310,7 @@ error:
void console_render_buffer(color_t *data, size_t w, size_t h){
/* Render framebuffer to terminal, two pixels per character using Unicode box drawing stuff */
color_t lastfg = {0, 0, 0}, lastbg = {0, 0, 0};
- printf("\e[38;5;0;48;5;0m");
+ printf("\e[38;5;0;48;5;0m\e[K");
for(size_t y=0; y < h; y+=2){
for(size_t x=0; x < w; x++){
/* Da magicks: ▀█▄ */
@@ -350,7 +349,7 @@ void console_render_buffer(color_t *data, size_t w, size_t h){
}
}
}
- printf("\n");
+ printf("\n\e[K");
}
printf("\033[0m");
}