From d19a2069c6d51b6e8aaf3f47742316e4808db49f Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Thu, 9 Aug 2001 22:34:20 +0000 Subject: Implemented keyboard input. Copied some functions from pldnet and d3d_render (now the player image shows in the mirror). --- src/render.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/render.c (limited to 'src/render.c') diff --git a/src/render.c b/src/render.c new file mode 100644 index 0000000..8ffd801 --- /dev/null +++ b/src/render.c @@ -0,0 +1,67 @@ +#include +#include +#include + +#include +#include +#include + +#include "fixer.h" + +#include "3dc.h" +#include "platform.h" +#include "inline.h" +#include "gamedef.h" +#include "module.h" +#include "stratdef.h" +#include "projfont.h" +#include "krender.h" +#include "kshape.h" +#include "prototyp.h" +#include "d3d_hud.h" +#include "bh_types.h" +#include "equipmnt.h" +#include "pldghost.h" + +#define UseLocalAssert Yes +#include "ourasert.h" + +extern DISPLAYBLOCK *ActiveBlockList[]; +extern int NumActiveBlocks; +extern int GlobalAmbience; + +int LightIntensityAtPoint(VECTORCH *pointPtr) +{ + int intensity = 0; + int i, j; + + DISPLAYBLOCK **activeBlockListPtr = ActiveBlockList; + for(i = NumActiveBlocks; i != 0; i--) { + DISPLAYBLOCK *dispPtr = *activeBlockListPtr++; + + if (dispPtr->ObNumLights) { + for(j = 0; j < dispPtr->ObNumLights; j++) { + LIGHTBLOCK *lptr = dispPtr->ObLights[j]; + VECTORCH disp = lptr->LightWorld; + int dist; + + disp.vx -= pointPtr->vx; + disp.vy -= pointPtr->vy; + disp.vz -= pointPtr->vz; + + dist = Approximate3dMagnitude(&disp); + + if (distLightRange) { + intensity += WideMulNarrowDiv(lptr->LightBright,lptr->LightRange-dist,lptr->LightRange); + } + } + } + } + if (intensity>ONE_FIXED) intensity=ONE_FIXED; + else if (intensity