Skip to content

Commit

Permalink
Code cleanup and warnings fixes
Browse files Browse the repository at this point in the history
Thanks to Im-Dex
Something taken from commits
Im-dex/xray-162@6632fec
Im-dex/xray-162@62639aa
  • Loading branch information
Xottab-DUTY committed Aug 13, 2017
1 parent 0fe94e6 commit 011430b
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 83 deletions.
7 changes: 4 additions & 3 deletions src/Layers/xrRenderDX10/dx10ResourceManager_Scripting.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "stdafx.h"
#pragma hdrstop

#include "xrEngine/Render.h"
#include "Layers/xrRender/ResourceManager.h"
Expand All @@ -24,21 +23,23 @@ class adopt_dx10options
public:
bool _dx10_msaa_alphatest_atoc()
{
return (RImplementation.o.dx10_msaa_alphatest == CRender::MSAA_ATEST_DX10_0_ATOC);
return RImplementation.o.dx10_msaa_alphatest == CRender::MSAA_ATEST_DX10_0_ATOC;
}
};

// wrapper
class adopt_dx10sampler
{
CBlender_Compile* m_pC;
u32 m_SI; // Sampler index
u32 m_SI; // Sampler index

public:
adopt_dx10sampler(CBlender_Compile* C, u32 SamplerIndex) : m_pC(C), m_SI(SamplerIndex)
{
if (u32(-1) == m_SI)
m_pC = 0;
}

adopt_dx10sampler(const adopt_dx10sampler& _C) : m_pC(_C.m_pC), m_SI(_C.m_SI)
{
if (u32(-1) == m_SI)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/xrLCUtil/xrLCUtil.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\Externals\zlib.vcxproj">
<ProjectReference Include="..\..\..\Externals\zlib.vcxproj">
<Project>{745dec58-ebb3-47a9-a9b8-4c6627c01bf8}</Project>
</ProjectReference>
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/utils/xrMiscMath/quaternion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
template <class T>
_quaternion<T>& _quaternion<T>::set(const _matrix<T>& M)
{
float trace, s;
auto s = T(0);

trace = M._11 + M._22 + M._33;
float trace = M._11 + M._22 + M._33;
if (trace > 0.0f)
{
s = _sqrt(trace + 1.0f);
Expand Down
26 changes: 11 additions & 15 deletions src/xrCDB/ISpatial.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#ifndef XRENGINE_ISPATIAL_H_INCLUDED
#define XRENGINE_ISPATIAL_H_INCLUDED

//#pragma once
#include "Common/Platform.hpp"
#include "xrCore/xrPool.h"
//#include "xr_collide_defs.h"
Expand Down Expand Up @@ -133,10 +133,10 @@ class XRCDB_API SpatialBase : public virtual ISpatial
spatial_updatesector_internal();
}

virtual IGameObject* dcast_GameObject() override { return 0; }
virtual Feel::Sound* dcast_FeelSound() override { return 0; }
virtual IRenderable* dcast_Renderable() override { return 0; }
virtual IRender_Light* dcast_Light() override { return 0; }
virtual IGameObject* dcast_GameObject() override { return nullptr; }
virtual Feel::Sound* dcast_FeelSound() override { return nullptr; }
virtual IRenderable* dcast_Renderable() override { return nullptr; }
virtual IRender_Light* dcast_Light() override { return nullptr; }
SpatialBase(ISpatial_DB* space);
virtual ~SpatialBase();
};
Expand All @@ -145,31 +145,28 @@ class XRCDB_API SpatialBase : public virtual ISpatial
// class ISpatial_NODE;
class ISpatial_NODE
{
public:
typedef _W64 unsigned ptrt;

public:
ISpatial_NODE* parent; // parent node for "empty-members" optimization
ISpatial_NODE* children[8]; // children nodes
xr_vector<ISpatial*> items; // own items
public:

void _init(ISpatial_NODE* _parent);
void _remove(ISpatial* _S);
void _insert(ISpatial* _S);
BOOL _empty()
bool _empty()
{
return items.empty() &&
(0 == (ptrt(children[0]) | ptrt(children[1]) | ptrt(children[2]) | ptrt(children[3]) | ptrt(children[4]) |
ptrt(children[5]) | ptrt(children[6]) | ptrt(children[7])));
0 == (intptr_t(children[0]) | intptr_t(children[1]) | intptr_t(children[2]) | intptr_t(children[3]) | intptr_t(children[4]) |
intptr_t(children[5]) | intptr_t(children[6]) | intptr_t(children[7]));
}
};
////////////

// template <class T, int granularity>
// class poolSS;
// class poolSS;
#ifndef DLL_API
#define DLL_API XR_IMPORT
#endif // #ifndef DLL_API
#endif // #ifndef DLL_API

//////////////////////////////////////////////////////////////////////////
class XRCDB_API ISpatial_DB
Expand Down Expand Up @@ -260,7 +257,6 @@ class XRCDB_API ISpatial_DB
void update(u32 nodes = 8);
BOOL verify();

public:
enum
{
O_ONLYFIRST = (1 << 0),
Expand Down
4 changes: 2 additions & 2 deletions src/xrCore/PPMd.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
extern "C" {
#endif

BOOL _STDCALL StartSubAllocator(UINT SubAllocatorSize);
bool _STDCALL StartSubAllocator(UINT SubAllocatorSize);
void _STDCALL StopSubAllocator(); /* it can be called once */
DWORD _STDCALL GetUsedMemory(); /* for information only */
size_t _STDCALL GetUsedMemory(); /* for information only */

/****************************************************************************
* Method of model restoration at memory insufficiency: *
Expand Down
Loading

0 comments on commit 011430b

Please sign in to comment.