rayzor
annotate src/m3drast.c @ 8:fcd06a15dfdd
added missing set_mouse_limits to dosemu.c
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 07 Apr 2014 08:46:06 +0300 |
parents | 9035507275d6 |
children | 70e332156d02 |
rev | line source |
---|---|
nuclear@3 | 1 #include "m3dimpl.h" |
nuclear@3 | 2 |
nuclear@3 | 3 |
nuclear@3 | 4 void draw_point(struct min3d_vertex *v) |
nuclear@3 | 5 { |
nuclear@5 | 6 int x = v->pos[0] + 0.5; |
nuclear@5 | 7 int y = v->pos[1] + 0.5; |
nuclear@5 | 8 int xsz = m3dctx->cbuf->xsz; |
nuclear@5 | 9 unsigned char *ptr = m3dctx->cbuf->pixels + (y * xsz + x) * 3; |
nuclear@5 | 10 |
nuclear@5 | 11 int r = (int)(v->color[0] * 255.0); |
nuclear@5 | 12 int g = (int)(v->color[1] * 255.0); |
nuclear@5 | 13 int b = (int)(v->color[2] * 255.0); |
nuclear@5 | 14 ptr[0] = r > 255 ? 255 : r; |
nuclear@5 | 15 ptr[1] = g > 255 ? 255 : g; |
nuclear@5 | 16 ptr[2] = b > 255 ? 255 : b; |
nuclear@3 | 17 } |
nuclear@3 | 18 |
nuclear@3 | 19 void draw_line(struct min3d_vertex *v) |
nuclear@3 | 20 { |
nuclear@3 | 21 } |
nuclear@3 | 22 |
nuclear@3 | 23 void draw_poly(struct min3d_vertex *v, int numv) |
nuclear@3 | 24 { |
nuclear@3 | 25 } |