/** * $Id:$ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** * * The contents of this file may be used under the terms of either the GNU * General Public License Version 2 or later (the "GPL", see * http://www.gnu.org/licenses/gpl.html ), or the Blender License 1.0 or * later (the "BL", see http://www.blender.org/BL/ ) which has to be * bought from the Blender Foundation to become active, in which case the * above mentioned GPL option does not apply. * * The Original Code is Copyright (C) 1997 by Ton Roosendaal, Frank van Beek and Joeri Kassenaar. * All rights reserved. * * The Original Code is: all of this file. * * Contributor(s): none yet. * * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ /** * $Id:$ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** * * The contents of this file may be used under the terms of either the GNU * General Public License Version 2 or later (the "GPL", see * http://www.gnu.org/licenses/gpl.html ), or the Blender License 1.0 or * later (the "BL", see http://www.blender.org/BL/ ) which has to be * bought from the Blender Foundation to become active, in which case the * above mentioned GPL option does not apply. * * The Original Code is Copyright (C) 1997 by Ton Roosendaal, Frank van Beek and Joeri Kassenaar. * All rights reserved. * * The Original Code is: all of this file. * * Contributor(s): none yet. * * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ /* cc -O3 Objbuts.c -lgl_s -lc_s -float -lfastm -o Objbuts cc Objbuts.c -lgl_s -lc_s -float -lfastm -o Objbuts */ #include #include #include #include "Trace.h" #include "Button.h" #include void shadeshadesphere(cb,n,col,x,y) struct ColBlck *cb; short x,y,col[]; float n[]; { float v1,inp,inpspec=0; float v[3]; short temp,temp2; if(cb->kspec) { /* geen spec dus geen viewvector */ v[0]=x+SHLX1; v[1]=y+SHLY1; v[2]=SHLZ1+256; NormalWrd(v); } col[0]=cb->r; col[1]=cb->g; col[2]=cb->b; if(cb->tex[0]); /*texture afhandeling;*/ inp=n[0]*SHLX+n[1]*SHLY+n[2]*SHLZ; if(cb->kspec) { if(inp<=0) inp=0; else { v1=v[0]*n[0]+v[1]*n[1]+v[2]*n[2]; if(v1>0) { v1=Spec(v1,cb->spec); temp2=2*(v1*cb->kspec); } } } if (cb->mode & 16) { col[0]+= (cb->specr*temp2)>>8; col[1]+= (cb->specg*temp2)>>8; col[2]+= (cb->specb*temp2)>>8; } else { temp=(cb->kref*inp); col[0]=(temp*(cb->ambr+col[0]) + temp2*cb->specr)>>8; col[1]=(temp*(cb->ambg+col[1]) + temp2*cb->specg)>>8; col[2]=(temp*(cb->ambb+col[2]) + temp2*cb->specb)>>8; } } void shadesphere(c) struct ColBlck *c; { short x1,y1,x,y,xof,yof,xof2,col[3]; float n[3],z1; long rsq,xsq,ysq,zsq; unsigned long line[2*SHADESPHEREX+10]; uchar *s; xof=10; yof=SHADESPHEREY+10; xof2=xof+(2*SHADESPHEREX); rsq=16*SHADESPHEREX-1; rsq*=rsq; for(y= -SHADESPHEREY;y