rayzor

changeset 18:859ccadca671

portability fixes
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 14 Apr 2014 18:35:37 +0300
parents 79609d482762
children 252999cd1a3f
files GNUmakefile src/camera.cc src/camera.h src/light.cc src/light.h src/main.cc src/min3d.c src/renderer.cc
diffstat 8 files changed, 12 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/GNUmakefile	Mon Apr 14 07:34:45 2014 +0300
     1.2 +++ b/GNUmakefile	Mon Apr 14 18:35:37 2014 +0300
     1.3 @@ -1,6 +1,6 @@
     1.4  baseobj = src/main.o src/logger.o src/screen.o src/scrman.o src/rbtree.o
     1.5  modelobj = src/modeller.o src/min3d.o src/m3drast.o src/lines.o
     1.6 -rendobj = src/renderer.o src/vmath.o
     1.7 +rendobj = src/renderer.o src/vmath.o src/raytrace.o
     1.8  scnobj = src/scene.o src/object.o src/light.o src/camera.o src/snode.o
     1.9  sysobj = src/dosemu/dosemu.o
    1.10  obj = $(baseobj) $(modelobj) $(rendobj) $(scnobj) $(sysobj)
     2.1 --- a/src/camera.cc	Mon Apr 14 07:34:45 2014 +0300
     2.2 +++ b/src/camera.cc	Mon Apr 14 18:35:37 2014 +0300
     2.3 @@ -37,7 +37,7 @@
     2.4  	}
     2.5  }
     2.6  
     2.7 -void Camera::draw() const
     2.8 +void Camera::draw(bool emph) const
     2.9  {
    2.10  }
    2.11  
     3.1 --- a/src/camera.h	Mon Apr 14 07:34:45 2014 +0300
     3.2 +++ b/src/camera.h	Mon Apr 14 18:35:37 2014 +0300
     3.3 @@ -20,7 +20,7 @@
     3.4  	void set_fov(float fov);
     3.5  	float get_fov() const;
     3.6  
     3.7 -	void draw() const;
     3.8 +	void draw(bool emph = false) const;
     3.9  
    3.10  	bool intersect(const Ray &ray, RayHit *hit = 0) const;
    3.11  
     4.1 --- a/src/light.cc	Mon Apr 14 07:34:45 2014 +0300
     4.2 +++ b/src/light.cc	Mon Apr 14 18:35:37 2014 +0300
     4.3 @@ -53,7 +53,7 @@
     4.4  	return at > 1.0 ? 1.0 : at;
     4.5  }
     4.6  
     4.7 -void Light::draw() const
     4.8 +void Light::draw(bool emph) const
     4.9  {
    4.10  }
    4.11  
     5.1 --- a/src/light.h	Mon Apr 14 07:34:45 2014 +0300
     5.2 +++ b/src/light.h	Mon Apr 14 18:35:37 2014 +0300
     5.3 @@ -27,7 +27,7 @@
     5.4  
     5.5  	float calc_attenuation(float d) const;
     5.6  
     5.7 -	void draw() const;
     5.8 +	void draw(bool emph = false) const;
     5.9  
    5.10  	bool intersect(const Ray &ray, RayHit *hit = 0) const;
    5.11  };
     6.1 --- a/src/main.cc	Mon Apr 14 07:34:45 2014 +0300
     6.2 +++ b/src/main.cc	Mon Apr 14 18:35:37 2014 +0300
     6.3 @@ -103,8 +103,10 @@
     6.4  	signal(SIGILL, sig);
     6.5  	signal(SIGFPE, sig);
     6.6  
     6.7 +#ifdef __WATCOM__
     6.8  	// mask all fpe except invalid op
     6.9  	_control87(~_EM_INVALID, _MCW_EM);
    6.10 +#endif
    6.11  
    6.12  	init_timer(128);
    6.13  
    6.14 @@ -481,10 +483,12 @@
    6.15  	cleanup();
    6.16  	fprintf(stderr, "signal caught: %d\n", s);
    6.17  
    6.18 +#ifdef __WATCOM__
    6.19  	if(s == SIGFPE) {
    6.20  		unsigned int st = _status87();
    6.21  		fprintf(stderr, "fpu status: %x\n", st);
    6.22  	}
    6.23 +#endif
    6.24  
    6.25  	exit(1);
    6.26  }
     7.1 --- a/src/min3d.c	Mon Apr 14 07:34:45 2014 +0300
     7.2 +++ b/src/min3d.c	Mon Apr 14 18:35:37 2014 +0300
     7.3 @@ -128,7 +128,7 @@
     7.4  
     7.5  void m3d_load_transpose_matrix(const float *m)
     7.6  {
     7.7 -	int i, j, lin = 0;
     7.8 +	int i, j;
     7.9  	int top = m3dctx->mstack[m3dctx->mmode].top;
    7.10  	float *dest = m3dctx->mstack[m3dctx->mmode].m[top];
    7.11  
     8.1 --- a/src/renderer.cc	Mon Apr 14 07:34:45 2014 +0300
     8.2 +++ b/src/renderer.cc	Mon Apr 14 18:35:37 2014 +0300
     8.3 @@ -143,12 +143,12 @@
     8.4  				break;
     8.5  
     8.6  			case MSG_GAMMA:
     8.7 -				rend->gamma = va_arg(ap, float);
     8.8 +				rend->gamma = va_arg(ap, double);
     8.9  				rend->inv_gamma = 1.0 / rend->gamma;
    8.10  				break;
    8.11  
    8.12  			case MSG_USE_GAMMA:
    8.13 -				rend->use_gamma = va_arg(ap, bool);
    8.14 +				rend->use_gamma = va_arg(ap, int);
    8.15  				break;
    8.16  			}
    8.17  		}