11 |
|
#include <GL/glx.h> |
12 |
|
#include <GL/glu.h> |
13 |
|
|
14 |
+ |
#include "platform.h" |
15 |
|
#include "rhd_qtree.h" |
16 |
|
#include "rhdriver.h" |
17 |
|
#include "rhdisp.h" |
61 |
|
|
62 |
|
struct driver odev; /* global device driver structure */ |
63 |
|
|
64 |
+ |
TMstruct *tmGlobal; /* global tone-mapping structure */ |
65 |
+ |
|
66 |
|
char odev_args[64]; /* command arguments */ |
67 |
|
|
68 |
|
static XEvent currentevent; /* current event */ |
144 |
|
&myprims[BLU][CIEX],&myprims[BLU][CIEY], |
145 |
|
&myprims[WHT][CIEX],&myprims[WHT][CIEY]) >= 6) |
146 |
|
dpri = myprims; |
147 |
< |
if (tmInit(mytmflags(), dpri, gamval) == NULL) |
147 |
> |
tmGlobal = tmInit(mytmflags(), dpri, gamval); |
148 |
> |
if (tmGlobal == NULL) |
149 |
|
error(SYSTEM, "not enough memory in dev_open"); |
150 |
|
/* open window */ |
151 |
|
ourwinattr.background_pixel = ourblack; |
214 |
|
XCloseDisplay(ourdisplay); |
215 |
|
ourdisplay = NULL; |
216 |
|
qtFreeLeaves(); |
217 |
< |
tmDone(NULL); |
217 |
> |
tmDone(tmGlobal); |
218 |
|
freecones(); |
219 |
|
odev.v.type = 0; |
220 |
|
odev.hres = odev.vres = 0; |
286 |
|
|
287 |
|
extern void |
288 |
|
dev_section( /* add octree for geometry rendering */ |
289 |
< |
char *ofn |
289 |
> |
char *gfn, |
290 |
> |
char *pfn |
291 |
|
) |
292 |
|
{ |
293 |
|
/* unimplemented */ |
344 |
|
|
345 |
|
extern void |
346 |
|
dev_cone( /* render a cone in view coordinates */ |
347 |
< |
BYTE rgb[3], |
347 |
> |
uby8 rgb[3], |
348 |
|
FVECT ip, |
349 |
|
double rad |
350 |
|
) |
465 |
|
getkey(levptr(XKeyPressedEvent)); |
466 |
|
break; |
467 |
|
case ButtonPress: |
468 |
< |
getmove(levptr(XButtonPressedEvent)); |
468 |
> |
switch (levptr(XButtonPressedEvent)->button) { |
469 |
> |
case Button4: /* wheel up */ |
470 |
> |
case Button5: /* wheel down */ |
471 |
> |
break; |
472 |
> |
default: |
473 |
> |
getmove(levptr(XButtonPressedEvent)); |
474 |
> |
break; |
475 |
> |
} |
476 |
|
break; |
477 |
|
} |
478 |
|
} |
491 |
|
static void |
492 |
|
draw_grids(void) /* draw holodeck section grids */ |
493 |
|
{ |
494 |
< |
static BYTE gridrgba[4] = {0x0, 0xff, 0xff, 0x00}; |
494 |
> |
static uby8 gridrgba[4] = {0x0, 0xff, 0xff, 0x00}; |
495 |
|
double xmin, xmax, ymin, ymax, zmin, zmax; |
496 |
|
double d; |
497 |
|
/* can we even do it? */ |
563 |
|
VSUM(nv.vp, qtL.wp[li], odir, -1.); |
564 |
|
spinvector(nv.vdir, nv.vdir, nv.vup, d); |
565 |
|
} else if (orb) { /* orbit up/down */ |
566 |
< |
fcross(v1, odir, nv.vup); |
567 |
< |
if (normalize(v1) == 0.) |
566 |
> |
if (geodesic(odir, odir, nv.vup, |
567 |
> |
d=MOVDEG*PI/180.*orb, GEOD_RAD) == 0.0) |
568 |
|
return(0); |
557 |
– |
spinvector(odir, odir, v1, d=MOVDEG*PI/180.*orb); |
569 |
|
VSUM(nv.vp, qtL.wp[li], odir, -1.); |
570 |
< |
spinvector(nv.vdir, nv.vdir, v1, d); |
570 |
> |
geodesic(nv.vdir, nv.vdir, nv.vup, d, GEOD_RAD); |
571 |
|
} else if (mov) { /* move forward/backward */ |
572 |
|
d = MOVPCT/100. * mov; |
573 |
|
VSUM(nv.vp, nv.vp, odir, d); |