Moved LightIntensityAtPoint to a better location.

Silenced more stub messages.
This commit is contained in:
Steven Fuller 2001-12-09 04:44:18 +00:00 committed by Patryk Obara
parent 783657fac7
commit c69d422333
5 changed files with 82 additions and 95 deletions

View file

@ -20,7 +20,7 @@ LDLIBS = -L/usr/X11R6/lib -lX11 -lXext -lGL `sdl-config --libs` -lopenal
AFLAGS = -g -w+macro-params -w+orphan-labels -w+number-overflow
ROOT = main.c mathline.c math.asm render.c opengl.c net.c menus.c openal.c cdplayer.c winapi.c stubs.c frustum.c kshape.c map.c maths.c md5.c mem3dc.c mem3dcpp.cpp module.c morph.c object.c shpanim.c sphere.c tables.c vdb.c version.c
ROOT = main.c mathline.c math.asm opengl.c net.c menus.c openal.c cdplayer.c winapi.c stubs.c frustum.c kshape.c map.c maths.c md5.c mem3dc.c mem3dcpp.cpp module.c morph.c object.c shpanim.c sphere.c tables.c vdb.c version.c
AVP = ai_sight.c avpview.c bh_agun.c bh_ais.c bh_alien.c bh_binsw.c bh_cable.c bh_corpse.c bh_deathvol.c bh_debri.c bh_dummy.c bh_fan.c bh_far.c bh_fhug.c bh_gener.c bh_ldoor.c bh_lift.c bh_light.c bh_lnksw.c bh_ltfx.c bh_marin.c bh_mission.c bh_near.c bh_pargen.c bh_plachier.c bh_plift.c bh_pred.c bh_queen.c bh_rubberduck.c bh_selfdest.c bh_snds.c bh_spcl.c bh_swdor.c bh_track.c bh_types.c bh_videoscreen.c bh_waypt.c bh_weap.c bh_xeno.c bonusabilities.c cconvars.cpp cdtrackselection.cpp cheatmodes.c comp_map.c comp_shp.c consolelog.cpp davehook.cpp deaths.c decal.c detaillevels.c dynamics.c dynblock.c equipmnt.c equiputl.cpp extents.c game.c game_statistics.c gamecmds.cpp gamevars.cpp hmodel.c hud.c inventry.c language.c lighting.c load_shp.c los.c maps.c mempool.c messagehistory.c missions.cpp movement.c paintball.c particle.c pfarlocs.c pheromon.c player.c pmove.c psnd.c psndproj.c pvisible.c savegame.c scream.cpp secstats.c sfx.c stratdef.c targeting.c track.c triggers.c weapons.c
SHAPES = cube.c
SUPPORT = consbind.cpp consbtch.cpp coordstr.cpp daemon.cpp indexfnt.cpp r2base.cpp r2pos666.cpp reflist.cpp refobj.cpp rentrntq.cpp scstring.cpp strtab.cpp strutil.c trig666.cpp wrapstr.cpp
@ -71,7 +71,7 @@ tester:
echo $(OBJ)
clean:
-rm -rf depend $(OBJ) AvP
-rm -rf depend depend.bak $(OBJ) AvP
distclean: clean
-rm -rf `find . -name "*~"`

2
TODO
View file

@ -5,7 +5,7 @@
[DONE] [12/05/01] Menus.
[DONE] [12/05/01] Progress bar.
[DONE] [12/06/01] Make vidmodes work.
* Debug "pure virtual method called"
[DONE] [12/08/01] Debug "pure virtual method called"
* Command line options.
* Proper file loading/saving (ignore case, search certain directories) and
config handling (~/.avp/{ge, re, ad, md, pd}/?)

View file

@ -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};

View file

@ -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;
}

View file

@ -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");
*/
}