X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_sfd.h;h=0f8e3746d567798e10d847fa4adfb4f3d8e7f645;hb=15beb60ade240af4e00b0d204f7e89a4d35dca36;hp=29244e8c843caf70dfcb3ad73b3e60323b3a6035;hpb=5e22cdfe9f6f83e807ce6456ab538d02104cd01d;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_sfd.h b/world_sfd.h index 29244e8..0f8e374 100644 --- a/world_sfd.h +++ b/world_sfd.h @@ -56,18 +56,20 @@ float sfd_encode_glyph( char c ) static void sfd_encode( struct sfd_instance *display, u32 row, const char *str ) { int end=0; + u32 row_h = display->h-1-row; + for( int i=0; iw; i++ ) { if( end ) { - display->buffer[display->w*row + i] = 0.0f; + display->buffer[display->w*row_h + i] = 0.0f; } else { if( !str[i] ) end = 1; - display->buffer[display->w*row + i] = sfd_encode_glyph( str[i] ); + display->buffer[display->w*row_h + i] = sfd_encode_glyph( str[i] ); } } }