mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
Merge pull request #54 from DanielGibson/fix-warnings-rebase
cherry-picked fixes by emlai, fix compilation again
This commit is contained in:
commit
aced26829a
|
@ -110,8 +110,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -Os -fno-unsafe-math-optimizations")
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -Os -fno-unsafe-math-optimizations")
|
||||||
|
|
||||||
# TODO fix these warnings
|
# TODO fix these warnings
|
||||||
# !!! FIXME: turn a bunch of these off, this is just for now. I hope. --ryan.
|
|
||||||
add_compile_options(-Wno-sign-compare)
|
|
||||||
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)
|
||||||
|
@ -123,7 +121,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
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)
|
# !!! FIXME: turn a bunch of these off, this is just for now. I hope. --ryan.
|
||||||
add_compile_options(-Wno-c++11-compat-deprecated-writable-strings)
|
add_compile_options(-Wno-c++11-compat-deprecated-writable-strings)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -173,16 +173,14 @@ BOOL CAnimData::IsAutoFreed(void)
|
||||||
// Reference counting functions
|
// Reference counting functions
|
||||||
void CAnimData::AddReference(void)
|
void CAnimData::AddReference(void)
|
||||||
{
|
{
|
||||||
if (this!=NULL) {
|
ASSERT(this!=NULL);
|
||||||
MarkUsed();
|
MarkUsed();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAnimData::RemReference(void)
|
void CAnimData::RemReference(void)
|
||||||
{
|
{
|
||||||
if (this!=NULL) {
|
ASSERT(this!=NULL);
|
||||||
RemReference_internal();
|
RemReference_internal();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAnimData::RemReference_internal(void)
|
void CAnimData::RemReference_internal(void)
|
||||||
|
|
|
@ -44,9 +44,7 @@ CConsole::CConsole(void)
|
||||||
// Destructor.
|
// Destructor.
|
||||||
CConsole::~CConsole(void)
|
CConsole::~CConsole(void)
|
||||||
{
|
{
|
||||||
if (this==NULL) {
|
ASSERT(this!=NULL);
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (con_fLog!=NULL) {
|
if (con_fLog!=NULL) {
|
||||||
fclose(con_fLog);
|
fclose(con_fLog);
|
||||||
con_fLog = NULL;
|
con_fLog = NULL;
|
||||||
|
@ -102,25 +100,19 @@ void CConsole::Initialize(const CTFileName &fnmLog, INDEX ctCharsPerLine, INDEX
|
||||||
// Get current console buffer.
|
// Get current console buffer.
|
||||||
const char *CConsole::GetBuffer(void)
|
const char *CConsole::GetBuffer(void)
|
||||||
{
|
{
|
||||||
if (this==NULL) {
|
ASSERT(this!=NULL);
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return con_strBuffer+(con_ctLines-con_ctLinesPrinted)*(con_ctCharsPerLine+1);
|
return con_strBuffer+(con_ctLines-con_ctLinesPrinted)*(con_ctCharsPerLine+1);
|
||||||
}
|
}
|
||||||
INDEX CConsole::GetBufferSize(void)
|
INDEX CConsole::GetBufferSize(void)
|
||||||
{
|
{
|
||||||
if (this==NULL) {
|
ASSERT(this!=NULL);
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return (con_ctCharsPerLine+1)*con_ctLines+1;
|
return (con_ctCharsPerLine+1)*con_ctLines+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Discard timing info for last lines
|
// Discard timing info for last lines
|
||||||
void CConsole::DiscardLastLineTimes(void)
|
void CConsole::DiscardLastLineTimes(void)
|
||||||
{
|
{
|
||||||
if (this==NULL) {
|
ASSERT(this!=NULL);
|
||||||
return;
|
|
||||||
}
|
|
||||||
for(INDEX i=0; i<con_ctLines; i++) {
|
for(INDEX i=0; i<con_ctLines; i++) {
|
||||||
con_atmLines[i] = -10000.0f;
|
con_atmLines[i] = -10000.0f;
|
||||||
}
|
}
|
||||||
|
@ -129,9 +121,7 @@ void CConsole::DiscardLastLineTimes(void)
|
||||||
// Get number of lines newer than given time
|
// Get number of lines newer than given time
|
||||||
INDEX CConsole::NumberOfLinesAfter(TIME tmLast)
|
INDEX CConsole::NumberOfLinesAfter(TIME tmLast)
|
||||||
{
|
{
|
||||||
if (this==NULL) {
|
ASSERT(this!=NULL);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
// clamp console variable
|
// clamp console variable
|
||||||
con_iLastLines = Clamp( con_iLastLines, 0, (INDEX)CONSOLE_MAXLASTLINES);
|
con_iLastLines = Clamp( con_iLastLines, 0, (INDEX)CONSOLE_MAXLASTLINES);
|
||||||
// find number of last console lines to be displayed on screen
|
// find number of last console lines to be displayed on screen
|
||||||
|
@ -146,9 +136,7 @@ INDEX CConsole::NumberOfLinesAfter(TIME tmLast)
|
||||||
// Get one of last lines
|
// Get one of last lines
|
||||||
CTString CConsole::GetLastLine(INDEX iLine)
|
CTString CConsole::GetLastLine(INDEX iLine)
|
||||||
{
|
{
|
||||||
if (this==NULL) {
|
ASSERT(this!=NULL);
|
||||||
return "";
|
|
||||||
}
|
|
||||||
if (iLine>=con_ctLinesPrinted) {
|
if (iLine>=con_ctLinesPrinted) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -166,9 +154,7 @@ CTString CConsole::GetLastLine(INDEX iLine)
|
||||||
// clear one given line in buffer
|
// clear one given line in buffer
|
||||||
void CConsole::ClearLine(INDEX iLine)
|
void CConsole::ClearLine(INDEX iLine)
|
||||||
{
|
{
|
||||||
if (this==NULL) {
|
ASSERT(this!=NULL);
|
||||||
return;
|
|
||||||
}
|
|
||||||
// line must be valid
|
// line must be valid
|
||||||
ASSERT(iLine>=0 && iLine<con_ctLines);
|
ASSERT(iLine>=0 && iLine<con_ctLines);
|
||||||
// get start of line
|
// get start of line
|
||||||
|
@ -183,9 +169,7 @@ void CConsole::ClearLine(INDEX iLine)
|
||||||
// scroll buffer up, discarding lines at the start
|
// scroll buffer up, discarding lines at the start
|
||||||
void CConsole::ScrollBufferUp(INDEX ctLines)
|
void CConsole::ScrollBufferUp(INDEX ctLines)
|
||||||
{
|
{
|
||||||
if (this==NULL) {
|
ASSERT(this!=NULL);
|
||||||
return;
|
|
||||||
}
|
|
||||||
ASSERT(ctLines>0 && ctLines<con_ctLines);
|
ASSERT(ctLines>0 && ctLines<con_ctLines);
|
||||||
// move buffer up
|
// move buffer up
|
||||||
memmove(
|
memmove(
|
||||||
|
@ -207,9 +191,7 @@ void CConsole::ScrollBufferUp(INDEX ctLines)
|
||||||
// Add a line of text to console
|
// Add a line of text to console
|
||||||
void CConsole::PutString(const char *strString)
|
void CConsole::PutString(const char *strString)
|
||||||
{
|
{
|
||||||
if (this==NULL) {
|
ASSERT(this!=NULL);
|
||||||
return;
|
|
||||||
}
|
|
||||||
// synchronize access to console
|
// synchronize access to console
|
||||||
CTSingleLock slConsole(&con_csConsole, TRUE);
|
CTSingleLock slConsole(&con_csConsole, TRUE);
|
||||||
|
|
||||||
|
@ -265,9 +247,7 @@ void CConsole::PutString(const char *strString)
|
||||||
// Close console log file buffers (call only when force-exiting!)
|
// Close console log file buffers (call only when force-exiting!)
|
||||||
void CConsole::CloseLog(void)
|
void CConsole::CloseLog(void)
|
||||||
{
|
{
|
||||||
if (this==NULL) {
|
ASSERT(this!=NULL);
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (con_fLog!=NULL) {
|
if (con_fLog!=NULL) {
|
||||||
fclose(con_fLog);
|
fclose(con_fLog);
|
||||||
}
|
}
|
||||||
|
|
|
@ -562,9 +562,9 @@ void CBrushShadowMap::CheckLayersUpToDate(void)
|
||||||
CBrushShadowLayer &bsl = *itbsl;
|
CBrushShadowLayer &bsl = *itbsl;
|
||||||
if( bsl.bsl_ulFlags&BSLF_ALLDARK) continue;
|
if( bsl.bsl_ulFlags&BSLF_ALLDARK) continue;
|
||||||
// light source must be valid
|
// light source must be valid
|
||||||
|
ASSERT( bsl.bsl_plsLightSource!=NULL);
|
||||||
|
if( bsl.bsl_plsLightSource==NULL) continue;
|
||||||
CLightSource &ls = *bsl.bsl_plsLightSource;
|
CLightSource &ls = *bsl.bsl_plsLightSource;
|
||||||
ASSERT( &ls!=NULL);
|
|
||||||
if( &ls==NULL) continue;
|
|
||||||
// if the layer is not up to date
|
// if the layer is not up to date
|
||||||
if( bsl.bsl_colLastAnim != ls.GetLightColor()) {
|
if( bsl.bsl_colLastAnim != ls.GetLightColor()) {
|
||||||
// invalidate entire shadow map
|
// invalidate entire shadow map
|
||||||
|
@ -581,9 +581,9 @@ BOOL CBrushShadowMap::HasDynamicLayers(void)
|
||||||
// for each layer
|
// for each layer
|
||||||
FOREACHINLIST( CBrushShadowLayer, bsl_lnInShadowMap, bsm_lhLayers, itbsl)
|
FOREACHINLIST( CBrushShadowLayer, bsl_lnInShadowMap, bsm_lhLayers, itbsl)
|
||||||
{ // light source must be valid
|
{ // light source must be valid
|
||||||
|
ASSERT( itbsl->bsl_plsLightSource!=NULL);
|
||||||
|
if( itbsl->bsl_plsLightSource==NULL) continue;
|
||||||
CLightSource &ls = *itbsl->bsl_plsLightSource;
|
CLightSource &ls = *itbsl->bsl_plsLightSource;
|
||||||
ASSERT( &ls!=NULL);
|
|
||||||
if( &ls==NULL) continue;
|
|
||||||
// if the layer is dynamic, it has
|
// if the layer is dynamic, it has
|
||||||
if( ls.ls_ulFlags&LSF_DYNAMIC) return TRUE;
|
if( ls.ls_ulFlags&LSF_DYNAMIC) return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2036,10 +2036,7 @@ static CStaticStackArray<CSentEvent> _aseSentEvents; // delayed events
|
||||||
/* Send an event to this entity. */
|
/* Send an event to this entity. */
|
||||||
void CEntity::SendEvent(const CEntityEvent &ee)
|
void CEntity::SendEvent(const CEntityEvent &ee)
|
||||||
{
|
{
|
||||||
if (this==NULL) {
|
ASSERT(this!=NULL);
|
||||||
ASSERT(FALSE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
CSentEvent &se = _aseSentEvents.Push();
|
CSentEvent &se = _aseSentEvents.Push();
|
||||||
se.se_penEntity = this;
|
se.se_penEntity = this;
|
||||||
se.se_peeEvent = ((CEntityEvent&)ee).MakeCopy(); // discard const qualifier
|
se.se_peeEvent = ((CEntityEvent&)ee).MakeCopy(); // discard const qualifier
|
||||||
|
|
|
@ -688,25 +688,24 @@ inline const CEntityPointer &CEntityPointer::operator=(const CEntityPointer &pen
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
inline CEntity* CEntityPointer::operator->(void) const { return ep_pen; }
|
inline CEntity* CEntityPointer::operator->(void) const { return ep_pen; }
|
||||||
|
inline CEntity* CEntityPointer::get(void) const { return ep_pen; }
|
||||||
inline CEntityPointer::operator CEntity*(void) const { return ep_pen; }
|
inline CEntityPointer::operator CEntity*(void) const { return ep_pen; }
|
||||||
inline CEntity& CEntityPointer::operator*(void) const { return *ep_pen; }
|
inline CEntity& CEntityPointer::operator*(void) const { return *ep_pen; }
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
// Reference counting functions
|
// Reference counting functions
|
||||||
inline void CEntity::AddReference(void) {
|
inline void CEntity::AddReference(void) {
|
||||||
if (this!=NULL) {
|
ASSERT(this!=NULL);
|
||||||
ASSERT(en_ctReferences>=0);
|
ASSERT(en_ctReferences>=0);
|
||||||
en_ctReferences++;
|
en_ctReferences++;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
inline void CEntity::RemReference(void) {
|
inline void CEntity::RemReference(void) {
|
||||||
if (this!=NULL) {
|
ASSERT(this!=NULL);
|
||||||
ASSERT(en_ctReferences>0);
|
ASSERT(en_ctReferences>0);
|
||||||
en_ctReferences--;
|
en_ctReferences--;
|
||||||
if(en_ctReferences==0) {
|
if(en_ctReferences==0) {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -64,14 +64,12 @@ CEntityClass::~CEntityClass(void)
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
// Reference counting functions
|
// Reference counting functions
|
||||||
void CEntityClass::AddReference(void) {
|
void CEntityClass::AddReference(void) {
|
||||||
if (this!=NULL) {
|
ASSERT(this!=NULL);
|
||||||
MarkUsed();
|
MarkUsed();
|
||||||
}
|
|
||||||
};
|
};
|
||||||
void CEntityClass::RemReference(void) {
|
void CEntityClass::RemReference(void) {
|
||||||
if (this!=NULL) {
|
ASSERT(this!=NULL);
|
||||||
_pEntityClassStock->Release(this);
|
_pEntityClassStock->Release(this);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -35,6 +35,7 @@ public:
|
||||||
inline const CEntityPointer &operator=(CEntity *pen);
|
inline const CEntityPointer &operator=(CEntity *pen);
|
||||||
inline const CEntityPointer &operator=(const CEntityPointer &penOther);
|
inline const CEntityPointer &operator=(const CEntityPointer &penOther);
|
||||||
inline CEntity* operator->(void) const;
|
inline CEntity* operator->(void) const;
|
||||||
|
inline CEntity* get(void) const;
|
||||||
inline operator CEntity*(void) const;
|
inline operator CEntity*(void) const;
|
||||||
inline CEntity& operator*(void) const;
|
inline CEntity& operator*(void) const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -99,7 +99,7 @@ void CFontData::Read_t( CTStream *inFile) // throw char *
|
||||||
SetCharSpacing(+1);
|
SetCharSpacing(+1);
|
||||||
SetLineSpacing(+1);
|
SetLineSpacing(+1);
|
||||||
SetSpaceWidth(0.5f);
|
SetSpaceWidth(0.5f);
|
||||||
fd_fcdFontCharData[' '].fcd_pixStart = 0;
|
fd_fcdFontCharData[(int)' '].fcd_pixStart = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFontData::Write_t( CTStream *outFile) // throw char *
|
void CFontData::Write_t( CTStream *outFile) // throw char *
|
||||||
|
@ -201,7 +201,7 @@ void CFontData::Make_t( const CTFileName &fnTexture, PIX pixCharWidth, PIX pixCh
|
||||||
iLetter++; // skip carriage return
|
iLetter++; // skip carriage return
|
||||||
}
|
}
|
||||||
// set default space width
|
// set default space width
|
||||||
fd_fcdFontCharData[' '].fcd_pixStart = 0;
|
fd_fcdFontCharData[(int)' '].fcd_pixStart = 0;
|
||||||
SetSpaceWidth(0.5f);
|
SetSpaceWidth(0.5f);
|
||||||
|
|
||||||
// all done
|
// all done
|
||||||
|
|
|
@ -71,7 +71,7 @@ public:
|
||||||
inline void SetFixedWidth(void) { fd_bFixedWidth = TRUE; };
|
inline void SetFixedWidth(void) { fd_bFixedWidth = TRUE; };
|
||||||
inline void SetVariableWidth(void) { fd_bFixedWidth = FALSE; };
|
inline void SetVariableWidth(void) { fd_bFixedWidth = FALSE; };
|
||||||
inline void SetSpaceWidth( FLOAT fWidthRatio) { // relative to char cell width (1/2 is default)
|
inline void SetSpaceWidth( FLOAT fWidthRatio) { // relative to char cell width (1/2 is default)
|
||||||
fd_fcdFontCharData[' '].fcd_pixEnd = (PIX)(fd_pixCharWidth*fWidthRatio); }
|
fd_fcdFontCharData[(int)' '].fcd_pixEnd = (PIX)(fd_pixCharWidth*fWidthRatio); }
|
||||||
|
|
||||||
void Read_t( CTStream *inFile); // throw char *
|
void Read_t( CTStream *inFile); // throw char *
|
||||||
void Write_t( CTStream *outFile); // throw char *
|
void Write_t( CTStream *outFile); // throw char *
|
||||||
|
|
|
@ -1770,8 +1770,9 @@ void CLayerMixer::MixOneMipmap(CBrushShadowMap *pbsm, INDEX iMipmap)
|
||||||
if( lm_pbpoPolygon->bpo_ulFlags&BPOF_HASDIRECTIONALAMBIENT) {
|
if( lm_pbpoPolygon->bpo_ulFlags&BPOF_HASDIRECTIONALAMBIENT) {
|
||||||
{FOREACHINLIST( CBrushShadowLayer, bsl_lnInShadowMap, lm_pbsmShadowMap->bsm_lhLayers, itbsl) {
|
{FOREACHINLIST( CBrushShadowLayer, bsl_lnInShadowMap, lm_pbsmShadowMap->bsm_lhLayers, itbsl) {
|
||||||
CBrushShadowLayer &bsl = *itbsl;
|
CBrushShadowLayer &bsl = *itbsl;
|
||||||
|
ASSERT( bsl.bsl_plsLightSource!=NULL);
|
||||||
|
if( bsl.bsl_plsLightSource==NULL) continue; // safety check
|
||||||
CLightSource &ls = *bsl.bsl_plsLightSource;
|
CLightSource &ls = *bsl.bsl_plsLightSource;
|
||||||
ASSERT( &ls!=NULL); if( &ls==NULL) continue; // safety check
|
|
||||||
if( !(ls.ls_ulFlags&LSF_DIRECTIONAL)) continue; // skip non-directional layers
|
if( !(ls.ls_ulFlags&LSF_DIRECTIONAL)) continue; // skip non-directional layers
|
||||||
COLOR col = AdjustColor( ls.GetLightAmbient(), _slShdHueShift, _slShdSaturation);
|
COLOR col = AdjustColor( ls.GetLightAmbient(), _slShdHueShift, _slShdSaturation);
|
||||||
colAmbient = AddColors( colAmbient, col);
|
colAmbient = AddColors( colAmbient, col);
|
||||||
|
@ -1843,8 +1844,9 @@ void CLayerMixer::MixOneMipmap(CBrushShadowMap *pbsm, INDEX iMipmap)
|
||||||
{FORDELETELIST( CBrushShadowLayer, bsl_lnInShadowMap, lm_pbsmShadowMap->bsm_lhLayers, itbsl)
|
{FORDELETELIST( CBrushShadowLayer, bsl_lnInShadowMap, lm_pbsmShadowMap->bsm_lhLayers, itbsl)
|
||||||
{
|
{
|
||||||
CBrushShadowLayer &bsl = *itbsl;
|
CBrushShadowLayer &bsl = *itbsl;
|
||||||
|
ASSERT( bsl.bsl_plsLightSource!=NULL);
|
||||||
|
if( bsl.bsl_plsLightSource==NULL) continue; // safety check
|
||||||
CLightSource &ls = *bsl.bsl_plsLightSource;
|
CLightSource &ls = *bsl.bsl_plsLightSource;
|
||||||
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;
|
||||||
|
|
|
@ -1115,10 +1115,10 @@ void CObjectPolygon::JoinContinuingEdges(CDynamicArray<CObjectEdge> &oedEdges)
|
||||||
|
|
||||||
// for each edge
|
// for each edge
|
||||||
{FOREACHINDYNAMICARRAY(opo_PolygonEdges, CObjectPolygonEdge, itope) {
|
{FOREACHINDYNAMICARRAY(opo_PolygonEdges, CObjectPolygonEdge, itope) {
|
||||||
CObjectEdge &oedThis = *itope->ope_Edge;
|
CObjectEdge *poedThis = itope->ope_Edge;
|
||||||
|
|
||||||
// if not already marked for removal
|
// if not already marked for removal
|
||||||
if (&oedThis != NULL) {
|
if (poedThis != NULL) {
|
||||||
CObjectVertex *povxStartThis, *povxEndThis;
|
CObjectVertex *povxStartThis, *povxEndThis;
|
||||||
// get start and end vertices
|
// get start and end vertices
|
||||||
itope->GetVertices(povxStartThis, povxEndThis);
|
itope->GetVertices(povxStartThis, povxEndThis);
|
||||||
|
@ -1133,12 +1133,12 @@ void CObjectPolygon::JoinContinuingEdges(CDynamicArray<CObjectEdge> &oedEdges)
|
||||||
|
|
||||||
// for each edge
|
// for each edge
|
||||||
{FOREACHINDYNAMICARRAY(opo_PolygonEdges, CObjectPolygonEdge, itope2) {
|
{FOREACHINDYNAMICARRAY(opo_PolygonEdges, CObjectPolygonEdge, itope2) {
|
||||||
CObjectEdge &oedOther = *itope2->ope_Edge;
|
CObjectEdge *poedOther = itope2->ope_Edge;
|
||||||
|
|
||||||
// if not already marked for removal
|
// if not already marked for removal
|
||||||
if (&oedOther != NULL) {
|
if (poedOther != NULL) {
|
||||||
// if the two edges are collinear
|
// if the two edges are collinear
|
||||||
if ( CompareEdgeLines(*oedThis.colinear2.oed_pedxLine, *oedOther.colinear2.oed_pedxLine)==0) {
|
if ( CompareEdgeLines(*poedThis->colinear2.oed_pedxLine, *poedOther->colinear2.oed_pedxLine)==0) {
|
||||||
CObjectVertex *povxStartOther, *povxEndOther;
|
CObjectVertex *povxStartOther, *povxEndOther;
|
||||||
// get start and end vertices
|
// get start and end vertices
|
||||||
itope2->GetVertices(povxStartOther, povxEndOther);
|
itope2->GetVertices(povxStartOther, povxEndOther);
|
||||||
|
|
|
@ -655,7 +655,8 @@ extern void FreeUnusedStock(void)
|
||||||
*/
|
*/
|
||||||
void CNetworkTimerHandler::HandleTimer(void)
|
void CNetworkTimerHandler::HandleTimer(void)
|
||||||
{
|
{
|
||||||
if (this==NULL || _bTempNetwork) {
|
ASSERT(this!=NULL);
|
||||||
|
if (_bTempNetwork) {
|
||||||
return; // this can happen during NET_MakeDefaultState_t()!
|
return; // this can happen during NET_MakeDefaultState_t()!
|
||||||
}
|
}
|
||||||
// enable stream handling during timer
|
// enable stream handling during timer
|
||||||
|
@ -902,7 +903,8 @@ void CNetworkLibrary::Init(const CTString &strGameID)
|
||||||
*/
|
*/
|
||||||
void CNetworkLibrary::AddTimerHandler(void)
|
void CNetworkLibrary::AddTimerHandler(void)
|
||||||
{
|
{
|
||||||
if (this==NULL || _bTempNetwork) {
|
ASSERT(this!=NULL);
|
||||||
|
if (_bTempNetwork) {
|
||||||
return; // this can happen during NET_MakeDefaultState_t()!
|
return; // this can happen during NET_MakeDefaultState_t()!
|
||||||
}
|
}
|
||||||
_pTimer->AddHandler(&ga_thTimerHandler);
|
_pTimer->AddHandler(&ga_thTimerHandler);
|
||||||
|
@ -912,7 +914,8 @@ void CNetworkLibrary::AddTimerHandler(void)
|
||||||
*/
|
*/
|
||||||
void CNetworkLibrary::RemoveTimerHandler(void)
|
void CNetworkLibrary::RemoveTimerHandler(void)
|
||||||
{
|
{
|
||||||
if (this==NULL || _bTempNetwork) {
|
ASSERT(this!=NULL);
|
||||||
|
if (_bTempNetwork) {
|
||||||
return; // this can happen during NET_MakeDefaultState_t()!
|
return; // this can happen during NET_MakeDefaultState_t()!
|
||||||
}
|
}
|
||||||
_pTimer->RemHandler(&ga_thTimerHandler);
|
_pTimer->RemHandler(&ga_thTimerHandler);
|
||||||
|
@ -1390,7 +1393,8 @@ void CNetworkLibrary::TogglePause(void)
|
||||||
// test if game is paused
|
// test if game is paused
|
||||||
BOOL CNetworkLibrary::IsPaused(void)
|
BOOL CNetworkLibrary::IsPaused(void)
|
||||||
{
|
{
|
||||||
if (this==NULL || _bTempNetwork) {
|
ASSERT(this!=NULL);
|
||||||
|
if (_bTempNetwork) {
|
||||||
return TRUE; // this can happen during NET_MakeDefaultState_t()!
|
return TRUE; // this can happen during NET_MakeDefaultState_t()!
|
||||||
}
|
}
|
||||||
return ga_sesSessionState.ses_bPause;
|
return ga_sesSessionState.ses_bPause;
|
||||||
|
@ -1427,7 +1431,8 @@ void CNetworkLibrary::SetLocalPause(BOOL bPause)
|
||||||
|
|
||||||
BOOL CNetworkLibrary::GetLocalPause(void)
|
BOOL CNetworkLibrary::GetLocalPause(void)
|
||||||
{
|
{
|
||||||
if (this==NULL || _bTempNetwork) {
|
ASSERT(this!=NULL);
|
||||||
|
if (_bTempNetwork) {
|
||||||
return TRUE; // this can happen during NET_MakeDefaultState_t()!
|
return TRUE; // this can happen during NET_MakeDefaultState_t()!
|
||||||
}
|
}
|
||||||
return ga_bLocalPause;
|
return ga_bLocalPause;
|
||||||
|
@ -2033,7 +2038,8 @@ void CNetworkLibrary::SendActionsToServer(void)
|
||||||
*/
|
*/
|
||||||
void CNetworkLibrary::TimerLoop(void)
|
void CNetworkLibrary::TimerLoop(void)
|
||||||
{
|
{
|
||||||
if (this==NULL || _bTempNetwork) {
|
ASSERT(this!=NULL);
|
||||||
|
if (_bTempNetwork) {
|
||||||
return; // this can happen during NET_MakeDefaultState_t()!
|
return; // this can happen during NET_MakeDefaultState_t()!
|
||||||
}
|
}
|
||||||
_pfNetworkProfile.StartTimer(CNetworkProfile::PTI_TIMERLOOP);
|
_pfNetworkProfile.StartTimer(CNetworkProfile::PTI_TIMERLOOP);
|
||||||
|
|
|
@ -779,23 +779,23 @@ CScreenPolygon *CRenderer::MakeScreenPolygon(CBrushPolygon &bpo)
|
||||||
void CRenderer::AddPolygonToScene( CScreenPolygon *pspo)
|
void CRenderer::AddPolygonToScene( CScreenPolygon *pspo)
|
||||||
{
|
{
|
||||||
// if the polygon is not falid or occluder and not selected
|
// if the polygon is not falid or occluder and not selected
|
||||||
CBrushPolygon &bpo = *pspo->spo_pbpoBrushPolygon;
|
CBrushPolygon *pbpo = pspo->spo_pbpoBrushPolygon;
|
||||||
if( &bpo==NULL || ((bpo.bpo_ulFlags&BPOF_OCCLUDER) && (!(bpo.bpo_ulFlags&BPOF_SELECTED) ||
|
if(pbpo==NULL || ((pbpo->bpo_ulFlags&BPOF_OCCLUDER) && (!(pbpo->bpo_ulFlags&BPOF_SELECTED) ||
|
||||||
_wrpWorldRenderPrefs.GetSelectionType()!=CWorldRenderPrefs::ST_POLYGONS))) {
|
_wrpWorldRenderPrefs.GetSelectionType()!=CWorldRenderPrefs::ST_POLYGONS))) {
|
||||||
// do not add it to rendering
|
// do not add it to rendering
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CBrushSector &bsc = *bpo.bpo_pbscSector;
|
CBrushSector &bsc = *pbpo->bpo_pbscSector;
|
||||||
ScenePolygon &sppo = pspo->spo_spoScenePolygon;
|
ScenePolygon &sppo = pspo->spo_spoScenePolygon;
|
||||||
const CViewVertex *pvvx0 = &re_avvxViewVertices[bsc.bsc_ivvx0];
|
const CViewVertex *pvvx0 = &re_avvxViewVertices[bsc.bsc_ivvx0];
|
||||||
const INDEX ctVtx = bpo.bpo_apbvxTriangleVertices.Count();
|
const INDEX ctVtx = pbpo->bpo_apbvxTriangleVertices.Count();
|
||||||
sppo.spo_iVtx0 = _avtxScene.Count();
|
sppo.spo_iVtx0 = _avtxScene.Count();
|
||||||
GFXVertex3 *pvtx = _avtxScene.Push(ctVtx);
|
GFXVertex3 *pvtx = _avtxScene.Push(ctVtx);
|
||||||
|
|
||||||
// find vertex with nearest Z distance while copying vertices
|
// find vertex with nearest Z distance while copying vertices
|
||||||
FLOAT fNearestZ = 123456789.0f;
|
FLOAT fNearestZ = 123456789.0f;
|
||||||
for( INDEX i=0; i<ctVtx; i++) {
|
for( INDEX i=0; i<ctVtx; i++) {
|
||||||
CBrushVertex *pbvx = bpo.bpo_apbvxTriangleVertices[i];
|
CBrushVertex *pbvx = pbpo->bpo_apbvxTriangleVertices[i];
|
||||||
const INDEX iVtx = bsc.bsc_abvxVertices.Index(pbvx);
|
const INDEX iVtx = bsc.bsc_abvxVertices.Index(pbvx);
|
||||||
const FLOAT3D &v = pvvx0[iVtx].vvx_vView;
|
const FLOAT3D &v = pvvx0[iVtx].vvx_vView;
|
||||||
if( -v(3)<fNearestZ) fNearestZ = -v(3); // inverted because of negative sign
|
if( -v(3)<fNearestZ) fNearestZ = -v(3); // inverted because of negative sign
|
||||||
|
@ -809,8 +809,8 @@ void CRenderer::AddPolygonToScene( CScreenPolygon *pspo)
|
||||||
|
|
||||||
// all done
|
// all done
|
||||||
sppo.spo_ctVtx = ctVtx;
|
sppo.spo_ctVtx = ctVtx;
|
||||||
sppo.spo_ctElements = bpo.bpo_aiTriangleElements.Count();
|
sppo.spo_ctElements = pbpo->bpo_aiTriangleElements.Count();
|
||||||
sppo.spo_piElements = sppo.spo_ctElements ? &bpo.bpo_aiTriangleElements[0] : NULL;
|
sppo.spo_piElements = sppo.spo_ctElements ? &pbpo->bpo_aiTriangleElements[0] : NULL;
|
||||||
_sfStats.IncrementCounter(CStatForm::SCI_SCENE_TRIANGLES, sppo.spo_ctElements/3);
|
_sfStats.IncrementCounter(CStatForm::SCI_SCENE_TRIANGLES, sppo.spo_ctElements/3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -252,16 +252,14 @@ SLONG CSoundData::GetUsedMemory(void)
|
||||||
// Add one reference
|
// Add one reference
|
||||||
void CSoundData::AddReference(void)
|
void CSoundData::AddReference(void)
|
||||||
{
|
{
|
||||||
if (this!=NULL) {
|
ASSERT(this!=NULL);
|
||||||
MarkUsed();
|
MarkUsed();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Remove one reference
|
// Remove one reference
|
||||||
void CSoundData::RemReference(void)
|
void CSoundData::RemReference(void)
|
||||||
{
|
{
|
||||||
if (this!=NULL) {
|
ASSERT(this!=NULL);
|
||||||
_pSoundStock->Release(this);
|
_pSoundStock->Release(this);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1233,6 +1233,7 @@ BOOL CSoundLibrary::SetEnvironment( INDEX iEnvNo, FLOAT fEnvSize/*=0*/)
|
||||||
// mute all sounds (erase playing buffer(s) and supress mixer)
|
// mute all sounds (erase playing buffer(s) and supress mixer)
|
||||||
void CSoundLibrary::Mute(void)
|
void CSoundLibrary::Mute(void)
|
||||||
{
|
{
|
||||||
|
ASSERT(this!=NULL);
|
||||||
// stop all IFeel effects
|
// stop all IFeel effects
|
||||||
IFeel_StopEffect(NULL);
|
IFeel_StopEffect(NULL);
|
||||||
|
|
||||||
|
@ -1244,7 +1245,7 @@ void CSoundLibrary::Mute(void)
|
||||||
|
|
||||||
#ifdef PLATFORM_WIN32
|
#ifdef PLATFORM_WIN32
|
||||||
// erase direct sound buffer (waveout will shut-up by itself), but skip if there's no more sound library
|
// erase direct sound buffer (waveout will shut-up by itself), but skip if there's no more sound library
|
||||||
if( this==NULL || !sl_bUsingDirectSound) return;
|
if(!sl_bUsingDirectSound) return;
|
||||||
|
|
||||||
// synchronize access to sounds
|
// synchronize access to sounds
|
||||||
CTSingleLock slSounds(&sl_csSound, TRUE);
|
CTSingleLock slSounds(&sl_csSound, TRUE);
|
||||||
|
|
|
@ -936,10 +936,11 @@ void CWorld::TriangularizeForVertices( CBrushVertexSelection &selVertex)
|
||||||
// add this entity to prediction
|
// add this entity to prediction
|
||||||
void CEntity::AddToPrediction(void)
|
void CEntity::AddToPrediction(void)
|
||||||
{
|
{
|
||||||
// this function may be called even for NULLs - so ignore it
|
// this function may be called even for NULLs - TODO: fix those cases
|
||||||
if (this==NULL) {
|
// (The compiler is free to assume that "this" is never NULL and optimize
|
||||||
return;
|
// based on that assumption. For example, an "if (this==NULL) {...}" could
|
||||||
}
|
// be optimized away completely.)
|
||||||
|
ASSERT(this!=NULL);
|
||||||
// if already added
|
// if already added
|
||||||
if (en_ulFlags&ENF_WILLBEPREDICTED) {
|
if (en_ulFlags&ENF_WILLBEPREDICTED) {
|
||||||
// do nothing
|
// do nothing
|
||||||
|
|
|
@ -172,15 +172,15 @@ void CWorld::DoCSGOperation(
|
||||||
AssureFPT_53();
|
AssureFPT_53();
|
||||||
|
|
||||||
// get relevant brush mips in each brush
|
// get relevant brush mips in each brush
|
||||||
CBrushMip &bmThis = *GetBrushMip(enThis);
|
CBrushMip *pbmThis = GetBrushMip(enThis);
|
||||||
CBrushMip &bmOther = *GetBrushMip(enOther);
|
CBrushMip *pbmOther = GetBrushMip(enOther);
|
||||||
if (&bmThis==NULL || &bmOther==NULL) {
|
if (pbmThis==NULL || pbmOther==NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get open sector of the other brush to object
|
// get open sector of the other brush to object
|
||||||
CBrushSectorSelectionForCSG selbscOtherOpen;
|
CBrushSectorSelectionForCSG selbscOtherOpen;
|
||||||
bmOther.SelectOpenSector(selbscOtherOpen);
|
pbmOther->SelectOpenSector(selbscOtherOpen);
|
||||||
CObject3D obOtherOpen;
|
CObject3D obOtherOpen;
|
||||||
DOUBLEaabbox3D boxOtherOpen;
|
DOUBLEaabbox3D boxOtherOpen;
|
||||||
woOther.CopySourceBrushSectorsToObject(enOther, selbscOtherOpen, plOther,
|
woOther.CopySourceBrushSectorsToObject(enOther, selbscOtherOpen, plOther,
|
||||||
|
@ -193,7 +193,7 @@ void CWorld::DoCSGOperation(
|
||||||
obOtherOpen.TurnPortalsToWalls();
|
obOtherOpen.TurnPortalsToWalls();
|
||||||
|
|
||||||
// if there are any sectors in this brush
|
// if there are any sectors in this brush
|
||||||
if (bmThis.bm_abscSectors.Count()>0) {
|
if (pbmThis->bm_abscSectors.Count()>0) {
|
||||||
// move affected part of this brush to an object3d object
|
// move affected part of this brush to an object3d object
|
||||||
CObject3D obThis;
|
CObject3D obThis;
|
||||||
MoveTargetBrushPartToObject(enThis, boxOtherOpen, obThis);
|
MoveTargetBrushPartToObject(enThis, boxOtherOpen, obThis);
|
||||||
|
@ -213,7 +213,7 @@ void CWorld::DoCSGOperation(
|
||||||
|
|
||||||
// get closed sectors of the other brush to object
|
// get closed sectors of the other brush to object
|
||||||
CBrushSectorSelectionForCSG selbscOtherClosed;
|
CBrushSectorSelectionForCSG selbscOtherClosed;
|
||||||
bmOther.SelectClosedSectors(selbscOtherClosed);
|
pbmOther->SelectClosedSectors(selbscOtherClosed);
|
||||||
CObject3D obOtherClosed;
|
CObject3D obOtherClosed;
|
||||||
DOUBLEaabbox3D boxOtherClosed;
|
DOUBLEaabbox3D boxOtherClosed;
|
||||||
woOther.CopySourceBrushSectorsToObject(enOther, selbscOtherClosed, plOther,
|
woOther.CopySourceBrushSectorsToObject(enOther, selbscOtherClosed, plOther,
|
||||||
|
@ -224,7 +224,7 @@ void CWorld::DoCSGOperation(
|
||||||
CObject3D obResult;
|
CObject3D obResult;
|
||||||
|
|
||||||
// if there are any sectors in this brush
|
// if there are any sectors in this brush
|
||||||
if (bmThis.bm_abscSectors.Count()>0) {
|
if (pbmThis->bm_abscSectors.Count()>0) {
|
||||||
// move affected part of this brush to an object3d object
|
// move affected part of this brush to an object3d object
|
||||||
CObject3D obThis;
|
CObject3D obThis;
|
||||||
MoveTargetBrushPartToObject(enThis, boxOtherClosed, obThis);
|
MoveTargetBrushPartToObject(enThis, boxOtherClosed, obThis);
|
||||||
|
@ -304,16 +304,16 @@ void CWorld::CSGRemove(CEntity &enThis, CWorld &woOther, CEntity &enOther,
|
||||||
AssureFPT_53();
|
AssureFPT_53();
|
||||||
|
|
||||||
// get relevant brush mip in other brush
|
// get relevant brush mip in other brush
|
||||||
CBrushMip &bmOther = *GetBrushMip(enOther);
|
CBrushMip *pbmOther = GetBrushMip(enOther);
|
||||||
if (&bmOther==NULL) {
|
if (pbmOther==NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if other brush has more than one sector
|
// if other brush has more than one sector
|
||||||
if (bmOther.bm_abscSectors.Count()>1) {
|
if (pbmOther->bm_abscSectors.Count()>1) {
|
||||||
// join all sectors of the other brush together
|
// join all sectors of the other brush together
|
||||||
CBrushSectorSelection selbscOtherAll;
|
CBrushSectorSelection selbscOtherAll;
|
||||||
bmOther.SelectAllSectors(selbscOtherAll);
|
pbmOther->SelectAllSectors(selbscOtherAll);
|
||||||
woOther.JoinSectors(selbscOtherAll);
|
woOther.JoinSectors(selbscOtherAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,15 +380,15 @@ void CWorld::SplitSectors(CEntity &enThis, CBrushSectorSelection &selbscSectorsT
|
||||||
AssureFPT_53();
|
AssureFPT_53();
|
||||||
|
|
||||||
// get relevant brush mip in this brush
|
// get relevant brush mip in this brush
|
||||||
CBrushMip &bmThis = *GetBrushMip(enThis);
|
CBrushMip *pbmThis = GetBrushMip(enThis);
|
||||||
if (&bmThis==NULL) {
|
if (pbmThis==NULL) {
|
||||||
_pfWorldEditingProfile.StopTimer(CWorldEditingProfile::PTI_CSGTOTAL);
|
_pfWorldEditingProfile.StopTimer(CWorldEditingProfile::PTI_CSGTOTAL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get relevant brush mip in other brush
|
// get relevant brush mip in other brush
|
||||||
CBrushMip &bmOther = *GetBrushMip(enOther);
|
CBrushMip *pbmOther = GetBrushMip(enOther);
|
||||||
if (&bmOther==NULL) {
|
if (pbmOther==NULL) {
|
||||||
_pfWorldEditingProfile.StopTimer(CWorldEditingProfile::PTI_CSGTOTAL);
|
_pfWorldEditingProfile.StopTimer(CWorldEditingProfile::PTI_CSGTOTAL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -396,10 +396,10 @@ void CWorld::SplitSectors(CEntity &enThis, CBrushSectorSelection &selbscSectorsT
|
||||||
/* Assure that the other brush has only one sector. */
|
/* Assure that the other brush has only one sector. */
|
||||||
|
|
||||||
// if other brush has more than one sector
|
// if other brush has more than one sector
|
||||||
if (bmOther.bm_abscSectors.Count()>1) {
|
if (pbmOther->bm_abscSectors.Count()>1) {
|
||||||
// join all sectors of the other brush together
|
// join all sectors of the other brush together
|
||||||
CBrushSectorSelection selbscOtherAll;
|
CBrushSectorSelection selbscOtherAll;
|
||||||
bmOther.SelectAllSectors(selbscOtherAll);
|
pbmOther->SelectAllSectors(selbscOtherAll);
|
||||||
woOther.JoinSectors(selbscOtherAll);
|
woOther.JoinSectors(selbscOtherAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,7 +407,7 @@ void CWorld::SplitSectors(CEntity &enThis, CBrushSectorSelection &selbscSectorsT
|
||||||
|
|
||||||
// get the sector of the other brush to object
|
// get the sector of the other brush to object
|
||||||
CBrushSectorSelectionForCSG selbscOther;
|
CBrushSectorSelectionForCSG selbscOther;
|
||||||
bmOther.SelectAllSectors(selbscOther);
|
pbmOther->SelectAllSectors(selbscOther);
|
||||||
CObject3D obOther;
|
CObject3D obOther;
|
||||||
DOUBLEaabbox3D boxOther;
|
DOUBLEaabbox3D boxOther;
|
||||||
woOther.CopySourceBrushSectorsToObject(enOther, selbscOther, plOther,
|
woOther.CopySourceBrushSectorsToObject(enOther, selbscOther, plOther,
|
||||||
|
@ -416,7 +416,7 @@ void CWorld::SplitSectors(CEntity &enThis, CBrushSectorSelection &selbscSectorsT
|
||||||
// if the selection is empty
|
// if the selection is empty
|
||||||
if (selbscSectorsToSplit.Count()==0) {
|
if (selbscSectorsToSplit.Count()==0) {
|
||||||
// select all sectors near the splitting tool
|
// select all sectors near the splitting tool
|
||||||
bmThis.SelectSectorsInRange(selbscSectorsToSplit, DOUBLEtoFLOAT(boxOther));
|
pbmThis->SelectSectorsInRange(selbscSectorsToSplit, DOUBLEtoFLOAT(boxOther));
|
||||||
}
|
}
|
||||||
// for all sectors in the selection
|
// for all sectors in the selection
|
||||||
FOREACHINDYNAMICCONTAINER(selbscSectorsToSplit, CBrushSector, itbsc) {
|
FOREACHINDYNAMICCONTAINER(selbscSectorsToSplit, CBrushSector, itbsc) {
|
||||||
|
@ -426,7 +426,7 @@ void CWorld::SplitSectors(CEntity &enThis, CBrushSectorSelection &selbscSectorsT
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the bounding boxes of this brush
|
// update the bounding boxes of this brush
|
||||||
bmThis.bm_pbrBrush->CalculateBoundingBoxes();
|
pbmThis->bm_pbrBrush->CalculateBoundingBoxes();
|
||||||
// find possible shadow layers near affected area
|
// find possible shadow layers near affected area
|
||||||
FindShadowLayers(DOUBLEtoFLOAT(boxOther));
|
FindShadowLayers(DOUBLEtoFLOAT(boxOther));
|
||||||
|
|
||||||
|
@ -574,8 +574,8 @@ void CWorld::SplitPolygons(CEntity &enThis, CBrushPolygonSelection &selbpoPolygo
|
||||||
_pfWorldEditingProfile.IncrementAveragingCounter();
|
_pfWorldEditingProfile.IncrementAveragingCounter();
|
||||||
|
|
||||||
// get relevant brush mip in other brush
|
// get relevant brush mip in other brush
|
||||||
CBrushMip &bmOther = *GetBrushMip(enOther);
|
CBrushMip *pbmOther = GetBrushMip(enOther);
|
||||||
if (&bmOther==NULL) {
|
if (pbmOther==NULL) {
|
||||||
_pfWorldEditingProfile.StopTimer(CWorldEditingProfile::PTI_CSGTOTAL);
|
_pfWorldEditingProfile.StopTimer(CWorldEditingProfile::PTI_CSGTOTAL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -596,7 +596,7 @@ void CWorld::SplitPolygons(CEntity &enThis, CBrushPolygonSelection &selbpoPolygo
|
||||||
|
|
||||||
// get the sector of the other brush to object
|
// get the sector of the other brush to object
|
||||||
CBrushSectorSelectionForCSG selbscOther;
|
CBrushSectorSelectionForCSG selbscOther;
|
||||||
bmOther.SelectAllSectors(selbscOther);
|
pbmOther->SelectAllSectors(selbscOther);
|
||||||
CObject3D obOther;
|
CObject3D obOther;
|
||||||
DOUBLEaabbox3D boxOther;
|
DOUBLEaabbox3D boxOther;
|
||||||
woOther.CopySourceBrushSectorsToObject(enOther, selbscOther, plOther,
|
woOther.CopySourceBrushSectorsToObject(enOther, selbscOther, plOther,
|
||||||
|
|
|
@ -344,7 +344,7 @@ functions:
|
||||||
GetNormalComponent( vDistance/fDistance, vHitNormal, ese.vDirection);
|
GetNormalComponent( vDistance/fDistance, vHitNormal, ese.vDirection);
|
||||||
FLOAT fLength = ese.vDirection.Length();
|
FLOAT fLength = ese.vDirection.Length();
|
||||||
fLength = Clamp( fLength*3, 1.0f, 3.0f);
|
fLength = Clamp( fLength*3, 1.0f, 3.0f);
|
||||||
fDistance = Clamp( log10(fDistance), 0.5f, 2.0f);
|
fDistance = Clamp( log10f(fDistance), 0.5f, 2.0f);
|
||||||
ese.vStretch = FLOAT3D( fDistance, fLength*fDistance, 1.0f);
|
ese.vStretch = FLOAT3D( fDistance, fLength*fDistance, 1.0f);
|
||||||
SpawnEffect(vHitPoint, ese);
|
SpawnEffect(vHitPoint, ese);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,8 +35,9 @@ CPathNode::~CPathNode(void)
|
||||||
// get name of this node
|
// get name of this node
|
||||||
const CTString &CPathNode::GetName(void)
|
const CTString &CPathNode::GetName(void)
|
||||||
{
|
{
|
||||||
|
ASSERT(this!=NULL);
|
||||||
static CTString strNone="<none>";
|
static CTString strNone="<none>";
|
||||||
if (this==NULL || pn_pnmMarker==NULL) {
|
if (pn_pnmMarker==NULL) {
|
||||||
return strNone;
|
return strNone;
|
||||||
} else {
|
} else {
|
||||||
return pn_pnmMarker->GetName();
|
return pn_pnmMarker->GetName();
|
||||||
|
@ -46,7 +47,8 @@ const CTString &CPathNode::GetName(void)
|
||||||
// get link with given index or null if no more (for iteration along the graph)
|
// get link with given index or null if no more (for iteration along the graph)
|
||||||
CPathNode *CPathNode::GetLink(INDEX i)
|
CPathNode *CPathNode::GetLink(INDEX i)
|
||||||
{
|
{
|
||||||
if (this==NULL || pn_pnmMarker==NULL) {
|
ASSERT(this!=NULL);
|
||||||
|
if (pn_pnmMarker==NULL) {
|
||||||
ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4588,7 +4588,7 @@ void TeleportPlayer(enum WorldLinkType EwltType)
|
||||||
TIME tmLevelTime = _pTimer->CurrentTick()-m_tmLevelStarted;
|
TIME tmLevelTime = _pTimer->CurrentTick()-m_tmLevelStarted;
|
||||||
m_psLevelStats.ps_tmTime = tmLevelTime;
|
m_psLevelStats.ps_tmTime = tmLevelTime;
|
||||||
m_psGameStats.ps_tmTime += tmLevelTime;
|
m_psGameStats.ps_tmTime += tmLevelTime;
|
||||||
FLOAT fTimeDelta = ClampDn(floor(m_tmEstTime)-floor(tmLevelTime), 0.0f);
|
FLOAT fTimeDelta = ClampDn(floorf(m_tmEstTime)-floorf(tmLevelTime), 0.0f);
|
||||||
m_iTimeScore = floor(fTimeDelta*100.0f);
|
m_iTimeScore = floor(fTimeDelta*100.0f);
|
||||||
m_psLevelStats.ps_iScore+=m_iTimeScore;
|
m_psLevelStats.ps_iScore+=m_iTimeScore;
|
||||||
m_psGameStats.ps_iScore+=m_iTimeScore;
|
m_psGameStats.ps_iScore+=m_iTimeScore;
|
||||||
|
|
|
@ -386,7 +386,7 @@ void SpawnHitTypeEffect(CEntity *pen, enum BulletHitType bhtType, BOOL bSound, F
|
||||||
GetNormalComponent( vDistance/fDistance, vHitNormal, ese.vDirection);
|
GetNormalComponent( vDistance/fDistance, vHitNormal, ese.vDirection);
|
||||||
FLOAT fLength = ese.vDirection.Length();
|
FLOAT fLength = ese.vDirection.Length();
|
||||||
fLength = Clamp( fLength*3, 1.0f, 3.0f);
|
fLength = Clamp( fLength*3, 1.0f, 3.0f);
|
||||||
fDistance = Clamp( log10(fDistance), 0.5f, 2.0f);
|
fDistance = Clamp( log10f(fDistance), 0.5f, 2.0f);
|
||||||
ese.vStretch = FLOAT3D( fDistance, fLength*fDistance, 1.0f);
|
ese.vStretch = FLOAT3D( fDistance, fLength*fDistance, 1.0f);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -527,7 +527,7 @@ void Particles_ViewerLocal(CEntity *penView)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ASSERT("Unknown environment particle type!");
|
ASSERTALWAYS("Unknown environment particle type!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// for those EPHs that are not rendered, clear possible
|
// for those EPHs that are not rendered, clear possible
|
||||||
|
|
|
@ -50,8 +50,9 @@ CPathNode::~CPathNode(void)
|
||||||
// get name of this node
|
// get name of this node
|
||||||
const CTString &CPathNode::GetName(void)
|
const CTString &CPathNode::GetName(void)
|
||||||
{
|
{
|
||||||
|
ASSERT(this!=NULL);
|
||||||
static CTString strNone="<none>";
|
static CTString strNone="<none>";
|
||||||
if (this==NULL || pn_pnmMarker==NULL) {
|
if (pn_pnmMarker==NULL) {
|
||||||
return strNone;
|
return strNone;
|
||||||
} else {
|
} else {
|
||||||
return pn_pnmMarker->GetName();
|
return pn_pnmMarker->GetName();
|
||||||
|
@ -61,10 +62,7 @@ const CTString &CPathNode::GetName(void)
|
||||||
// get link with given index or null if no more (for iteration along the graph)
|
// get link with given index or null if no more (for iteration along the graph)
|
||||||
CPathNode *CPathNode::GetLink(INDEX i)
|
CPathNode *CPathNode::GetLink(INDEX i)
|
||||||
{
|
{
|
||||||
if (this==NULL || pn_pnmMarker==NULL) {
|
ASSERT(this!=NULL && pn_pnmMarker!=NULL);
|
||||||
ASSERT(FALSE);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
CNavigationMarker *pnm = pn_pnmMarker->GetLink(i);
|
CNavigationMarker *pnm = pn_pnmMarker->GetLink(i);
|
||||||
if (pnm==NULL) {
|
if (pnm==NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -99,7 +99,7 @@ functions:
|
||||||
} else if (m_gtType==GT_COMMANDER) {
|
} else if (m_gtType==GT_COMMANDER) {
|
||||||
return &eiGruntSoldier;
|
return &eiGruntSoldier;
|
||||||
} else {
|
} else {
|
||||||
ASSERT("Unknown grunt type!");
|
ASSERTALWAYS("Unknown grunt type!");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -280,7 +280,7 @@ functions:
|
||||||
} else if (m_gtType==GT_COMMANDER) {
|
} else if (m_gtType==GT_COMMANDER) {
|
||||||
return &eiGruntSoldier;
|
return &eiGruntSoldier;
|
||||||
} else {
|
} else {
|
||||||
ASSERT("Unknown grunt type!");
|
ASSERTALWAYS("Unknown grunt type!");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -5381,7 +5381,7 @@ functions:
|
||||||
TIME tmLevelTime = _pTimer->CurrentTick()-m_tmLevelStarted;
|
TIME tmLevelTime = _pTimer->CurrentTick()-m_tmLevelStarted;
|
||||||
m_psLevelStats.ps_tmTime = tmLevelTime;
|
m_psLevelStats.ps_tmTime = tmLevelTime;
|
||||||
m_psGameStats.ps_tmTime += tmLevelTime;
|
m_psGameStats.ps_tmTime += tmLevelTime;
|
||||||
FLOAT fTimeDelta = ClampDn(floor(m_tmEstTime)-floor(tmLevelTime), 0.0f);
|
FLOAT fTimeDelta = ClampDn(floorf(m_tmEstTime)-floorf(tmLevelTime), 0.0f);
|
||||||
m_iTimeScore = (INDEX) floor(fTimeDelta*100.0f);
|
m_iTimeScore = (INDEX) floor(fTimeDelta*100.0f);
|
||||||
m_psLevelStats.ps_iScore+=m_iTimeScore;
|
m_psLevelStats.ps_iScore+=m_iTimeScore;
|
||||||
m_psGameStats.ps_iScore+=m_iTimeScore;
|
m_psGameStats.ps_iScore+=m_iTimeScore;
|
||||||
|
|
|
@ -3442,7 +3442,7 @@ functions:
|
||||||
return (WeaponType)i;
|
return (WeaponType)i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ASSERT("Non-existant weapon in remap array!");
|
ASSERTALWAYS("Non-existant weapon in remap array!");
|
||||||
return (WeaponType)0;
|
return (WeaponType)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -618,7 +618,7 @@ functions:
|
||||||
pen = &m_penGroup03Template01;
|
pen = &m_penGroup03Template01;
|
||||||
iCount = IRnd()%m_iGroup03Count+1;
|
iCount = IRnd()%m_iGroup03Count+1;
|
||||||
} else {
|
} else {
|
||||||
ASSERT("Invalid group!");
|
ASSERTALWAYS("Invalid group!");
|
||||||
iCount = 0; // DG: this should have a deterministic value in case this happens after all!
|
iCount = 0; // DG: this should have a deterministic value in case this happens after all!
|
||||||
}
|
}
|
||||||
ASSERT(iCount>0);
|
ASSERT(iCount>0);
|
||||||
|
@ -627,7 +627,7 @@ functions:
|
||||||
while (iCount>0)
|
while (iCount>0)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
while (&*pen[i]==NULL) {
|
while (pen[i].get()==NULL) {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
iCount--;
|
iCount--;
|
||||||
|
@ -1337,17 +1337,17 @@ procedures:
|
||||||
m_iGroup01Count = 0;
|
m_iGroup01Count = 0;
|
||||||
pen = &m_penGroup01Template01;
|
pen = &m_penGroup01Template01;
|
||||||
for (i=0; i<SUMMONER_TEMP_PER_GROUP; i++) {
|
for (i=0; i<SUMMONER_TEMP_PER_GROUP; i++) {
|
||||||
if (&*pen[i]!=NULL) { m_iGroup01Count++; }
|
if (pen[i].get()!=NULL) { m_iGroup01Count++; }
|
||||||
}
|
}
|
||||||
m_iGroup02Count = 0;
|
m_iGroup02Count = 0;
|
||||||
pen = &m_penGroup02Template01;
|
pen = &m_penGroup02Template01;
|
||||||
for (i=0; i<SUMMONER_TEMP_PER_GROUP; i++) {
|
for (i=0; i<SUMMONER_TEMP_PER_GROUP; i++) {
|
||||||
if (&*pen[i]!=NULL) { m_iGroup02Count++; }
|
if (pen[i].get()!=NULL) { m_iGroup02Count++; }
|
||||||
}
|
}
|
||||||
m_iGroup03Count = 0;
|
m_iGroup03Count = 0;
|
||||||
pen = &m_penGroup03Template01;
|
pen = &m_penGroup03Template01;
|
||||||
for (i=0; i<SUMMONER_TEMP_PER_GROUP; i++) {
|
for (i=0; i<SUMMONER_TEMP_PER_GROUP; i++) {
|
||||||
if (&*pen[i]!=NULL) { m_iGroup03Count++; }
|
if (pen[i].get()!=NULL) { m_iGroup03Count++; }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DoSafetyChecks()) {
|
if (!DoSafetyChecks()) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ INDEX CDlgPgInfoAttachingPlacement::GetCurrentAttachingPlacement(void)
|
||||||
void CDlgPgInfoAttachingPlacement::SetPlacementReferenceVertex(INDEX iCenter, INDEX iFront, INDEX iUp)
|
void CDlgPgInfoAttachingPlacement::SetPlacementReferenceVertex(INDEX iCenter, INDEX iFront, INDEX iUp)
|
||||||
{
|
{
|
||||||
// patch for calling before page is refreshed
|
// patch for calling before page is refreshed
|
||||||
if(this == NULL) return;
|
ASSERT(this!=NULL);
|
||||||
CModelerView *pModelerView = CModelerView::GetActiveView();
|
CModelerView *pModelerView = CModelerView::GetActiveView();
|
||||||
if(pModelerView == NULL) return;
|
if(pModelerView == NULL) return;
|
||||||
CModelerDoc* pDoc = pModelerView->GetDocument();
|
CModelerDoc* pDoc = pModelerView->GetDocument();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user