Rev 1649 | Rev 1672 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1649 | Rev 1668 | ||
|---|---|---|---|
| Line 221... | Line 221... | ||
| 221 | int dy = viewports[vp].y + y; |
221 | int dy = viewports[vp].y + y; |
| 222 | 222 | ||
| 223 | return (*screen.scr2rgb)(&screen.fbaddress[POINTPOS(dx,dy)]); |
223 | return (*screen.scr2rgb)(&screen.fbaddress[POINTPOS(dx,dy)]); |
| 224 | } |
224 | } |
| 225 | 225 | ||
| 226 | /** Fill line with color BGCOLOR */ |
- | |
| 227 | static void clear_line(int vp, unsigned int y) |
226 | static inline void putpixel_mem(char *mem, unsigned int x, unsigned int y, |
| - | 227 | int color) |
|
| 228 | { |
228 | { |
| 229 | unsigned int x; |
- | |
| 230 | for (x = 0; x < viewports[vp].width; x++) |
- | |
| 231 | putpixel(vp, x, y, viewports[vp].style.bg_color); |
229 | (*screen.rgb2scr)(&mem[POINTPOS(x,y)],color); |
| 232 | } |
230 | } |
| 233 | 231 | ||
| 234 | static void draw_rectangle(int vp, unsigned int sx, unsigned int sy, |
232 | static void draw_rectangle(int vp, unsigned int sx, unsigned int sy, |
| 235 | unsigned int width, unsigned int height, |
233 | unsigned int width, unsigned int height, |
| 236 | int color) |
234 | int color) |
| 237 | { |
235 | { |
| 238 | unsigned int x, y; |
236 | unsigned int x, y; |
| - | 237 | static void *tmpline; |
|
| - | 238 | ||
| - | 239 | if (!tmpline) |
|
| - | 240 | tmpline = malloc(screen.scanline*screen.pixelbytes); |
|
| 239 | 241 | ||
| 240 | /* Clear first line */ |
242 | /* Clear first line */ |
| 241 | for (x = 0; x < width; x++) |
243 | for (x = 0; x < width; x++) |
| 242 | putpixel(vp, sx + x, sy, color); |
244 | putpixel_mem(tmpline, x, 0, color); |
| 243 | 245 | ||
| 244 | /* Recompute to screen coords */ |
246 | /* Recompute to screen coords */ |
| 245 | sx += viewports[vp].x; |
247 | sx += viewports[vp].x; |
| 246 | sy += viewports[vp].y; |
248 | sy += viewports[vp].y; |
| 247 | /* Copy the rest */ |
249 | /* Copy the rest */ |
| 248 | for (y = sy+1;y < sy+height; y++) |
250 | for (y = sy;y < sy+height; y++) |
| 249 | memcpy(&screen.fbaddress[POINTPOS(sx,y)], |
251 | memcpy(&screen.fbaddress[POINTPOS(sx,y)], tmpline, |
| 250 | &screen.fbaddress[POINTPOS(sx,sy)], |
- | |
| 251 | screen.pixelbytes * width); |
252 | screen.pixelbytes * width); |
| 252 | 253 | ||
| 253 | } |
254 | } |
| 254 | 255 | ||
| 255 | /** Fill viewport with background color */ |
256 | /** Fill viewport with background color */ |