Compare commits

..

No commits in common. "3ade0894d8ca70aa5612d8eecae86b86e9f30952" and "191a5ebccf3476b59f86da1890d444741449d449" have entirely different histories.

2 changed files with 9 additions and 22 deletions

View file

@ -4,7 +4,7 @@
#if GINT_RENDER_RGB
/* gint_dhline(): Optimized horizontal line */
void gint_dhline(int x1, int x2, int y, int color)
void gint_dhline(int x1, int x2, int y, uint16_t color)
{
if(y < dwindow.top || y >= dwindow.bottom) return;
if(x1 > x2) swap(x1, x2);
@ -16,13 +16,8 @@ void gint_dhline(int x1, int x2, int y, int color)
/* Use longwords to do the copy, but first paint the endpoints to heed
for odd x1 and x2. Checking the parity may be a waste of time. */
if (color != C_INVERT) {
gint_vram[offset + x1] = color;
gint_vram[offset + x2] = color;
} else {
gint_vram[offset + x1] ^= 0xffff;
gint_vram[offset + x2] ^= 0xffff;
}
/* Now round to longword boundaries and copy everything in-between with
longwords */
@ -31,17 +26,13 @@ void gint_dhline(int x1, int x2, int y, int color)
uint32_t *start = (void *)(gint_vram + offset + x1);
uint32_t *end = (void *)(gint_vram + offset + x2);
if (color != C_INVERT) {
uint32_t op = (color << 16) | color;
while(end > start) *--end = op;
} else {
while(end > start) *--end ^= 0xffffffff;
}
}
/* gint_dvline(): Optimized vertical line */
void gint_dvline(int y1, int y2, int x, int color)
void gint_dvline(int y1, int y2, int x, uint16_t color)
{
if(x < dwindow.left || x >= dwindow.right) return;
if(y1 > y2) swap(y1, y2);
@ -51,11 +42,7 @@ void gint_dvline(int y1, int y2, int x, int color)
uint16_t *v = gint_vram + DWIDTH * y1 + x;
int height = y2 - y1 + 1;
if (color != C_INVERT) {
while(height-- > 0) *v = color, v += DWIDTH;
} else {
while(height-- > 0) *v ^= 0xffff, v += DWIDTH;
}
}
#endif

View file

@ -11,12 +11,12 @@
/* gint_dhline(): Optimized horizontal line
@x1 @x2 @y Coordinates of endpoints of line (both included)
@color Any color suitable for dline() */
void gint_dhline(int x1, int x2, int y, int color);
void gint_dhline(int x1, int x2, int y, color_t color);
/* gint_dvline(): Optimized vertical line
@y1 @y2 @x Coordinates of endpoints of line (both included)
@color Any color suitable for dline() */
void gint_dvline(int y1, int y2, int x, int color);
void gint_dvline(int y1, int y2, int x, color_t color);
//---
// Font rendering (topti)