101 int check_mask, check_color;
103 int xmod, ymod, row, col, cnt, xcnt, ycnt, x1off;
105 float pt[4], xres, yres, ymax, zexag;
106 int col_src, curcolor;
109 G_debug(3,
"gsd_wire_surf_map");
115 check_mask = surf->
curmask ? 1 : 0;
125 xres = xmod * surf->
xres;
126 yres = ymod * surf->
yres;
127 ymax = (surf->
rows - 1) * surf->
yres;
128 xcnt = 1 + (surf->
cols - 1) / xmod;
129 ycnt = 1 + (surf->
rows - 1) / ymod;
164 for (row = 0; row < ycnt; row++) {
165 pt[
Y] = ymax - row * yres;
166 y1off = row * ymod * surf->
cols;
171 for (col = 0; col < xcnt; col++) {
174 offset = x1off + y1off;
196 pt[
Z] = pt[
Z] * zexag;
213 for (col = 0; col < xcnt; col++) {
220 for (row = 0; row < ycnt; row++) {
221 pt[
Y] = ymax - row * yres;
222 y1off = row * ymod * surf->
cols;
223 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_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;
588 int datacol1, datacol2, datacol3;
592 float kem, ksh, pkem, pksh;
595 int step_val = 2 * surf->
x_modw;
596 int start_val = surf->
x_modw;
625 xres = xmod * surf->
xres;
626 yres = ymod * surf->
yres;
627 ymax = (surf->
rows - 1) * surf->
yres;
648 ktrans = (255U << 24);
656 else if (
MAP_ATT == trans_src) {
658 check_transp = trbuff ? 1 : 0;
674 check_emis = embuff ? 1 : 0;
689 check_shin = shbuff ? 1 : 0;
710 check_material = (check_shin || check_emis || (kem && check_color));
714 for (row = start_val; row <= ycnt - start_val; row += step_val) {
722 y1 = ymax - row * yres;
723 y2 = ymax - (row - (step_val / 2)) * yres;
724 y3 = ymax - (row + (step_val / 2)) * yres;
726 y1off = row * ymod * surf->
cols;
727 y2off = (row - (step_val / 2)) * ymod * surf->
cols;
728 y3off = (row + (step_val / 2)) * ymod * surf->
cols;
730 for (col = start_val; col <= xcnt - start_val; col += step_val) {
732 datacol1 = col * xmod;
733 datacol2 = (col - (step_val / 2)) * xmod;
734 datacol3 = (col + (step_val / 2)) * xmod;
737 x2 = (col - (step_val / 2)) * xres;
738 x3 = (col + (step_val / 2)) * xres;
743 offset2[0] = y1off + datacol1;
752 offset2[1] = y2off + datacol2;
753 offset2[2] = y2off + datacol1;
754 offset2[3] = y2off + datacol3;
755 offset2[4] = y1off + datacol3;
756 offset2[5] = y3off + datacol3;
757 offset2[6] = y3off + datacol1;
758 offset2[7] = y3off + datacol2;
759 offset2[8] = y1off + datacol2;
760 offset2[9] = y2off + datacol2;
783 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)(255U - ktrans) << 24;
804 if (check_material) {
815 if (pksh != ksh || pkem != kem || (kem && check_color)) {
int BM_get(struct BM *, int, int)
Gets 'val' from the bitmap.
int G_debug(int, const char *,...) __attribute__((format(printf
void gsd_endtfan(void)
ADD.
void gsd_pushmatrix(void)
Push the current matrix stack.
void gsd_do_scale(int)
Set current scale.
int gs_get_att_src(geosurf *, int)
Get attribute source.
int gs_calc_normals(geosurf *)
Calculate normals.
int gs_mapcolor(typbuff *, gsurf_att *, int)
Call this one when you already know att_src is MAP_ATT.
int gs_update_curmask(geosurf *)
Update current maps.
void gsd_color_func(unsigned int)
Set current color.
void gsd_translate(float, float, float)
Multiply the current matrix by a translation matrix.
void gsd_popmatrix(void)
Pop the current matrix stack.
void gsd_zwritemask(unsigned long)
Write out z-mask.
void gsd_endline(void)
End line.
int gsd_surf_const(geosurf *, float)
Using tmesh - not confident with qstrips portability.
void gsd_colormode(int)
Set color mode.
geosurf * gsdiff_get_SDref(void)
ADD.
void GS_get_scale(float *, float *, float *, int)
Get axis scale.
void gsd_bgntfan(void)
ADD.
void gsd_set_material(int, int, float, float, int)
Set material.
typbuff * gs_get_att_typbuff(geosurf *, int, int)
Get attribute data buffer.
void gsd_bgnline(void)
Begin line.
float gsdiff_do_SD(float, int)
ADD.
void gsd_blend(int)
Specify pixel arithmetic.
void gsd_vert_func(float *)
ADD.
int gsd_arrow(float *, unsigned long, float, float *, float, geosurf *)
ADD.
void gsd_litvert_func(float *, unsigned long, float *)
Set the current normal vector & specify vertex.
float GS_global_exag(void)
Get global z-exag value.
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
int gsd_wire_surf_func(geosurf *gs UNUSED, int(*user_func)(void) UNUSED)
ADD.
int gsd_wire_arrows(geosurf *surf)
ADD.
int gsd_wire_surf(geosurf *surf)
Draw surface wire.
int gsd_coarse_surf_map(geosurf *surf)
Draw coarse surface.
int gsd_wire_surf_const(geosurf *surf, float k)
ADD.
int gsd_wire_surf_map(geosurf *surf)
ADD.
#define SCALE_ATT(att, val, low, high)
#define GET_MAPATT(buff, offset, att)