diff --git a/Makefile b/Makefile index 8f584b6..8cfd397 100644 --- a/Makefile +++ b/Makefile @@ -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 "*~"` diff --git a/TODO b/TODO index 24caf6a..98970f4 100644 --- a/TODO +++ b/TODO @@ -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}/?) diff --git a/src/avp/avpview.c b/src/avp/avpview.c index 8de8435..7786a92 100644 --- a/src/avp/avpview.c +++ b/src/avp/avpview.c @@ -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 (distLightRange) { + intensity += WideMulNarrowDiv(lptr->LightBright,lptr->LightRange-dist,lptr->LightRange); + } + } + } + } + if (intensity>ONE_FIXED) intensity=ONE_FIXED; + else if (intensity -#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 "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