gint/src/gray/gint_gline.c
Lephe 94fb300e72
gray: finalize the gray engine API
* Define dgray() to replace gray_start() and gray_stop()
* Introduce a mechanism to override the d*() functions rather than using
  another set of functions, namely g*(). Gray rendering should now be
  done with d*() (a compatibility macro for g*() is available until v2.1).
* Gray engine now reserves TMU0 at the start of the add-in to prevent
  surprises if timers are exhausted, so it nevers fails to start
* Replace other gray engine functions with dgray_*()
* More general rendering functions (in render/) to lessen the burden of
  porting them to the gray engine. As a consequence, dtext_opt(),
  dprint_opt() and drect_border() are now available in the gray engine,
  which was an omission from 230b796.
* Allow C_NONE in more functions, mainly on fx-CG 50
* Remove the now-unused dupdate_noint()
2020-07-13 13:49:07 +02:00

17 lines
474 B
C

#include <gint/display.h>
#include <gint/defs/util.h>
/* gint_ghline(): Optimized horizontal line, but not actually optimized */
void gint_ghline(int x1, int x2, int y, int color)
{
if(x1 > x2) swap(x1, x2);
for(int x = x1; x <= x2; x++) dpixel(x, y, color);
}
/* gint_gvline(): Optimized horizontal line, but not actually optimized */
void gint_gvline(int y1, int y2, int x, int color)
{
if(y1 > y2) swap(y1, y2);
for(int y = y1; y <= y2; y++) dpixel(x, y, color);
}