Commented out unused functions and variables

many unused functions and variables are now commented out

You'll still get tons of warnings, which should mostly fall in one of
the following categories:
1. Unnecessary variables or values generated from .es scripts
2. Pointers assigned to from functions with side-effects: DO NOT REMOVE!
   Like CEntity *penNew = CreateEntity_t(...); - even if penNew isn't
   used, CreateEntity() must be called there!
This commit is contained in:
Daniel Gibson 2016-04-24 01:01:37 +02:00
parent bee4102374
commit 72edf1c720
61 changed files with 265 additions and 239 deletions

View File

@ -114,8 +114,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Wno-switch) add_compile_options(-Wno-switch)
add_compile_options(-Wno-char-subscripts) add_compile_options(-Wno-char-subscripts)
add_compile_options(-Wno-unknown-pragmas) add_compile_options(-Wno-unknown-pragmas)
add_compile_options(-Wno-unused-variable) add_compile_options(-Wno-unused-variable) # TODO: maybe only enable this for Entities
add_compile_options(-Wno-unused-value) add_compile_options(-Wno-unused-value) # same here (the Scripts generate tons of unused variables and values)
add_compile_options(-Wno-missing-braces)
add_compile_options(-Wno-parentheses) add_compile_options(-Wno-parentheses)
MESSAGE(WARNING, "re-enable some of the warnings some day!") MESSAGE(WARNING, "re-enable some of the warnings some day!")

View File

@ -904,14 +904,14 @@ void CAnimObject::PlayAnim(INDEX iNew, ULONG ulFlags)
class COneAnim *pCOA = &ao_AnimData->ad_Anims[ao_iCurrentAnim]; class COneAnim *pCOA = &ao_AnimData->ad_Anims[ao_iCurrentAnim];
TIME tmNow = _pTimer->CurrentTick(); TIME tmNow = _pTimer->CurrentTick();
TIME tmLength = GetCurrentAnimLength(); TIME tmLength = GetCurrentAnimLength();
FLOAT fFrame = ((_pTimer->CurrentTick() - ao_tmAnimStart)/pCOA->oa_SecsPerFrame); FLOAT fFrame = ((tmNow - ao_tmAnimStart)/pCOA->oa_SecsPerFrame);
INDEX iFrame = INDEX(fFrame); INDEX iFrame = INDEX(fFrame);
FLOAT fFract = fFrame-iFrame; FLOAT fFract = fFrame-iFrame;
iFrame = ClipFrame(iFrame); iFrame = ClipFrame(iFrame);
TIME tmPassed = (iFrame+fFract)*pCOA->oa_SecsPerFrame; TIME tmPassed = (iFrame+fFract)*pCOA->oa_SecsPerFrame;
TIME tmLeft = tmLength-tmPassed; TIME tmLeft = tmLength-tmPassed;
// set time ahead to end of the current animation // set time ahead to end of the current animation
ao_tmAnimStart = _pTimer->CurrentTick()+tmLeft; ao_tmAnimStart = tmNow+tmLeft;
// remember last animation // remember last animation
ao_iLastAnim = ao_iCurrentAnim; ao_iLastAnim = ao_iCurrentAnim;
// set new animation number // set new animation number

View File

@ -110,7 +110,7 @@ CDynamicStackArray<CTString> _shell_astrTempStrings;
CDynamicStackArray<CTString> _shell_astrExtStrings; CDynamicStackArray<CTString> _shell_astrExtStrings;
CDynamicStackArray<FLOAT> _shell_afExtFloats; CDynamicStackArray<FLOAT> _shell_afExtFloats;
static const char *strCommandLine = ""; //static const char *strCommandLine = "";
FLOAT tmp_af[10] = { 0 }; FLOAT tmp_af[10] = { 0 };
INDEX tmp_ai[10] = { 0 }; INDEX tmp_ai[10] = { 0 };

View File

