mirror of
https://github.com/olikraus/u8g2.git
synced 2026-10-26 22:10:25 +00:00
Merge branch 'master' of https://github.com/olikraus/u8g2
This commit is contained in:
commit
4aa652f143
3 files changed
+15
-4
No files matched your search
+1
-1
@@ -75,7 +75,7 @@ static void u8g2_draw_arc(u8g2_t *u8g2, u8g2_uint_t x0, u8g2_uint_t y0, u8g2_uin
|
||||
d = d - 2 * x - 1;
|
||||
x = x + 1;
|
||||
}
|
||||
else if (d < 2 * (rad - y))
|
||||
else if (d < 2 * ((u8g2_int_t)rad - y))
|
||||
{
|
||||
d = d + 2 * y - 1;
|
||||
y = y - 1;
|
||||
|
||||
@@ -77,6 +77,7 @@ void u8g2_ll_hvline_vertical_top_lsb(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y,
|
||||
uint8_t or_mask, xor_mask;
|
||||
#ifdef __unix
|
||||
uint8_t *max_ptr = u8g2->tile_buf_ptr + u8g2_GetU8x8(u8g2)->display_info->tile_width*u8g2->tile_buf_height*8;
|
||||
(void)max_ptr; /* silence unused variable warning if asserts are disabled */
|
||||
#endif
|
||||
|
||||
//assert(x >= u8g2->buf_x0);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
//#define HEIGHT (64)
|
||||
//#define WIDTH 128
|
||||
@@ -19,7 +20,16 @@ SDL_Window *u8g_sdl_window;
|
||||
SDL_Surface *u8g_sdl_screen;
|
||||
#endif
|
||||
|
||||
#ifdef U8G2_U8G_SDL_MULTIPLE
|
||||
|
||||
int u8g_sdl_multiple = U8G2_U8G_SDL_MULTIPLE;
|
||||
|
||||
#else
|
||||
|
||||
int u8g_sdl_multiple = 3;
|
||||
|
||||
#endif
|
||||
|
||||
uint32_t u8g_sdl_color[256];
|
||||
int u8g_sdl_height, u8g_sdl_width;
|
||||
|
||||
@@ -27,7 +37,7 @@ int u8g_sdl_height, u8g_sdl_width;
|
||||
|
||||
static void u8g_sdl_set_pixel(int x, int y, int idx)
|
||||
{
|
||||
uint32_t *ptr;
|
||||
uint8_t *ptr;
|
||||
uint32_t offset;
|
||||
int i, j;
|
||||
|
||||
@@ -50,8 +60,8 @@ static void u8g_sdl_set_pixel(int x, int y, int idx)
|
||||
|
||||
assert( offset < (Uint32)(u8g_sdl_width * u8g_sdl_multiple * u8g_sdl_height * u8g_sdl_multiple * u8g_sdl_screen->format->BytesPerPixel) );
|
||||
|
||||
ptr = (uint32_t *)(((uint8_t *)(u8g_sdl_screen->pixels)) + offset);
|
||||
*ptr = u8g_sdl_color[idx];
|
||||
ptr = ((uint8_t *)(u8g_sdl_screen->pixels)) + offset;
|
||||
memcpy(ptr, &u8g_sdl_color[idx], sizeof(u8g_sdl_color[idx]));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user