#include "../include/drawstuff.h" #include "../parameters.h" #include #include "../fixed.h" void gint_dhline(int x1, int x2, int y, uint16_t color) { if((uint)y >= 224) return; if(x1 > x2) swap(x1, x2); if(x1 >= 396 || x2 < 0) return; if(x1 < 0) x1 = 0; if(x2 >= 396) x2 = 395; int offset = 396 * y; gint_vram[offset + x1] = color; gint_vram[offset + x2] = color; x1 = x1 + (x1 & 1); x2 = (x2 + 1) & ~1; uint32_t *start = (void *)(gint_vram + offset + x1); uint32_t *end = (void *)(gint_vram + offset + x2); uint32_t op = (color << 16) | color; while(end > start) *--end = op; }; void drawGrass( int y1, int y2, uint8_t R, uint8_t G, uint8_t B, uint8_t A ) { uint16_t color = C_RGB(R,G,B); for (int y=y1; y<=y2; y++) gint_dhline( 0, SCREEN_WIDTH, y, color ); }; void drawPolygon( int x1min, int x1max, int y1, int x2min, int x2max, int y2, uint8_t R, uint8_t G, uint8_t B, uint8_t A ) { /* uint16_t color = C_RGB(R,G,B); float Ddeltay = 1.0f / (float) (y2-y1); float deltay=0.0f; for (int y=y1; y<=y2; y++) { if (y>0 && y0 && y