@ -1433,7 +1433,7 @@ static INDEX ExpandFilePath_read(ULONG ulType, const CTFileName &fnmFile, CTFile
{ {
// search for the file in zips // search for the file in zips
INDEX iFileInZip = UNZIPGetFileIndex(fnmFile); INDEX iFileInZip = UNZIPGetFileIndex(fnmFile);
const BOOL userdir_not_basedir = (_fnmUserDir != _fnmApplicationPath); //const BOOL userdir_not_basedir = (_fnmUserDir != _fnmApplicationPath);
// if a mod is active // if a mod is active
if (_fnmMod!="") { if (_fnmMod!="") {

View File

@ -161,8 +161,8 @@ void CTimer_TimerFunc_internal(void)
CTimerValue tvTimeNow = _pTimer->GetHighPrecisionTimer(); CTimerValue tvTimeNow = _pTimer->GetHighPrecisionTimer();
TIME tmTickNow = _pTimer->tm_RealTimeTimer; TIME tmTickNow = _pTimer->tm_RealTimeTimer;
// calculate how long has passed since we have last been on time // calculate how long has passed since we have last been on time
TIME tmTimeDelay = (TIME)(tvTimeNow - _pTimer->tm_tvLastTimeOnTime).GetSeconds(); //TIME tmTimeDelay = (TIME)(tvTimeNow - _pTimer->tm_tvLastTimeOnTime).GetSeconds();
TIME tmTickDelay = (tmTickNow - _pTimer->tm_tmLastTickOnTime); //TIME tmTickDelay = (tmTickNow - _pTimer->tm_tmLastTickOnTime);
_sfStats.StartTimer(CStatForm::STI_TIMER); _sfStats.StartTimer(CStatForm::STI_TIMER);
// if we are keeping up to time (more or less) // if we are keeping up to time (more or less)
@ -209,13 +209,14 @@ Uint32 CTimer_TimerFunc_SDL(Uint32 interval, void* param)
#pragma inline_depth() #pragma inline_depth()
#ifdef PLATFORM_WIN32 // DG: not used on other platforms
#define MAX_MEASURE_TRIES 5 #define MAX_MEASURE_TRIES 5
static INDEX _aiTries[MAX_MEASURE_TRIES]; static INDEX _aiTries[MAX_MEASURE_TRIES];
// Get processor speed in Hertz // Get processor speed in Hertz
static __int64 GetCPUSpeedHz(void) static __int64 GetCPUSpeedHz(void)
{ {
#ifdef PLATFORM_WIN32
// get the frequency of the 'high' precision timer // get the frequency of the 'high' precision timer
__int64 llTimerFrequency; __int64 llTimerFrequency;
BOOL bPerformanceCounterPresent = QueryPerformanceFrequency((LARGE_INTEGER*)&llTimerFrequency); BOOL bPerformanceCounterPresent = QueryPerformanceFrequency((LARGE_INTEGER*)&llTimerFrequency);
@ -296,14 +297,8 @@ static __int64 GetCPUSpeedHz(void)
// use measured value // use measured value
return (__int64)slSpeedRead*1000000; return (__int64)slSpeedRead*1000000;
} }
#else
STUBBED("I hope this isn't critical...");
return(1);
#endif
} }
#endif // PLATFORM_WIN32
#if PLATFORM_MACOSX #if PLATFORM_MACOSX

View File

@ -509,7 +509,7 @@ CBrushPolygon &CBrushPolygon::CopyPolygon(CBrushPolygon &bp)
bpo_boxBoundingBox=bp.bpo_boxBoundingBox; bpo_boxBoundingBox=bp.bpo_boxBoundingBox;
bpo_pbscSector=bp.bpo_pbscSector; bpo_pbscSector=bp.bpo_pbscSector;
bpo_rsOtherSideSectors.Clear(); bpo_rsOtherSideSectors.Clear();
bpo_lhShadingInfos; //bpo_lhShadingInfos; // FIXME: DG: was this missing "= bp.bpo_lhShadingInfos" or something like that?
bpo_iInWorld=bp.bpo_iInWorld; bpo_iInWorld=bp.bpo_iInWorld;
return *this; return *this;
} }

View File

@ -605,7 +605,7 @@ BOOL CBrushShadowMap::IsShadowFlat( COLOR &colFlat)
COLOR col; COLOR col;
UBYTE ubR,ubG,ubB, ubR1,ubG1,ubB1; UBYTE ubR,ubG,ubB, ubR1,ubG1,ubB1;
SLONG slR=0,slG=0,slB=0; SLONG slR=0,slG=0,slB=0;
INDEX ctPointLights=0; //INDEX ctPointLights=0;
CBrushPolygon *pbpo = GetBrushPolygon(); CBrushPolygon *pbpo = GetBrushPolygon();
// if the shadowmap is not using the shading mode // if the shadowmap is not using the shading mode

View File

@ -480,7 +480,7 @@ void CTriangularizer::FindExistingTriangleEdges(void)
// for each edge // for each edge
FOREACHINDYNAMICARRAY(tr_abedEdges, CBrushEdge, itbed) { FOREACHINDYNAMICARRAY(tr_abedEdges, CBrushEdge, itbed) {
CBrushEdge *pbed = itbed; //CBrushEdge *pbed = itbed;
// if it is the bottom edge of the triangle // if it is the bottom edge of the triangle
if (tr_pbedBottom == itbed) { if (tr_pbedBottom == itbed) {
@ -517,7 +517,7 @@ BOOL CTriangularizer::CheckTriangleAgainstEdges(void)
{ {
// for each edge // for each edge
FOREACHINDYNAMICARRAY(tr_abedEdges, CBrushEdge, itbed) { FOREACHINDYNAMICARRAY(tr_abedEdges, CBrushEdge, itbed) {
CBrushEdge *pbed = itbed; //CBrushEdge *pbed = itbed;
// if it is the bottom edge of the triangle // if it is the bottom edge of the triangle
if (tr_pbedBottom == itbed) { if (tr_pbedBottom == itbed) {

View File

@ -67,7 +67,9 @@ CTCriticalSection zip_csLock; // critical section for access to zlib functions
// to keep system gamma table // to keep system gamma table
#ifdef PLATFORM_WIN32 // DG: other platforms don't (currently?) use this
static UWORD auwSystemGamma[256*3]; static UWORD auwSystemGamma[256*3];
#endif
// OS info // OS info
@ -818,7 +820,7 @@ ENGINE_API void SE_UpdateWindowHandle( HWND hwndMain)
_bFullScreen = _pGfx!=NULL && (_pGfx->gl_ulFlags&GLF_FULLSCREEN); _bFullScreen = _pGfx!=NULL && (_pGfx->gl_ulFlags&GLF_FULLSCREEN);
} }
#ifdef PLATFORM_WIN32
static BOOL TouchBlock(UBYTE *pubMemoryBlock, INDEX ctBlockSize) static BOOL TouchBlock(UBYTE *pubMemoryBlock, INDEX ctBlockSize)
{ {
#if (defined __MSC_VER) #if (defined __MSC_VER)
@ -856,12 +858,13 @@ touchLoop:
// !!! More importantly, will this help if the system is paging to disk // !!! More importantly, will this help if the system is paging to disk
// !!! like mad anyhow? Leaving this as a no-op for most systems seems safe // !!! like mad anyhow? Leaving this as a no-op for most systems seems safe
// !!! to me. --ryan. // !!! to me. --ryan.
// DG: put this into #ifdef PLATFORM_WIN32 because otherwise the function is not called anyway
#endif #endif
return TRUE; return TRUE;
} }
#endif // PLATFORM_WIN32
// pretouch all memory commited by process // pretouch all memory commited by process
BOOL _bNeedPretouch = FALSE; BOOL _bNeedPretouch = FALSE;

View File

@ -481,7 +481,7 @@ void CEntity::GetCollisionBoxParameters(INDEX iBox, FLOATaabbox3D &box, INDEX &i
if(en_RenderType==RT_SKAMODEL || en_RenderType==RT_SKAEDITORMODEL) { if(en_RenderType==RT_SKAMODEL || en_RenderType==RT_SKAEDITORMODEL) {
box.minvect = GetModelInstance()->GetCollisionBoxMin(iBox); box.minvect = GetModelInstance()->GetCollisionBoxMin(iBox);
box.maxvect = GetModelInstance()->GetCollisionBoxMax(iBox); box.maxvect = GetModelInstance()->GetCollisionBoxMax(iBox);
FLOATaabbox3D boxNS = box; //FLOATaabbox3D boxNS = box;
box.StretchByVector(GetModelInstance()->mi_vStretch); box.StretchByVector(GetModelInstance()->mi_vStretch);
iEquality = GetModelInstance()->GetCollisionBoxDimensionEquality(iBox); iEquality = GetModelInstance()->GetCollisionBoxDimensionEquality(iBox);
} else { } else {
@ -1833,7 +1833,7 @@ void CEntity::FindSectorsAroundEntity(void)
// for each brush in the world // for each brush in the world
FOREACHINDYNAMICARRAY(en_pwoWorld->wo_baBrushes.ba_abrBrushes, CBrush3D, itbr) { FOREACHINDYNAMICARRAY(en_pwoWorld->wo_baBrushes.ba_abrBrushes, CBrush3D, itbr) {
CBrush3D &br=*itbr; //CBrush3D &br=*itbr;
// if the brush entity is not zoning // if the brush entity is not zoning
if (itbr->br_penEntity==NULL || !(itbr->br_penEntity->en_ulFlags&ENF_ZONING)) { if (itbr->br_penEntity==NULL || !(itbr->br_penEntity->en_ulFlags&ENF_ZONING)) {
// skip it // skip it
@ -3146,7 +3146,7 @@ void CEntity::InflictBoxDamage(CEntity *penInflictor, enum DamageType dmtType,
if (en.en_pciCollisionInfo==NULL) { if (en.en_pciCollisionInfo==NULL) {
continue; continue;
} }
CCollisionInfo *pci = en.en_pciCollisionInfo; //CCollisionInfo *pci = en.en_pciCollisionInfo;
// if entity is not allowed to execute now // if entity is not allowed to execute now
if (!en.IsAllowedForPrediction()) { if (!en.IsAllowedForPrediction()) {
// do nothing // do nothing

View File

@ -452,7 +452,7 @@ void CWorld::CopyEntities(CWorld &woOther, CDynamicContainer<CEntity> &cenToCopy
// for each of the created entities // for each of the created entities
{FOREACHINSTATICARRAY(_aprRemaps, CPointerRemapping, itpr) { {FOREACHINSTATICARRAY(_aprRemaps, CPointerRemapping, itpr) {
CEntity *penOriginal = itpr->pr_penOriginal; //CEntity *penOriginal = itpr->pr_penOriginal;
CEntity *penCopy = itpr->pr_penCopy; CEntity *penCopy = itpr->pr_penCopy;
if (_bReinitEntitiesWhileCopying) { if (_bReinitEntitiesWhileCopying) {
// init the new copy // init the new copy
@ -469,7 +469,7 @@ void CWorld::CopyEntities(CWorld &woOther, CDynamicContainer<CEntity> &cenToCopy
// for each of the created entities // for each of the created entities
{FOREACHINSTATICARRAY(_aprRemaps, CPointerRemapping, itpr) { {FOREACHINSTATICARRAY(_aprRemaps, CPointerRemapping, itpr) {
CEntity *penOriginal = itpr->pr_penOriginal; //CEntity *penOriginal = itpr->pr_penOriginal;
CEntity *penCopy = itpr->pr_penCopy; CEntity *penCopy = itpr->pr_penCopy;
// if this is a brush // if this is a brush
@ -718,7 +718,7 @@ void CWorld::CopyEntitiesToPredictors(CDynamicContainer<CEntity> &cenToCopy)
// for each of the created entities // for each of the created entities
{FOREACHINSTATICARRAY(_aprRemaps, CPointerRemapping, itpr) { {FOREACHINSTATICARRAY(_aprRemaps, CPointerRemapping, itpr) {
CEntity *penOriginal = itpr->pr_penOriginal; //CEntity *penOriginal = itpr->pr_penOriginal;
CEntity *penCopy = itpr->pr_penCopy; CEntity *penCopy = itpr->pr_penCopy;
// if this is a brush // if this is a brush

View File

@ -96,7 +96,7 @@ void CEntity::WriteEntityPointer_t(CTStream *ostrm, CEntityPointer pen)
void CEntity::ReadProperties_t(CTStream &istrm) // throw char * void CEntity::ReadProperties_t(CTStream &istrm) // throw char *
{ {
istrm.ExpectID_t("PRPS"); // 'properties' istrm.ExpectID_t("PRPS"); // 'properties'
CDLLEntityClass *pdecDLLClass = en_pecClass->ec_pdecDLLClass; //CDLLEntityClass *pdecDLLClass = en_pecClass->ec_pdecDLLClass;
INDEX ctProperties; INDEX ctProperties;
// read number of properties (note that this doesn't have to be same as number // read number of properties (note that this doesn't have to be same as number
// of properties in the class (class might have changed)) // of properties in the class (class might have changed))
@ -104,7 +104,7 @@ void CEntity::ReadProperties_t(CTStream &istrm) // throw char *
// for all saved properties // for all saved properties
for(INDEX iProperty=0; iProperty<ctProperties; iProperty++) { for(INDEX iProperty=0; iProperty<ctProperties; iProperty++) {
pdecDLLClass->dec_ctProperties; //pdecDLLClass->dec_ctProperties;
// read packed identifier // read packed identifier
ULONG ulIDAndType; ULONG ulIDAndType;
istrm>>ulIDAndType; istrm>>ulIDAndType;

View File

@ -34,6 +34,7 @@ extern const D3DDEVTYPE d3dDevType;
// list of all modes avaliable through CDS // list of all modes avaliable through CDS
static CListHead _lhCDSModes; static CListHead _lhCDSModes;
#ifdef PLATFORM_WIN32 // DG: all this code is (currently?) only used for windows.
class CResolution { class CResolution {
public: public:
PIX re_pixSizeI; PIX re_pixSizeI;
@ -74,8 +75,6 @@ static CResolution _areResolutions[] =
static const INDEX MAX_RESOLUTIONS = sizeof(_areResolutions)/sizeof(_areResolutions[0]); static const INDEX MAX_RESOLUTIONS = sizeof(_areResolutions)/sizeof(_areResolutions[0]);
#ifdef PLATFORM_WIN32
// initialize CDS support (enumerate modes at startup) // initialize CDS support (enumerate modes at startup)
void CGfxLibrary::InitAPIs(void) void CGfxLibrary::InitAPIs(void)
{ {
@ -240,7 +239,7 @@ void CGfxLibrary::InitAPIs(void)
// fill OpenGL adapter info // fill OpenGL adapter info
CDisplayAdapter *pda; CDisplayAdapter *pda;
INDEX iResolution; //INDEX iResolution;
gl_gaAPI[GAT_OGL].ga_ctAdapters = 1; gl_gaAPI[GAT_OGL].ga_ctAdapters = 1;
gl_gaAPI[GAT_OGL].ga_iCurrentAdapter = 0; gl_gaAPI[GAT_OGL].ga_iCurrentAdapter = 0;

View File

@ -33,7 +33,7 @@ static PIX _pixSizeI;
static PIX _pixSizeJ; static PIX _pixSizeJ;
static CTimerValue _tv; static CTimerValue _tv;
static BOOL _bBlend = FALSE; static BOOL _bBlend = FALSE;
static BOOL _bVisible = FALSE; //static BOOL _bVisible = FALSE;
static BOOL _bTexture = FALSE; static BOOL _bTexture = FALSE;
static BOOL _bDepth = FALSE; static BOOL _bDepth = FALSE;
static BOOL _bMultiTexture = FALSE; static BOOL _bMultiTexture = FALSE;

View File

@ -274,7 +274,7 @@ void StartFog( CFogParameters &fp, const FLOAT3D &vViewPosAbs, const FLOATmatrix
// exp fog // exp fog
case AT_EXP: { case AT_EXP: {
// calculate linear step for the fog parameter // calculate linear step for the fog parameter
FLOAT fT = 0.0f; //FLOAT fT = 0.0f;
FLOAT fTStep = 1.0f/pixSizeL*fFar*fDensity*fA; FLOAT fTStep = 1.0f/pixSizeL*fFar*fDensity*fA;
// fog is exp(-t) function of fog parameter, now calculate // fog is exp(-t) function of fog parameter, now calculate
// step (actually multiplication) for the fog // step (actually multiplication) for the fog
@ -287,7 +287,7 @@ void StartFog( CFogParameters &fp, const FLOAT3D &vViewPosAbs, const FLOATmatrix
} break; } break;
case AT_EXP2: { case AT_EXP2: {
// calculate linear step for the fog parameter // calculate linear step for the fog parameter
FLOAT fT = 0.0f; //FLOAT fT = 0.0f;
FLOAT fTStep = 1.0f/pixSizeL*fFar*fDensity*fA; FLOAT fTStep = 1.0f/pixSizeL*fFar*fDensity*fA;
// fog is exp(-t^2) function of fog parameter, now calculate // fog is exp(-t^2) function of fog parameter, now calculate
// first and second order step (actually multiplication) for the fog // first and second order step (actually multiplication) for the fog

View File

@ -91,7 +91,9 @@ extern BOOL CVA_bModels;
static FLOAT _fLastBrightness, _fLastContrast, _fLastGamma; static FLOAT _fLastBrightness, _fLastContrast, _fLastGamma;
static FLOAT _fLastBiasR, _fLastBiasG, _fLastBiasB; static FLOAT _fLastBiasR, _fLastBiasG, _fLastBiasB;
static INDEX _iLastLevels; static INDEX _iLastLevels;
#ifdef PLATFORM_WIN32 // DG: not used on other platforms
static UWORD _auwGammaTable[256*3]; static UWORD _auwGammaTable[256*3];
#endif
// table for clipping [-512..+1024] to [0..255] // table for clipping [-512..+1024] to [0..255]
static UBYTE aubClipByte[256*2+ 256 +256*3]; static UBYTE aubClipByte[256*2+ 256 +256*3];
@ -1213,6 +1215,7 @@ void CGfxLibrary::Init(void)
// !!! FIXME : rcg11232001 Scripts/CustomOptions/GFX-AdvancedRendering.cfg // !!! FIXME : rcg11232001 Scripts/CustomOptions/GFX-AdvancedRendering.cfg
// !!! FIXME : rcg11232001 references non-existing cvars, so I'm adding // !!! FIXME : rcg11232001 references non-existing cvars, so I'm adding
// !!! FIXME : rcg11232001 them here for now. // !!! FIXME : rcg11232001 them here for now.
// FXME: DG: so why are they commented out?
// _pShell->DeclareSymbol("persistent user INDEX mdl_bRenderBump;", (void *) &mdl_bRenderBump); // _pShell->DeclareSymbol("persistent user INDEX mdl_bRenderBump;", (void *) &mdl_bRenderBump);
// _pShell->DeclareSymbol("persistent user FLOAT ogl_fTextureAnisotropy;", (void *) &ogl_fTextureAnisotropy); // _pShell->DeclareSymbol("persistent user FLOAT ogl_fTextureAnisotropy;", (void *) &ogl_fTextureAnisotropy);
_pShell->DeclareSymbol("persistent user FLOAT tex_fNormalSize;", (void *) &tex_fNormalSize); _pShell->DeclareSymbol("persistent user FLOAT tex_fNormalSize;", (void *) &tex_fNormalSize);
@ -1609,11 +1612,10 @@ void CGfxLibrary::UnlockDrawPort( CDrawPort *pdpToUnlock)
/* Create a new window canvas. */ /* Create a new window canvas. */
void CGfxLibrary::CreateWindowCanvas(void *hWnd, CViewPort **ppvpNew, CDrawPort **ppdpNew) void CGfxLibrary::CreateWindowCanvas(void *hWnd, CViewPort **ppvpNew, CDrawPort **ppdpNew)
{ {
RECT rectWindow; // rectangle for the client area of the window
// get the dimensions from the window // get the dimensions from the window
// !!! FIXME : rcg11052001 Abstract this. // !!! FIXME : rcg11052001 Abstract this.
#ifdef PLATFORM_WIN32 #ifdef PLATFORM_WIN32
RECT rectWindow; // rectangle for the client area of the window
GetClientRect( (HWND)hWnd, &rectWindow); GetClientRect( (HWND)hWnd, &rectWindow);
const PIX pixWidth = rectWindow.right - rectWindow.left; const PIX pixWidth = rectWindow.right - rectWindow.left;
const PIX pixHeight = rectWindow.bottom - rectWindow.top; const PIX pixHeight = rectWindow.bottom - rectWindow.top;
@ -1627,7 +1629,7 @@ void CGfxLibrary::CreateWindowCanvas(void *hWnd, CViewPort **ppvpNew, CDrawPort
*ppvpNew = NULL; *ppvpNew = NULL;
*ppdpNew = NULL; *ppdpNew = NULL;
// create a new viewport // create a new viewport
if (*ppvpNew = new CViewPort( pixWidth, pixHeight, (HWND)hWnd)) { if((*ppvpNew = new CViewPort( pixWidth, pixHeight, (HWND)hWnd))) {
// and it's drawport // and it's drawport
*ppdpNew = &(*ppvpNew)->vp_Raster.ra_MainDrawPort; *ppdpNew = &(*ppvpNew)->vp_Raster.ra_MainDrawPort;
} else { } else {
@ -1802,7 +1804,9 @@ INDEX _ctProbeShdU = 0;
INDEX _ctProbeShdB = 0; INDEX _ctProbeShdB = 0;
INDEX _ctFullShdU = 0; INDEX _ctFullShdU = 0;
SLONG _slFullShdUBytes = 0; SLONG _slFullShdUBytes = 0;
#ifdef PLATFORM_WIN32 // only used there
static BOOL GenerateGammaTable(void); static BOOL GenerateGammaTable(void);
#endif
@ -2064,7 +2068,7 @@ void CGfxLibrary::UnlockRaster( CRaster *praToUnlock)
} }
#ifdef PLATFORM_WIN32 // DG: only used on windows
// generates gamma table and returns true if gamma table has been changed // generates gamma table and returns true if gamma table has been changed
static BOOL GenerateGammaTable(void) static BOOL GenerateGammaTable(void)
{ {
@ -2140,7 +2144,7 @@ static BOOL GenerateGammaTable(void)
// done // done
return TRUE; return TRUE;
} }
#endif // PLATFORM_WIN32
#if 0 #if 0

View File

@ -220,7 +220,7 @@ void UploadTexture_OGL( ULONG *pulTexture, PIX pixSizeU, PIX pixSizeV,
#else #else
// Basically average every other pixel... // Basically average every other pixel...
UWORD w = 0; //UWORD w = 0;
UBYTE *dptr = (UBYTE *) pulDst; UBYTE *dptr = (UBYTE *) pulDst;
UBYTE *sptr = (UBYTE *) pulSrc; UBYTE *sptr = (UBYTE *) pulSrc;
#if 0 #if 0

View File

@ -72,7 +72,7 @@ FLOAT GFX_fLastF = 0;
INDEX GFX_ctVertices = 0; INDEX GFX_ctVertices = 0;
// for D3D: mark need for clipping (when wants to be disable but cannot be because of user clip plane) // for D3D: mark need for clipping (when wants to be disable but cannot be because of user clip plane)
static BOOL _bWantsClipping = TRUE; //static BOOL _bWantsClipping = TRUE;
// current color mask (for Get... function) // current color mask (for Get... function)
static ULONG _ulCurrentColorMask = (CT_RMASK|CT_GMASK|CT_BMASK|CT_AMASK); static ULONG _ulCurrentColorMask = (CT_RMASK|CT_GMASK|CT_BMASK|CT_AMASK);
// locking state for OGL // locking state for OGL
@ -81,7 +81,7 @@ static BOOL _bCVAReallyLocked = FALSE;
// clip plane and last view matrix for D3D // clip plane and last view matrix for D3D
FLOAT D3D_afClipPlane[4] = {0,0,0,0}; FLOAT D3D_afClipPlane[4] = {0,0,0,0};
FLOAT D3D_afViewMatrix[16] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0}; FLOAT D3D_afViewMatrix[16] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
static FLOAT _afActiveClipPlane[4] = {0,0,0,0}; //static FLOAT _afActiveClipPlane[4] = {0,0,0,0};
// Truform/N-Patches // Truform/N-Patches
INDEX truform_iLevel = -1; INDEX truform_iLevel = -1;

View File

@ -2673,7 +2673,7 @@ void DrawTriangle_Mask( UBYTE *pubMaskPlane, SLONG slMaskWidth, SLONG slMaskHeig
// find row counter and max delta J // find row counter and max delta J
SLONG ctJShort1 = pixMdJ - pixUpJ; SLONG ctJShort1 = pixMdJ - pixUpJ;
SLONG ctJShort2 = pixDnJ - pixMdJ; SLONG ctJShort2 = pixDnJ - pixMdJ;
SLONG ctJLong = pixDnJ - pixUpJ; //SLONG ctJLong = pixDnJ - pixUpJ;
FLOAT currK, curr1oK, currUoK, currVoK; FLOAT currK, curr1oK, currUoK, currVoK;
PIX pixJ = pixUpJ; PIX pixJ = pixUpJ;

View File

@ -78,6 +78,7 @@ static __forceinline CTStream &operator>>(CTStream &strm, PCXHeader &t) {
return strm; return strm;
} }
#if 0 // DG: unused.
static __forceinline CTStream &operator<<(CTStream &strm, const PCXHeader &t) { static __forceinline CTStream &operator<<(CTStream &strm, const PCXHeader &t) {
strm<<t.MagicID; strm<<t.MagicID;
strm<<t.Version; strm<<t.Version;
@ -99,6 +100,7 @@ static __forceinline CTStream &operator<<(CTStream &strm, const PCXHeader &t) {
strm.Write_t(t.Filler, sizeof (t.Filler)); strm.Write_t(t.Filler, sizeof (t.Filler));
return strm; return strm;
} }
#endif // 0
// TARGA header structure // TARGA header structure
struct TGAHeader struct TGAHeader
@ -129,6 +131,7 @@ static __forceinline CTStream &operator>>(CTStream &strm, TGAHeader &t) {
return(strm); return(strm);
} }
#if 0 // DG: unused.
static __forceinline CTStream &operator<<(CTStream &strm, const TGAHeader &t) { static __forceinline CTStream &operator<<(CTStream &strm, const TGAHeader &t) {
strm<<t.IdLength; strm<<t.IdLength;
strm<<t.ColorMapType; strm<<t.ColorMapType;
@ -142,6 +145,7 @@ static __forceinline CTStream &operator<<(CTStream &strm, const TGAHeader &t) {
strm<<t.Descriptor; strm<<t.Descriptor;
return(strm); return(strm);
} }
#endif // 0 (unused)
/****************************************************** /******************************************************

View File

@ -843,6 +843,7 @@ void CTextureData::Read_t( CTStream *inFile)
*inFile >> ctEffectSources; *inFile >> ctEffectSources;
// add requested number of members to effect source array // add requested number of members to effect source array
CTextureEffectSource *pEffectSources = td_ptegEffect->teg_atesEffectSources.New( ctEffectSources); CTextureEffectSource *pEffectSources = td_ptegEffect->teg_atesEffectSources.New( ctEffectSources);
(void)pEffectSources;
// read whole dynamic array of effect sources // read whole dynamic array of effect sources
FOREACHINDYNAMICARRAY( td_ptegEffect->teg_atesEffectSources, CTextureEffectSource, itEffectSource) FOREACHINDYNAMICARRAY( td_ptegEffect->teg_atesEffectSources, CTextureEffectSource, itEffectSource)

View File

@ -2915,9 +2915,9 @@ static void AnimateFire( SLONG slDensity)
// use only one buffer (otherwise it's not working) // use only one buffer (otherwise it's not working)
UBYTE *pubNew = (UBYTE*)_ptdEffect->td_pubBuffer2; UBYTE *pubNew = (UBYTE*)_ptdEffect->td_pubBuffer2;
SLONG slBufferMask = _pixBufferWidth*_pixBufferHeight -1; SLONG slBufferMask = _pixBufferWidth*_pixBufferHeight -1;
SLONG slColumnModulo = _pixBufferWidth*(_pixBufferHeight-2) -1;
#if ASMOPT == 1 #if ASMOPT == 1
SLONG slColumnModulo = _pixBufferWidth*(_pixBufferHeight-2) -1;
#if (defined __MSVC_INLINE__) #if (defined __MSVC_INLINE__)
__asm { __asm {

View File

@ -329,8 +329,8 @@ void CLayerMaker::SpreadShadowMaskOutwards(void)
PIX pixLayerMinV = lm_pixLayerMinV>>iMipmap; PIX pixLayerMinV = lm_pixLayerMinV>>iMipmap;
PIX pixLayerSizeU = lm_pixLayerSizeU>>iMipmap; PIX pixLayerSizeU = lm_pixLayerSizeU>>iMipmap;
PIX pixLayerSizeV = lm_pixLayerSizeV>>iMipmap; PIX pixLayerSizeV = lm_pixLayerSizeV>>iMipmap;
PIX pixSizeU = lm_pixSizeU>>iMipmap; //PIX pixSizeU = lm_pixSizeU>>iMipmap;
PIX pixSizeV = lm_pixSizeV>>iMipmap; //PIX pixSizeV = lm_pixSizeV>>iMipmap;
PIX pixSizeULog2 = FastLog2(lm_pixSizeU)-iMipmap; PIX pixSizeULog2 = FastLog2(lm_pixSizeU)-iMipmap;
UBYTE *pubLayer = lm_pubLayer+lm_mmtLayer.mmt_aslOffsets[iMipmap]; UBYTE *pubLayer = lm_pubLayer+lm_mmtLayer.mmt_aslOffsets[iMipmap];
UBYTE *pubPolygonMask = lm_pubPolygonMask+lm_mmtPolygonMask.mmt_aslOffsets[iMipmap]; UBYTE *pubPolygonMask = lm_pubPolygonMask+lm_mmtPolygonMask.mmt_aslOffsets[iMipmap];
@ -419,8 +419,8 @@ void CLayerMaker::SpreadShadowMaskInwards(void)
PIX pixLayerMinV = lm_pixLayerMinV>>iMipmap; PIX pixLayerMinV = lm_pixLayerMinV>>iMipmap;
PIX pixLayerSizeU = lm_pixLayerSizeU>>iMipmap; PIX pixLayerSizeU = lm_pixLayerSizeU>>iMipmap;
PIX pixLayerSizeV = lm_pixLayerSizeV>>iMipmap; PIX pixLayerSizeV = lm_pixLayerSizeV>>iMipmap;
PIX pixSizeU = lm_pixSizeU>>iMipmap; //PIX pixSizeU = lm_pixSizeU>>iMipmap;
PIX pixSizeV = lm_pixSizeV>>iMipmap; //PIX pixSizeV = lm_pixSizeV>>iMipmap;
PIX pixSizeULog2 = FastLog2(lm_pixSizeU)-iMipmap; PIX pixSizeULog2 = FastLog2(lm_pixSizeU)-iMipmap;
UBYTE *pubLayer = lm_pubLayer+lm_mmtLayer.mmt_aslOffsets[iMipmap]; UBYTE *pubLayer = lm_pubLayer+lm_mmtLayer.mmt_aslOffsets[iMipmap];
UBYTE *pubPolygonMask = lm_pubPolygonMask+lm_mmtPolygonMask.mmt_aslOffsets[iMipmap]; UBYTE *pubPolygonMask = lm_pubPolygonMask+lm_mmtPolygonMask.mmt_aslOffsets[iMipmap];
@ -526,7 +526,7 @@ void CLayerMaker::MakePolygonMask(void)
UBYTE *pub = lm_pubPolygonMask; UBYTE *pub = lm_pubPolygonMask;
// for each mip-map // for each mip-map
for (INDEX iMipmap=0; iMipmap<lm_mmtPolygonMask.mmt_ctMipmaps; iMipmap++) { for (INDEX iMipmap=0; iMipmap<lm_mmtPolygonMask.mmt_ctMipmaps; iMipmap++) {
UBYTE *pubForSaving = pub; //UBYTE *pubForSaving = pub;
// start at the first pixel // start at the first pixel
FLOAT3D vRow = lm_vO+(lm_vStepU+lm_vStepV)*(FLOAT(1<<iMipmap)/2.0f); FLOAT3D vRow = lm_vO+(lm_vStepU+lm_vStepV)*(FLOAT(1<<iMipmap)/2.0f);
// for each pixel in the shadow map // for each pixel in the shadow map
@ -565,8 +565,8 @@ void CLayerMaker::MakePolygonMask(void)
// flip shadow mask around V axis (for parallel lights) // flip shadow mask around V axis (for parallel lights)
void CLayerMaker::FlipShadowMask(INDEX iMip) void CLayerMaker::FlipShadowMask(INDEX iMip)
{ {
PIX pixLayerMinU = lm_pixLayerMinU>>iMip; //PIX pixLayerMinU = lm_pixLayerMinU>>iMip;
PIX pixLayerMinV = lm_pixLayerMinV>>iMip; //PIX pixLayerMinV = lm_pixLayerMinV>>iMip;
PIX pixLayerSizeU = lm_pixLayerSizeU>>iMip; PIX pixLayerSizeU = lm_pixLayerSizeU>>iMip;
PIX pixLayerSizeV = lm_pixLayerSizeV>>iMip; PIX pixLayerSizeV = lm_pixLayerSizeV>>iMip;
UBYTE *pubLayer = lm_pubLayer+lm_mmtLayer.mmt_aslOffsets[iMip]; UBYTE *pubLayer = lm_pubLayer+lm_mmtLayer.mmt_aslOffsets[iMip];
@ -632,7 +632,7 @@ ULONG CLayerMaker::MakeShadowMask(CBrushShadowLayer *pbsl)
// allocate shadow mask for the light (+8 is safety wall for fast conversions) // allocate shadow mask for the light (+8 is safety wall for fast conversions)
lm_pubLayer = (UBYTE *)AllocMemory(lm_mmtLayer.mmt_slTotalSize+8); lm_pubLayer = (UBYTE *)AllocMemory(lm_mmtLayer.mmt_slTotalSize+8);
const FLOAT fEpsilon = (1<<lm_iMipLevel)/1024.0f; //const FLOAT fEpsilon = (1<<lm_iMipLevel)/1024.0f;
ULONG ulLighted=BSLF_ALLLIGHT|BSLF_ALLDARK; ULONG ulLighted=BSLF_ALLLIGHT|BSLF_ALLDARK;
// if this polygon requires exact shadows // if this polygon requires exact shadows

View File

@ -128,6 +128,7 @@ static inline void IncrementByteWithClip( UBYTE &ub, SLONG slAdd)
ub = pubClipByte[(SLONG)ub+slAdd]; ub = pubClipByte[(SLONG)ub+slAdd];
} }
#if 0 // DG: unused.
// increment a color without overflowing it // increment a color without overflowing it
static inline void IncrementColorWithClip( UBYTE &ubR, UBYTE &ubG, UBYTE &ubB, static inline void IncrementColorWithClip( UBYTE &ubR, UBYTE &ubG, UBYTE &ubB,
SLONG slR, SLONG slG, SLONG slB) SLONG slR, SLONG slG, SLONG slB)
@ -136,6 +137,7 @@ static inline void IncrementColorWithClip( UBYTE &ubR, UBYTE &ubG, UBYTE &ubB,
IncrementByteWithClip( ubG, slG); IncrementByteWithClip( ubG, slG);
IncrementByteWithClip( ubB, slB); IncrementByteWithClip( ubB, slB);
} }
#endif // 0 (unused)
// add the intensity to the pixel // add the intensity to the pixel
inline void CLayerMixer::AddToCluster( UBYTE *pub) inline void CLayerMixer::AddToCluster( UBYTE *pub)
@ -276,7 +278,7 @@ void CLayerMixer::AddAmbientPoint(void)
// prepare some local variables // prepare some local variables
mmDDL2oDU_AddAmbientPoint = _slDDL2oDU; mmDDL2oDU_AddAmbientPoint = _slDDL2oDU;
mmDDL2oDV_AddAmbientPoint = _slDDL2oDV; mmDDL2oDV_AddAmbientPoint = _slDDL2oDV;
ULONG ulLightRGB = ByteSwap(lm_colLight); ULONG ulLightRGB = ByteSwap(lm_colLight); // FIXME: shouldn't this be used in plain C impl too?
_slLightMax<<=7; _slLightMax<<=7;
_slLightStep>>=1; _slLightStep>>=1;
@ -476,7 +478,7 @@ void CLayerMixer::AddAmbientMaskPoint( UBYTE *pubMask, UBYTE ubMask)
// prepare some local variables // prepare some local variables
mmDDL2oDU_addAmbientMaskPoint = _slDDL2oDU; mmDDL2oDU_addAmbientMaskPoint = _slDDL2oDU;
mmDDL2oDV_addAmbientMaskPoint = _slDDL2oDV; mmDDL2oDV_addAmbientMaskPoint = _slDDL2oDV;
ULONG ulLightRGB = ByteSwap(lm_colLight); ULONG ulLightRGB = ByteSwap(lm_colLight); // FIXME: shouldn't this be used in plain C impl too?
_slLightMax<<=7; _slLightMax<<=7;
_slLightStep>>=1; _slLightStep>>=1;
@ -654,7 +656,7 @@ skipPixel:
for( PIX pixU=0; pixU<_iPixCt; pixU++) for( PIX pixU=0; pixU<_iPixCt; pixU++)
{ {
// if the point is not masked // if the point is not masked
if( *pubMask & ubMask && (slL2Point<FTOX)) { if( (*pubMask & ubMask) && (slL2Point<FTOX)) {
SLONG slL = (slL2Point>>SHIFTX)&(SQRTTABLESIZE-1); // and is just for degenerate cases SLONG slL = (slL2Point>>SHIFTX)&(SQRTTABLESIZE-1); // and is just for degenerate cases
SLONG slIntensity = _slLightMax; SLONG slIntensity = _slLightMax;
slL = aubSqrt[slL]; slL = aubSqrt[slL];
@ -699,7 +701,7 @@ void CLayerMixer::AddDiffusionPoint(void)
// prepare some local variables // prepare some local variables
mmDDL2oDU_AddDiffusionPoint = _slDDL2oDU; mmDDL2oDU_AddDiffusionPoint = _slDDL2oDU;
mmDDL2oDV_AddDiffusionPoint = _slDDL2oDV; mmDDL2oDV_AddDiffusionPoint = _slDDL2oDV;
ULONG ulLightRGB = ByteSwap(lm_colLight); ULONG ulLightRGB = ByteSwap(lm_colLight); // FIXME: shouldn't this be used in plain C impl too?
_slLightMax<<=7; _slLightMax<<=7;
_slLightStep>>=1; _slLightStep>>=1;
@ -900,7 +902,7 @@ void CLayerMixer::AddDiffusionMaskPoint( UBYTE *pubMask, UBYTE ubMask)
// prepare some local variables // prepare some local variables
mmDDL2oDU_AddDiffusionMaskPoint = _slDDL2oDU; mmDDL2oDU_AddDiffusionMaskPoint = _slDDL2oDU;
mmDDL2oDV_AddDiffusionMaskPoint = _slDDL2oDV; mmDDL2oDV_AddDiffusionMaskPoint = _slDDL2oDV;
ULONG ulLightRGB = ByteSwap(lm_colLight); ULONG ulLightRGB = ByteSwap(lm_colLight); // FIXME: shouldn't this be used in plain C impl too?
_slLightMax<<=7; _slLightMax<<=7;
_slLightStep>>=1; _slLightStep>>=1;
@ -1076,7 +1078,7 @@ skipPixel:
for( PIX pixU=0; pixU<_iPixCt; pixU++) for( PIX pixU=0; pixU<_iPixCt; pixU++)
{ {
// if the point is not masked // if the point is not masked
if( *pubMask&ubMask && (slL2Point<FTOX)) { if( (*pubMask & ubMask) && (slL2Point<FTOX)) {
SLONG sl1oL = (slL2Point>>SHIFTX)&(SQRTTABLESIZE-1); // and is just for degenerate cases SLONG sl1oL = (slL2Point>>SHIFTX)&(SQRTTABLESIZE-1); // and is just for degenerate cases
sl1oL = auw1oSqrt[sl1oL]; sl1oL = auw1oSqrt[sl1oL];
SLONG slIntensity = _slLightMax; SLONG slIntensity = _slLightMax;
@ -1709,7 +1711,7 @@ void CLayerMixer::AddOneLayerDirectional( CBrushShadowLayer *pbsl, UBYTE *pubMas
// get the light source of the layer // get the light source of the layer
lm_plsLight = pbsl->bsl_plsLightSource; lm_plsLight = pbsl->bsl_plsLightSource;
const FLOAT3D &vLight = lm_plsLight->ls_penEntity->GetPlacement().pl_PositionVector; //const FLOAT3D &vLight = lm_plsLight->ls_penEntity->GetPlacement().pl_PositionVector;
AnglesToDirectionVector( lm_plsLight->ls_penEntity->GetPlacement().pl_OrientationAngle, AnglesToDirectionVector( lm_plsLight->ls_penEntity->GetPlacement().pl_OrientationAngle,
lm_vLightDirection); lm_vLightDirection);
// calculate intensity // calculate intensity
@ -1845,7 +1847,7 @@ void CLayerMixer::MixOneMipmap(CBrushShadowMap *pbsm, INDEX iMipmap)
ASSERT( &ls!=NULL); if( &ls==NULL) continue; // safety check ASSERT( &ls!=NULL); if( &ls==NULL) continue; // safety check
// skip if should not be applied // skip if should not be applied
if( (bDynamicOnly && !(ls.ls_ulFlags&LSF_NONPERSISTENT)) || ls.ls_ulFlags&LSF_DYNAMIC) continue; if( (bDynamicOnly && !(ls.ls_ulFlags&LSF_NONPERSISTENT)) || (ls.ls_ulFlags & LSF_DYNAMIC)) continue;
// set corresponding shadowmap flag if this is an animating light // set corresponding shadowmap flag if this is an animating light
if( ls.ls_paoLightAnimation!=NULL) lm_pbsmShadowMap->sm_ulFlags |= SMF_ANIMATINGLIGHTS; if( ls.ls_paoLightAnimation!=NULL) lm_pbsmShadowMap->sm_ulFlags |= SMF_ANIMATINGLIGHTS;

View File

@ -90,6 +90,7 @@ static int qsort_CompareVerticesAlongLine(const void *pvVertex0, const void *pvV
CObjectVertex &vx1 = **(CObjectVertex **)pvVertex1; CObjectVertex &vx1 = **(CObjectVertex **)pvVertex1;
return CompareVerticesAlongLine(vx0, vx1); return CompareVerticesAlongLine(vx0, vx1);
} }
#if 0 // DG: unused.
/* /*
* Compare two vertices along a line for quick-sort - reversely. * Compare two vertices along a line for quick-sort - reversely.
*/ */
@ -99,6 +100,7 @@ static int qsort_CompareVerticesAlongLineReversely(const void *pvVertex0, const
CObjectVertex &vx1 = **(CObjectVertex **)pvVertex1; CObjectVertex &vx1 = **(CObjectVertex **)pvVertex1;
return -CompareVerticesAlongLine(vx0, vx1); return -CompareVerticesAlongLine(vx0, vx1);
} }
#endif // 0 (unused)
/* /*
@ -548,6 +550,7 @@ CObjectPolygon *CObjectSector::CreatePolygon(INDEX ctVertices, INDEX aivVertices
void CObjectSector::CheckOptimizationAlgorithm(void) void CObjectSector::CheckOptimizationAlgorithm(void)
{ {
// for vertices // for vertices
#if 0 // DG: this doesn't really do anything?!
FOREACHINDYNAMICARRAY(osc_aovxVertices, CObjectVertex, itvx1) { FOREACHINDYNAMICARRAY(osc_aovxVertices, CObjectVertex, itvx1) {
FOREACHINDYNAMICARRAY(osc_aovxVertices, CObjectVertex, itvx2) { FOREACHINDYNAMICARRAY(osc_aovxVertices, CObjectVertex, itvx2) {
CObjectVertex &vx1 = itvx1.Current(); CObjectVertex &vx1 = itvx1.Current();
@ -555,6 +558,7 @@ void CObjectSector::CheckOptimizationAlgorithm(void)
// !!!!why this fails sometimes ?(on spheres) ASSERT( (&vx1 == &vx2) || (CompareVertices(vx1, vx2)!=0) ); // !!!!why this fails sometimes ?(on spheres) ASSERT( (&vx1 == &vx2) || (CompareVertices(vx1, vx2)!=0) );
} }
} }
#endif // 0
// for planes // for planes
FOREACHINDYNAMICARRAY(osc_aoplPlanes, CObjectPlane, itpl1) { FOREACHINDYNAMICARRAY(osc_aoplPlanes, CObjectPlane, itpl1) {
@ -600,7 +604,7 @@ void CObjectSector::CheckOptimizationAlgorithm(void)
{FOREACHINDYNAMICARRAY(osc_aopoPolygons, CObjectPolygon, itopo) { {FOREACHINDYNAMICARRAY(osc_aopoPolygons, CObjectPolygon, itopo) {
// for each edge in polygon // for each edge in polygon
{FOREACHINDYNAMICARRAY(itopo->opo_PolygonEdges, CObjectPolygonEdge, itope) { {FOREACHINDYNAMICARRAY(itopo->opo_PolygonEdges, CObjectPolygonEdge, itope) {
CObjectEdge &oedThis = *itope->ope_Edge; //CObjectEdge &oedThis = *itope->ope_Edge;
CObjectVertex *povxStartThis, *povxEndThis; CObjectVertex *povxStartThis, *povxEndThis;
// get start and end vertices // get start and end vertices
itope->GetVertices(povxStartThis, povxEndThis); itope->GetVertices(povxStartThis, povxEndThis);
@ -629,7 +633,7 @@ BOOL CObjectSector::ArePolygonsPlanar(void)
{FOREACHINDYNAMICARRAY(osc_aopoPolygons, CObjectPolygon, itopo) { {FOREACHINDYNAMICARRAY(osc_aopoPolygons, CObjectPolygon, itopo) {
// for each edge in polygon // for each edge in polygon
{FOREACHINDYNAMICARRAY(itopo->opo_PolygonEdges, CObjectPolygonEdge, itope) { {FOREACHINDYNAMICARRAY(itopo->opo_PolygonEdges, CObjectPolygonEdge, itope) {
CObjectEdge &oedThis = *itope->ope_Edge; //CObjectEdge &oedThis = *itope->ope_Edge;
CObjectVertex *povxStartThis, *povxEndThis; CObjectVertex *povxStartThis, *povxEndThis;
// get start and end vertices // get start and end vertices
itope->GetVertices(povxStartThis, povxEndThis); itope->GetVertices(povxStartThis, povxEndThis);
@ -715,7 +719,7 @@ void CObjectSector::RemapClonedPlanes(void)
/* /*
* Remap different vertices with same coordinates to use only one of each. * Remap different vertices with same coordinates to use only one of each.
*/ */
static BOOL bBug=FALSE; //static BOOL bBug=FALSE;
void CObjectSector::RemapClonedVertices(void) void CObjectSector::RemapClonedVertices(void)
{ {
// if there are no vertices in the sector // if there are no vertices in the sector
@ -1107,7 +1111,7 @@ void CObjectPolygon::JoinContinuingEdges(CDynamicArray<CObjectEdge> &oedEdges)
// create an empty array for newly created edges // create an empty array for newly created edges
CDynamicArray<CObjectPolygonEdge> aopeNew; CDynamicArray<CObjectPolygonEdge> aopeNew;
// set the counter of edges to current number of edges // set the counter of edges to current number of edges
INDEX ctEdges = opo_PolygonEdges.Count(); //INDEX ctEdges = opo_PolygonEdges.Count();
// for each edge // for each edge
{FOREACHINDYNAMICARRAY(opo_PolygonEdges, CObjectPolygonEdge, itope) { {FOREACHINDYNAMICARRAY(opo_PolygonEdges, CObjectPolygonEdge, itope) {
@ -1186,10 +1190,10 @@ void CObjectSector::SplitCollinearEdgesRun(CStaticArray<CEdgeEx *> &apedxSortedE
if (iFirstInRun>iLastInRun) { if (iFirstInRun>iLastInRun) {
return; // this should not happen, but anyway! return; // this should not happen, but anyway!
} }
CEdgeEx &edxLine = *apedxSortedEdgeLines[iFirstInRun]; // representative line of the run
/* set up array of vertex pointers */ /* set up array of vertex pointers */
/* /*
CEdgeEx &edxLine = *apedxSortedEdgeLines[iFirstInRun]; // representative line of the run
// for each vertex in sector // for each vertex in sector
INDEX ctVerticesOnLine=0; INDEX ctVerticesOnLine=0;
{FOREACHINDYNAMICARRAY(osc_aovxVertices, CObjectVertex, itovx) { {FOREACHINDYNAMICARRAY(osc_aovxVertices, CObjectVertex, itovx) {

View File

@ -138,7 +138,7 @@ void CMappingDefinition::TransformMappingVectors( const CMappingVectors &mvSrc,
FLOAT vot2 = +sou2*ood2; FLOAT vos2 = -tou2*ood2; FLOAT vot2 = +sou2*ood2; FLOAT vos2 = -tou2*ood2;
mvDst.mv_vO = mvSrc.mv_vO mvDst.mv_vO = mvSrc.mv_vO
+ mvDst.mv_vU * (md_fUOffset*uos2 + md_fVOffset*vos2) + mvDst.mv_vU * (md_fUOffset*uos2 + md_fVOffset*vos2) // FIXME: should vos2 have been uot2 here?
+ mvDst.mv_vV * (md_fUOffset*vos2 + md_fVOffset*vot2); + mvDst.mv_vV * (md_fUOffset*vos2 + md_fVOffset*vot2);
} }
} }
@ -263,9 +263,9 @@ void CMappingDefinition::ProjectMapping(const FLOATplane3D &plOriginal, const CM
mv.mv_vO = pl.DeprojectPoint (plOriginal, mvOriginal.mv_vO); mv.mv_vO = pl.DeprojectPoint (plOriginal, mvOriginal.mv_vO);
mv.mv_vU = pl.DeprojectDirection(plOriginal, mvOriginal.mv_vU); mv.mv_vU = pl.DeprojectDirection(plOriginal, mvOriginal.mv_vU);
mv.mv_vV = pl.DeprojectDirection(plOriginal, mvOriginal.mv_vV); mv.mv_vV = pl.DeprojectDirection(plOriginal, mvOriginal.mv_vV);
FLOAT3D vOTest = plOriginal.ProjectPoint(mv.mv_vO); //FLOAT3D vOTest = plOriginal.ProjectPoint(mv.mv_vO);
FLOAT3D vUTest = plOriginal.ProjectDirection(mv.mv_vU); //FLOAT3D vUTest = plOriginal.ProjectDirection(mv.mv_vU);
FLOAT3D vVTest = plOriginal.ProjectDirection(mv.mv_vV); //FLOAT3D vVTest = plOriginal.ProjectDirection(mv.mv_vV);
// make mapping on this plane // make mapping on this plane
CMappingVectors mvDefault; CMappingVectors mvDefault;

View File

@ -1068,7 +1068,7 @@ void CModelData::IndicesToPtrs()
{ {
FOREACHINSTATICARRAY(it1.Current().mp_PolygonVertices, ModelPolygonVertex, it2) FOREACHINSTATICARRAY(it1.Current().mp_PolygonVertices, ModelPolygonVertex, it2)
{ {
struct ModelPolygonVertex * pMPV = &it2.Current(); //struct ModelPolygonVertex * pMPV = &it2.Current();
// DG: this looks like a 64-bit issue but is most probably ok, as the pointers // DG: this looks like a 64-bit issue but is most probably ok, as the pointers
// should contain indices from PtrToIndices() // should contain indices from PtrToIndices()
j = (INDEX) (size_t) it2.Current().mpv_ptvTransformedVertex; j = (INDEX) (size_t) it2.Current().mpv_ptvTransformedVertex;

View File

@ -43,7 +43,7 @@ static FLOAT fZoomI, fZoomJ;
static FLOAT fFrontClipDistance, f1oFrontClipDistance; static FLOAT fFrontClipDistance, f1oFrontClipDistance;
static FLOAT fBackClipDistance, f1oBackClipDistance; static FLOAT fBackClipDistance, f1oBackClipDistance;
static FLOAT fDepthBufferFactor; static FLOAT fDepthBufferFactor;
static BOOL bBackFaced, bDoubleSided; //static BOOL bBackFaced, bDoubleSided;
static BOOL bPerspective; static BOOL bPerspective;
static BOOL b16BitCompression; static BOOL b16BitCompression;
static ULONG ulColorMask; static ULONG ulColorMask;

View File

@ -475,7 +475,7 @@ static void PrepareModelMipForRendering( CModelData &md, INDEX iMip)
// for each surface // for each surface
INDEX iSrfVx = 0; INDEX iSrfVx = 0;
INDEX iSrfEl = 0; //INDEX iSrfEl = 0;
{FOREACHINSTATICARRAY( mmi.mmpi_MappingSurfaces, MappingSurface, itms) {FOREACHINSTATICARRAY( mmi.mmpi_MappingSurfaces, MappingSurface, itms)
{ {
MappingSurface &ms = *itms; MappingSurface &ms = *itms;
@ -2286,7 +2286,7 @@ diffColLoop:
// for each vertex in the surface // for each vertex in the surface
for( INDEX iSrfVx=0; iSrfVx<ctSrfVx; iSrfVx++) { for( INDEX iSrfVx=0; iSrfVx<ctSrfVx; iSrfVx++) {
// set detail texcoord and color // set detail texcoord and color
INDEX iMipVx = mmi.mmpi_auwSrfToMip[iSrfVx]; //INDEX iMipVx = mmi.mmpi_auwSrfToMip[iSrfVx];
ptexSrfBase[iSrfVx].st.s = pvTexCoord[iSrfVx](1) * fTexCorrU; ptexSrfBase[iSrfVx].st.s = pvTexCoord[iSrfVx](1) * fTexCorrU;
ptexSrfBase[iSrfVx].st.t = pvTexCoord[iSrfVx](2) * fTexCorrV; ptexSrfBase[iSrfVx].st.t = pvTexCoord[iSrfVx](2) * fTexCorrV;
pcolSrfBase[iSrfVx] = colSrfBump; pcolSrfBase[iSrfVx] = colSrfBump;

View File

@ -98,10 +98,10 @@ void CModelObject::GetModelVertices( CStaticStackArray<FLOAT3D> &avVertices, FLO
_vOffset = vOffset = pmd->md_vCompressedCenter; _vOffset = vOffset = pmd->md_vCompressedCenter;
// check if object is inverted (in mirror) // check if object is inverted (in mirror)
BOOL bXInverted = vStretch(1)<0; //BOOL bXInverted = vStretch(1)<0;
BOOL bYInverted = vStretch(2)<0; //BOOL bYInverted = vStretch(2)<0;
BOOL bZInverted = vStretch(3)<0; //BOOL bZInverted = vStretch(3)<0;
BOOL bInverted = bXInverted!=bYInverted!=bZInverted; //BOOL bInverted = bXInverted!=bYInverted!=bZInverted;
// if dynamic stretch factor should be applied // if dynamic stretch factor should be applied
if( mo_Stretch != FLOAT3D( 1.0f, 1.0f, 1.0f)) { if( mo_Stretch != FLOAT3D( 1.0f, 1.0f, 1.0f)) {
@ -113,7 +113,7 @@ void CModelObject::GetModelVertices( CStaticStackArray<FLOAT3D> &avVertices, FLO
// get current mip model using mip factor // get current mip model using mip factor
INDEX iMipLevel = GetMipModel( fMipFactor); INDEX iMipLevel = GetMipModel( fMipFactor);
// get current vertices mask // get current vertices mask
ULONG ulVtxMask = (1L) << iMipLevel; //ULONG ulVtxMask = (1L) << iMipLevel;
struct ModelMipInfo *pmmiMip = &pmd->md_MipInfos[iMipLevel]; struct ModelMipInfo *pmmiMip = &pmd->md_MipInfos[iMipLevel];
// allocate space for vertices // allocate space for vertices
@ -188,7 +188,7 @@ void CModelObject::GetModelVertices( CStaticStackArray<FLOAT3D> &avVertices, FLO
CAttachmentModelObject *pamo = itamo; CAttachmentModelObject *pamo = itamo;
CModelData *pmd=pamo->amo_moModelObject.GetData(); CModelData *pmd=pamo->amo_moModelObject.GetData();
ASSERT(pmd!=NULL); ASSERT(pmd!=NULL);
if(pmd==NULL || pmd->md_Flags&(MF_FACE_FORWARD|MF_HALF_FACE_FORWARD)) continue; if(pmd==NULL || (pmd->md_Flags & (MF_FACE_FORWARD|MF_HALF_FACE_FORWARD))) continue;
FLOATmatrix3D mNew = mRotation; FLOATmatrix3D mNew = mRotation;
FLOAT3D vNew = vPosition; FLOAT3D vNew = vPosition;
// get new rotation and position matrices // get new rotation and position matrices

View File

@ -92,7 +92,7 @@ void CActionBuffer::RemoveOldest(void)
{ {
// for each buffered action // for each buffered action
FORDELETELIST(CActionEntry, ae_ln, ab_lhActions, itae) { FORDELETELIST(CActionEntry, ae_ln, ab_lhActions, itae) {
CActionEntry &ae = *itae; //CActionEntry &ae = *itae;
// delete only first one // delete only first one
delete &*itae; delete &*itae;
break; break;

View File

@ -402,7 +402,7 @@ BOOL CClientInterface::UpdateInputBuffers(void)
// if there are packets in the input buffer, process them // if there are packets in the input buffer, process them
FORDELETELIST(CPacket,pa_lnListNode,ci_pbInputBuffer.pb_lhPacketStorage,ppaPacket) { FORDELETELIST(CPacket,pa_lnListNode,ci_pbInputBuffer.pb_lhPacketStorage,ppaPacket) {
CPacket &paPacket = *ppaPacket; //CPacket &paPacket = *ppaPacket;
// if it's an acknowledge packet, remove the acknowledged packets from the wait acknowledge buffer // if it's an acknowledge packet, remove the acknowledged packets from the wait acknowledge buffer
if (ppaPacket->pa_ubReliable & UDP_PACKET_ACKNOWLEDGE) { if (ppaPacket->pa_ubReliable & UDP_PACKET_ACKNOWLEDGE) {
@ -552,7 +552,7 @@ BOOL CClientInterface::UpdateInputBuffersBroadcast(void)
// if there are packets in the input buffer, process them // if there are packets in the input buffer, process them
FORDELETELIST(CPacket,pa_lnListNode,ci_pbInputBuffer.pb_lhPacketStorage,ppaPacket) { FORDELETELIST(CPacket,pa_lnListNode,ci_pbInputBuffer.pb_lhPacketStorage,ppaPacket) {
CPacket &paPacket = *ppaPacket; //CPacket &paPacket = *ppaPacket;
// if it's an acknowledge packet, remove the acknowledged packets from the wait acknowledge buffer // if it's an acknowledge packet, remove the acknowledged packets from the wait acknowledge buffer
if (ppaPacket->pa_ubReliable & UDP_PACKET_ACKNOWLEDGE) { if (ppaPacket->pa_ubReliable & UDP_PACKET_ACKNOWLEDGE) {

View File

@ -124,7 +124,7 @@ UBYTE *FindFirstEntity(UBYTE *pubBlock, SLONG slSize)
if (*(ULONG*)pub == ENT4) { if (*(ULONG*)pub == ENT4) {
UBYTE *pubTmp = pub; UBYTE *pubTmp = pub;
pubTmp+=sizeof(ULONG); pubTmp+=sizeof(ULONG);
ULONG ulID = *(ULONG*)pubTmp; //ULONG ulID = *(ULONG*)pubTmp;
pubTmp+=sizeof(ULONG); pubTmp+=sizeof(ULONG);
SLONG slSizeChunk = *(SLONG*)pubTmp; SLONG slSizeChunk = *(SLONG*)pubTmp;
pubTmp+=sizeof(ULONG); pubTmp+=sizeof(ULONG);
@ -221,7 +221,7 @@ void MakeDiff_t(void)
void UnDiff_t(void) void UnDiff_t(void)
{ {
// start at beginning // start at beginning
UBYTE *pubOld = _pubOld; //UBYTE *pubOld = _pubOld;
UBYTE *pubNew = _pubNew; UBYTE *pubNew = _pubNew;
SLONG slSizeOldStream = 0; SLONG slSizeOldStream = 0;
SLONG slSizeOutStream = 0; SLONG slSizeOutStream = 0;
@ -314,7 +314,7 @@ void Cleanup(void)
void DIFF_Diff_t(CTStream *pstrmOld, CTStream *pstrmNew, CTStream *pstrmDiff) void DIFF_Diff_t(CTStream *pstrmOld, CTStream *pstrmNew, CTStream *pstrmDiff)
{ {
try { try {
CTimerValue tv0 = _pTimer->GetHighPrecisionTimer(); //CTimerValue tv0 = _pTimer->GetHighPrecisionTimer();
_slSizeOld = pstrmOld->GetStreamSize()-pstrmOld->GetPos_t(); _slSizeOld = pstrmOld->GetStreamSize()-pstrmOld->GetPos_t();
_pubOld = (UBYTE*)AllocMemory(_slSizeOld); _pubOld = (UBYTE*)AllocMemory(_slSizeOld);
@ -332,7 +332,7 @@ void DIFF_Diff_t(CTStream *pstrmOld, CTStream *pstrmNew, CTStream *pstrmDiff)
MakeDiff_t(); MakeDiff_t();
CTimerValue tv1 = _pTimer->GetHighPrecisionTimer(); //CTimerValue tv1 = _pTimer->GetHighPrecisionTimer();
//CPrintF("diff encoded in %.2gs\n", (tv1-tv0).GetSeconds()); //CPrintF("diff encoded in %.2gs\n", (tv1-tv0).GetSeconds());
Cleanup(); Cleanup();
@ -347,7 +347,7 @@ void DIFF_Diff_t(CTStream *pstrmOld, CTStream *pstrmNew, CTStream *pstrmDiff)
void DIFF_Undiff_t(CTStream *pstrmOld, CTStream *pstrmDiff, CTStream *pstrmNew) void DIFF_Undiff_t(CTStream *pstrmOld, CTStream *pstrmDiff, CTStream *pstrmNew)
{ {
try { try {
CTimerValue tv0 = _pTimer->GetHighPrecisionTimer(); //CTimerValue tv0 = _pTimer->GetHighPrecisionTimer();
_slSizeOld = pstrmOld->GetStreamSize()-pstrmOld->GetPos_t(); _slSizeOld = pstrmOld->GetStreamSize()-pstrmOld->GetPos_t();
_pubOld = (UBYTE*)AllocMemory(_slSizeOld); _pubOld = (UBYTE*)AllocMemory(_slSizeOld);
@ -361,7 +361,7 @@ void DIFF_Undiff_t(CTStream *pstrmOld, CTStream *pstrmDiff, CTStream *pstrmNew)
UnDiff_t(); UnDiff_t();
CTimerValue tv1 = _pTimer->GetHighPrecisionTimer(); //CTimerValue tv1 = _pTimer->GetHighPrecisionTimer();
//CPrintF("diff decoded in %.2gs\n", (tv1-tv0).GetSeconds()); //CPrintF("diff decoded in %.2gs\n", (tv1-tv0).GetSeconds());
Cleanup(); Cleanup();

View File

@ -728,7 +728,7 @@ void CServer::ServerLoop(void)
// handle all incoming messages // handle all incoming messages
HandleAll(); HandleAll();
INDEX iSpeed = 1; //INDEX iSpeed = 1;
extern INDEX ser_bWaitFirstPlayer; extern INDEX ser_bWaitFirstPlayer;
// if the local session is keeping up with time and not paused // if the local session is keeping up with time and not paused
BOOL bPaused = srv_bPause || _pNetwork->ga_bLocalPause || _pNetwork->IsWaitingForPlayers() || BOOL bPaused = srv_bPause || _pNetwork->ga_bLocalPause || _pNetwork->IsWaitingForPlayers() ||
@ -1094,8 +1094,8 @@ void CServer::SendSessionStateData(INDEX iClient)
void CServer::HandleAll() void CServer::HandleAll()
{ {
// clear last accepted client info // clear last accepted client info
INDEX iClient = -1; /* INDEX iClient = -1;
/* if (_cmiComm.GetLastAccepted(iClient)) { if (_cmiComm.GetLastAccepted(iClient)) {
CPrintF(TRANSV("Server: Accepted session connection by '%s'\n"), CPrintF(TRANSV("Server: Accepted session connection by '%s'\n"),
(const char *) _cmiComm.Server_GetClientName(iClient)); (const char *) _cmiComm.Server_GetClientName(iClient));
} }

View File

@ -118,7 +118,7 @@ void CRenderer::PreClipPlanes(void)
const FLOAT fx = wpl.wpl_plRelative(1); const FLOAT fx = wpl.wpl_plRelative(1);
const FLOAT fy = wpl.wpl_plRelative(2); const FLOAT fy = wpl.wpl_plRelative(2);
const FLOAT fz = wpl.wpl_plRelative(3); const FLOAT fz = wpl.wpl_plRelative(3);
const FLOAT fd = wpl.wpl_plRelative.Distance(); //const FLOAT fd = wpl.wpl_plRelative.Distance();
wpl.wpl_plView(1) = fx*m(1, 1)+fy*m(1, 2)+fz*m(1, 3); wpl.wpl_plView(1) = fx*m(1, 1)+fy*m(1, 2)+fz*m(1, 3);
wpl.wpl_plView(2) = fx*m(2, 1)+fy*m(2, 2)+fz*m(2, 3); wpl.wpl_plView(2) = fx*m(2, 1)+fy*m(2, 2)+fz*m(2, 3);
wpl.wpl_plView(3) = fx*m(3, 1)+fy*m(3, 2)+fz*m(3, 3); wpl.wpl_plView(3) = fx*m(3, 1)+fy*m(3, 2)+fz*m(3, 3);
@ -179,8 +179,8 @@ void CRenderer::PreClipPlanes(void)
void CRenderer::PostClipVertices(void) void CRenderer::PostClipVertices(void)
{ {
_pfRenderProfile.StartTimer(CRenderProfile::PTI_PROJECTVERTICES); _pfRenderProfile.StartTimer(CRenderProfile::PTI_PROJECTVERTICES);
const FLOATmatrix3D &m = re_pbrCurrent->br_prProjection->pr_RotationMatrix; //const FLOATmatrix3D &m = re_pbrCurrent->br_prProjection->pr_RotationMatrix;
const FLOAT3D &v = re_pbrCurrent->br_prProjection->pr_TranslationVector; //const FLOAT3D &v = re_pbrCurrent->br_prProjection->pr_TranslationVector;
// if the projection is perspective // if the projection is perspective
if (re_pbrCurrent->br_prProjection.IsPerspective()) { if (re_pbrCurrent->br_prProjection.IsPerspective()) {
@ -749,7 +749,7 @@ CScreenPolygon *CRenderer::MakeScreenPolygon(CBrushPolygon &bpo)
sppo.spo_aubTextureFlags[0] = STXF_BLEND_ALPHA; sppo.spo_aubTextureFlags[0] = STXF_BLEND_ALPHA;
} }
// get its mapping gradients from shadowmap and stretch // get its mapping gradients from shadowmap and stretch
CWorkingPlane &wpl = *bpo.bpo_pbplPlane->bpl_pwplWorking; //CWorkingPlane &wpl = *bpo.bpo_pbplPlane->bpl_pwplWorking;
sppo.spo_amvMapping[0] = sppo.spo_amvMapping[3]; sppo.spo_amvMapping[0] = sppo.spo_amvMapping[3];
FLOAT fStretch = bpo.bpo_boxBoundingBox.Size().Length()/1000; FLOAT fStretch = bpo.bpo_boxBoundingBox.Size().Length()/1000;
sppo.spo_amvMapping[0].mv_vU *= fStretch; sppo.spo_amvMapping[0].mv_vU *= fStretch;
@ -870,7 +870,7 @@ void CRenderer::AddSpansToScene(void)
return; return;
} }
FLOAT fpixLastScanJOffseted = re_pixCurrentScanJ-1 +OFFSET_DN; //FLOAT fpixLastScanJOffseted = re_pixCurrentScanJ-1 +OFFSET_DN;
// first, little safety check - quit if zero spans in line! // first, little safety check - quit if zero spans in line!
INDEX ctSpans = re_aspSpans.Count(); INDEX ctSpans = re_aspSpans.Count();
if( ctSpans==0) { if( ctSpans==0) {

View File

@ -810,7 +810,7 @@ void CRenderer::ScanEdges(void)
CopyActiveCoordinates(); CopyActiveCoordinates();
// if scan-line is not coherent with the last one // if scan-line is not coherent with the last one
} else/**/ { } else*/ {
// scan list of active edges into spans // scan list of active edges into spans
pspoPortal = ScanOneLine(); pspoPortal = ScanOneLine();

View File

@ -512,20 +512,20 @@ void CRenderer::RenderWireFrameTerrains(void)
papr = &re_prProjection; papr = &re_prProjection;
BOOL bShowEdges = _wrpWorldRenderPrefs.wrp_ftEdges != CWorldRenderPrefs::FT_NONE; BOOL bShowEdges = _wrpWorldRenderPrefs.wrp_ftEdges != CWorldRenderPrefs::FT_NONE;
BOOL bShowVertices = _wrpWorldRenderPrefs.wrp_ftVertices != CWorldRenderPrefs::FT_NONE; //BOOL bShowVertices = _wrpWorldRenderPrefs.wrp_ftVertices != CWorldRenderPrefs::FT_NONE;
// BOOL bForceRegenerate = _wrpWorldRenderPrefs.wrp_ftPolygons // BOOL bForceRegenerate = _wrpWorldRenderPrefs.wrp_ftPolygons
COLOR colEdges = _wrpWorldRenderPrefs.wrp_colEdges; COLOR colEdges = _wrpWorldRenderPrefs.wrp_colEdges;
COLOR colVertices = 0xFF0000FF; //COLOR colVertices = 0xFF0000FF;
// for all active terrains // for all active terrains
{FORDELETELIST(CTerrain, tr_lnInActiveTerrains, re_lhActiveTerrains, ittr) { {FORDELETELIST(CTerrain, tr_lnInActiveTerrains, re_lhActiveTerrains, ittr) {
// render terrain // render terrain
if(bShowEdges) { if(bShowEdges) {
ittr->RenderWireFrame(*papr, re_pdpDrawPort,colEdges); ittr->RenderWireFrame(*papr, re_pdpDrawPort,colEdges);
} }
if(bShowVertices) { /*if(bShowVertices) {
//ittr->RenderVertices(*papr, re_pdpDrawPort,colVertices); //ittr->RenderVertices(*papr, re_pdpDrawPort,colVertices);
} }*/
}} }}
} }
// draw the prepared things to screen // draw the prepared things to screen
@ -564,7 +564,7 @@ void CRenderer::DrawToScreen(void)
&&_wrpWorldRenderPrefs.wrp_ftPolygons != CWorldRenderPrefs::FT_NONE) { &&_wrpWorldRenderPrefs.wrp_ftPolygons != CWorldRenderPrefs::FT_NONE) {
// render translucent portals // render translucent portals
_pfRenderProfile.StartTimer(CRenderProfile::PTI_RENDERSCENE); _pfRenderProfile.StartTimer(CRenderProfile::PTI_RENDERSCENE);
CPerspectiveProjection3D *pprPerspective = (CPerspectiveProjection3D*)(CProjection3D*)(re_prBackgroundProjection); //CPerspectiveProjection3D *pprPerspective = (CPerspectiveProjection3D*)(CProjection3D*)(re_prBackgroundProjection);
RenderScene( re_pdpDrawPort, SortTranslucentPolygons(re_pspoFirstBackgroundTranslucent), RenderScene( re_pdpDrawPort, SortTranslucentPolygons(re_pspoFirstBackgroundTranslucent),
re_prBackgroundProjection, re_colSelection, TRUE); re_prBackgroundProjection, re_colSelection, TRUE);
_pfRenderProfile.StopTimer(CRenderProfile::PTI_RENDERSCENE); _pfRenderProfile.StopTimer(CRenderProfile::PTI_RENDERSCENE);
@ -583,7 +583,7 @@ void CRenderer::DrawToScreen(void)
// render the spans to screen // render the spans to screen
re_prProjection->Prepare(); re_prProjection->Prepare();
_pfRenderProfile.StartTimer(CRenderProfile::PTI_RENDERSCENE); _pfRenderProfile.StartTimer(CRenderProfile::PTI_RENDERSCENE);
CPerspectiveProjection3D *pprPerspective = (CPerspectiveProjection3D*)(CProjection3D*)re_prProjection; //CPerspectiveProjection3D *pprPerspective = (CPerspectiveProjection3D*)(CProjection3D*)re_prProjection;
RenderScene( re_pdpDrawPort, re_pspoFirst, re_prProjection, re_colSelection, FALSE); RenderScene( re_pdpDrawPort, re_pspoFirst, re_prProjection, re_colSelection, FALSE);
_pfRenderProfile.StopTimer(CRenderProfile::PTI_RENDERSCENE); _pfRenderProfile.StopTimer(CRenderProfile::PTI_RENDERSCENE);
} }
@ -659,7 +659,7 @@ void CRenderer::FillMirrorDepth(CMirror &mi)
// for each polygon // for each polygon
FOREACHINDYNAMICCONTAINER(mi.mi_cspoPolygons, CScreenPolygon, itspo) { FOREACHINDYNAMICCONTAINER(mi.mi_cspoPolygons, CScreenPolygon, itspo) {
CScreenPolygon &spo = *itspo; CScreenPolygon &spo = *itspo;
CBrushPolygon &bpo = *spo.spo_pbpoBrushPolygon; //CBrushPolygon &bpo = *spo.spo_pbpoBrushPolygon;
// create a new screen polygon // create a new screen polygon
CScreenPolygon &spoNew = re_aspoScreenPolygons.Push(); CScreenPolygon &spoNew = re_aspoScreenPolygons.Push();
ScenePolygon &sppoNew = spoNew.spo_spoScenePolygon; ScenePolygon &sppoNew = spoNew.spo_spoScenePolygon;

View File

@ -20,8 +20,8 @@ void CRenderer::DrawBrushPolygonVerticesAndEdges(CBrushPolygon &bpo)
CBrushSector &bsc = *bpo.bpo_pbscSector; CBrushSector &bsc = *bpo.bpo_pbscSector;
CBrushMip *pbm = bsc.bsc_pbmBrushMip; CBrushMip *pbm = bsc.bsc_pbmBrushMip;
CBrush3D &br = *pbm->bm_pbrBrush; CBrush3D &br = *pbm->bm_pbrBrush;
INDEX iMinVx = bsc.bsc_ivvx0; //INDEX iMinVx = bsc.bsc_ivvx0;
INDEX iMaxVx = bsc.bsc_ivvx0+bsc.bsc_awvxVertices.Count(); //INDEX iMaxVx = bsc.bsc_ivvx0+bsc.bsc_awvxVertices.Count();
// set line type and color for edges and vertices // set line type and color for edges and vertices
ULONG ulEdgesLineType = EdgeLineType(wplPolygonPlane.wpl_bVisible); ULONG ulEdgesLineType = EdgeLineType(wplPolygonPlane.wpl_bVisible);
@ -155,7 +155,7 @@ void CRenderer::DrawBrushPolygonVerticesAndEdges(CBrushPolygon &bpo)
void CRenderer::DrawBrushSectorVerticesAndEdges(CBrushSector &bscSector) void CRenderer::DrawBrushSectorVerticesAndEdges(CBrushSector &bscSector)
{ {
CBrushMip *pbm = bscSector.bsc_pbmBrushMip; CBrushMip *pbm = bscSector.bsc_pbmBrushMip;
CBrush3D &br = *pbm->bm_pbrBrush; //CBrush3D &br = *pbm->bm_pbrBrush;
// clear all vertex drawn flags // clear all vertex drawn flags
FOREACHINSTATICARRAY(bscSector.bsc_abvxVertices, CBrushVertex, itbvx) { FOREACHINSTATICARRAY(bscSector.bsc_abvxVertices, CBrushVertex, itbvx) {
@ -275,7 +275,7 @@ void CRenderer::PrepareBrush(CEntity *penBrush)
// for static brushes // for static brushes
CProjection3D &pr = *brBrush.br_prProjection; CProjection3D &pr = *brBrush.br_prProjection;
const FLOATmatrix3D &mRot = penBrush->en_mRotation; const FLOATmatrix3D &mRot = penBrush->en_mRotation;
const FLOAT3D &vRot = penBrush->en_plPlacement.pl_PositionVector; //const FLOAT3D &vRot = penBrush->en_plPlacement.pl_PositionVector;
// fixup projection to use placement of this brush // fixup projection to use placement of this brush
pr.pr_mDirectionRotation = pr.pr_ViewerRotationMatrix*mRot; pr.pr_mDirectionRotation = pr.pr_ViewerRotationMatrix*mRot;
pr.pr_RotationMatrix = pr.pr_mDirectionRotation; pr.pr_RotationMatrix = pr.pr_mDirectionRotation;

View File

@ -263,6 +263,7 @@ static void GetHazeMapInVertex( GFXVertex4 &vtx, FLOAT &tx1)
tx1 = (fD+_fHazeAdd) * _haze_fMul; tx1 = (fD+_fHazeAdd) * _haze_fMul;
} }
#if 0 // DG: unused
// check model's bounding box against fog // check model's bounding box against fog
static BOOL IsModelInFog( FLOAT3D &vMin, FLOAT3D &vMax) static BOOL IsModelInFog( FLOAT3D &vMin, FLOAT3D &vMax)
{ {
@ -294,6 +295,7 @@ static BOOL IsModelInHaze( FLOAT3D &vMin, FLOAT3D &vMax)
vtx.x=vMax(1); vtx.y=vMax(2); vtx.z=vMax(3); GetHazeMapInVertex(vtx,fS); if(InHaze(fS)) return TRUE; vtx.x=vMax(1); vtx.y=vMax(2); vtx.z=vMax(3); GetHazeMapInVertex(vtx,fS); if(InHaze(fS)) return TRUE;
return FALSE; return FALSE;
} }
#endif // 0 (unused)
BOOL PrepareHaze(void) BOOL PrepareHaze(void)
{ {
@ -312,7 +314,7 @@ BOOL PrepareHaze(void)
// _fFogAddZ = _vViewer % (rm.rm_vObjectPosition - _aprProjection->pr_vViewerPosition); // BUG in compiler !!!! // _fFogAddZ = _vViewer % (rm.rm_vObjectPosition - _aprProjection->pr_vViewerPosition); // BUG in compiler !!!!
_fFogAddZ = -_mObjToView[11]; _fFogAddZ = -_mObjToView[11];
// get fog offset // get fog offset
_fFogAddH = _fog_fAddH;/*( _fFogAddH = _fog_fAddH; // (
_vHDirView(1)*_mObjToView[3] + _vHDirView(1)*_mObjToView[3] +
_vHDirView(2)*_mObjToView[7] + _vHDirView(2)*_mObjToView[7] +
_vHDirView(3)*_mObjToView[11]) + _fog_fp.fp_fH3; _vHDirView(3)*_mObjToView[11]) + _fog_fp.fp_fH3;
@ -2087,7 +2089,7 @@ static void RenderMesh(RenMesh &rmsh,RenModel &rm)
// clamp surface texture count to max number of textrues in mesh // clamp surface texture count to max number of textrues in mesh
INDEX cttx = pShaderParams->sp_aiTextureIDs.Count(); INDEX cttx = pShaderParams->sp_aiTextureIDs.Count();
INDEX cttxMax = rmsh.rmsh_pMeshInst->mi_tiTextures.Count(); //INDEX cttxMax = rmsh.rmsh_pMeshInst->mi_tiTextures.Count();
// cttx = ClampUp(cttx,cttxMax); // cttx = ClampUp(cttx,cttxMax);
_patoTextures.PopAll(); _patoTextures.PopAll();
@ -2250,7 +2252,7 @@ static void PrepareMeshForRendering(RenMesh &rmsh, INDEX iSkeletonlod)
} else { } else {
// blend absolute (1-f)*cur + f*dst // blend absolute (1-f)*cur + f*dst
INDEX vtx = rm.rmp_pmmmMorphMap->mmp_aMorphMap[ivx].mwm_iVxIndex; INDEX vtx = rm.rmp_pmmmMorphMap->mmp_aMorphMap[ivx].mwm_iVxIndex;
MeshVertex &mvSrc = mlod.mlod_aVertices[vtx]; //MeshVertex &mvSrc = mlod.mlod_aVertices[vtx];
MeshVertexMorph &mvmDst = rm.rmp_pmmmMorphMap->mmp_aMorphMap[ivx]; MeshVertexMorph &mvmDst = rm.rmp_pmmmMorphMap->mmp_aMorphMap[ivx];
// blend vertices // blend vertices
_aMorphedVtxs[vtx].x = (1.0f-rm.rmp_fFactor) * _aMorphedVtxs[vtx].x + rm.rmp_fFactor*mvmDst.mwm_x; _aMorphedVtxs[vtx].x = (1.0f-rm.rmp_fFactor) * _aMorphedVtxs[vtx].x + rm.rmp_fFactor*mvmDst.mwm_x;

View File

@ -103,18 +103,19 @@ static HINSTANCE _hInstDS = NULL;
static CTString snd_strDeviceName; static CTString snd_strDeviceName;
#endif #endif
static INDEX _iWriteOffset = 0;
static INDEX _iWriteOffset2 = 0;
static BOOL _bMuted = FALSE; static BOOL _bMuted = FALSE;
static INDEX _iLastEnvType = 1234; static INDEX _iLastEnvType = 1234;
static FLOAT _fLastEnvSize = 1234; static FLOAT _fLastEnvSize = 1234;
static FLOAT _fLastPanning = 1234;
#ifdef PLATFORM_WIN32
static FLOAT _fLastPanning = 1234;
static INDEX _iWriteOffset = 0;
static INDEX _iWriteOffset2 = 0;
// TEMP! - for writing mixer buffer to file // TEMP! - for writing mixer buffer to file
static FILE *_filMixerBuffer; static FILE *_filMixerBuffer;
static BOOL _bOpened = FALSE; static BOOL _bOpened = FALSE;
#endif
#define WAVEOUTBLOCKSIZE 1024 #define WAVEOUTBLOCKSIZE 1024
#define MINPAN (1.0f) #define MINPAN (1.0f)
@ -1467,10 +1468,10 @@ void CSoundTimerHandler::HandleTimer(void)
// copying of mixer buffer to sound buffer(s) // copying of mixer buffer to sound buffer(s)
#ifdef PLATFORM_WIN32
static LPVOID _lpData, _lpData2; static LPVOID _lpData, _lpData2;
static DWORD _dwSize, _dwSize2; static DWORD _dwSize, _dwSize2;
#ifdef PLATFORM_WIN32
static void CopyMixerBuffer_dsound( CSoundLibrary &sl, SLONG slMixedSize) static void CopyMixerBuffer_dsound( CSoundLibrary &sl, SLONG slMixedSize)
{ {
LPVOID lpData; LPVOID lpData;

View File

@ -51,6 +51,7 @@ extern BOOL _bPredictionActive;
extern FLOAT snd_fSoundVolume; extern FLOAT snd_fSoundVolume;
extern FLOAT snd_fMusicVolume; extern FLOAT snd_fMusicVolume;
#if 0 // DG: unused.
static CTString GetPred(CEntity*pen) static CTString GetPred(CEntity*pen)
{ {
CTString str1; CTString str1;
@ -67,6 +68,7 @@ static CTString GetPred(CEntity*pen)
str.PrintF("%08x-%s", pen, (const char *) str1); str.PrintF("%08x-%s", pen, (const char *) str1);
return str; return str;
} }
#endif // 0 (unused)
/* ==================================================== /* ====================================================
* *
* Class global methods * Class global methods

View File

@ -956,7 +956,6 @@ template<class Type, int iDimensions>
BSPNode<Type, iDimensions> *BSPTree<Type, iDimensions>::CreateSubTree(CDynamicArray<BSPPolygon<Type, iDimensions> > &abpoPolygons) BSPNode<Type, iDimensions> *BSPTree<Type, iDimensions>::CreateSubTree(CDynamicArray<BSPPolygon<Type, iDimensions> > &abpoPolygons)
{ {
// local declarations, to fix macro expansion in FOREACHINDYNAMICARRAY // local declarations, to fix macro expansion in FOREACHINDYNAMICARRAY
typedef BSPEdge<Type, iDimensions> edge_t;
typedef BSPPolygon<Type, iDimensions> polygon_t; typedef BSPPolygon<Type, iDimensions> polygon_t;
ASSERT(abpoPolygons.Count()>=1); ASSERT(abpoPolygons.Count()>=1);
@ -1042,8 +1041,6 @@ BSPNode<Type, iDimensions> *BSPTree<Type, iDimensions>::CreateSubTree(CDynamicAr
template<class Type, int iDimensions> template<class Type, int iDimensions>
void BSPTree<Type, iDimensions>::Create(CDynamicArray<BSPPolygon<Type, iDimensions> > &abpoPolygons) void BSPTree<Type, iDimensions>::Create(CDynamicArray<BSPPolygon<Type, iDimensions> > &abpoPolygons)
{ {
typedef BSPPolygon<Type, iDimensions> polygon_t; // local declaration, to fix macro expansion in FOREACHINDYNAMICARRAY
// free eventual existing tree // free eventual existing tree
Destroy(); Destroy();

View File

@ -142,7 +142,7 @@ SLONG CStock_TYPE::CalculateUsedMemory(void)
void CStock_TYPE::DumpMemoryUsage_t(CTStream &strm) // throw char * void CStock_TYPE::DumpMemoryUsage_t(CTStream &strm) // throw char *
{ {
CTString strLine; CTString strLine;
SLONG slUsedTotal = 0; //SLONG slUsedTotal = 0;
{FOREACHINDYNAMICCONTAINER(st_ctObjects, TYPE, itt) { {FOREACHINDYNAMICCONTAINER(st_ctObjects, TYPE, itt) {
SLONG slUsedByObject = itt->GetUsedMemory(); SLONG slUsedByObject = itt->GetUsedMemory();
if (slUsedByObject<0) { if (slUsedByObject<0) {

View File

@ -359,15 +359,15 @@ static void CropMap(INDEX iNewWidth, INDEX iNewHeight, INDEX iOldWidth, INDEX iO
template <class Type> template <class Type>
static void StretchMap(INDEX iNewWidth, INDEX iNewHeight, INDEX iOldWidth, INDEX iOldHeight, Type *pNewData, Type *pOldData) static void StretchMap(INDEX iNewWidth, INDEX iNewHeight, INDEX iOldWidth, INDEX iOldHeight, Type *pNewData, Type *pOldData)
{ {
int a=0; //int a=0;
CropMap(iNewWidth,iNewHeight,iOldWidth,iOldHeight,pNewData,pOldData); CropMap(iNewWidth,iNewHeight,iOldWidth,iOldHeight,pNewData,pOldData);
} }
template <class Type> template <class Type>
static void ShrinkMap(INDEX iNewWidth, INDEX iNewHeight, INDEX iOldWidth, INDEX iOldHeight, Type *pNewData, Type *pOldData) static void ShrinkMap(INDEX iNewWidth, INDEX iNewHeight, INDEX iOldWidth, INDEX iOldHeight, Type *pNewData, Type *pOldData)
{ {
FLOAT fWidth = iNewWidth; //FLOAT fWidth = iNewWidth;
FLOAT fHeight = iNewHeight; //FLOAT fHeight = iNewHeight;
FLOAT fDiffX = (FLOAT)iNewWidth / iOldWidth; FLOAT fDiffX = (FLOAT)iNewWidth / iOldWidth;
FLOAT fDiffY = (FLOAT)iNewHeight / iOldHeight; FLOAT fDiffY = (FLOAT)iNewHeight / iOldHeight;
@ -800,7 +800,7 @@ void CTerrain::AddAllTilesToRegenQueue()
// for each terrain tile // for each terrain tile
for(INDEX itt=0;itt<tr_ctTiles;itt++) { for(INDEX itt=0;itt<tr_ctTiles;itt++) {
// Add tile to reqen queue // Add tile to reqen queue
CTerrainTile &tt = tr_attTiles[itt]; //CTerrainTile &tt = tr_attTiles[itt];
AddTileToRegenQueue(itt); AddTileToRegenQueue(itt);
} }
} }
@ -842,6 +842,7 @@ __forceinline void CopyPixel(COLOR *pubSrc,COLOR *pubDst,FLOAT fMaskStrength)
pcolSrc->ub.a = 255; pcolSrc->ub.a = 255;
} }
#if 0 // DG: unused.
static INDEX _ctSavedTopMaps=0; static INDEX _ctSavedTopMaps=0;
static void SaveAsTga(CTextureData *ptdTex) static void SaveAsTga(CTextureData *ptdTex)
{ {
@ -879,6 +880,7 @@ static void SaveAsTga(CTextureData *ptdTex)
*/ */
} }
#endif // 0
static void AddTileLayerToTopMap(CTerrain *ptrTerrain, INDEX iTileIndex, INDEX iLayer) static void AddTileLayerToTopMap(CTerrain *ptrTerrain, INDEX iTileIndex, INDEX iLayer)
{ {
@ -1004,7 +1006,7 @@ void CTerrain::UpdateTopMap(INDEX iTileIndex, Rect *prcDest/*=NULL*/)
INDEX iFirstInMask = 0; INDEX iFirstInMask = 0;
INDEX iMaskWidth = tr_pixHeightMapWidth; INDEX iMaskWidth = tr_pixHeightMapWidth;
INDEX iTiling = 1; INDEX iTiling = 1;
INDEX iSrcMipWidth = 1; //INDEX iSrcMipWidth = 1;
// destionation texture (must have set allocated memory) // destionation texture (must have set allocated memory)
@ -1587,7 +1589,7 @@ void CTerrain::BuildQuadTree(void)
INDEX ctQuadLevels = tr_aqtlQuadTreeLevels.Count(); INDEX ctQuadLevels = tr_aqtlQuadTreeLevels.Count();
// for each quadtree level after first // for each quadtree level after first
for(INDEX iql=1;iql<ctQuadLevels;iql++) { for(INDEX iql=1;iql<ctQuadLevels;iql++) {
QuadTreeLevel &qtl = tr_aqtlQuadTreeLevels[iql]; //QuadTreeLevel &qtl = tr_aqtlQuadTreeLevels[iql];
QuadTreeLevel &qtlPrev = tr_aqtlQuadTreeLevels[iql-1]; QuadTreeLevel &qtlPrev = tr_aqtlQuadTreeLevels[iql-1];
// for each quadtree node row // for each quadtree node row
for(INDEX ir=0;ir<qtlPrev.qtl_ctNodesRow;ir+=2) { for(INDEX ir=0;ir<qtlPrev.qtl_ctNodesRow;ir+=2) {
@ -1737,7 +1739,7 @@ static void ShowTerrainInfo(CAnyProjection3D &apr, CDrawPort *pdp, CTerrain *ptr
strInfo +=strTemp; strInfo +=strTemp;
// Show memory usage // Show memory usage
SLONG slUsedMemory=0; //SLONG slUsedMemory=0;
// Height map usage // Height map usage
SLONG slHeightMap = ptrTerrain->tr_pixHeightMapWidth*ptrTerrain->tr_pixHeightMapHeight*sizeof(UWORD); SLONG slHeightMap = ptrTerrain->tr_pixHeightMapWidth*ptrTerrain->tr_pixHeightMapHeight*sizeof(UWORD);
// Edge map usage // Edge map usage

View File

@ -39,7 +39,7 @@ static FLOATaabbox3D CalculateAABBoxFromRect(CTerrain *ptrTerrain, Rect rcExtrac
ASSERT(ptrTerrain->tr_penEntity!=NULL); ASSERT(ptrTerrain->tr_penEntity!=NULL);
// Get entity that holds this terrain // Get entity that holds this terrain
CEntity *penEntity = ptrTerrain->tr_penEntity; //CEntity *penEntity = ptrTerrain->tr_penEntity;
FLOATaabbox3D bboxExtract; FLOATaabbox3D bboxExtract;
FLOATaabbox3D bboxAllTerrain; FLOATaabbox3D bboxAllTerrain;
@ -60,7 +60,7 @@ static INDEX GetFirstTileInMidLod(CTerrain *ptrTerrain, Rect &rcExtract)
// for each terrain tile // for each terrain tile
for(INDEX itt=0;itt<ptrTerrain->tr_ctTiles;itt++) { for(INDEX itt=0;itt<ptrTerrain->tr_ctTiles;itt++) {
QuadTreeNode &qtn = ptrTerrain->tr_aqtnQuadTreeNodes[itt]; QuadTreeNode &qtn = ptrTerrain->tr_aqtnQuadTreeNodes[itt];
CTerrainTile &tt = ptrTerrain->tr_attTiles[itt]; //CTerrainTile &tt = ptrTerrain->tr_attTiles[itt];
// if it is coliding with given box // if it is coliding with given box
if(qtn.qtn_aabbox.HasContactWith(bboxExtract)) { if(qtn.qtn_aabbox.HasContactWith(bboxExtract)) {
// calculate its real distance factor // calculate its real distance factor
@ -367,8 +367,8 @@ void SetBufferForEditing(CTerrain *ptrTerrain, UWORD *puwEditedBuffer, Rect &rcE
PIX pixTop = rcExtract.rc_iTop; PIX pixTop = rcExtract.rc_iTop;
PIX pixBottom = rcExtract.rc_iBottom; PIX pixBottom = rcExtract.rc_iBottom;
PIX pixWidht = pixRight-pixLeft; //PIX pixWidht = pixRight-pixLeft;
PIX pixHeight = pixBottom-pixTop; //PIX pixHeight = pixBottom-pixTop;
PIX pixMaxWidth = ptrTerrain->tr_pixHeightMapWidth; PIX pixMaxWidth = ptrTerrain->tr_pixHeightMapWidth;
PIX pixMaxHeight = ptrTerrain->tr_pixHeightMapHeight; PIX pixMaxHeight = ptrTerrain->tr_pixHeightMapHeight;

View File

@ -53,6 +53,7 @@ FLOATaabbox3D _bboxDrawTwo;
#define LEFT 1 #define LEFT 1
#define MIDDLE 2 #define MIDDLE 2
#if 0 // DG: unused.
// Test AABBox agains ray // Test AABBox agains ray
static BOOL HitBoundingBox(FLOAT3D &vOrigin, FLOAT3D &vDir, FLOAT3D &vHit, FLOATaabbox3D &bbox) static BOOL HitBoundingBox(FLOAT3D &vOrigin, FLOAT3D &vDir, FLOAT3D &vHit, FLOATaabbox3D &bbox)
{ {
@ -123,7 +124,6 @@ static BOOL HitBoundingBox(FLOAT3D &vOrigin, FLOAT3D &vDir, FLOAT3D &vHit, FLOAT
return (TRUE); /* ray hits box */ return (TRUE); /* ray hits box */
} }
// Test AABBox agains ray // Test AABBox agains ray
static BOOL RayHitsAABBox(FLOAT3D &vOrigin, FLOAT3D &vDir, FLOAT3D &vHit, FLOATaabbox3D &bbox) static BOOL RayHitsAABBox(FLOAT3D &vOrigin, FLOAT3D &vDir, FLOAT3D &vHit, FLOATaabbox3D &bbox)
{ {
@ -201,11 +201,12 @@ static BOOL RayHitsAABBox(FLOAT3D &vOrigin, FLOAT3D &vDir, FLOAT3D &vHit, FLOATa
vHit = FLOAT3D(coord[0],coord[1],coord[2]); vHit = FLOAT3D(coord[0],coord[1],coord[2]);
return TRUE; return TRUE;
} }
#endif // 0 (unused)
// Get exact hit location in tile // Get exact hit location in tile
FLOAT GetExactHitLocation(INDEX iTileIndex, FLOAT3D &vOrigin, FLOAT3D &vTarget, FLOAT3D &vHitLocation) FLOAT GetExactHitLocation(INDEX iTileIndex, FLOAT3D &vOrigin, FLOAT3D &vTarget, FLOAT3D &vHitLocation)
{ {
CTerrainTile &tt = _ptrTerrain->tr_attTiles[iTileIndex]; //CTerrainTile &tt = _ptrTerrain->tr_attTiles[iTileIndex];
QuadTreeNode &qtn = _ptrTerrain->tr_aqtnQuadTreeNodes[iTileIndex]; QuadTreeNode &qtn = _ptrTerrain->tr_aqtnQuadTreeNodes[iTileIndex];
GFXVertex *pavVertices; GFXVertex *pavVertices;
@ -341,7 +342,7 @@ Rect ExtractPolygonsInBox(CTerrain *ptrTerrain, const FLOATaabbox3D &bboxExtract
INDEX iFirst = iStartX + iStartY * ptrTerrain->tr_pixHeightMapWidth; INDEX iFirst = iStartX + iStartY * ptrTerrain->tr_pixHeightMapWidth;
INDEX iPitchX = ptrTerrain->tr_pixHeightMapWidth - iWidth; INDEX iPitchX = ptrTerrain->tr_pixHeightMapWidth - iWidth;
INDEX iPitchY = ptrTerrain->tr_pixHeightMapHeight - iHeight; //INDEX iPitchY = ptrTerrain->tr_pixHeightMapHeight - iHeight;
// get first pixel in height map // get first pixel in height map
UWORD *puwHeight = &ptrTerrain->tr_auwHeightMap[iFirst]; UWORD *puwHeight = &ptrTerrain->tr_auwHeightMap[iFirst];
@ -385,7 +386,7 @@ Rect ExtractPolygonsInBox(CTerrain *ptrTerrain, const FLOATaabbox3D &bboxExtract
} }
INDEX ivx=0; INDEX ivx=0;
INDEX ind=0; //INDEX ind=0;
INDEX iFacing=iFirst; INDEX iFacing=iFirst;
GFXVertex *pavExtVtx = &_avExtVertices[0]; GFXVertex *pavExtVtx = &_avExtVertices[0];
@ -493,7 +494,7 @@ void ExtractVerticesInRect(CTerrain *ptrTerrain, Rect &rc, GFXVertex4 **pavVtx,
INDEX *pauiIndices = &_aiExtIndices[0]; INDEX *pauiIndices = &_aiExtIndices[0];
INDEX ivx=0; INDEX ivx=0;
INDEX ind=0; //INDEX ind=0;
INDEX iFacing=iFirstHeight; INDEX iFacing=iFirstHeight;
// for each row // for each row
for(iy=0;iy<iHeight-1;iy++) { for(iy=0;iy<iHeight-1;iy++) {
@ -903,7 +904,7 @@ static FLOATaabbox3D AbsoluteToRelative(const CTerrain *ptrTerrain, const FLOATa
return bboxRelative; return bboxRelative;
} }
static ULONG ulTemp = 0xFFFFFFFF; //static ULONG ulTemp = 0xFFFFFFFF;
void UpdateTerrainShadowMap(CTerrain *ptrTerrain, FLOATaabbox3D *pboxUpdate/*=NULL*/, BOOL bAbsoluteSpace/*=FALSE*/) void UpdateTerrainShadowMap(CTerrain *ptrTerrain, FLOATaabbox3D *pboxUpdate/*=NULL*/, BOOL bAbsoluteSpace/*=FALSE*/)
{ {
@ -952,8 +953,8 @@ void UpdateTerrainShadowMap(CTerrain *ptrTerrain, FLOATaabbox3D *pboxUpdate/*=NU
// Get pointer to world that holds this terrain // Get pointer to world that holds this terrain
CWorld *pwldWorld = penEntity->en_pwoWorld; CWorld *pwldWorld = penEntity->en_pwoWorld;
PIX pixWidth = ptrTerrain->GetShadowMapWidth(); //PIX pixWidth = ptrTerrain->GetShadowMapWidth();
PIX pixHeight = ptrTerrain->GetShadowMapHeight(); //PIX pixHeight = ptrTerrain->GetShadowMapHeight();
CTextureData &tdShadowMap = ptrTerrain->tr_tdShadowMap; CTextureData &tdShadowMap = ptrTerrain->tr_tdShadowMap;
ASSERT(tdShadowMap.td_pulFrames!=NULL); ASSERT(tdShadowMap.td_pulFrames!=NULL);

View File

@ -269,7 +269,7 @@ void PrepareSmothVertices(INDEX itt)
GFXVertex *pvBorderSrc = pavSrc; GFXVertex *pvBorderSrc = pavSrc;
for(INDEX ivx=tt.tt_ctNonBorderVertices;ivx<ctVertices;ivx++) { for(INDEX ivx=tt.tt_ctNonBorderVertices;ivx<ctVertices;ivx++) {
//*pavDst++ = *pavSrc++; // *pavDst++ = *pavSrc++;
pvBorderDst[0] = pvBorderSrc[0]; pvBorderDst[0] = pvBorderSrc[0];
pvBorderDst++; pvBorderDst++;
pvBorderSrc++; pvBorderSrc++;
@ -601,7 +601,7 @@ void PrepareSmothVertices(INDEX itt)
void PrepareSmothVerticesOnTileLayer(INDEX iTerrainTile, INDEX iTileLayer) void PrepareSmothVerticesOnTileLayer(INDEX iTerrainTile, INDEX iTileLayer)
{ {
CTerrainTile &tt = _ptrTerrain->tr_attTiles[iTerrainTile]; CTerrainTile &tt = _ptrTerrain->tr_attTiles[iTerrainTile];
CTerrainLayer &tl = _ptrTerrain->tr_atlLayers[iTileLayer]; //CTerrainLayer &tl = _ptrTerrain->tr_atlLayers[iTileLayer];
TileLayer &ttl = tt.GetTileLayers()[iTileLayer]; TileLayer &ttl = tt.GetTileLayers()[iTileLayer];
ASSERT(tt.tt_iLod==0); ASSERT(tt.tt_iLod==0);
@ -1231,7 +1231,7 @@ void RenderTerrain(void)
RenderBatchedTiles(); RenderBatchedTiles();
} }
CEntity *pen = _ptrTerrain->tr_penEntity; //CEntity *pen = _ptrTerrain->tr_penEntity;
extern void ShowRayPath(CDrawPort *pdp); extern void ShowRayPath(CDrawPort *pdp);
ShowRayPath(_pdp); ShowRayPath(_pdp);

View File

@ -441,8 +441,8 @@ void CTerrainTile::ReGenerate()
} }
} }
INDEX ctVtxBefore = GetVertices().Count(); //INDEX ctVtxBefore = GetVertices().Count();
INDEX ctTrisBefore = GetIndices().Count()/3; //INDEX ctTrisBefore = GetIndices().Count()/3;
// tt_ctNormalVertices = GetVertexCount(); // tt_ctNormalVertices = GetVertexCount();
// Generate borders for tile // Generate borders for tile
@ -535,7 +535,7 @@ INDEX CTerrainTile::CalculateLOD(void)
INDEX ini = tt_aiNeighbours[in]; INDEX ini = tt_aiNeighbours[in];
// if neighbour is valid // if neighbour is valid
if(ini>=0) { if(ini>=0) {
CTerrainTile &ttNeigbour = _ptrTerrain->tr_attTiles[ini]; //CTerrainTile &ttNeigbour = _ptrTerrain->tr_attTiles[ini];
// if neighbour is in higher lod // if neighbour is in higher lod
if(TRUE) { /*ttNeigbour.tt_iLod > tt.tt_iNewLod*/ if(TRUE) { /*ttNeigbour.tt_iLod > tt.tt_iNewLod*/
// add neighbour to regen queue // add neighbour to regen queue

View File

@ -51,6 +51,7 @@ extern BOOL _bPortalSectorLinksPreLoaded;
extern BOOL _bEntitySectorLinksPreLoaded; extern BOOL _bEntitySectorLinksPreLoaded;
extern INDEX _ctPredictorEntities; extern INDEX _ctPredictorEntities;
#if 0 // DG: unused.
// calculate ray placement from origin and target positions (obsolete?) // calculate ray placement from origin and target positions (obsolete?)
static inline CPlacement3D CalculateRayPlacement( static inline CPlacement3D CalculateRayPlacement(
const FLOAT3D &vOrigin, const FLOAT3D &vTarget) const FLOAT3D &vOrigin, const FLOAT3D &vTarget)
@ -65,6 +66,7 @@ static inline CPlacement3D CalculateRayPlacement(
DirectionVectorToAngles(vDirection, plRay.pl_OrientationAngle); DirectionVectorToAngles(vDirection, plRay.pl_OrientationAngle);
return plRay; return plRay;
} }
#endif // 0
/* Constructor. */ /* Constructor. */
CTextureTransformation::CTextureTransformation(void) CTextureTransformation::CTextureTransformation(void)

View File

@ -137,7 +137,7 @@ void CEmiter::AnimateParticles(void)
ep.ep_fLastRot=ep.ep_fRot; ep.ep_fLastRot=ep.ep_fRot;
ep.ep_fRot+=ep.ep_fRotSpeed*_pTimer->TickQuantum; ep.ep_fRot+=ep.ep_fRotSpeed*_pTimer->TickQuantum;
// animate color // animate color
FLOAT fRatio=CalculateRatio(tmNow, ep.ep_tmEmitted, ep.ep_tmEmitted+ep.ep_tmLife, 1, 0); //FLOAT fRatio=CalculateRatio(tmNow, ep.ep_tmEmitted, ep.ep_tmEmitted+ep.ep_tmLife, 1, 0);
ep.ep_colLastColor=ep.ep_colColor; ep.ep_colLastColor=ep.ep_colColor;
iCurrent++; iCurrent++;
} }

View File

@ -271,6 +271,7 @@ static int qsort_CompareFrags( const void *ppPEN0, const void *ppPEN1) {
else return -qsort_CompareDeaths(ppPEN0, ppPEN1); else return -qsort_CompareDeaths(ppPEN0, ppPEN1);
} }
#if 0 // DG: unused.
static int qsort_CompareLatencies( const void *ppPEN0, const void *ppPEN1) { static int qsort_CompareLatencies( const void *ppPEN0, const void *ppPEN1) {
CPlayer &en0 = **(CPlayer**)ppPEN0; CPlayer &en0 = **(CPlayer**)ppPEN0;
CPlayer &en1 = **(CPlayer**)ppPEN1; CPlayer &en1 = **(CPlayer**)ppPEN1;
@ -280,6 +281,7 @@ static int qsort_CompareLatencies( const void *ppPEN0, const void *ppPEN1) {
else if( sl0>sl1) return -1; else if( sl0>sl1) return -1;
else return 0; else return 0;
} }
#endif // 0 (unused)
// prepare color transitions // prepare color transitions
static void PrepareColorTransitions( COLOR colFine, COLOR colHigh, COLOR colMedium, COLOR colLow, static void PrepareColorTransitions( COLOR colFine, COLOR colHigh, COLOR colMedium, COLOR colLow,
@ -560,7 +562,8 @@ static void DrawAspectCorrectTextureCentered( class CTextureObject *_pTO, FLOAT
CTextureData *ptd = (CTextureData*)_pTO->GetData(); CTextureData *ptd = (CTextureData*)_pTO->GetData();
FLOAT fTexSizeI = ptd->GetPixWidth(); FLOAT fTexSizeI = ptd->GetPixWidth();
FLOAT fTexSizeJ = ptd->GetPixHeight(); FLOAT fTexSizeJ = ptd->GetPixHeight();
FLOAT fHeight = fWidth*fTexSizeJ/fTexSizeJ; FLOAT fHeight = fWidth*fTexSizeJ/fTexSizeJ; // FIXME: not fTexSizeJ/fTexSizeI ??
STUBBED("fWidth*fTexSizeJ/fTexSizeJ is most likely not intended!");
_pDP->InitTexture( _pTO); _pDP->InitTexture( _pTO);
_pDP->AddTexture( fX-fWidth*0.5f, fY-fHeight*0.5f, fX+fWidth*0.5f, fY+fHeight*0.5f, 0, 0, 1, 1, col); _pDP->AddTexture( fX-fWidth*0.5f, fY-fHeight*0.5f, fX+fWidth*0.5f, fY+fHeight*0.5f, 0, 0, 1, 1, col);
@ -580,8 +583,8 @@ static void HUD_DrawSniperMask( void )
COLOR colMask = C_WHITE|CT_OPAQUE; COLOR colMask = C_WHITE|CT_OPAQUE;
CTextureData *ptd = (CTextureData*)_toSniperMask.GetData(); CTextureData *ptd = (CTextureData*)_toSniperMask.GetData();
const FLOAT fTexSizeI = ptd->GetPixWidth(); //const FLOAT fTexSizeI = ptd->GetPixWidth();
const FLOAT fTexSizeJ = ptd->GetPixHeight(); //const FLOAT fTexSizeJ = ptd->GetPixHeight();
// main sniper mask // main sniper mask
_pDP->InitTexture( &_toSniperMask); _pDP->InitTexture( &_toSniperMask);
@ -925,7 +928,7 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
_fCustomScaling = ClampDn( _fCustomScaling*0.8f, 0.5f); _fCustomScaling = ClampDn( _fCustomScaling*0.8f, 0.5f);
const FLOAT fOneUnitS = fOneUnit *0.8f; const FLOAT fOneUnitS = fOneUnit *0.8f;
const FLOAT fAdvUnitS = fAdvUnit *0.8f; const FLOAT fAdvUnitS = fAdvUnit *0.8f;
const FLOAT fNextUnitS = fNextUnit *0.8f; //const FLOAT fNextUnitS = fNextUnit *0.8f;
const FLOAT fHalfUnitS = fHalfUnit *0.8f; const FLOAT fHalfUnitS = fHalfUnit *0.8f;
// prepare postition and ammo quantities // prepare postition and ammo quantities

View File

@ -593,7 +593,7 @@ void Particles_RomboidTrail(CEntity *pen)
for(INDEX iPos = 0; iPos<plp->lp_ctUsed; iPos++) for(INDEX iPos = 0; iPos<plp->lp_ctUsed; iPos++)
{ {
FLOAT3D vPos = plp->GetPosition(iPos); FLOAT3D vPos = plp->GetPosition(iPos);
FLOAT fRand = rand()/FLOAT(RAND_MAX); //FLOAT fRand = rand()/FLOAT(RAND_MAX);
FLOAT fAngle = fSeconds*256+iPos*2.0f*PI/ROMBOID_TRAIL_POSITIONS; FLOAT fAngle = fSeconds*256+iPos*2.0f*PI/ROMBOID_TRAIL_POSITIONS;
FLOAT fSin = FLOAT(sin(fAngle)); FLOAT fSin = FLOAT(sin(fAngle));
vPos(2) += fSin*iPos/ROMBOID_TRAIL_POSITIONS; vPos(2) += fSin*iPos/ROMBOID_TRAIL_POSITIONS;
@ -754,7 +754,7 @@ void Particles_WhiteLineTrail(CEntity *pen)
vPos(1) += fSin*iPos*1.0f/WHITE_LINE_TRAIL_POSITIONS; vPos(1) += fSin*iPos*1.0f/WHITE_LINE_TRAIL_POSITIONS;
vPos(2) += fCos*iPos*1.0f/WHITE_LINE_TRAIL_POSITIONS; vPos(2) += fCos*iPos*1.0f/WHITE_LINE_TRAIL_POSITIONS;
UBYTE ub = 255-iPos*256/WHITE_LINE_TRAIL_POSITIONS; //UBYTE ub = 255-iPos*256/WHITE_LINE_TRAIL_POSITIONS;
FLOAT fLerpFactor = FLOAT(iPos)/WHITE_LINE_TRAIL_POSITIONS; FLOAT fLerpFactor = FLOAT(iPos)/WHITE_LINE_TRAIL_POSITIONS;
COLOR colColor = LerpColor( C_YELLOW, C_dRED, fLerpFactor); COLOR colColor = LerpColor( C_YELLOW, C_dRED, fLerpFactor);
Particle_RenderLine( vPos, vOldPos, 0.05f, colColor); Particle_RenderLine( vPos, vOldPos, 0.05f, colColor);
@ -850,7 +850,7 @@ void Particles_CannonBall_Prepare(CEntity *pen)
void Particles_CannonBall(CEntity *pen, FLOAT fSpeedRatio) void Particles_CannonBall(CEntity *pen, FLOAT fSpeedRatio)
{ {
CLastPositions *plp = pen->GetLastPositions(CANNON_TRAIL_POSITIONS); CLastPositions *plp = pen->GetLastPositions(CANNON_TRAIL_POSITIONS);
FLOAT fSeconds = _pTimer->GetLerpedCurrentTick(); //FLOAT fSeconds = _pTimer->GetLerpedCurrentTick();
Particle_PrepareTexture(&_toCannonBall, PBT_BLEND); Particle_PrepareTexture(&_toCannonBall, PBT_BLEND);
Particle_SetTexturePart( 512, 512, 0, 0); Particle_SetTexturePart( 512, 512, 0, 0);
@ -1133,7 +1133,7 @@ void Particles_RocketTrail_Prepare(CEntity *pen)
void Particles_RocketTrail(CEntity *pen, FLOAT fStretch) void Particles_RocketTrail(CEntity *pen, FLOAT fStretch)
{ {
CLastPositions *plp = pen->GetLastPositions(ROCKET_TRAIL_POSITIONS); CLastPositions *plp = pen->GetLastPositions(ROCKET_TRAIL_POSITIONS);
FLOAT fSeconds = _pTimer->GetLerpedCurrentTick(); //FLOAT fSeconds = _pTimer->GetLerpedCurrentTick();
Particle_PrepareTexture(&_toRocketTrail, PBT_ADD); Particle_PrepareTexture(&_toRocketTrail, PBT_ADD);
Particle_SetTexturePart( 512, 512, 0, 0); Particle_SetTexturePart( 512, 512, 0, 0);
@ -1153,7 +1153,7 @@ void Particles_RocketTrail(CEntity *pen, FLOAT fStretch)
} }
for (INDEX iInter=0; iInter<ROCKET_TRAIL_INTERPOSITIONS; iInter++) for (INDEX iInter=0; iInter<ROCKET_TRAIL_INTERPOSITIONS; iInter++)
{ {
FLOAT fRand = rand()/FLOAT(RAND_MAX); //FLOAT fRand = rand()/FLOAT(RAND_MAX);
FLOAT fAngle = 0.0f; FLOAT fAngle = 0.0f;
FLOAT3D vPos = Lerp(*pvPos1, *pvPos2, iInter*1.0f/ROCKET_TRAIL_INTERPOSITIONS); FLOAT3D vPos = Lerp(*pvPos1, *pvPos2, iInter*1.0f/ROCKET_TRAIL_INTERPOSITIONS);
FLOAT fSize = iParticle*0.5f/iParticlesLiving*fStretch+0.25f; FLOAT fSize = iParticle*0.5f/iParticlesLiving*fStretch+0.25f;
@ -1336,7 +1336,7 @@ void Particles_ExplosionDebris3(CEntity *pen, FLOAT tmStart, FLOAT3D vStretch, C
void Particles_ExplosionSmoke(CEntity *pen, FLOAT tmStart, FLOAT3D vStretch, COLOR colMultiply/*=C_WHITE|CT_OPAQUE*/) void Particles_ExplosionSmoke(CEntity *pen, FLOAT tmStart, FLOAT3D vStretch, COLOR colMultiply/*=C_WHITE|CT_OPAQUE*/)
{ {
Particle_PrepareTexture( &_toBulletSmoke, PBT_BLEND); Particle_PrepareTexture( &_toBulletSmoke, PBT_BLEND);
CTextureData *pTD = (CTextureData *) _toExplosionDebrisGradient.GetData(); //CTextureData *pTD = (CTextureData *) _toExplosionDebrisGradient.GetData();
FLOAT fNow = _pTimer->GetLerpedCurrentTick(); FLOAT fNow = _pTimer->GetLerpedCurrentTick();
const FLOATmatrix3D &m = pen->GetRotationMatrix(); const FLOATmatrix3D &m = pen->GetRotationMatrix();
FLOAT3D vY( m(1,2), m(2,2), m(3,2)); FLOAT3D vY( m(1,2), m(2,2), m(3,2));
@ -1355,7 +1355,7 @@ void Particles_ExplosionSmoke(CEntity *pen, FLOAT tmStart, FLOAT3D vStretch, COL
FLOAT fTRnd=afStarsPositions[iRnd][0]; FLOAT fTRnd=afStarsPositions[iRnd][0];
FLOAT tmBorn=tmStart+i*TM_ES_SMOKE_DELTA+(TM_ES_SMOKE_DELTA*fTRnd)/2.0f; FLOAT tmBorn=tmStart+i*TM_ES_SMOKE_DELTA+(TM_ES_SMOKE_DELTA*fTRnd)/2.0f;
FLOAT fT=fNow-tmBorn; FLOAT fT=fNow-tmBorn;
FLOAT fRatio=Clamp(fT/TM_ES_TOTAL_LIFE, 0.0f, 1.0f); //FLOAT fRatio=Clamp(fT/TM_ES_TOTAL_LIFE, 0.0f, 1.0f);
if( fT>0) if( fT>0)
{ {
FLOAT3D vSpeed=FLOAT3D(afStarsPositions[iRnd][0]*0.15f, FLOAT3D vSpeed=FLOAT3D(afStarsPositions[iRnd][0]*0.15f,
@ -1455,7 +1455,7 @@ void DECL_DLL Particles_Waterfall(CEntity *pen, INDEX ctCount, FLOAT fStretchAll
fT *= 1/fParam1; fT *= 1/fParam1;
// get fraction part // get fraction part
fT = fT-int(fT); fT = fT-int(fT);
FLOAT fSlowFactor=1.0f-fT*0.25f; //FLOAT fSlowFactor=1.0f-fT*0.25f;
FLOAT3D vSpeed= FLOAT3D vSpeed=
vX*(afStarsPositions[iRnd][0]*0.25f)+ vX*(afStarsPositions[iRnd][0]*0.25f)+
vY*(afStarsPositions[iRnd][0]*0.25f)+ vY*(afStarsPositions[iRnd][0]*0.25f)+
@ -1497,9 +1497,9 @@ void Particles_BloodTrail(CEntity *pen)
{ {
Particle_SetTexturePart( 256, 256, iPos%8, 0); Particle_SetTexturePart( 256, 256, iPos%8, 0);
FLOAT3D vPos = plp->GetPosition(iPos); FLOAT3D vPos = plp->GetPosition(iPos);
FLOAT fRand = rand()/FLOAT(RAND_MAX); //FLOAT fRand = rand()/FLOAT(RAND_MAX);
FLOAT fAngle = iPos*2.0f*PI/BLOOD01_TRAIL_POSITIONS; FLOAT fAngle = iPos*2.0f*PI/BLOOD01_TRAIL_POSITIONS;
FLOAT fSin = FLOAT(sin(fAngle)); //FLOAT fSin = FLOAT(sin(fAngle));
FLOAT fT = iPos*_pTimer->TickQuantum; FLOAT fT = iPos*_pTimer->TickQuantum;
vPos += vGDir*fGA*fT*fT/8.0f; vPos += vGDir*fGA*fT*fT/8.0f;
FLOAT fSize = 0.2f-iPos*0.15f/BLOOD01_TRAIL_POSITIONS; FLOAT fSize = 0.2f-iPos*0.15f/BLOOD01_TRAIL_POSITIONS;
@ -1735,8 +1735,8 @@ void Particles_FlameThrowerStart(const CPlacement3D &plPipe, FLOAT fStartTime, F
fPowerFactor *= Clamp(1.0f+(fStopTime-fNow)/2.0f,0.0f,1.0f); fPowerFactor *= Clamp(1.0f+(fStopTime-fNow)/2.0f,0.0f,1.0f);
INDEX ctParticles = (INDEX) (FLOAT(CT_FTSPARKS) * fPowerFactor); INDEX ctParticles = (INDEX) (FLOAT(CT_FTSPARKS) * fPowerFactor);
ASSERT( ctParticles<=CT_MAX_PARTICLES_TABLE); ASSERT( ctParticles<=CT_MAX_PARTICLES_TABLE);
FLOAT fHeight = 1.0f*fPowerFactor; //FLOAT fHeight = 1.0f*fPowerFactor;
INDEX iParticle=0; //INDEX iParticle=0;
for( INDEX iSpark=0; iSpark<ctParticles; iSpark++) for( INDEX iSpark=0; iSpark<ctParticles; iSpark++)
{ {
for( INDEX iTrail=0; iTrail<CT_FTSPARK_TRAIL; iTrail++) for( INDEX iTrail=0; iTrail<CT_FTSPARK_TRAIL; iTrail++)
@ -2223,12 +2223,12 @@ void Particles_DustFall(CEntity *pen, FLOAT tmStarted, FLOAT3D vStretch)
FLOAT3D vY( m(1,2), m(2,2), m(3,2)); FLOAT3D vY( m(1,2), m(2,2), m(3,2));
FLOAT3D vZ( m(1,3), m(2,3), m(3,3)); FLOAT3D vZ( m(1,3), m(2,3), m(3,3));
FLOAT3D vCenter = pen->GetLerpedPlacement().pl_PositionVector; FLOAT3D vCenter = pen->GetLerpedPlacement().pl_PositionVector;
FLOAT3D vG=-vY; //FLOAT3D vG=-vY;
FLOAT tmNow = _pTimer->GetLerpedCurrentTick(); //FLOAT tmNow = _pTimer->GetLerpedCurrentTick();
FLOAT fT = _pTimer->GetLerpedCurrentTick()-tmStarted; FLOAT fT = _pTimer->GetLerpedCurrentTick()-tmStarted;
FLOAT fStretch=vStretch.Length(); FLOAT fStretch=vStretch.Length();
INDEX ctParticles=(INDEX) (4+fSizeRatio*28); //INDEX ctParticles=(INDEX) (4+fSizeRatio*28);
for(INDEX iDust=0; iDust<32; iDust++) for(INDEX iDust=0; iDust<32; iDust++)
{ {
INDEX iRnd = (pen->en_ulID*12345+iDust)%CT_MAX_PARTICLES_TABLE; INDEX iRnd = (pen->en_ulID*12345+iDust)%CT_MAX_PARTICLES_TABLE;
@ -2240,9 +2240,9 @@ void Particles_DustFall(CEntity *pen, FLOAT tmStarted, FLOAT3D vStretch)
FLOAT fPower = CalculateRatio(fT, 0, fLifeTime, 0.1f, 0.4f); FLOAT fPower = CalculateRatio(fT, 0, fLifeTime, 0.1f, 0.4f);
FLOAT fSpeed=0.351f+0.0506f*log(fRatio+0.001f); FLOAT fSpeed=0.351f+0.0506f*log(fRatio+0.001f);
FLOAT fRndAppearX = afStarsPositions[iRnd][0]*vStretch(1); //FLOAT fRndAppearX = afStarsPositions[iRnd][0]*vStretch(1);
FLOAT fRndSpeedY = (afStarsPositions[iRnd][1]+0.5f)*0.125f*vStretch(2); //FLOAT fRndSpeedY = (afStarsPositions[iRnd][1]+0.5f)*0.125f*vStretch(2);
FLOAT fRndAppearZ = afStarsPositions[iRnd][2]*vStretch(3); //FLOAT fRndAppearZ = afStarsPositions[iRnd][2]*vStretch(3);
FLOAT3D vRndDir=FLOAT3D(afStarsPositions[iRnd][0],0,afStarsPositions[iRnd][2]); FLOAT3D vRndDir=FLOAT3D(afStarsPositions[iRnd][0],0,afStarsPositions[iRnd][2]);
vRndDir.Normalize(); vRndDir.Normalize();
FLOAT fRiseTime=Max(fRatio-0.5f,0.0f); FLOAT fRiseTime=Max(fRatio-0.5f,0.0f);
@ -2590,7 +2590,7 @@ BOOL UpdateGrowthCache(CEntity *pen, CTextureData *ptdGrowthMap, FLOATaabbox3D &
FLOAT fGridStep; FLOAT fGridStep;
ULONG fXSpan; ULONG fXSpan;
UBYTE ubFade=0xff; // UBYTE ubFade=0xff;
fGridStep = GROWTH_RENDERING_STEP; fGridStep = GROWTH_RENDERING_STEP;
fXSpan = 1234; fXSpan = 1234;
@ -2798,7 +2798,7 @@ void Particles_Growth(CEntity *pen, CTextureData *ptdGrowthMap, FLOATaabbox3D &b
// calculate fade value // calculate fade value
FLOAT fFadeOutStrip = GROWTH_RENDERING_RADIUS_FADE - GROWTH_RENDERING_RADIUS_OPAQUE; FLOAT fFadeOutStrip = GROWTH_RENDERING_RADIUS_FADE - GROWTH_RENDERING_RADIUS_OPAQUE;
UBYTE ubFade = (UBYTE)(((GROWTH_RENDERING_RADIUS_FADE - cgParticle->fDistanceToViewer) / fFadeOutStrip)*255.0f); //UBYTE ubFade = (UBYTE)(((GROWTH_RENDERING_RADIUS_FADE - cgParticle->fDistanceToViewer) / fFadeOutStrip)*255.0f);
if ( cgParticle->fDistanceToViewer < GROWTH_RENDERING_RADIUS_OPAQUE) { if ( cgParticle->fDistanceToViewer < GROWTH_RENDERING_RADIUS_OPAQUE) {
cgParticle->ubFade = 255; cgParticle->ubFade = 255;
acgDraw.Push() = *cgParticle; acgDraw.Push() = *cgParticle;
@ -3166,7 +3166,7 @@ void Particles_Snow(CEntity *pen, FLOAT fGridSize, INDEX ctGrids, FLOAT fFactor,
FLOAT fFlakeStartPos=vPos(2)-fFlakePath; FLOAT fFlakeStartPos=vPos(2)-fFlakePath;
FLOAT fSnapFlakeStartPos=fFlakeStartPos; FLOAT fSnapFlakeStartPos=fFlakeStartPos;
SnapFloat(fSnapFlakeStartPos, YGRID_SIZE); SnapFloat(fSnapFlakeStartPos, YGRID_SIZE);
INDEX iRndFlakeStart=INDEX(fSnapFlakeStartPos)%CT_MAX_PARTICLES_TABLE; //INDEX iRndFlakeStart=INDEX(fSnapFlakeStartPos)%CT_MAX_PARTICLES_TABLE;
FLOAT tmSnapSnowFalling = tmSnowFalling; FLOAT tmSnapSnowFalling = tmSnowFalling;
SnapFloat( tmSnapSnowFalling, SNOW_TILE_DROP_TIME); SnapFloat( tmSnapSnowFalling, SNOW_TILE_DROP_TIME);
FLOAT fTileRatio = (tmSnowFalling-tmSnapSnowFalling)/SNOW_TILE_DROP_TIME; FLOAT fTileRatio = (tmSnowFalling-tmSnapSnowFalling)/SNOW_TILE_DROP_TIME;
@ -3552,9 +3552,9 @@ void Particles_BulletSpray(INDEX iRndBase, FLOAT3D vSource, FLOAT3D vGDir, enum
fSpeedStart = 1.75f; fSpeedStart = 1.75f;
fConeMultiplier = 0.125f; fConeMultiplier = 0.125f;
FLOAT fFadeStart = BULLET_SPRAY_WATER_FADEOUT_START; //FLOAT fFadeStart = BULLET_SPRAY_WATER_FADEOUT_START;
FLOAT fLifeTotal = BULLET_SPRAY_WATER_TOTAL_TIME; //FLOAT fLifeTotal = BULLET_SPRAY_WATER_TOTAL_TIME;
FLOAT fFadeLen = fLifeTotal-fFadeStart; //FLOAT fFadeLen = fLifeTotal-fFadeStart;
break; break;
} }
@ -3784,7 +3784,7 @@ void Particles_EmptyShells( CEntity *pen, ShellLaunchData *asldData)
{ {
// render smoke // render smoke
INDEX iRnd = (INDEX(tmLaunch*1234))%CT_MAX_PARTICLES_TABLE; INDEX iRnd = (INDEX(tmLaunch*1234))%CT_MAX_PARTICLES_TABLE;
FLOAT fTRatio = fT/fLife; //FLOAT fTRatio = fT/fLife;
INDEX iColumn = 4+INDEX( iShell)%4; INDEX iColumn = 4+INDEX( iShell)%4;
Particle_SetTexturePart( 256, 256, iColumn, 2); Particle_SetTexturePart( 256, 256, iColumn, 2);
@ -3805,7 +3805,7 @@ void Particles_EmptyShells( CEntity *pen, ShellLaunchData *asldData)
{ {
// render smoke // render smoke
INDEX iRnd = (INDEX(tmLaunch*1234))%CT_MAX_PARTICLES_TABLE; INDEX iRnd = (INDEX(tmLaunch*1234))%CT_MAX_PARTICLES_TABLE;
FLOAT fTRatio = fT/fLife; //FLOAT fTRatio = fT/fLife;
INDEX iColumn = 4+INDEX( iShell)%4; INDEX iColumn = 4+INDEX( iShell)%4;
Particle_SetTexturePart( 256, 256, iColumn, 2); Particle_SetTexturePart( 256, 256, iColumn, 2);
@ -3832,7 +3832,7 @@ void Particles_EmptyShells( CEntity *pen, ShellLaunchData *asldData)
FLOAT3D vUp( m(1,2), m(2,2), m(3,2)); FLOAT3D vUp( m(1,2), m(2,2), m(3,2));
INDEX iRnd = (INDEX(tmLaunch*1234))%CT_MAX_PARTICLES_TABLE; INDEX iRnd = (INDEX(tmLaunch*1234))%CT_MAX_PARTICLES_TABLE;
FLOAT fTRatio = fT/fLife; //FLOAT fTRatio = fT/fLife;
INDEX iColumn = 4+INDEX( iShell)%4; INDEX iColumn = 4+INDEX( iShell)%4;
Particle_SetTexturePart( 256, 256, iColumn, 2); Particle_SetTexturePart( 256, 256, iColumn, 2);
@ -4151,7 +4151,7 @@ void Particles_Appearing(CEntity *pen, TIME tmStart)
if( (fTime<APPEAR_IN_START) || (fTime>APPEAR_OUT_END)) { if( (fTime<APPEAR_IN_START) || (fTime>APPEAR_OUT_END)) {
return; return;
} }
FLOAT fPowerTime = pow(fTime-SPIRIT_SPIRAL_START, 2.5f); //FLOAT fPowerTime = pow(fTime-SPIRIT_SPIRAL_START, 2.5f);
// fill array with absolute vertices of entity's model and its attached models // fill array with absolute vertices of entity's model and its attached models
pen->GetModelVerticesAbsolute(avVertices, 0.05f, fMipFactor); pen->GetModelVerticesAbsolute(avVertices, 0.05f, fMipFactor);
@ -4161,7 +4161,7 @@ void Particles_Appearing(CEntity *pen, TIME tmStart)
FLOAT3D vX( m(1,1), m(2,1), m(3,1)); FLOAT3D vX( m(1,1), m(2,1), m(3,1));
FLOAT3D vY( m(1,2), m(2,2), m(3,2)); FLOAT3D vY( m(1,2), m(2,2), m(3,2));
FLOAT3D vZ( m(1,3), m(2,3), m(3,3)); FLOAT3D vZ( m(1,3), m(2,3), m(3,3));
FLOAT3D vCenter = pen->GetLerpedPlacement().pl_PositionVector; //FLOAT3D vCenter = pen->GetLerpedPlacement().pl_PositionVector;
SetupParticleTexture( PT_STAR07); SetupParticleTexture( PT_STAR07);
@ -4180,12 +4180,12 @@ void Particles_Appearing(CEntity *pen, TIME tmStart)
COLOR col = RGBToColor(ubColor,ubColor,ubColor)|CT_OPAQUE; COLOR col = RGBToColor(ubColor,ubColor,ubColor)|CT_OPAQUE;
INDEX ctVtx = avVertices.Count(); INDEX ctVtx = avVertices.Count();
FLOAT fSpeedFactor = 1.0f/ctVtx; //FLOAT fSpeedFactor = 1.0f/ctVtx;
// get corp size // get corp size
FLOATaabbox3D box; FLOATaabbox3D box;
pen->en_pmoModelObject->GetCurrentFrameBBox(box); pen->en_pmoModelObject->GetCurrentFrameBBox(box);
FLOAT fHeightStretch = box.Size()(2); //FLOAT fHeightStretch = box.Size()(2);
FLOAT fStep = ClampDn( fMipFactor, 1.0f); FLOAT fStep = ClampDn( fMipFactor, 1.0f);
for( FLOAT fVtx=0.0f; fVtx<ctVtx; fVtx+=fStep) for( FLOAT fVtx=0.0f; fVtx<ctVtx; fVtx+=fStep)
@ -4435,7 +4435,7 @@ void Particles_BloodSpray(enum SprayParticlesType sptType, FLOAT3D vSource, FLOA
else else
{ {
UBYTE ubRndH = UBYTE( 32+afStarsPositions[ int(iSpray+tmStarted*10)%CT_MAX_PARTICLES_TABLE][0]*16); UBYTE ubRndH = UBYTE( 32+afStarsPositions[ int(iSpray+tmStarted*10)%CT_MAX_PARTICLES_TABLE][0]*16);
UBYTE ubRndS = UBYTE( 127+(afStarsPositions[ int(iSpray+tmStarted*10)%CT_MAX_PARTICLES_TABLE][1]+0.5)*128); //UBYTE ubRndS = UBYTE( 127+(afStarsPositions[ int(iSpray+tmStarted*10)%CT_MAX_PARTICLES_TABLE][1]+0.5)*128);
UBYTE ubRndV = UBYTE( 159+(afStarsPositions[ int(iSpray+tmStarted*10)%CT_MAX_PARTICLES_TABLE][2])*192); UBYTE ubRndV = UBYTE( 159+(afStarsPositions[ int(iSpray+tmStarted*10)%CT_MAX_PARTICLES_TABLE][2])*192);
col = HSVToColor(ubRndH, 0, ubRndV)|ubAlpha; col = HSVToColor(ubRndH, 0, ubRndV)|ubAlpha;
fSize/=2.0f; fSize/=2.0f;
@ -4849,7 +4849,7 @@ void Particles_RocketMotorBurning(CEntity *pen, FLOAT tmSpawn, FLOAT3D vStretch,
FLOAT fMipDisappearDistance=13.0f; FLOAT fMipDisappearDistance=13.0f;
FLOAT fMipFactor = Particle_GetMipFactor(); FLOAT fMipFactor = Particle_GetMipFactor();
if( fMipFactor>fMipDisappearDistance) return; if( fMipFactor>fMipDisappearDistance) return;
FLOAT fMipBlender=CalculateRatio(fMipFactor, 0.0f, fMipDisappearDistance, 0.0f, 0.1f); //FLOAT fMipBlender=CalculateRatio(fMipFactor, 0.0f, fMipDisappearDistance, 0.0f, 0.1f);
CPlacement3D pl = pen->GetLerpedPlacement(); CPlacement3D pl = pen->GetLerpedPlacement();
const FLOATmatrix3D &m = pen->GetRotationMatrix(); const FLOATmatrix3D &m = pen->GetRotationMatrix();
@ -4858,7 +4858,7 @@ void Particles_RocketMotorBurning(CEntity *pen, FLOAT tmSpawn, FLOAT3D vStretch,
CTextureData *pTD = (CTextureData *) _toAfterBurnerGradient.GetData(); CTextureData *pTD = (CTextureData *) _toAfterBurnerGradient.GetData();
ULONG *pcolFlare=pTD->GetRowPointer(0); // flare color //ULONG *pcolFlare=pTD->GetRowPointer(0); // flare color
ULONG *pcolExp=pTD->GetRowPointer(1); // explosion color ULONG *pcolExp=pTD->GetRowPointer(1); // explosion color
ULONG *pcolSmoke=pTD->GetRowPointer(2); // smoke color ULONG *pcolSmoke=pTD->GetRowPointer(2); // smoke color
FLOAT aFlare_sol[256], aFlare_vol[256], aFlare_wol[256], aFlare_rol[256]; FLOAT aFlare_sol[256], aFlare_vol[256], aFlare_wol[256], aFlare_rol[256];
@ -5103,7 +5103,7 @@ void Particles_Twister( CEntity *pen, FLOAT fStretch, FLOAT fStartTime, FLOAT fF
// get fraction part // get fraction part
fT = fT-int(fT); fT = fT-int(fT);
INDEX iPos=(INDEX) (fT*255); INDEX iPos=(INDEX) (fT*255);
FLOAT fSlowFactor=1.0f-fT*0.25f; //FLOAT fSlowFactor=1.0f-fT*0.25f;
FLOAT fSpeed=25.0f+(afStarsPositions[iRnd][0]+0.5f)*2.0f; FLOAT fSpeed=25.0f+(afStarsPositions[iRnd][0]+0.5f)*2.0f;
FLOAT fR=arol[iPos]*8.0f; FLOAT fR=arol[iPos]*8.0f;
FLOAT3D vPos=vCenter+vY*fSpeed*fT+ FLOAT3D vPos=vCenter+vY*fSpeed*fT+
@ -5235,7 +5235,7 @@ void Particles_Windblast( CEntity *pen, FLOAT fStretch, FLOAT fFadeOutStartTime)
// get fraction part // get fraction part
fT = fT-int(fT); fT = fT-int(fT);
INDEX iPos=(INDEX) (fT*255); INDEX iPos=(INDEX) (fT*255);
FLOAT fSlowFactor=1.0f-fT*0.25f; //FLOAT fSlowFactor=1.0f-fT*0.25f;
FLOAT fSpeed=25.0f+(afStarsPositions[iRnd][0]+0.5f)*2.0f; FLOAT fSpeed=25.0f+(afStarsPositions[iRnd][0]+0.5f)*2.0f;
FLOAT fR=arol[iPos]*8.0f; FLOAT fR=arol[iPos]*8.0f;
fR=3.0f; fR=3.0f;
@ -5332,19 +5332,19 @@ void Particles_CollectEnergy(CEntity *pen, FLOAT tmStart, FLOAT tmStop)
// calculate fraction part // calculate fraction part
FLOAT fT=fPassedTime/fStarLife; FLOAT fT=fPassedTime/fStarLife;
fT=fT-INDEX(fT); fT=fT-INDEX(fT);
INDEX iRnd = iStar%CT_MAX_PARTICLES_TABLE; //INDEX iRnd = iStar%CT_MAX_PARTICLES_TABLE;
FLOAT fRadius=2; FLOAT fRadius=2;
FLOAT3D vPos= vCenter+ FLOAT3D vPos= vCenter+
vX*Sin(fT*360.0f)*fRadius+ vX*Sin(fT*360.0f)*fRadius+
vY*fT*2+ vY*fT*2+
vZ*Cos(fT*360.0f)*fRadius; vZ*Cos(fT*360.0f)*fRadius;
UBYTE ubR = (UBYTE) (255); //UBYTE ubR = (UBYTE) (255);
UBYTE ubG = (UBYTE) (128+(1.0f-fT)*128); //UBYTE ubG = (UBYTE) (128+(1.0f-fT)*128);
UBYTE ubB = (UBYTE) (16+afStarsPositions[iRnd][2]*32+(1.0f-fT)*64); //UBYTE ubB = (UBYTE) (16+afStarsPositions[iRnd][2]*32+(1.0f-fT)*64);
FLOAT fFader=CalculateRatio( fT, 0.0f, 1.0f, 0.4f, 0.01f); FLOAT fFader=CalculateRatio( fT, 0.0f, 1.0f, 0.4f, 0.01f);
FLOAT fPulser=(1.0f+(sin((fT*fT)/4.0f)))/2.0f; FLOAT fPulser=(1.0f+(sin((fT*fT)/4.0f)))/2.0f;
UBYTE ubA = (UBYTE) (fFader*fPulser*255); UBYTE ubA = (UBYTE) (fFader*fPulser*255);
COLOR colLine = RGBToColor( ubA, ubA, ubA) | CT_OPAQUE; //COLOR colLine = RGBToColor( ubA, ubA, ubA) | CT_OPAQUE;
FLOAT fSize = 2; FLOAT fSize = 2;
Particle_RenderSquare( vPos, fSize, 0.0f, C_ORANGE|ubA); Particle_RenderSquare( vPos, fSize, 0.0f, C_ORANGE|ubA);
ctRendered++; ctRendered++;
@ -5455,7 +5455,7 @@ void Particles_GrowingSwirl( CEntity *pen, FLOAT fStretch, FLOAT fStartTime)
INDEX ctStars=(INDEX)(TM_GROWING_SWIRL_FX_LIFE/TM_SWIRL_SPARK_LAUNCH); INDEX ctStars=(INDEX)(TM_GROWING_SWIRL_FX_LIFE/TM_SWIRL_SPARK_LAUNCH);
for(INDEX i=0; i<ctStars; i++) for(INDEX i=0; i<ctStars; i++)
{ {
INDEX iRnd =(pen->en_ulID+i)%CT_MAX_PARTICLES_TABLE; //INDEX iRnd =(pen->en_ulID+i)%CT_MAX_PARTICLES_TABLE;
FLOAT fBirth = fStartTime+i*TM_SWIRL_SPARK_LAUNCH-2.0f;//+afTimeOffsets[i]*TM_SWIRL_SPARK_LAUNCH/0.25f; FLOAT fBirth = fStartTime+i*TM_SWIRL_SPARK_LAUNCH-2.0f;//+afTimeOffsets[i]*TM_SWIRL_SPARK_LAUNCH/0.25f;
FLOAT fT = tmNow-fBirth; FLOAT fT = tmNow-fBirth;
FLOAT fFade=CalculateRatio(fT, 0, TM_GROWING_SWIRL_TOTAL_LIFE, 0.1f, 0.2f); FLOAT fFade=CalculateRatio(fT, 0, TM_GROWING_SWIRL_TOTAL_LIFE, 0.1f, 0.2f);
@ -5622,7 +5622,7 @@ void Particles_MeteorTrail(CEntity *pen, FLOAT fStretch, FLOAT fLength, FLOAT3D
{ {
Particle_PrepareTexture( &_toMeteorTrail, PBT_ADD); Particle_PrepareTexture( &_toMeteorTrail, PBT_ADD);
Particle_SetTexturePart( 1024, 2048, 0, 0); Particle_SetTexturePart( 1024, 2048, 0, 0);
CTextureData *pTD = (CTextureData *) _toExplosionDebrisGradient.GetData(); //CTextureData *pTD = (CTextureData *) _toExplosionDebrisGradient.GetData();
FLOAT3D vPos0 = pen->GetLerpedPlacement().pl_PositionVector+vSpeed*0.05f; FLOAT3D vPos0 = pen->GetLerpedPlacement().pl_PositionVector+vSpeed*0.05f;
FLOAT3D vPos1 = pen->GetLerpedPlacement().pl_PositionVector+vSpeed*0.05f-vSpeed*0.125f; FLOAT3D vPos1 = pen->GetLerpedPlacement().pl_PositionVector+vSpeed*0.05f-vSpeed*0.125f;
Particle_RenderLine( vPos1, vPos0, 3.0f, C_WHITE|CT_OPAQUE); Particle_RenderLine( vPos1, vPos0, 3.0f, C_WHITE|CT_OPAQUE);
@ -5749,19 +5749,19 @@ void Particles_LarvaEnergy(CEntity *pen, FLOAT3D vOffset)
// calculate fraction part // calculate fraction part
FLOAT fT=fPassedTime/fStarLife; FLOAT fT=fPassedTime/fStarLife;
fT=fT-INDEX(fT); fT=fT-INDEX(fT);
INDEX iRnd = iStar%CT_MAX_PARTICLES_TABLE; //INDEX iRnd = iStar%CT_MAX_PARTICLES_TABLE;
FLOAT fRadius=2; FLOAT fRadius=2;
FLOAT3D vPos= vCenter+ FLOAT3D vPos= vCenter+
vX*Sin(fT*360.0f)*fRadius+ vX*Sin(fT*360.0f)*fRadius+
vY*fT*2+ vY*fT*2+
vZ*Cos(fT*360.0f)*fRadius; vZ*Cos(fT*360.0f)*fRadius;
UBYTE ubR = (UBYTE) (255); //UBYTE ubR = (UBYTE) (255);
UBYTE ubG = (UBYTE) (128+(1.0f-fT)*128); //UBYTE ubG = (UBYTE) (128+(1.0f-fT)*128);
UBYTE ubB = (UBYTE) (16+afStarsPositions[iRnd][2]*32+(1.0f-fT)*64); // UBYTE ubB = (UBYTE) (16+afStarsPositions[iRnd][2]*32+(1.0f-fT)*64);
FLOAT fFader=CalculateRatio( fT, 0.0f, 1.0f, 0.4f, 0.01f); FLOAT fFader=CalculateRatio( fT, 0.0f, 1.0f, 0.4f, 0.01f);
FLOAT fPulser=(1.0f+(sin((fT*fT)/4.0f)))/2.0f; FLOAT fPulser=(1.0f+(sin((fT*fT)/4.0f)))/2.0f;
UBYTE ubA = (UBYTE) (fFader*fPulser*255); UBYTE ubA = (UBYTE) (fFader*fPulser*255);
COLOR colLine = RGBToColor( ubA, ubA, ubA) | CT_OPAQUE; //COLOR colLine = RGBToColor( ubA, ubA, ubA) | CT_OPAQUE;
FLOAT fSize = 2; FLOAT fSize = 2;
Particle_RenderSquare( vPos, fSize, 0.0f, C_ORANGE|ubA); Particle_RenderSquare( vPos, fSize, 0.0f, C_ORANGE|ubA);
ctRendered++; ctRendered++;
@ -5792,7 +5792,7 @@ void Particles_AirElemental_Comp(CModelObject *mo, FLOAT fStretch, FLOAT fFade,
FLOAT3D vG=-vY; FLOAT3D vG=-vY;
FLOAT fSpeed=1.0f; FLOAT fSpeed=1.0f;
FLOAT fG=50.0f; //FLOAT fG=50.0f;
FLOAT fGValue=0.0f; FLOAT fGValue=0.0f;
Particle_PrepareTexture( &_toTwister, PBT_BLEND); Particle_PrepareTexture( &_toTwister, PBT_BLEND);
@ -5843,7 +5843,7 @@ void Particles_ModelGlow( CEntity *pen, FLOAT tmEnd, enum ParticleTexture ptText
FLOAT3D vX( m(1,1), m(2,1), m(3,1)); FLOAT3D vX( m(1,1), m(2,1), m(3,1));
FLOAT3D vY( m(1,2), m(2,2), m(3,2)); FLOAT3D vY( m(1,2), m(2,2), m(3,2));
FLOAT3D vZ( m(1,3), m(2,3), m(3,3)); FLOAT3D vZ( m(1,3), m(2,3), m(3,3));
FLOAT3D vCenter = pen->GetLerpedPlacement().pl_PositionVector; //FLOAT3D vCenter = pen->GetLerpedPlacement().pl_PositionVector;
UBYTE ubCol=255; UBYTE ubCol=255;
if((tmEnd-tmNow)<5.0f) if((tmEnd-tmNow)<5.0f)
@ -5884,7 +5884,7 @@ void Particles_ModelGlow2( CModelObject *mo, CPlacement3D pl, FLOAT tmEnd, enum
FLOAT3D vX( m(1,1), m(2,1), m(3,1)); FLOAT3D vX( m(1,1), m(2,1), m(3,1));
FLOAT3D vY( m(1,2), m(2,2), m(3,2)); FLOAT3D vY( m(1,2), m(2,2), m(3,2));
FLOAT3D vZ( m(1,3), m(2,3), m(3,3)); FLOAT3D vZ( m(1,3), m(2,3), m(3,3));
FLOAT3D vCenter = plPlacement.pl_PositionVector; //FLOAT3D vCenter = plPlacement.pl_PositionVector;
UBYTE ubCol=255; UBYTE ubCol=255;
if((tmEnd-tmNow)<5.0f) if((tmEnd-tmNow)<5.0f)
@ -5933,7 +5933,7 @@ void Particles_RunAfterBurner(CEntity *pen, FLOAT tmEnd, FLOAT fStretch, INDEX i
const FLOAT3D *pvPos1; const FLOAT3D *pvPos1;
const FLOAT3D *pvPos2 = &plp->GetPosition(plp->lp_ctUsed-1); const FLOAT3D *pvPos2 = &plp->GetPosition(plp->lp_ctUsed-1);
ULONG *pcolFlare=pTD->GetRowPointer(0); // flare color //ULONG *pcolFlare=pTD->GetRowPointer(0); // flare color
ULONG *pcolExp=pTD->GetRowPointer(1); // explosion color ULONG *pcolExp=pTD->GetRowPointer(1); // explosion color
ULONG *pcolSmoke=pTD->GetRowPointer(2); // smoke color ULONG *pcolSmoke=pTD->GetRowPointer(2); // smoke color
FLOAT aFlare_sol[256], aFlare_vol[256], aFlare_wol[256], aFlare_rol[256]; FLOAT aFlare_sol[256], aFlare_vol[256], aFlare_wol[256], aFlare_rol[256];

View File

@ -733,7 +733,7 @@ extern void SetupCompModel_t(const CTString &strName)
CTFILENAME("ModelsMP\\Weapons\\Chainsaw\\Blade.tex"), CTFILENAME("ModelsMP\\Weapons\\Chainsaw\\Blade.tex"),
CTFILENAME("Models\\ReflectionTextures\\LightMetal01.tex"), CTFILENAME("Models\\ReflectionTextures\\LightMetal01.tex"),
CTFILENAME("Models\\SpecularTextures\\Medium.tex")); CTFILENAME("Models\\SpecularTextures\\Medium.tex"));
CAttachmentModelObject *amo = pmo->GetAttachmentModel(CHAINSAWITEM_ATTACHMENT_BLADE); //CAttachmentModelObject *amo = pmo->GetAttachmentModel(CHAINSAWITEM_ATTACHMENT_BLADE);
AddAttachment_t(pmo, BLADEFORPLAYER_ATTACHMENT_TEETH, AddAttachment_t(pmo, BLADEFORPLAYER_ATTACHMENT_TEETH,
CTFILENAME("ModelsMP\\Weapons\\Chainsaw\\Teeth.mdl"), 0, CTFILENAME("ModelsMP\\Weapons\\Chainsaw\\Teeth.mdl"), 0,
CTFILENAME("ModelsMP\\Weapons\\Chainsaw\\Teeth.tex"), CTFILENAME("ModelsMP\\Weapons\\Chainsaw\\Teeth.tex"),

View File

@ -181,8 +181,8 @@ static PIXaabbox2D GetTextSliderBox(void)
return PIXaabbox2D(); return PIXaabbox2D();
} }
INDEX ctTextLines = _acmMessages[_iActiveMessage].cm_ctFormattedLines; INDEX ctTextLines = _acmMessages[_iActiveMessage].cm_ctFormattedLines;
PIX pixSizeI = _boxMsgText.Size()(1); //PIX pixSizeI = _boxMsgText.Size()(1);
PIX pixSizeJ = _boxMsgText.Size()(2); //PIX pixSizeJ = _boxMsgText.Size()(2);
return GetSliderBox( return GetSliderBox(
_iTextLineOnScreen, _ctTextLinesOnScreen, ctTextLines, GetTextSliderSpace()); _iTextLineOnScreen, _ctTextLinesOnScreen, ctTextLines, GetTextSliderSpace());
} }
@ -190,8 +190,8 @@ static PIXaabbox2D GetTextSliderBox(void)
static PIXaabbox2D GetMsgSliderBox(void) static PIXaabbox2D GetMsgSliderBox(void)
{ {
INDEX ctLines = _acmMessages.Count(); INDEX ctLines = _acmMessages.Count();
PIX pixSizeI = _boxMsgList.Size()(1); //PIX pixSizeI = _boxMsgList.Size()(1);
PIX pixSizeJ = _boxMsgList.Size()(2); //PIX pixSizeJ = _boxMsgList.Size()(2);
return GetSliderBox( return GetSliderBox(
_iFirstMessageOnScreen, _ctMessagesOnScreen, ctLines, GetMsgSliderSpace()); _iFirstMessageOnScreen, _ctMessagesOnScreen, ctLines, GetMsgSliderSpace());
} }
@ -755,7 +755,7 @@ void RenderMessageStats(CDrawPort *pdp)
{ {
CSessionProperties *psp = (CSessionProperties *)_pNetwork->GetSessionProperties(); CSessionProperties *psp = (CSessionProperties *)_pNetwork->GetSessionProperties();
ULONG ulLevelMask = psp->sp_ulLevelsMask; ULONG ulLevelMask = psp->sp_ulLevelsMask;
INDEX iLevel = -1; //INDEX iLevel = -1;
if (psp->sp_bCooperative) { if (psp->sp_bCooperative) {
extern void RenderMap( CDrawPort *pdp, ULONG ulLevelMask, CProgressHookInfo *pphi); extern void RenderMap( CDrawPort *pdp, ULONG ulLevelMask, CProgressHookInfo *pphi);
if (pdp->Lock()) { if (pdp->Lock()) {
@ -1244,8 +1244,8 @@ void CGame::ComputerRender(CDrawPort *pdp)
MarkCurrentRead(); MarkCurrentRead();
// get current time and alpha value // get current time and alpha value
FLOAT tmNow = (FLOAT)tvNow.GetSeconds(); //FLOAT tmNow = (FLOAT)tvNow.GetSeconds();
ULONG ulA = NormFloatToByte(fComputerFadeValue); //ULONG ulA = NormFloatToByte(fComputerFadeValue);
_colLight = LCDFadedColor(C_WHITE|255); _colLight = LCDFadedColor(C_WHITE|255);
_colMedium = LCDFadedColor(SE_COL_BLUE_LIGHT|255); _colMedium = LCDFadedColor(SE_COL_BLUE_LIGHT|255);

View File

@ -252,6 +252,7 @@ static void PlayScriptSound(INDEX iChannel, const CTString &strSound, FLOAT fVol
CPrintF("%s\n", strError); CPrintF("%s\n", strError);
} }
} }
#if 0 // DG: unused.
static void PlayScriptSoundCfunc(void* pArgs) static void PlayScriptSoundCfunc(void* pArgs)
{ {
INDEX iChannel = NEXTARGUMENT(INDEX); INDEX iChannel = NEXTARGUMENT(INDEX);
@ -261,6 +262,7 @@ static void PlayScriptSoundCfunc(void* pArgs)
BOOL bLooping = NEXTARGUMENT(INDEX); BOOL bLooping = NEXTARGUMENT(INDEX);
PlayScriptSound(iChannel, strSound, fVolume, fPitch, bLooping); PlayScriptSound(iChannel, strSound, fVolume, fPitch, bLooping);
} }
#endif // 0 (unused)
static void StopScriptSound(void* pArgs) static void StopScriptSound(void* pArgs)
{ {
INDEX iChannel = NEXTARGUMENT(INDEX); INDEX iChannel = NEXTARGUMENT(INDEX);
@ -2148,7 +2150,7 @@ void CGame::GameRedrawView( CDrawPort *pdpDrawPort, ULONG ulFlags)
CTFileName fnm = _fnmThumb; CTFileName fnm = _fnmThumb;
_fnmThumb = CTString(""); _fnmThumb = CTString("");
// render one game view to a small cloned drawport // render one game view to a small cloned drawport
PIX pixSizeJ = pdpDrawPort->GetHeight(); //PIX pixSizeJ = pdpDrawPort->GetHeight();
PIXaabbox2D boxThumb( PIX2D(0,0), PIX2D(128,128)); PIXaabbox2D boxThumb( PIX2D(0,0), PIX2D(128,128));
CDrawPort dpThumb( pdpDrawPort, boxThumb); CDrawPort dpThumb( pdpDrawPort, boxThumb);
_bPlayerViewRendered = FALSE; _bPlayerViewRendered = FALSE;
@ -2180,7 +2182,7 @@ void CGame::GameRedrawView( CDrawPort *pdpDrawPort, ULONG ulFlags)
} }
// if game is started and computer isn't on // if game is started and computer isn't on
BOOL bClientJoined = FALSE; //BOOL bClientJoined = FALSE;
if( gm_bGameOn && (_pGame->gm_csComputerState==CS_OFF || pdpDrawPort->IsDualHead()) if( gm_bGameOn && (_pGame->gm_csComputerState==CS_OFF || pdpDrawPort->IsDualHead())
&& gm_CurrentSplitScreenCfg!=SSC_DEDICATED ) && gm_CurrentSplitScreenCfg!=SSC_DEDICATED )
{ {

View File

@ -613,9 +613,10 @@ void RenderMap( CDrawPort *pdp, ULONG ulLevelMask, CProgressHookInfo *pphi)
if (ulLevelMask == 0x00000001 && !map_bIsFirstEncounter) { if (ulLevelMask == 0x00000001 && !map_bIsFirstEncounter) {
// render the book // render the book
PIX pixX = (PIX) (aIconCoords[0][0]*fStretch+pixC1S); //PIX pixX = (PIX) (aIconCoords[0][0]*fStretch+pixC1S);
PIX pixY = (PIX) (aIconCoords[0][1]*fStretch+pixR1S); //PIX pixY = (PIX) (aIconCoords[0][1]*fStretch+pixR1S);
CTextureObject *pto = &atoIcons[0]; CTextureObject *pto = &atoIcons[0];
// FIXME: DG: or was the line below supposed to use pixX and pixY?
pdp->PutTexture( pto, PIXaabbox2D( PIX2D(pixC1S,pixR1S), PIX2D(pixC2E,pixR2E)), C_WHITE|255); pdp->PutTexture( pto, PIXaabbox2D( PIX2D(pixC1S,pixR1S), PIX2D(pixC2E,pixR2E)), C_WHITE|255);
} else { } else {

View File

@ -70,7 +70,7 @@ void InitGLSettings(void)
try try
{ {
strmFile.Open_t( CTString("Scripts\\GLSettings\\GLSettings.lst"), CTStream::OM_READ); strmFile.Open_t( CTString("Scripts\\GLSettings\\GLSettings.lst"), CTStream::OM_READ);
INDEX iIndex = 0; //INDEX iIndex = 0;
do do
{ {
achrLine [0] = 0; achrLine [0] = 0;

View File

@ -2198,8 +2198,8 @@ void InitializeMenus(void)
((CTextureData*)_toLogoMenuB.GetData())->Force(TEX_CONSTANT); ((CTextureData*)_toLogoMenuB.GetData())->Force(TEX_CONSTANT);
// menu's relative placement // menu's relative placement
CPlacement3D plRelative = CPlacement3D( FLOAT3D( 0.0f, 0.0f, -9.0f), //CPlacement3D plRelative = CPlacement3D( FLOAT3D( 0.0f, 0.0f, -9.0f),
ANGLE3D( AngleDeg(0.0f), AngleDeg(0.0f), AngleDeg(0.0f))); // ANGLE3D( AngleDeg(0.0f), AngleDeg(0.0f), AngleDeg(0.0f)));
try try
{ {
TRANSLATERADIOARRAY(astrNoYes); TRANSLATERADIOARRAY(astrNoYes);
@ -2464,7 +2464,7 @@ void MenuUpdateMouseFocus(void)
CMenuGadget *pmgActive = NULL; CMenuGadget *pmgActive = NULL;
// for all gadgets in menu // for all gadgets in menu
FOREACHINLIST( CMenuGadget, mg_lnNode, pgmCurrentMenu->gm_lhGadgets, itmg) { FOREACHINLIST( CMenuGadget, mg_lnNode, pgmCurrentMenu->gm_lhGadgets, itmg) {
CMenuGadget &mg = *itmg; //CMenuGadget &mg = *itmg;
// if focused // if focused
if( itmg->mg_bFocused) { if( itmg->mg_bFocused) {
// remember it // remember it
@ -2596,11 +2596,11 @@ BOOL DoMenu( CDrawPort *pdp)
if( bMenuActive) if( bMenuActive)
{ {
// get current time // get current time
TIME tmNow = _pTimer->GetLerpedCurrentTick(); //TIME tmNow = _pTimer->GetLerpedCurrentTick();
UBYTE ubH1 = (INDEX)(tmNow*08.7f) & 255; //UBYTE ubH1 = (INDEX)(tmNow*08.7f) & 255;
UBYTE ubH2 = (INDEX)(tmNow*27.6f) & 255; //UBYTE ubH2 = (INDEX)(tmNow*27.6f) & 255;
UBYTE ubH3 = (INDEX)(tmNow*16.5f) & 255; //UBYTE ubH3 = (INDEX)(tmNow*16.5f) & 255;
UBYTE ubH4 = (INDEX)(tmNow*35.4f) & 255; //UBYTE ubH4 = (INDEX)(tmNow*35.4f) & 255;
// clear screen with background texture // clear screen with background texture
_pGame->LCDPrepare(1.0f); _pGame->LCDPrepare(1.0f);
@ -2751,7 +2751,7 @@ BOOL DoMenu( CDrawPort *pdp)
if (!_bMouseUsedLast) { if (!_bMouseUsedLast) {
// find focused gadget // find focused gadget
FOREACHINLIST( CMenuGadget, mg_lnNode, pgmCurrentMenu->gm_lhGadgets, itmg) { FOREACHINLIST( CMenuGadget, mg_lnNode, pgmCurrentMenu->gm_lhGadgets, itmg) {
CMenuGadget &mg = *itmg; //CMenuGadget &mg = *itmg;
// if focused // if focused
if( itmg->mg_bFocused) { if( itmg->mg_bFocused) {
// it is active // it is active
@ -2969,8 +2969,8 @@ void CGameMenu::ScrollList(INDEX iDir)
} }
// set new focus // set new focus
const INDEX iFirst = 0; //const INDEX iFirst = 0;
const INDEX iLast = gm_ctListVisible-1; //const INDEX iLast = gm_ctListVisible-1;
switch(iDir) { switch(iDir) {
case +1: case +1:
gm_pmgListBottom->OnSetFocus(); gm_pmgListBottom->OnSetFocus();
@ -5444,7 +5444,7 @@ void CServersMenu::Initialize_t(void)
mgServerRefresh.mg_pActivatedFunction = &RefreshServerList; mgServerRefresh.mg_pActivatedFunction = &RefreshServerList;
gm_lhGadgets.AddTail( mgServerRefresh.mg_lnNode); gm_lhGadgets.AddTail( mgServerRefresh.mg_lnNode);
CTString astrColumns[7]; //CTString astrColumns[7];
mgServerColumn[0].mg_strText = TRANS("Server") ; mgServerColumn[0].mg_strText = TRANS("Server") ;
mgServerColumn[1].mg_strText = TRANS("Map") ; mgServerColumn[1].mg_strText = TRANS("Map") ;
mgServerColumn[2].mg_strText = TRANS("Ping") ; mgServerColumn[2].mg_strText = TRANS("Ping") ;

View File

@ -266,7 +266,7 @@ void CMGButton::Render( CDrawPort *pdp)
CTString str = mg_strText; CTString str = mg_strText;
if (pdp->dp_FontData->fd_bFixedWidth) { if (pdp->dp_FontData->fd_bFixedWidth) {
str = str.Undecorated(); str = str.Undecorated();
INDEX iLen = str.Length(); //INDEX iLen = str.Length();
INDEX iMaxLen = ClampDn(box.Size()(1)/(pdp->dp_pixTextCharSpacing+pdp->dp_FontData->fd_pixCharWidth), 1); INDEX iMaxLen = ClampDn(box.Size()(1)/(pdp->dp_pixTextCharSpacing+pdp->dp_FontData->fd_pixCharWidth), 1);
if (iCursor>=iMaxLen) { if (iCursor>=iMaxLen) {
str.TrimRight(iCursor); str.TrimRight(iCursor);
@ -768,7 +768,7 @@ void CMGTrigger::Render( CDrawPort *pdp)
CTextureObject to; CTextureObject to;
try { try {
to.SetData_t(mg_strValue); to.SetData_t(mg_strValue);
CTextureData *ptd = (CTextureData *)to.GetData(); //CTextureData *ptd = (CTextureData *)to.GetData();
PIX pixSize = box.Size()(2); PIX pixSize = box.Size()(2);
PIX pixCX = box.Max()(1)-pixSize/2; PIX pixCX = box.Max()(1)-pixSize/2;
PIX pixCY = box.Center()(2); PIX pixCY = box.Center()(2);
@ -1393,7 +1393,7 @@ void CMGServerList::Render(CDrawPort *pdp)
BOOL bFocusedBefore = mg_bFocused; BOOL bFocusedBefore = mg_bFocused;
mg_bFocused = FALSE; mg_bFocused = FALSE;
PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen); //PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen);
COLOR col = GetCurrentColor(); COLOR col = GetCurrentColor();
PIX pixDPSizeI = pdp->GetWidth(); PIX pixDPSizeI = pdp->GetWidth();
@ -1404,7 +1404,7 @@ void CMGServerList::Render(CDrawPort *pdp)
PIX pixSliderSizeI = 10; PIX pixSliderSizeI = 10;
PIX pixOuterMargin = 20; PIX pixOuterMargin = 20;
INDEX ctSessions = _lhServers.Count(); //INDEX ctSessions = _lhServers.Count();
INDEX iSession=0; INDEX iSession=0;
INDEX ctColumns[7]; INDEX ctColumns[7];
@ -1430,7 +1430,7 @@ void CMGServerList::Render(CDrawPort *pdp)
apixSeparatorI[2] = apixSeparatorI[3]-pixSizePing-pixLineSize; apixSeparatorI[2] = apixSeparatorI[3]-pixSizePing-pixLineSize;
apixSeparatorI[1] = apixSeparatorI[2]-pixSizeMapName-pixLineSize; apixSeparatorI[1] = apixSeparatorI[2]-pixSizeMapName-pixLineSize;
apixSeparatorI[1] = apixSeparatorI[2]-pixSizeMapName-pixLineSize; apixSeparatorI[1] = apixSeparatorI[2]-pixSizeMapName-pixLineSize;
PIX pixSizeServerName = apixSeparatorI[1]-apixSeparatorI[0]-pixLineSize; //PIX pixSizeServerName = apixSeparatorI[1]-apixSeparatorI[0]-pixLineSize;
PIX pixTopJ = (PIX) (pixDPSizeJ*0.15f); PIX pixTopJ = (PIX) (pixDPSizeJ*0.15f);
PIX pixBottomJ = (PIX) (pixDPSizeJ*0.82f); PIX pixBottomJ = (PIX) (pixDPSizeJ*0.82f);
@ -1470,7 +1470,7 @@ void CMGServerList::Render(CDrawPort *pdp)
PIXaabbox2D boxHandle = GetScrollBarHandleBox(); PIXaabbox2D boxHandle = GetScrollBarHandleBox();
pdp->Fill(boxHandle.Min()(1)+2, boxHandle.Min()(2)+2, boxHandle.Size()(1)-3, boxHandle.Size()(2)-3, col|CT_OPAQUE); pdp->Fill(boxHandle.Min()(1)+2, boxHandle.Min()(2)+2, boxHandle.Size()(1)-3, boxHandle.Size()(2)-3, col|CT_OPAQUE);
PIX pixJ = pixTopJ+pixLineSize*2+1; //PIX pixJ = pixTopJ+pixLineSize*2+1;
mg_ctOnScreen = ctSessionsOnScreen; mg_ctOnScreen = ctSessionsOnScreen;
AdjustFirstOnScreen(); AdjustFirstOnScreen();
@ -1755,7 +1755,7 @@ void CMGKeyDefinition::SetBindingNames(BOOL bDefining)
{ {
// find the button // find the button
INDEX ict=0; INDEX ict=0;
INDEX iDik=0; //INDEX iDik=0;
FOREACHINLIST( CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions, itba) { FOREACHINLIST( CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions, itba) {
if( ict == mg_iControlNumber) { if( ict == mg_iControlNumber) {
CButtonAction &ba = *itba; CButtonAction &ba = *itba;

View File

@ -33,7 +33,7 @@ SHADER_MAIN(Color)
shaDepthFunc(GFX_LESS_EQUAL); shaDepthFunc(GFX_LESS_EQUAL);
BOOL bDoubleSided = shaGetFlags()&BASE_DOUBLE_SIDED; BOOL bDoubleSided = shaGetFlags()&BASE_DOUBLE_SIDED;
BOOL bFullBright = shaGetFlags()&BASE_FULL_BRIGHT; //BOOL bFullBright = shaGetFlags()&BASE_FULL_BRIGHT;
if(bDoubleSided) { if(bDoubleSided) {
shaCullFace(GFX_NONE); shaCullFace(GFX_NONE);

View File

@ -18,7 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
void DoSpecularLayer(INDEX iSpeculaTexture,INDEX iSpecularColor) void DoSpecularLayer(INDEX iSpeculaTexture,INDEX iSpecularColor)
{ {
GFXVertex4 *paVertices = shaGetVertexArray(); //GFXVertex4 *paVertices = shaGetVertexArray();
GFXNormal *paNormals = shaGetNormalArray(); GFXNormal *paNormals = shaGetNormalArray();
INDEX ctVertices = shaGetVertexCount(); INDEX ctVertices = shaGetVertexCount();
FLOAT3D vLightDir = -shaGetLightDirection().Normalize(); FLOAT3D vLightDir = -shaGetLightDirection().Normalize();
@ -106,7 +106,7 @@ void DoReflectionLayer(INDEX iReflectionTexture,INDEX iReflectionColor,BOOL bFul
paNormals = shaGetNormalArray(); paNormals = shaGetNormalArray();
INDEX ctVertices = shaGetVertexCount(); INDEX ctVertices = shaGetVertexCount();
GFXTexCoord *ptcUVMap = shaGetNewTexCoordArray(); GFXTexCoord *ptcUVMap = shaGetNewTexCoordArray();
Matrix12 &mObjToView = *shaGetObjToViewMatrix(); //Matrix12 &mObjToView = *shaGetObjToViewMatrix();
Matrix12 &mObjToAbs = *shaGetObjToAbsMatrix(); Matrix12 &mObjToAbs = *shaGetObjToAbsMatrix();
CAnyProjection3D &apr = *shaGetProjection(); CAnyProjection3D &apr = *shaGetProjection();