102 int check_mask, check_color;
104 int xmod, ymod, row, col, cnt, xcnt, ycnt, x1off;
106 float pt[4], xres, yres, ymax, zexag;
107 int col_src, curcolor;
110 G_debug(3,
"gsd_wire_surf_map");
116 check_mask = surf->
curmask ? 1 : 0;
126 xres = xmod * surf->
xres;
127 yres = ymod * surf->
yres;
128 ymax = (surf->
rows - 1) * surf->
yres;
129 xcnt = 1 + (surf->
cols - 1) / xmod;
130 ycnt = 1 + (surf->
rows - 1) / ymod;
165 for (row = 0; row < ycnt; row++) {
166 pt[
Y] = ymax - row * yres;
167 y1off = row * ymod * surf->
cols;
172 for (col = 0; col < xcnt; col++) {
175 offset = x1off + y1off;
197 pt[
Z] = pt[
Z] * zexag;
214 for (col = 0; col < xcnt; col++) {
221 for (row = 0; row < ycnt; row++) {
222 pt[
Y] = ymax - row * yres;
223 y1off = row * ymod * surf->
cols;
224 offset = x1off + y1off;
245 pt[
Z] = pt[
Z] * zexag;
278 int do_diff, check_mask, check_color;
279 int xmod, ymod, row, col, cnt, xcnt, ycnt, x1off;
281 float pt[4], xres, yres, ymax, zexag;
286 G_debug(3,
"gsd_wire_surf_const");
291 check_mask = surf->
curmask ? 1 : 0;
297 xres = xmod * surf->
xres;
298 yres = ymod * surf->
yres;
300 xcnt = 1 + (surf->
cols - 1) / xmod;
301 ycnt = 1 + (surf->
rows - 1) / ymod;
302 ymax = (surf->
rows - 1) * surf->
yres;
338 for (row = 0; row < ycnt; row++) {
339 pt[
Y] = ymax - row * yres;
340 y1off = row * ymod * surf->
cols;
345 for (col = 0; col < xcnt; col++) {
348 offset = x1off + y1off;
382 for (col = 0; col < xcnt; col++) {
389 for (row = 0; row < ycnt; row++) {
390 pt[
Y] = ymax - row * yres;
391 y1off = row * ymod * surf->
cols;
392 offset = x1off + y1off;
460 int check_mask, check_color;
461 int xmod, ymod, row, col, xcnt, ycnt;
463 float tx, ty, tz, sz;
464 float n[3], pt[4], xres, yres, ymax, zexag;
465 int col_src, curcolor;
480 check_mask = surf->
curmask ? 1 : 0;
508 xres = xmod * surf->
xres;
509 yres = ymod * surf->
yres;
510 ymax = (surf->
rows - 1) * surf->
yres;
511 xcnt = 1 + (surf->
cols - 1) / xmod;
512 ycnt = 1 + (surf->
rows - 1) / ymod;
523 for (row = 0; row < ycnt; row++) {
524 pt[
Y] = ymax - row * yres;
525 y1off = row * ymod * surf->
cols;
527 for (col = 0; col < xcnt; col++) {
529 offset = col * xmod + y1off;
545 gsd_arrow(pt, curcolor, xres * 2, n, sz, surf);
574 int check_mask, check_color, check_transp;
575 int check_material, check_emis, check_shin;
576 typbuff *buff, *cobuff, *trbuff, *embuff, *shbuff;
578 int row, col, xcnt, ycnt;
579 long y1off, y2off, y3off;
583 float x1, x2, x3, y1, y2, y3, tx, ty, tz, ttr;
584 float n[3], pt[4], xres, yres, ymax, zexag;
585 int em_src, sh_src, trans_src, col_src, curcolor;
586 gsurf_att *ematt, *shatt, *tratt, *coloratt;
589 int datarow1, datacol1, datarow2, datacol2, datarow3, datacol3;
591 float kem, ksh, pkem, pksh;
594 int step_val = 2 * surf->
x_modw;
595 int start_val = surf->
x_modw;
616 check_mask = surf->
curmask ? 1 : 0;
624 xres = xmod * surf->
xres;
625 yres = ymod * surf->
yres;
626 ymax = (surf->
rows - 1) * surf->
yres;
647 ktrans = (255 << 24);
655 else if (
MAP_ATT == trans_src) {
657 check_transp = trbuff ? 1 : 0;
673 check_emis = embuff ? 1 : 0;
688 check_shin = shbuff ? 1 : 0;
709 check_material = (check_shin || check_emis || (kem && check_color));
713 for (row = start_val; row <= ycnt - start_val; row += step_val) {
715 datarow1 = row * ymod;
716 datarow2 = (row - (step_val / 2)) * ymod;
717 datarow3 = (row + (step_val / 2)) * ymod;
720 y1 = ymax - row * yres;
721 y2 = ymax - (row - (step_val / 2)) * yres;
722 y3 = ymax - (row + (step_val / 2)) * yres;
724 y1off = row * ymod * surf->
cols;
725 y2off = (row - (step_val / 2)) * ymod * surf->
cols;
726 y3off = (row + (step_val / 2)) * ymod * surf->
cols;
728 for (col = start_val; col <= xcnt - start_val; col += step_val) {
730 datacol1 = col * xmod;
731 datacol2 = (col - (step_val / 2)) * xmod;
732 datacol3 = (col + (step_val / 2)) * xmod;
735 x2 = (col - (step_val / 2)) * xres;
736 x3 = (col + (step_val / 2)) * xres;
742 offset2[0] = y1off + datacol1;
751 offset2[1] = y2off + datacol2;
752 offset2[2] = y2off + datacol1;
753 offset2[3] = y2off + datacol3;
754 offset2[4] = y1off + datacol3;
755 offset2[5] = y3off + datacol3;
756 offset2[6] = y3off + datacol1;
757 offset2[7] = y3off + datacol2;
758 offset2[8] = y1off + datacol2;
759 offset2[9] = y2off + datacol2;
782 for (ii = 0; ii < 10; ii++) {
796 curcolor =
gs_mapcolor(cobuff, coloratt, offset2[ii]);
800 ktrans = (char)
SCALE_ATT(tratt, ttr, 0, 255);
801 ktrans = (char)(255 - ktrans) << 24;
805 if (check_material) {
816 if (pksh != ksh || pkem != kem || (kem && check_color)) {
int gs_mapcolor(typbuff *, gsurf_att *, int)
Call this one when you already know att_src is MAP_ATT.
void gsd_endtfan(void)
ADD.
void gsd_blend(int)
Specify pixel arithmetic.
int gsd_wire_surf(geosurf *surf)
Draw surface wire.
int gsd_arrow(float *, unsigned long, float, float *, float, geosurf *)
ADD.
void gsd_popmatrix(void)
Pop the current matrix stack.
int gs_get_att_src(geosurf *, int)
Get attribute source.
void gsd_colormode(int)
Set color mode.
int gsd_wire_surf_const(geosurf *surf, float k)
ADD.
float gsdiff_do_SD(float, int)
ADD.
int gsd_wire_arrows(geosurf *surf)
ADD.
void gsd_color_func(unsigned int)
Set current color.
int gs_update_curmask(geosurf *)
Update current maps.
void gsd_endline(void)
End line.
void gsd_translate(float, float, float)
Multiply the current matrix by a translation matrix.
int gsd_wire_surf_func(geosurf *gs, int(*user_func)())
ADD.
int gsd_coarse_surf_map(geosurf *surf)
Draw coarse surface.
void gsd_bgntfan(void)
ADD.
int BM_get(struct BM *, int, int)
Gets 'val' from the bitmap.
float GS_global_exag(void)
Get global z-exag value.
void gsd_zwritemask(unsigned long)
Write out z-mask.
typbuff * gs_get_att_typbuff(geosurf *, int, int)
Get attribute data buffer.
void gsd_litvert_func(float *, unsigned long, float *)
Set the current normal vector & specify vertex.
geosurf * gsdiff_get_SDref(void)
ADD.
void gsd_pushmatrix(void)
Push the current matrix stack.
void GS_get_scale(float *, float *, float *, int)
Get axis scale.
#define SCALE_ATT(att, val, low, high)
void gsd_set_material(int, int, float, float, int)
Set material.
void gsd_do_scale(int)
Set current scale.
int G_debug(int, const char *,...) __attribute__((format(printf
void gsd_bgnline(void)
Begin line.
int gsd_surf_const(geosurf *, float)
Using tmesh - not confident with qstrips portability.
int gs_calc_normals(geosurf *)
Calculate normals.
int gsd_wire_surf_map(geosurf *surf)
ADD.
#define GET_MAPATT(buff, offset, att)
void gsd_vert_func(float *)
ADD.