Moved LightIntensityAtPoint to a better location.
Silenced more stub messages.
This commit is contained in:
parent
783657fac7
commit
c69d422333
5 changed files with 82 additions and 95 deletions
|
@ -86,7 +86,7 @@ int *Global_EID_IPtr;
|
|||
|
||||
extern float CameraZoomScale;
|
||||
extern int CameraZoomLevel;
|
||||
extern int AlienBiteAttackInProgress=0;
|
||||
int AlienBiteAttackInProgress;
|
||||
|
||||
/* phase for cloaked objects */
|
||||
int CloakingPhase;
|
||||
|
@ -253,8 +253,42 @@ void LightSourcesInRangeOfObject(DISPLAYBLOCK *dptr)
|
|||
lightElementPtr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 (dist<lptr->LightRange) {
|
||||
intensity += WideMulNarrowDiv(lptr->LightBright,lptr->LightRange-dist,lptr->LightRange);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (intensity>ONE_FIXED) intensity=ONE_FIXED;
|
||||
else if (intensity<GlobalAmbience) intensity=GlobalAmbience;
|
||||
|
||||
/* KJL 20:31:39 12/1/97 - limit how dark things can be so blood doesn't go green */
|
||||
if (intensity<10*256) intensity = 10*256;
|
||||
|
||||
return intensity;
|
||||
}
|
||||
|
||||
EULER HeadOrientation = {0,0,0};
|
||||
|
|
66
src/render.c
66
src/render.c
|
@ -1,66 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <SDL.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glext.h>
|
||||
|
||||
#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 "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 (dist<lptr->LightRange) {
|
||||
intensity += WideMulNarrowDiv(lptr->LightBright,lptr->LightRange-dist,lptr->LightRange);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (intensity>ONE_FIXED) intensity=ONE_FIXED;
|
||||
else if (intensity<GlobalAmbience) intensity=GlobalAmbience;
|
||||
|
||||
/* KJL 20:31:39 12/1/97 - limit how dark things can be so blood doesn't go green */
|
||||
if (intensity<10*256) intensity = 10*256;
|
||||
|
||||
return intensity;
|
||||
}
|
69
src/stubs.c
69
src/stubs.c
|
@ -145,7 +145,34 @@ int GetTextureHandle(IMAGEHEADER *imageHeaderPtr)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* d3d_render.cpp -- some of these got mixed in with d3_func.cpp! */
|
||||
void ReleaseDirect3DNotDDOrImages()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "ReleaseDirect3DNotDDOrImages()\n");
|
||||
*/
|
||||
}
|
||||
|
||||
void ReleaseDirect3DNotDD()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "ReleaseDirect3DNotDD()\n");
|
||||
*/
|
||||
}
|
||||
|
||||
void ReleaseDirect3D()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "ReleaseDirect3D()\n");
|
||||
*/
|
||||
}
|
||||
|
||||
void ReloadImageIntoD3DImmediateSurface(IMAGEHEADER* iheader)
|
||||
{
|
||||
fprintf(stderr, "ReloadImageIntoD3DImmediateSurface(%p)\n", iheader);
|
||||
}
|
||||
|
||||
|
||||
/* d3d_render.cpp */
|
||||
int NumberOfLandscapePolygons;
|
||||
int FMVParticleColour;
|
||||
int WireFrameMode;
|
||||
|
@ -153,12 +180,13 @@ int WaterFallBase;
|
|||
|
||||
void InitDrawTest()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "InitDrawTest()\n");
|
||||
*/
|
||||
}
|
||||
|
||||
void CheckWireFrameMode(int shouldBeOn)
|
||||
{
|
||||
// fprintf(stderr, "CheckWireFrameMode(%d)\n", shouldBeOn);
|
||||
if (shouldBeOn)
|
||||
fprintf(stderr, "CheckWireFrameMode(%d)\n", shouldBeOn);
|
||||
}
|
||||
|
@ -175,29 +203,9 @@ BOOL UnlockExecuteBufferAndPrepareForUse()
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void ReloadImageIntoD3DImmediateSurface(IMAGEHEADER* iheader)
|
||||
{
|
||||
fprintf(stderr, "ReloadImageIntoD3DImmediateSurface(%p)\n", iheader);
|
||||
}
|
||||
|
||||
void ReleaseDirect3DNotDDOrImages()
|
||||
{
|
||||
fprintf(stderr, "ReleaseDirect3DNotDDOrImages()\n");
|
||||
}
|
||||
|
||||
void ReleaseDirect3DNotDD()
|
||||
{
|
||||
fprintf(stderr, "ReleaseDirect3DNotDD()\n");
|
||||
}
|
||||
|
||||
void ReleaseDirect3D()
|
||||
{
|
||||
fprintf(stderr, "ReleaseDirect3D()\n");
|
||||
}
|
||||
|
||||
BOOL ExecuteBuffer()
|
||||
{
|
||||
// fprintf(stderr, "ExecuteBuffer()\n");
|
||||
fprintf(stderr, "ExecuteBuffer()\n");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -209,10 +217,13 @@ BOOL EndD3DScene()
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* ddplat.cpp */
|
||||
void MinimizeAllDDGraphics()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "MinimizeAllDDGraphics()\n");
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -232,12 +243,16 @@ void LockSurfaceAndGetBufferPointer()
|
|||
|
||||
void finiObjectsExceptDD()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "finiObjectsExceptDD()\n");
|
||||
*/
|
||||
}
|
||||
|
||||
void finiObjects()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "finiObjects()\n");
|
||||
*/
|
||||
}
|
||||
|
||||
void UnlockSurface()
|
||||
|
@ -267,21 +282,25 @@ void ReleaseDDSurface(void* DDSurface)
|
|||
|
||||
BOOL ChangeDirectDrawObject()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "ChangeDirectDrawObject()\n");
|
||||
|
||||
*/
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int SelectDirectDrawObject(void *pGUID)
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "SelectDirectDrawObject(%p)\n", pGUID);
|
||||
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
void GenerateDirectDrawSurface()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "GenerateDirectDrawSurface()\n");
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue