mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 18:30:27 +01:00
Fix TFE warnings and lots of unused variable warnings
.. still, didn't look at unused variable warnings from *.es because so many are generated.
This commit is contained in:
parent
de4f96d208
commit
b64df456b6
|
@ -119,13 +119,12 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
add_compile_options(-Wno-unused-value) # same here (the Scripts generate tons of unused variables and values)
|
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-missing-braces)
|
||||||
add_compile_options(-Wno-overloaded-virtual)
|
add_compile_options(-Wno-overloaded-virtual)
|
||||||
|
add_compile_options(-Wno-invalid-offsetof)
|
||||||
MESSAGE(WARNING, "re-enable some of the warnings some day!")
|
MESSAGE(WARNING, "re-enable some of the warnings some day!")
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
|
||||||
add_compile_options(-Wno-tautological-undefined-compare) # don't complain about if(this!=NULL)
|
add_compile_options(-Wno-tautological-undefined-compare) # don't complain about if(this!=NULL)
|
||||||
add_compile_options(-Wno-c++11-compat-deprecated-writable-strings)
|
add_compile_options(-Wno-c++11-compat-deprecated-writable-strings)
|
||||||
else() # most probably GCC
|
|
||||||
add_compile_options(-Wno-unused-but-set-variable) # my clang doesn't know this FIXME: re-enable?
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MACOSX)
|
if(MACOSX)
|
||||||
|
|
|
@ -934,7 +934,7 @@ void CTFileStream::Create_t(const CTFileName &fnFileName,
|
||||||
}
|
}
|
||||||
|
|
||||||
CTFileName fnmFullFileName;
|
CTFileName fnmFullFileName;
|
||||||
INDEX iFile = ExpandFilePath(EFP_WRITE, fnFileNameAbsolute, fnmFullFileName);
|
/* INDEX iFile = */ ExpandFilePath(EFP_WRITE, fnFileNameAbsolute, fnmFullFileName);
|
||||||
|
|
||||||
// check parameters
|
// check parameters
|
||||||
ASSERT(strlen(fnFileNameAbsolute)>0);
|
ASSERT(strlen(fnFileNameAbsolute)>0);
|
||||||
|
@ -1317,7 +1317,7 @@ BOOL FileExistsForWriting(const CTFileName &fnmFile)
|
||||||
}
|
}
|
||||||
// expand the filename to full path for writing
|
// expand the filename to full path for writing
|
||||||
CTFileName fnmFullFileName;
|
CTFileName fnmFullFileName;
|
||||||
INDEX iFile = ExpandFilePath(EFP_WRITE, fnmFile, fnmFullFileName);
|
/* INDEX iFile = */ ExpandFilePath(EFP_WRITE, fnmFile, fnmFullFileName);
|
||||||
|
|
||||||
// check if it exists
|
// check if it exists
|
||||||
FILE *f = fopen(fnmFullFileName, "rb");
|
FILE *f = fopen(fnmFullFileName, "rb");
|
||||||
|
|
|
@ -337,7 +337,7 @@ void CTriangularizer::MakeEdgesForTriangularization(void)
|
||||||
// get number of edges in polygon
|
// get number of edges in polygon
|
||||||
INDEX ctEdges = tr_abpeOriginalEdges.Count();
|
INDEX ctEdges = tr_abpeOriginalEdges.Count();
|
||||||
// create that much edges in the array
|
// create that much edges in the array
|
||||||
CBrushEdge *pbedEdges = tr_abedEdges.New(ctEdges);
|
/* CBrushEdge *pbedEdges = */ tr_abedEdges.New(ctEdges);
|
||||||
|
|
||||||
tr_abedEdges.Lock();
|
tr_abedEdges.Lock();
|
||||||
|
|
||||||
|
|
|
@ -2863,7 +2863,7 @@ out:;
|
||||||
|
|
||||||
_pfPhysicsProfile.IncrementCounter((INDEX) CPhysicsProfile::PCI_DOMOVING);
|
_pfPhysicsProfile.IncrementCounter((INDEX) CPhysicsProfile::PCI_DOMOVING);
|
||||||
|
|
||||||
FLOAT fTickQuantum=_pTimer->TickQuantum; // used for normalizing from SI units to game ticks
|
//FLOAT fTickQuantum=_pTimer->TickQuantum; // used for normalizing from SI units to game ticks
|
||||||
|
|
||||||
// if rotation and translation are synchronized
|
// if rotation and translation are synchronized
|
||||||
if (en_ulPhysicsFlags&EPF_RT_SYNCHRONIZED) {
|
if (en_ulPhysicsFlags&EPF_RT_SYNCHRONIZED) {
|
||||||
|
@ -2878,7 +2878,7 @@ out:;
|
||||||
if ((en_ulPhysicsFlags&EPF_ONBLOCK_MASK)==EPF_ONBLOCK_PUSH) {
|
if ((en_ulPhysicsFlags&EPF_ONBLOCK_MASK)==EPF_ONBLOCK_PUSH) {
|
||||||
penPusher = this;
|
penPusher = this;
|
||||||
}
|
}
|
||||||
BOOL bMoveSuccessfull = TryToMove(penPusher, TRUE, TRUE);
|
/* BOOL bMoveSuccessfull = */ TryToMove(penPusher, TRUE, TRUE);
|
||||||
|
|
||||||
// if rotation and translation are asynchronious
|
// if rotation and translation are asynchronious
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -799,7 +799,7 @@ void CDrawPort::Fill( PIX pixI, PIX pixJ, PIX pixWidth, PIX pixHeight,
|
||||||
// thru OpenGL
|
// thru OpenGL
|
||||||
gfxResetArrays();
|
gfxResetArrays();
|
||||||
GFXVertex *pvtx = _avtxCommon.Push(4);
|
GFXVertex *pvtx = _avtxCommon.Push(4);
|
||||||
GFXTexCoord *ptex = _atexCommon.Push(4);
|
/* GFXTexCoord *ptex = */ _atexCommon.Push(4);
|
||||||
GFXColor *pcol = _acolCommon.Push(4);
|
GFXColor *pcol = _acolCommon.Push(4);
|
||||||
const GFXColor glcolUL(colUL); const GFXColor glcolUR(colUR);
|
const GFXColor glcolUL(colUL); const GFXColor glcolUR(colUR);
|
||||||
const GFXColor glcolDL(colDL); const GFXColor glcolDR(colDR);
|
const GFXColor glcolDL(colDL); const GFXColor glcolDR(colDR);
|
||||||
|
@ -1617,7 +1617,7 @@ void CDrawPort::AddTriangle( const FLOAT fI0, const FLOAT fJ0,
|
||||||
const GFXColor glCol( AdjustColor( col, _slTexHueShift, _slTexSaturation));
|
const GFXColor glCol( AdjustColor( col, _slTexHueShift, _slTexSaturation));
|
||||||
const INDEX iStart = _avtxCommon.Count();
|
const INDEX iStart = _avtxCommon.Count();
|
||||||
GFXVertex *pvtx = _avtxCommon.Push(3);
|
GFXVertex *pvtx = _avtxCommon.Push(3);
|
||||||
GFXTexCoord *ptex = _atexCommon.Push(3);
|
/* GFXTexCoord *ptex = */ _atexCommon.Push(3);
|
||||||
GFXColor *pcol = _acolCommon.Push(3);
|
GFXColor *pcol = _acolCommon.Push(3);
|
||||||
INDEX *pelm = _aiCommonElements.Push(3);
|
INDEX *pelm = _aiCommonElements.Push(3);
|
||||||
pvtx[0].x = fI0; pvtx[0].y = fJ0; pvtx[0].z = 0;
|
pvtx[0].x = fI0; pvtx[0].y = fJ0; pvtx[0].z = 0;
|
||||||
|
@ -1699,7 +1699,7 @@ void CDrawPort::BlendScreen(void)
|
||||||
// set arrays
|
// set arrays
|
||||||
gfxResetArrays();
|
gfxResetArrays();
|
||||||
GFXVertex *pvtx = _avtxCommon.Push(4);
|
GFXVertex *pvtx = _avtxCommon.Push(4);
|
||||||
GFXTexCoord *ptex = _atexCommon.Push(4);
|
/* GFXTexCoord *ptex = */ _atexCommon.Push(4);
|
||||||
GFXColor *pcol = _acolCommon.Push(4);
|
GFXColor *pcol = _acolCommon.Push(4);
|
||||||
const INDEX iW = dp_Width;
|
const INDEX iW = dp_Width;
|
||||||
const INDEX iH = dp_Height;
|
const INDEX iH = dp_Height;
|
||||||
|
|
|
@ -816,6 +816,7 @@ static void RSSetTextureCoords( ScenePolygon *pspoGroup, INDEX iLayer, INDEX iUn
|
||||||
// generate tex coord for all scene polygons in list
|
// generate tex coord for all scene polygons in list
|
||||||
const FLOATmatrix3D &mViewer = _ppr->pr_ViewerRotationMatrix;
|
const FLOATmatrix3D &mViewer = _ppr->pr_ViewerRotationMatrix;
|
||||||
const INDEX iMappingOffset = iLayer * sizeof(CMappingVectors);
|
const INDEX iMappingOffset = iLayer * sizeof(CMappingVectors);
|
||||||
|
(void)iMappingOffset; // shut up compiler, this is used if inline ASM is used
|
||||||
|
|
||||||
for( ScenePolygon *pspo=pspoGroup; pspo!=NULL; pspo=pspo->spo_pspoSucc)
|
for( ScenePolygon *pspo=pspoGroup; pspo!=NULL; pspo=pspo->spo_pspoSucc)
|
||||||
{
|
{
|
||||||
|
@ -1979,7 +1980,7 @@ void RenderSceneBackground(CDrawPort *pDP, COLOR col)
|
||||||
// set arrays
|
// set arrays
|
||||||
gfxResetArrays();
|
gfxResetArrays();
|
||||||
GFXVertex *pvtx = _avtxCommon.Push(4);
|
GFXVertex *pvtx = _avtxCommon.Push(4);
|
||||||
GFXTexCoord *ptex = _atexCommon.Push(4);
|
/* GFXTexCoord *ptex = */ _atexCommon.Push(4);
|
||||||
GFXColor *pcol = _acolCommon.Push(4);
|
GFXColor *pcol = _acolCommon.Push(4);
|
||||||
pvtx[0].x = 0; pvtx[0].y = 0; pvtx[0].z = 1;
|
pvtx[0].x = 0; pvtx[0].y = 0; pvtx[0].z = 1;
|
||||||
pvtx[1].x = 0; pvtx[1].y = iH; pvtx[1].z = 1;
|
pvtx[1].x = 0; pvtx[1].y = iH; pvtx[1].z = 1;
|
||||||
|
|
|
@ -665,6 +665,7 @@ void DitherBitmap( INDEX iDitherType, ULONG *pulSrc, ULONG *pulDst, PIX pixWidth
|
||||||
ASSERT( pixCanvasWidth>=pixWidth && pixCanvasHeight>=pixHeight);
|
ASSERT( pixCanvasWidth>=pixWidth && pixCanvasHeight>=pixHeight);
|
||||||
SLONG slModulo = (pixCanvasWidth-pixWidth) *BYTES_PER_TEXEL;
|
SLONG slModulo = (pixCanvasWidth-pixWidth) *BYTES_PER_TEXEL;
|
||||||
SLONG slWidthModulo = pixWidth*BYTES_PER_TEXEL +slModulo;
|
SLONG slWidthModulo = pixWidth*BYTES_PER_TEXEL +slModulo;
|
||||||
|
(void)slWidthModulo; // shut up compiler, this is used if inline ASM is used
|
||||||
|
|
||||||
// if bitmap is smaller than 4x2 pixels
|
// if bitmap is smaller than 4x2 pixels
|
||||||
if( pixWidth<4 || pixHeight<2)
|
if( pixWidth<4 || pixHeight<2)
|
||||||
|
|
|
@ -1397,9 +1397,11 @@ void CModelData::Read_t( CTStream *pFile) // throw char *
|
||||||
if( cidVerticesChunk == CChunkID("AV16"))
|
if( cidVerticesChunk == CChunkID("AV16"))
|
||||||
{
|
{
|
||||||
CChunkID cidDummy = pFile->GetID_t();
|
CChunkID cidDummy = pFile->GetID_t();
|
||||||
|
(void)cidDummy; // shut up about unused variable, compiler.
|
||||||
ULONG ulDummy;
|
ULONG ulDummy;
|
||||||
// skip chunk size
|
// skip chunk size
|
||||||
*pFile >> ulDummy;
|
*pFile >> ulDummy;
|
||||||
|
(void)ulDummy; // shut up about unused variable, compiler.
|
||||||
for( INDEX iVtx=0; iVtx<md_VerticesCt * md_FramesCt; iVtx++)
|
for( INDEX iVtx=0; iVtx<md_VerticesCt * md_FramesCt; iVtx++)
|
||||||
{
|
{
|
||||||
(*pFile)>>md_FrameVertices16[iVtx];
|
(*pFile)>>md_FrameVertices16[iVtx];
|
||||||
|
@ -2859,22 +2861,26 @@ void CModelObject::AutoSetTextures(void)
|
||||||
if( id == CChunkID("WTEX"))
|
if( id == CChunkID("WTEX"))
|
||||||
{
|
{
|
||||||
CChunkID idDummy = strmIni.GetID_t();
|
CChunkID idDummy = strmIni.GetID_t();
|
||||||
|
(void)idDummy; // shut up about unused variable, compiler.
|
||||||
strmIni >> ctDiffuseTextures;
|
strmIni >> ctDiffuseTextures;
|
||||||
strmIni >> fnDiffuse;
|
strmIni >> fnDiffuse;
|
||||||
}
|
}
|
||||||
else if( id == CChunkID("FXTR"))
|
else if( id == CChunkID("FXTR"))
|
||||||
{
|
{
|
||||||
CChunkID idDummy = strmIni.GetID_t();
|
CChunkID idDummy = strmIni.GetID_t();
|
||||||
|
(void)idDummy; // shut up about unused variable, compiler.
|
||||||
strmIni >> fnReflection;
|
strmIni >> fnReflection;
|
||||||
}
|
}
|
||||||
else if( id == CChunkID("FXTS"))
|
else if( id == CChunkID("FXTS"))
|
||||||
{
|
{
|
||||||
CChunkID idDummy = strmIni.GetID_t();
|
CChunkID idDummy = strmIni.GetID_t();
|
||||||
|
(void)idDummy; // shut up about unused variable, compiler.
|
||||||
strmIni >> fnSpecular;
|
strmIni >> fnSpecular;
|
||||||
}
|
}
|
||||||
else if( id == CChunkID("FXTB"))
|
else if( id == CChunkID("FXTB"))
|
||||||
{
|
{
|
||||||
CChunkID idDummy = strmIni.GetID_t();
|
CChunkID idDummy = strmIni.GetID_t();
|
||||||
|
(void)idDummy; // shut up about unused variable, compiler.
|
||||||
strmIni >> fnBump;
|
strmIni >> fnBump;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2914,6 +2920,7 @@ void CModelObject::AutoSetAttachments(void)
|
||||||
if( id == CChunkID("ATTM"))
|
if( id == CChunkID("ATTM"))
|
||||||
{
|
{
|
||||||
CChunkID idDummy = strmIni.GetID_t();
|
CChunkID idDummy = strmIni.GetID_t();
|
||||||
|
(void)idDummy; // shut up about unused variable, compiler.
|
||||||
// try to load attached models
|
// try to load attached models
|
||||||
INDEX ctAttachedModels;
|
INDEX ctAttachedModels;
|
||||||
strmIni >> ctAttachedModels;
|
strmIni >> ctAttachedModels;
|
||||||
|
|
|
@ -763,7 +763,7 @@ CScreenPolygon *CRenderer::ScanOneLine(void)
|
||||||
}
|
}
|
||||||
// remove all left-over polygons from stack
|
// remove all left-over polygons from stack
|
||||||
do {
|
do {
|
||||||
BOOL bWasTop = RemPolygonFromSurfaceStack(*pspoTop);
|
/* BOOL bWasTop = */ RemPolygonFromSurfaceStack(*pspoTop);
|
||||||
pspoTop = LIST_HEAD(re_lhSurfaceStack, CScreenPolygon, spo_lnInStack);
|
pspoTop = LIST_HEAD(re_lhSurfaceStack, CScreenPolygon, spo_lnInStack);
|
||||||
} while (&re_spoFarSentinel != pspoTop);
|
} while (&re_spoFarSentinel != pspoTop);
|
||||||
// mark start of background span at right border
|
// mark start of background span at right border
|
||||||
|
|
|
@ -154,7 +154,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
|
||||||
|
|
|
@ -44,7 +44,7 @@ void CTerrainArchive::Read_t( CTStream *istrFile) // throw char *
|
||||||
// if there are some terrains
|
// if there are some terrains
|
||||||
if (ctTerrains!=0) {
|
if (ctTerrains!=0) {
|
||||||
// create that much terrains
|
// create that much terrains
|
||||||
CTerrain *atrBrushes = ta_atrTerrains.New(ctTerrains);
|
/* CTerrain *atrBrushes = */ ta_atrTerrains.New(ctTerrains);
|
||||||
// for each of the new terrains
|
// for each of the new terrains
|
||||||
for (INDEX iTerrain=0; iTerrain<ctTerrains; iTerrain++) {
|
for (INDEX iTerrain=0; iTerrain<ctTerrains; iTerrain++) {
|
||||||
// read it from stream
|
// read it from stream
|
||||||
|
|
|
@ -1008,12 +1008,14 @@ void CheckOnePolygon(CBrushSector &bsc, CBrushPolygon &bpo)
|
||||||
// "try to access stuff and make sure it doesn't segfault", so keep it
|
// "try to access stuff and make sure it doesn't segfault", so keep it
|
||||||
// like it is even if the compiler complains about unused values?
|
// like it is even if the compiler complains about unused values?
|
||||||
CBrushPlane *pbplPlane=bpo.bpo_pbplPlane;
|
CBrushPlane *pbplPlane=bpo.bpo_pbplPlane;
|
||||||
|
(void)pbplPlane; // shut up, compiler - I know this is unused, but I think it's intended like that.
|
||||||
INDEX ctEdges=bpo.bpo_abpePolygonEdges.Count();
|
INDEX ctEdges=bpo.bpo_abpePolygonEdges.Count();
|
||||||
INDEX ctVertices=bpo.bpo_apbvxTriangleVertices.Count();
|
INDEX ctVertices=bpo.bpo_apbvxTriangleVertices.Count();
|
||||||
for(INDEX iEdge=0;iEdge<ctEdges;iEdge++)
|
for(INDEX iEdge=0;iEdge<ctEdges;iEdge++)
|
||||||
{
|
{
|
||||||
CBrushPolygonEdge &edg=bpo.bpo_abpePolygonEdges[iEdge];
|
CBrushPolygonEdge &edg=bpo.bpo_abpePolygonEdges[iEdge];
|
||||||
CBrushEdge &be=*edg.bpe_pbedEdge;
|
CBrushEdge &be=*edg.bpe_pbedEdge;
|
||||||
|
(void)be; // shut up, compiler
|
||||||
CBrushVertex *pbvx0, *pbvx1;
|
CBrushVertex *pbvx0, *pbvx1;
|
||||||
edg.GetVertices(pbvx0, pbvx1);
|
edg.GetVertices(pbvx0, pbvx1);
|
||||||
}
|
}
|
||||||
|
@ -1025,11 +1027,13 @@ void CheckOnePolygon(CBrushSector &bsc, CBrushPolygon &bpo)
|
||||||
DOUBLE3D vdRel=vtx.bvx_vdPreciseRelative;
|
DOUBLE3D vdRel=vtx.bvx_vdPreciseRelative;
|
||||||
DOUBLE3D *pvdPreciseAbsolute=vtx.bvx_pvdPreciseAbsolute;
|
DOUBLE3D *pvdPreciseAbsolute=vtx.bvx_pvdPreciseAbsolute;
|
||||||
CBrushSector &bsc=*vtx.bvx_pbscSector;
|
CBrushSector &bsc=*vtx.bvx_pbscSector;
|
||||||
|
(void)vAbs; (void)vRel; (void)vdRel; (void)pvdPreciseAbsolute; (void)bsc; // shut up, compiler
|
||||||
}
|
}
|
||||||
for(INDEX ite=0;ite<bpo.bpo_aiTriangleElements.Count();ite++)
|
for(INDEX ite=0;ite<bpo.bpo_aiTriangleElements.Count();ite++)
|
||||||
{
|
{
|
||||||
INDEX iTriangleVtx=bpo.bpo_aiTriangleElements[ite];
|
INDEX iTriangleVtx=bpo.bpo_aiTriangleElements[ite];
|
||||||
CBrushSector &bsc=*bpo.bpo_pbscSector;
|
CBrushSector &bsc=*bpo.bpo_pbscSector;
|
||||||
|
(void)iTriangleVtx; (void)bsc; // ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -384,7 +384,7 @@ void CWorld::ReadState_veryold_t( CTStream *istr) // throw char *
|
||||||
// read entity class index and entity placement
|
// read entity class index and entity placement
|
||||||
(*istr)>>iEntityClass>>plPlacement;
|
(*istr)>>iEntityClass>>plPlacement;
|
||||||
// create an entity of that class
|
// create an entity of that class
|
||||||
CEntity *penNew = CreateEntity_t(plPlacement, cecClasses[iEntityClass]);
|
/* CEntity *penNew = */ CreateEntity_t(plPlacement, cecClasses[iEntityClass]);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
// for each entity
|
// for each entity
|
||||||
|
@ -498,7 +498,7 @@ void CWorld::ReadState_old_t( CTStream *istr) // throw char *
|
||||||
// read entity class index and entity placement
|
// read entity class index and entity placement
|
||||||
(*istr)>>iEntityClass>>plPlacement;
|
(*istr)>>iEntityClass>>plPlacement;
|
||||||
// create an entity of that class
|
// create an entity of that class
|
||||||
CEntity *penNew = CreateEntity_t(plPlacement, cecClasses[iEntityClass]);
|
/* CEntity *penNew = */ CreateEntity_t(plPlacement, cecClasses[iEntityClass]);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
// for each entity
|
// for each entity
|
||||||
|
|
|
@ -234,6 +234,7 @@ static int qsort_CompareDeaths( const void *ppPEN0, const void *ppPEN1) {
|
||||||
else return 0;
|
else return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#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;
|
||||||
|
@ -243,6 +244,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,
|
||||||
|
@ -690,7 +692,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
|
||||||
|
@ -868,7 +870,7 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
|
||||||
if( iHealth>25) colHealth = _colHUD;
|
if( iHealth>25) colHealth = _colHUD;
|
||||||
if( iArmor >25) colArmor = _colHUD;
|
if( iArmor >25) colArmor = _colHUD;
|
||||||
// eventually print it out
|
// eventually print it out
|
||||||
if( hud_iShowPlayers==1 || hud_iShowPlayers==-1 && !bSinglePlay) {
|
if( hud_iShowPlayers==1 || (hud_iShowPlayers==-1 && !bSinglePlay)) {
|
||||||
// printout location and info aren't the same for deathmatch and coop play
|
// printout location and info aren't the same for deathmatch and coop play
|
||||||
const FLOAT fCharWidth = (PIX)((_pfdDisplayFont->GetWidth()-2) *fTextScale);
|
const FLOAT fCharWidth = (PIX)((_pfdDisplayFont->GetWidth()-2) *fTextScale);
|
||||||
if( bCooperative) {
|
if( bCooperative) {
|
||||||
|
|
|
@ -276,7 +276,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;
|
||||||
|
@ -437,7 +437,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);
|
||||||
|
@ -533,7 +533,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);
|
||||||
|
@ -718,9 +718,9 @@ void Particles_BeastProjectileTrail( CEntity *pen, FLOAT fSize, FLOAT fHeight, I
|
||||||
fT *= 1/BEAST_PROJECTILE_TOTAL_TIME;
|
fT *= 1/BEAST_PROJECTILE_TOTAL_TIME;
|
||||||
// get fraction part
|
// get fraction part
|
||||||
fT = fT-int(fT);
|
fT = fT-int(fT);
|
||||||
FLOAT fFade;
|
//FLOAT fFade;
|
||||||
if (fT>(1.0f-BEAST_PROJECTILE_FADE_OUT)) fFade=(1-fT)*(1/BEAST_PROJECTILE_FADE_OUT);
|
//if (fT>(1.0f-BEAST_PROJECTILE_FADE_OUT)) fFade=(1-fT)*(1/BEAST_PROJECTILE_FADE_OUT);
|
||||||
else fFade=1.0f;
|
//else fFade=1.0f;
|
||||||
|
|
||||||
#define GET_POS( time) vCenter + \
|
#define GET_POS( time) vCenter + \
|
||||||
vX*(afStarsPositions[iStar][0]*time*fSize*1.5) +\
|
vX*(afStarsPositions[iStar][0]*time*fSize*1.5) +\
|
||||||
|
@ -816,7 +816,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);
|
||||||
|
@ -835,7 +835,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;
|
||||||
|
@ -888,9 +888,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;
|
||||||
|
@ -1709,7 +1709,7 @@ void Particles_Rain(CEntity *pen, FLOAT fGridSize, INDEX ctGrids, FLOAT fFactor,
|
||||||
pixRainMapH = ptdRainMap->GetPixHeight();
|
pixRainMapH = ptdRainMap->GetPixHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
INDEX ctDiscarded=0;
|
//INDEX ctDiscarded=0;
|
||||||
for( INDEX iZ=0; iZ<ctGrids; iZ++)
|
for( INDEX iZ=0; iZ<ctGrids; iZ++)
|
||||||
{
|
{
|
||||||
INDEX iRndZ = (ULONG(vPos(3)+iZ)) % CT_MAX_PARTICLES_TABLE;
|
INDEX iRndZ = (ULONG(vPos(3)+iZ)) % CT_MAX_PARTICLES_TABLE;
|
||||||
|
@ -1803,7 +1803,7 @@ void Particles_Snow( CEntity *pen, FLOAT fGridSize, INDEX ctGrids)
|
||||||
UBYTE ubR = 128+afStarsPositions[(INDEX)fT0*CT_MAX_PARTICLES_TABLE][2]*64;
|
UBYTE ubR = 128+afStarsPositions[(INDEX)fT0*CT_MAX_PARTICLES_TABLE][2]*64;
|
||||||
COLOR colDrop = RGBToColor(ubR, ubR, ubR)|CT_OPAQUE;
|
COLOR colDrop = RGBToColor(ubR, ubR, ubR)|CT_OPAQUE;
|
||||||
FLOAT3D vRender = FLOAT3D( fX, fY, fZ);
|
FLOAT3D vRender = FLOAT3D( fX, fY, fZ);
|
||||||
FLOAT fSize = 1.75f+afStarsPositions[(INDEX)fT0*CT_MAX_PARTICLES_TABLE][1];
|
//FLOAT fSize = 1.75f+afStarsPositions[(INDEX)fT0*CT_MAX_PARTICLES_TABLE][1];
|
||||||
Particle_RenderSquare( vRender, 0.1f, 0, colDrop);
|
Particle_RenderSquare( vRender, 0.1f, 0, colDrop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2113,9 +2113,9 @@ void Particles_BulletSpray(CEntity *pen, FLOAT3D vGDir, enum EffectParticlesType
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
@ -2321,7 +2321,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);
|
||||||
|
|
||||||
|
@ -2342,7 +2342,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);
|
||||||
|
|
||||||
|
@ -2369,7 +2369,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);
|
||||||
|
|
||||||
|
@ -2495,7 +2495,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);
|
||||||
|
@ -2505,7 +2505,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);
|
||||||
|
|
||||||
|
@ -2524,12 +2524,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)
|
||||||
|
@ -2733,7 +2733,7 @@ void Particles_BloodSpray(enum SprayParticlesType sptType, CEntity *penSpray, FL
|
||||||
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;
|
||||||
|
|
|
@ -66,7 +66,7 @@ functions:
|
||||||
{
|
{
|
||||||
// cannot be damaged immediately after spawning
|
// cannot be damaged immediately after spawning
|
||||||
if ((_pTimer->CurrentTick()-m_tmStarted<1.0f)
|
if ((_pTimer->CurrentTick()-m_tmStarted<1.0f)
|
||||||
||(dmtType==DMT_CANNONBALL_EXPLOSION) && (_pTimer->CurrentTick()-m_tmStarted<5.0f)) {
|
||((dmtType==DMT_CANNONBALL_EXPLOSION) && (_pTimer->CurrentTick()-m_tmStarted<5.0f))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CMovableModelEntity::ReceiveDamage(penInflictor, dmtType, fDamageAmmount, vHitPoint, vDirection);
|
CMovableModelEntity::ReceiveDamage(penInflictor, dmtType, fDamageAmmount, vHitPoint, vDirection);
|
||||||
|
|
|
@ -444,8 +444,8 @@ procedures:
|
||||||
|
|
||||||
Hit(EVoid) : CEnemyBase::Hit {
|
Hit(EVoid) : CEnemyBase::Hit {
|
||||||
// burn enemy
|
// burn enemy
|
||||||
if (m_EdtType == DT_SERGEANT && CalcDist(m_penEnemy) <= 6.0f ||
|
if ((m_EdtType == DT_SERGEANT && CalcDist(m_penEnemy) <= 6.0f) ||
|
||||||
m_EdtType == DT_MONSTER && CalcDist(m_penEnemy) <= 20.0f) {
|
(m_EdtType == DT_MONSTER && CalcDist(m_penEnemy) <= 20.0f)) {
|
||||||
jump BurnEnemy();
|
jump BurnEnemy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ functions:
|
||||||
|
|
||||||
void AdjustMipFactor(FLOAT &fMipFactor)
|
void AdjustMipFactor(FLOAT &fMipFactor)
|
||||||
{
|
{
|
||||||
if (m_eetType==ET_DISAPPEAR_MODEL || m_eetType==ET_DISAPPEAR_MODEL_NOW && m_penModel!=NULL)
|
if (m_eetType==ET_DISAPPEAR_MODEL || (m_eetType==ET_DISAPPEAR_MODEL_NOW && m_penModel!=NULL))
|
||||||
{
|
{
|
||||||
CModelObject *pmo = m_penModel->GetModelObject();
|
CModelObject *pmo = m_penModel->GetModelObject();
|
||||||
TIME tmDelta = _pTimer->GetLerpedCurrentTick()-m_tmStarted;
|
TIME tmDelta = _pTimer->GetLerpedCurrentTick()-m_tmStarted;
|
||||||
|
@ -131,7 +131,7 @@ functions:
|
||||||
COLOR col = C_WHITE|ubAlpha;
|
COLOR col = C_WHITE|ubAlpha;
|
||||||
pmo->mo_colBlendColor = col;
|
pmo->mo_colBlendColor = col;
|
||||||
}
|
}
|
||||||
if (m_eetType==ET_APPEAR_MODEL || m_eetType==ET_APPEAR_MODEL_NOW && m_penModel!=NULL)
|
if (m_eetType==ET_APPEAR_MODEL || (m_eetType==ET_APPEAR_MODEL_NOW && m_penModel!=NULL))
|
||||||
{
|
{
|
||||||
CModelObject *pmo = m_penModel->GetModelObject();
|
CModelObject *pmo = m_penModel->GetModelObject();
|
||||||
TIME tmDelta = _pTimer->GetLerpedCurrentTick()-m_tmStarted;
|
TIME tmDelta = _pTimer->GetLerpedCurrentTick()-m_tmStarted;
|
||||||
|
@ -434,7 +434,7 @@ procedures:
|
||||||
// setup light source
|
// setup light source
|
||||||
if (m_bLightSource) { SetupLightSource(); }
|
if (m_bLightSource) { SetupLightSource(); }
|
||||||
|
|
||||||
while(_pTimer->CurrentTick()<m_tmStarted+m_tmLifeTime && m_bAlive || m_bWaitTrigger)
|
while((_pTimer->CurrentTick()<m_tmStarted+m_tmLifeTime && m_bAlive) || m_bWaitTrigger)
|
||||||
{
|
{
|
||||||
wait( 0.25f)
|
wait( 0.25f)
|
||||||
{
|
{
|
||||||
|
|
|
@ -425,6 +425,7 @@ functions:
|
||||||
default: iAnim = ELEMENTALLAVA_ANIM_WOUND03; break;
|
default: iAnim = ELEMENTALLAVA_ANIM_WOUND03; break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
iAnim = 0; // DG: should at least have deterministic value
|
||||||
/* switch (IRnd()%3) {
|
/* switch (IRnd()%3) {
|
||||||
case 0: iAnim = STONEMAN_ANIM_WOUND01; break;
|
case 0: iAnim = STONEMAN_ANIM_WOUND01; break;
|
||||||
case 1: iAnim = STONEMAN_ANIM_WOUND02; break;
|
case 1: iAnim = STONEMAN_ANIM_WOUND02; break;
|
||||||
|
@ -494,6 +495,7 @@ functions:
|
||||||
if (m_EetType == ELT_LAVA) {
|
if (m_EetType == ELT_LAVA) {
|
||||||
iAnim = ELEMENTALLAVA_ANIM_DEATH03;
|
iAnim = ELEMENTALLAVA_ANIM_DEATH03;
|
||||||
} else {
|
} else {
|
||||||
|
iAnim = 0; // DG: should at least have deterministic value
|
||||||
// iAnim = STONEMAN_ANIM_DEATH03;
|
// iAnim = STONEMAN_ANIM_DEATH03;
|
||||||
}
|
}
|
||||||
StartModelAnim(iAnim, 0);
|
StartModelAnim(iAnim, 0);
|
||||||
|
@ -821,20 +823,23 @@ functions:
|
||||||
GetBoundingBox(box);
|
GetBoundingBox(box);
|
||||||
FLOAT fEntitySize = box.Size().MaxNorm()/2;
|
FLOAT fEntitySize = box.Size().MaxNorm()/2;
|
||||||
|
|
||||||
|
/*
|
||||||
INDEX iCount = 1;
|
INDEX iCount = 1;
|
||||||
switch (m_EecChar) {
|
switch (m_EecChar) {
|
||||||
case ELC_SMALL: iCount = 3; break;
|
case ELC_SMALL: iCount = 3; break;
|
||||||
case ELC_BIG: iCount = 5; break;
|
case ELC_BIG: iCount = 5; break;
|
||||||
case ELC_LARGE: iCount = 7; break;
|
case ELC_LARGE: iCount = 7; break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
FLOAT3D vNormalizedDamage = m_vDamage-m_vDamage*(m_fBlowUpAmount/m_vDamage.Length());
|
FLOAT3D vNormalizedDamage = m_vDamage-m_vDamage*(m_fBlowUpAmount/m_vDamage.Length());
|
||||||
vNormalizedDamage /= Sqrt(vNormalizedDamage.Length());
|
vNormalizedDamage /= Sqrt(vNormalizedDamage.Length());
|
||||||
vNormalizedDamage *= 1.75f;
|
vNormalizedDamage *= 1.75f;
|
||||||
|
|
||||||
|
/*
|
||||||
FLOAT3D vBodySpeed = en_vCurrentTranslationAbsolute-en_vGravityDir*(en_vGravityDir%en_vCurrentTranslationAbsolute);
|
FLOAT3D vBodySpeed = en_vCurrentTranslationAbsolute-en_vGravityDir*(en_vGravityDir%en_vCurrentTranslationAbsolute);
|
||||||
|
|
||||||
// spawn debris
|
// spawn debris
|
||||||
/*
|
|
||||||
switch (m_EetType) {
|
switch (m_EetType) {
|
||||||
case ELT_ICE: {
|
case ELT_ICE: {
|
||||||
Debris_Begin(EIBT_ICE, DPT_NONE, BET_NONE, fEntitySize, vNormalizedDamage, vBodySpeed, 1.0f, 0.0f);
|
Debris_Begin(EIBT_ICE, DPT_NONE, BET_NONE, fEntitySize, vNormalizedDamage, vBodySpeed, 1.0f, 0.0f);
|
||||||
|
@ -1213,6 +1218,7 @@ procedures:
|
||||||
if (m_EetType == ELT_LAVA) {
|
if (m_EetType == ELT_LAVA) {
|
||||||
iAnim = ELEMENTALLAVA_ANIM_MELTUP;
|
iAnim = ELEMENTALLAVA_ANIM_MELTUP;
|
||||||
} else {
|
} else {
|
||||||
|
iAnim = 0; // DG: should at least have deterministic value
|
||||||
// iAnim = STONEMAN_ANIM_MORPHPLANEUP;
|
// iAnim = STONEMAN_ANIM_MORPHPLANEUP;
|
||||||
}
|
}
|
||||||
StartModelAnim(iAnim, 0);
|
StartModelAnim(iAnim, 0);
|
||||||
|
@ -1318,7 +1324,7 @@ procedures:
|
||||||
autocall FallOnFloor() EReturn;
|
autocall FallOnFloor() EReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_EecChar==ELC_LARGE || m_EecChar==ELC_BIG && m_EetType==ELT_LAVA)
|
if (m_EecChar==ELC_LARGE || (m_EecChar==ELC_BIG && m_EetType==ELT_LAVA))
|
||||||
{
|
{
|
||||||
PlaySound(m_soBackground, SOUND_LAVA_LAVABURN, SOF_3D|SOF_LOOP);
|
PlaySound(m_soBackground, SOUND_LAVA_LAVABURN, SOF_3D|SOF_LOOP);
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ functions:
|
||||||
// render one lightning toward enemy
|
// render one lightning toward enemy
|
||||||
FLOAT3D vSource = GetPlacement().pl_PositionVector;
|
FLOAT3D vSource = GetPlacement().pl_PositionVector;
|
||||||
FLOAT3D vTarget = m_penEnemy->GetPlacement().pl_PositionVector;
|
FLOAT3D vTarget = m_penEnemy->GetPlacement().pl_PositionVector;
|
||||||
FLOAT3D vDirection = (vTarget-vSource).Normalize();
|
//FLOAT3D vDirection = (vTarget-vSource).Normalize();
|
||||||
Particles_Ghostbuster(vSource, vTarget, 32, 1.0f);
|
Particles_Ghostbuster(vSource, vTarget, 32, 1.0f);
|
||||||
|
|
||||||
// random lightnings arround
|
// random lightnings arround
|
||||||
|
|
|
@ -56,7 +56,7 @@ functions:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL bFlare = TRUE;
|
//BOOL bFlare = TRUE;
|
||||||
// if current player has already picked this item
|
// if current player has already picked this item
|
||||||
if (_ulPlayerRenderingMask&m_ulPickedMask) {
|
if (_ulPlayerRenderingMask&m_ulPickedMask) {
|
||||||
// if picked items are not rendered
|
// if picked items are not rendered
|
||||||
|
@ -67,10 +67,10 @@ functions:
|
||||||
}
|
}
|
||||||
// if picked item particles are not rendered
|
// if picked item particles are not rendered
|
||||||
extern INDEX plr_bRenderPickedParticles;
|
extern INDEX plr_bRenderPickedParticles;
|
||||||
if (!plr_bRenderPickedParticles) {
|
/*if (!plr_bRenderPickedParticles) {
|
||||||
// kill flare
|
// kill flare
|
||||||
bFlare = FALSE;
|
bFlare = FALSE; // DG: bFlare is not otherwise used!
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// implement flare on/off ?
|
// implement flare on/off ?
|
||||||
|
|
|
@ -173,7 +173,7 @@ functions:
|
||||||
} else {
|
} else {
|
||||||
vDirectionFixed = FLOAT3D(0,1,0);
|
vDirectionFixed = FLOAT3D(0,1,0);
|
||||||
}
|
}
|
||||||
FLOAT3D vDamageOld = m_vDamage;
|
//FLOAT3D vDamageOld = m_vDamage;
|
||||||
m_vDamage += vDirectionFixed*fKickDamage;
|
m_vDamage += vDirectionFixed*fKickDamage;
|
||||||
|
|
||||||
// NOTE: we don't receive damage here, but handle death differently
|
// NOTE: we don't receive damage here, but handle death differently
|
||||||
|
|
|
@ -462,10 +462,10 @@ DECL_DLL void ctl_ComposeActionPacket(const CPlayerCharacter &pc, CPlayerAction
|
||||||
}
|
}
|
||||||
|
|
||||||
// add button movement/rotation/look actions to the axis actions
|
// add button movement/rotation/look actions to the axis actions
|
||||||
if(pctlCurrent.bMoveForward || pctlCurrent.bStrafeFB&&pctlCurrent.bTurnUp ) paAction.pa_vTranslation(3) -= plr_fSpeedForward;
|
if(pctlCurrent.bMoveForward || (pctlCurrent.bStrafeFB&&pctlCurrent.bTurnUp) ) paAction.pa_vTranslation(3) -= plr_fSpeedForward;
|
||||||
if(pctlCurrent.bMoveBackward || pctlCurrent.bStrafeFB&&pctlCurrent.bTurnDown) paAction.pa_vTranslation(3) += plr_fSpeedBackward;
|
if(pctlCurrent.bMoveBackward || (pctlCurrent.bStrafeFB&&pctlCurrent.bTurnDown)) paAction.pa_vTranslation(3) += plr_fSpeedBackward;
|
||||||
if(pctlCurrent.bMoveLeft || pctlCurrent.bStrafe&&pctlCurrent.bTurnLeft) paAction.pa_vTranslation(1) -= plr_fSpeedSide;
|
if(pctlCurrent.bMoveLeft || (pctlCurrent.bStrafe&&pctlCurrent.bTurnLeft) ) paAction.pa_vTranslation(1) -= plr_fSpeedSide;
|
||||||
if(pctlCurrent.bMoveRight || pctlCurrent.bStrafe&&pctlCurrent.bTurnRight) paAction.pa_vTranslation(1) += plr_fSpeedSide;
|
if(pctlCurrent.bMoveRight || (pctlCurrent.bStrafe&&pctlCurrent.bTurnRight)) paAction.pa_vTranslation(1) += plr_fSpeedSide;
|
||||||
if(pctlCurrent.bMoveUp ) paAction.pa_vTranslation(2) += plr_fSpeedUp;
|
if(pctlCurrent.bMoveUp ) paAction.pa_vTranslation(2) += plr_fSpeedUp;
|
||||||
if(pctlCurrent.bMoveDown ) paAction.pa_vTranslation(2) -= plr_fSpeedUp;
|
if(pctlCurrent.bMoveDown ) paAction.pa_vTranslation(2) -= plr_fSpeedUp;
|
||||||
|
|
||||||
|
@ -3702,7 +3702,7 @@ functions:
|
||||||
}
|
}
|
||||||
|
|
||||||
// if just started swimming
|
// if just started swimming
|
||||||
if (m_pstState == PST_SWIM && _pTimer->CurrentTick()<m_fSwimTime+0.5f
|
if ((m_pstState == PST_SWIM && _pTimer->CurrentTick()<m_fSwimTime+0.5f)
|
||||||
||_pTimer->CurrentTick()<m_tmOutOfWater+0.5f) {
|
||_pTimer->CurrentTick()<m_tmOutOfWater+0.5f) {
|
||||||
// no up/down change
|
// no up/down change
|
||||||
vTranslation(2)=0;
|
vTranslation(2)=0;
|
||||||
|
@ -3852,7 +3852,8 @@ functions:
|
||||||
void DeathActions(const CPlayerAction &paAction) {
|
void DeathActions(const CPlayerAction &paAction) {
|
||||||
// set heading, pitch and banking from the normal rotation into the camera view rotation
|
// set heading, pitch and banking from the normal rotation into the camera view rotation
|
||||||
if (m_penView!=NULL) {
|
if (m_penView!=NULL) {
|
||||||
ASSERT(IsPredicted()&&m_penView->IsPredicted()||IsPredictor()&&m_penView->IsPredictor()||!IsPredicted()&&!m_penView->IsPredicted()&&!IsPredictor()&&!m_penView->IsPredictor());
|
ASSERT((IsPredicted()&&m_penView->IsPredicted()) || (IsPredictor()&&m_penView->IsPredictor())
|
||||||
|
|| (!IsPredicted()&&!m_penView->IsPredicted()&&!IsPredictor()&&!m_penView->IsPredictor()));
|
||||||
en_plViewpoint.pl_PositionVector = FLOAT3D(0, 1, 0);
|
en_plViewpoint.pl_PositionVector = FLOAT3D(0, 1, 0);
|
||||||
en_plViewpoint.pl_OrientationAngle += (ANGLE3D(
|
en_plViewpoint.pl_OrientationAngle += (ANGLE3D(
|
||||||
(ANGLE)((FLOAT)paAction.pa_aRotation(1)*_pTimer->TickQuantum),
|
(ANGLE)((FLOAT)paAction.pa_aRotation(1)*_pTimer->TickQuantum),
|
||||||
|
|
|
@ -981,7 +981,7 @@ functions:
|
||||||
FLOAT3D vDesiredTranslation = pl.en_vDesiredTranslationRelative;
|
FLOAT3D vDesiredTranslation = pl.en_vDesiredTranslationRelative;
|
||||||
FLOAT3D vCurrentTranslation = pl.en_vCurrentTranslationAbsolute * !pl.en_mRotation;
|
FLOAT3D vCurrentTranslation = pl.en_vCurrentTranslationAbsolute * !pl.en_mRotation;
|
||||||
ANGLE3D aDesiredRotation = pl.en_aDesiredRotationRelative;
|
ANGLE3D aDesiredRotation = pl.en_aDesiredRotationRelative;
|
||||||
ANGLE3D aCurrentRotation = pl.en_aCurrentRotationAbsolute;
|
//ANGLE3D aCurrentRotation = pl.en_aCurrentRotationAbsolute;
|
||||||
|
|
||||||
// if player is moving
|
// if player is moving
|
||||||
if (vDesiredTranslation.ManhattanNorm()>0.01f
|
if (vDesiredTranslation.ManhattanNorm()>0.01f
|
||||||
|
|
|
@ -908,7 +908,7 @@ functions:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// apply cannon draw
|
// apply cannon draw
|
||||||
else if( (m_iCurrentWeapon == WEAPON_IRONCANNON) /*||
|
else if( m_iCurrentWeapon == WEAPON_IRONCANNON /*||
|
||||||
(m_iCurrentWeapon == WEAPON_NUKECANNON) */)
|
(m_iCurrentWeapon == WEAPON_NUKECANNON) */)
|
||||||
{
|
{
|
||||||
FLOAT fLerpedMovement = Lerp(m_fWeaponDrawPowerOld, m_fWeaponDrawPower, _pTimer->GetLerpFactor());
|
FLOAT fLerpedMovement = Lerp(m_fWeaponDrawPowerOld, m_fWeaponDrawPower, _pTimer->GetLerpFactor());
|
||||||
|
@ -3385,7 +3385,7 @@ procedures:
|
||||||
GetAnimator()->FireAnimation(BODY_ANIM_SHOTGUN_FIRESHORT, AOF_LOOPING);
|
GetAnimator()->FireAnimation(BODY_ANIM_SHOTGUN_FIRESHORT, AOF_LOOPING);
|
||||||
} else if (m_iCurrentWeapon==WEAPON_TOMMYGUN) {
|
} else if (m_iCurrentWeapon==WEAPON_TOMMYGUN) {
|
||||||
autocall TommyGunStart() EEnd;
|
autocall TommyGunStart() EEnd;
|
||||||
} else if ((m_iCurrentWeapon==WEAPON_IRONCANNON) /*|| (m_iCurrentWeapon==WEAPON_NUKECANNON)*/) {
|
} else if (m_iCurrentWeapon==WEAPON_IRONCANNON /*|| (m_iCurrentWeapon==WEAPON_NUKECANNON)*/) {
|
||||||
jump CannonFireStart();
|
jump CannonFireStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2281,7 +2281,7 @@ procedures:
|
||||||
ANGLE aHeading = GetRotationSpeed( aWantedHeading, m_aRotateSpeed, fWaitFrequency);
|
ANGLE aHeading = GetRotationSpeed( aWantedHeading, m_aRotateSpeed, fWaitFrequency);
|
||||||
|
|
||||||
// factor used to decrease speed of projectiles oriented opposite of its target
|
// factor used to decrease speed of projectiles oriented opposite of its target
|
||||||
FLOAT fSpeedDecreasingFactor = ((180-abs(aWantedHeading))/180.0f);
|
FLOAT fSpeedDecreasingFactor = ((180-fabsf(aWantedHeading))/180.0f);
|
||||||
// factor used to increase speed when far away from target
|
// factor used to increase speed when far away from target
|
||||||
FLOAT fSpeedIncreasingFactor = (vDesiredPosition-GetPlacement().pl_PositionVector).Length()/100;
|
FLOAT fSpeedIncreasingFactor = (vDesiredPosition-GetPlacement().pl_PositionVector).Length()/100;
|
||||||
fSpeedIncreasingFactor = ClampDn(fSpeedIncreasingFactor, 1.0f);
|
fSpeedIncreasingFactor = ClampDn(fSpeedIncreasingFactor, 1.0f);
|
||||||
|
@ -2302,7 +2302,7 @@ procedures:
|
||||||
FLOAT fRNDPitch = (FRnd()-0.5f)*90*fDistanceFactor;
|
FLOAT fRNDPitch = (FRnd()-0.5f)*90*fDistanceFactor;
|
||||||
|
|
||||||
// if we are looking near direction of target
|
// if we are looking near direction of target
|
||||||
if( abs( aWantedHeading) < 30.0f)
|
if( fabsf( aWantedHeading) < 30.0f)
|
||||||
{
|
{
|
||||||
// calculate pitch speed
|
// calculate pitch speed
|
||||||
ANGLE aWantedPitch = GetRelativePitch( vDesiredDirection);
|
ANGLE aWantedPitch = GetRelativePitch( vDesiredDirection);
|
||||||
|
|
|
@ -461,7 +461,7 @@ functions:
|
||||||
void SpawnBeamMachineMainFlare(void)
|
void SpawnBeamMachineMainFlare(void)
|
||||||
{
|
{
|
||||||
// spawn main flare
|
// spawn main flare
|
||||||
CPlacement3D plSpaceShip = GetPlacement();
|
//CPlacement3D plSpaceShip = GetPlacement();
|
||||||
CPlacement3D plFlare = CPlacement3D( FLOAT3D(0, BM_MASTER_Y+BM_FLARE_DY, 0), ANGLE3D(0,0,0));
|
CPlacement3D plFlare = CPlacement3D( FLOAT3D(0, BM_MASTER_Y+BM_FLARE_DY, 0), ANGLE3D(0,0,0));
|
||||||
plFlare.RelativeToAbsolute(GetPlacement());
|
plFlare.RelativeToAbsolute(GetPlacement());
|
||||||
CEntity *penFlare = CreateEntity( plFlare, CLASS_EFFECTOR);
|
CEntity *penFlare = CreateEntity( plFlare, CLASS_EFFECTOR);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user