Skip to content

Commit

Permalink
add asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
drug007 authored and eagleivg committed Nov 6, 2018
1 parent 2a21afc commit b49e03a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Layers/xrRenderPC_GL/rgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ void CRender::OnFrame()
if (ps_r2_ls_flags.test(R2FLAG_EXP_MT_CALC))
{
// MT-details (@front)
assert (Details);
Device.seqParallel.insert(Device.seqParallel.begin(),
fastdelegate::FastDelegate0<>(Details, &CDetailManager::MT_CALC));

Expand Down
7 changes: 6 additions & 1 deletion src/xrCore/fastdelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#endif // _MSC_VER > 1000

#include <memory.h> // to allow <,> comparisons
#include <cassert>

//////////////////////////////////////////////////
#define xr_stdcall __stdcall
Expand Down Expand Up @@ -969,7 +970,11 @@ class FastDelegate0
m_Closure.bindstaticfunc(this, &FastDelegate0::InvokeStaticFunction, function_to_bind);
}
// Invoke the delegate
RetType operator()() const { return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(); }
RetType operator()() const {
assert (m_Closure.GetClosureThis());
assert (m_Closure.GetClosureMemPtr());
return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))();
}
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct
Expand Down
4 changes: 4 additions & 0 deletions src/xrGame/Level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,10 @@ void CLevel::OnFrame()
if (!GEnv.isDedicatedServer)
{
if (g_mt_config.test(mtMap))
{
assert(m_map_manager);
Device.seqParallel.push_back(fastdelegate::FastDelegate0<>(m_map_manager, &CMapManager::Update));
}
else
MapManager().Update();
if (IsGameTypeSingle() && Device.dwPrecacheFrame == 0)
Expand Down Expand Up @@ -549,6 +552,7 @@ void CLevel::OnFrame()
{
if (g_mt_config.test(mtLevelSounds))
{
assert(m_level_sound_manager);
Device.seqParallel.push_back(
fastdelegate::FastDelegate0<>(m_level_sound_manager, &CLevelSoundManager::Update));
}
Expand Down
1 change: 1 addition & 0 deletions src/xrGame/ui/UIPdaWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ void CUIPdaWnd::Update()
m_clock->TextItemControl().SetText(
InventoryUtilities::GetGameTimeAsString(InventoryUtilities::etpTimeToMinutes).c_str());

assert(pUILogsWnd);
Device.seqParallel.push_back(fastdelegate::FastDelegate0<>(pUILogsWnd, &CUILogsWnd::PerformWork));
}

Expand Down

0 comments on commit b49e03a

Please sign in to comment.