# HG changeset patch # User John Tsiombikas # Date 1397489737 -10800 # Node ID 859ccadca671e71dbedf9e378d70774f9b175745 # Parent 79609d4827627b67bb165d4ae871930f0508ac5e portability fixes diff -r 79609d482762 -r 859ccadca671 GNUmakefile --- a/GNUmakefile Mon Apr 14 07:34:45 2014 +0300 +++ b/GNUmakefile Mon Apr 14 18:35:37 2014 +0300 @@ -1,6 +1,6 @@ baseobj = src/main.o src/logger.o src/screen.o src/scrman.o src/rbtree.o modelobj = src/modeller.o src/min3d.o src/m3drast.o src/lines.o -rendobj = src/renderer.o src/vmath.o +rendobj = src/renderer.o src/vmath.o src/raytrace.o scnobj = src/scene.o src/object.o src/light.o src/camera.o src/snode.o sysobj = src/dosemu/dosemu.o obj = $(baseobj) $(modelobj) $(rendobj) $(scnobj) $(sysobj) diff -r 79609d482762 -r 859ccadca671 src/camera.cc --- a/src/camera.cc Mon Apr 14 07:34:45 2014 +0300 +++ b/src/camera.cc Mon Apr 14 18:35:37 2014 +0300 @@ -37,7 +37,7 @@ } } -void Camera::draw() const +void Camera::draw(bool emph) const { } diff -r 79609d482762 -r 859ccadca671 src/camera.h --- a/src/camera.h Mon Apr 14 07:34:45 2014 +0300 +++ b/src/camera.h Mon Apr 14 18:35:37 2014 +0300 @@ -20,7 +20,7 @@ void set_fov(float fov); float get_fov() const; - void draw() const; + void draw(bool emph = false) const; bool intersect(const Ray &ray, RayHit *hit = 0) const; diff -r 79609d482762 -r 859ccadca671 src/light.cc --- a/src/light.cc Mon Apr 14 07:34:45 2014 +0300 +++ b/src/light.cc Mon Apr 14 18:35:37 2014 +0300 @@ -53,7 +53,7 @@ return at > 1.0 ? 1.0 : at; } -void Light::draw() const +void Light::draw(bool emph) const { } diff -r 79609d482762 -r 859ccadca671 src/light.h --- a/src/light.h Mon Apr 14 07:34:45 2014 +0300 +++ b/src/light.h Mon Apr 14 18:35:37 2014 +0300 @@ -27,7 +27,7 @@ float calc_attenuation(float d) const; - void draw() const; + void draw(bool emph = false) const; bool intersect(const Ray &ray, RayHit *hit = 0) const; }; diff -r 79609d482762 -r 859ccadca671 src/main.cc --- a/src/main.cc Mon Apr 14 07:34:45 2014 +0300 +++ b/src/main.cc Mon Apr 14 18:35:37 2014 +0300 @@ -103,8 +103,10 @@ signal(SIGILL, sig); signal(SIGFPE, sig); +#ifdef __WATCOM__ // mask all fpe except invalid op _control87(~_EM_INVALID, _MCW_EM); +#endif init_timer(128); @@ -481,10 +483,12 @@ cleanup(); fprintf(stderr, "signal caught: %d\n", s); +#ifdef __WATCOM__ if(s == SIGFPE) { unsigned int st = _status87(); fprintf(stderr, "fpu status: %x\n", st); } +#endif exit(1); } diff -r 79609d482762 -r 859ccadca671 src/min3d.c --- a/src/min3d.c Mon Apr 14 07:34:45 2014 +0300 +++ b/src/min3d.c Mon Apr 14 18:35:37 2014 +0300 @@ -128,7 +128,7 @@ void m3d_load_transpose_matrix(const float *m) { - int i, j, lin = 0; + int i, j; int top = m3dctx->mstack[m3dctx->mmode].top; float *dest = m3dctx->mstack[m3dctx->mmode].m[top]; diff -r 79609d482762 -r 859ccadca671 src/renderer.cc --- a/src/renderer.cc Mon Apr 14 07:34:45 2014 +0300 +++ b/src/renderer.cc Mon Apr 14 18:35:37 2014 +0300 @@ -143,12 +143,12 @@ break; case MSG_GAMMA: - rend->gamma = va_arg(ap, float); + rend->gamma = va_arg(ap, double); rend->inv_gamma = 1.0 / rend->gamma; break; case MSG_USE_GAMMA: - rend->use_gamma = va_arg(ap, bool); + rend->use_gamma = va_arg(ap, int); break; } }