shut up Warning about Pixel_figure_no_screen()

Also fix drawing at X=0 or Y=0
This commit is contained in:
Thomas Bernard 2019-02-15 15:22:35 +01:00
parent 758807e746
commit fc3e424922
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -210,9 +210,9 @@ void Update_colors_during_script(void)
} }
/// Paint a pixel in image without updating the screen /// Paint a pixel in image without updating the screen
void Pixel_figure_no_screen(short x_pos,short y_pos,byte color) static void Pixel_figure_no_screen(word x_pos, word y_pos, byte color)
{ {
if (x_pos>0 && y_pos >0 && x_pos<Main.image_width && y_pos<Main.image_height) if (x_pos < Main.image_width && y_pos < Main.image_height)
Pixel_in_current_screen(x_pos, y_pos, color); Pixel_in_current_screen(x_pos, y_pos, color);
} }
@ -526,7 +526,7 @@ int L_DrawLine(lua_State* L)
LUA_ARG_NUMBER(4, "drawline", y2, INT_MIN, INT_MAX); LUA_ARG_NUMBER(4, "drawline", y2, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(5, "drawline", c, INT_MIN, INT_MAX); LUA_ARG_NUMBER(5, "drawline", c, INT_MIN, INT_MAX);
Set_Pixel_figure((void (*) (word,word,byte))Pixel_figure_no_screen); Set_Pixel_figure(Pixel_figure_no_screen);
Draw_line_general(x1, y1, x2, y2, c); Draw_line_general(x1, y1, x2, y2, c);
return 0; return 0;
@ -600,7 +600,7 @@ int L_DrawCircle(lua_State* L)
LUA_ARG_NUMBER(3, "drawcircle", r, INT_MIN, INT_MAX); LUA_ARG_NUMBER(3, "drawcircle", r, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(4, "drawcircle", c, INT_MIN, INT_MAX); LUA_ARG_NUMBER(4, "drawcircle", c, INT_MIN, INT_MAX);
Set_Pixel_figure((void (*) (word,word,byte))Pixel_figure_no_screen); Set_Pixel_figure(Pixel_figure_no_screen);
Draw_empty_circle_general(x1, y1, r*r, c); Draw_empty_circle_general(x1, y1, r*r, c);
return 0; return 0;