Skip to content

Commit 011430b

Browse files
committed
Code cleanup and warnings fixes
Thanks to Im-Dex Something taken from commits Im-dex/xray-162@6632fec Im-dex/xray-162@62639aa
1 parent 0fe94e6 commit 011430b

File tree

13 files changed

+115
-83
lines changed

13 files changed

+115
-83
lines changed

src/Layers/xrRenderDX10/dx10ResourceManager_Scripting.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "stdafx.h"
2-
#pragma hdrstop
32

43
#include "xrEngine/Render.h"
54
#include "Layers/xrRender/ResourceManager.h"
@@ -24,21 +23,23 @@ class adopt_dx10options
2423
public:
2524
bool _dx10_msaa_alphatest_atoc()
2625
{
27-
return (RImplementation.o.dx10_msaa_alphatest == CRender::MSAA_ATEST_DX10_0_ATOC);
26+
return RImplementation.o.dx10_msaa_alphatest == CRender::MSAA_ATEST_DX10_0_ATOC;
2827
}
2928
};
3029

3130
// wrapper
3231
class adopt_dx10sampler
3332
{
3433
CBlender_Compile* m_pC;
35-
u32 m_SI; // Sampler index
34+
u32 m_SI; // Sampler index
35+
3636
public:
3737
adopt_dx10sampler(CBlender_Compile* C, u32 SamplerIndex) : m_pC(C), m_SI(SamplerIndex)
3838
{
3939
if (u32(-1) == m_SI)
4040
m_pC = 0;
4141
}
42+
4243
adopt_dx10sampler(const adopt_dx10sampler& _C) : m_pC(_C.m_pC), m_SI(_C.m_SI)
4344
{
4445
if (u32(-1) == m_SI)

src/utils/xrLCUtil/xrLCUtil.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
300300
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
301301
</ProjectReference>
302-
<ProjectReference Include="..\..\Externals\zlib.vcxproj">
302+
<ProjectReference Include="..\..\..\Externals\zlib.vcxproj">
303303
<Project>{745dec58-ebb3-47a9-a9b8-4c6627c01bf8}</Project>
304304
</ProjectReference>
305305
</ItemGroup>

src/utils/xrMiscMath/quaternion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
template <class T>
1010
_quaternion<T>& _quaternion<T>::set(const _matrix<T>& M)
1111
{
12-
float trace, s;
12+
auto s = T(0);
1313

14-
trace = M._11 + M._22 + M._33;
14+
float trace = M._11 + M._22 + M._33;
1515
if (trace > 0.0f)
1616
{
1717
s = _sqrt(trace + 1.0f);

src/xrCDB/ISpatial.h

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
#pragma once
12
#ifndef XRENGINE_ISPATIAL_H_INCLUDED
23
#define XRENGINE_ISPATIAL_H_INCLUDED
34

4-
//#pragma once
55
#include "Common/Platform.hpp"
66
#include "xrCore/xrPool.h"
77
//#include "xr_collide_defs.h"
@@ -133,10 +133,10 @@ class XRCDB_API SpatialBase : public virtual ISpatial
133133
spatial_updatesector_internal();
134134
}
135135

136-
virtual IGameObject* dcast_GameObject() override { return 0; }
137-
virtual Feel::Sound* dcast_FeelSound() override { return 0; }
138-
virtual IRenderable* dcast_Renderable() override { return 0; }
139-
virtual IRender_Light* dcast_Light() override { return 0; }
136+
virtual IGameObject* dcast_GameObject() override { return nullptr; }
137+
virtual Feel::Sound* dcast_FeelSound() override { return nullptr; }
138+
virtual IRenderable* dcast_Renderable() override { return nullptr; }
139+
virtual IRender_Light* dcast_Light() override { return nullptr; }
140140
SpatialBase(ISpatial_DB* space);
141141
virtual ~SpatialBase();
142142
};
@@ -145,31 +145,28 @@ class XRCDB_API SpatialBase : public virtual ISpatial
145145
// class ISpatial_NODE;
146146
class ISpatial_NODE
147147
{
148-
public:
149-
typedef _W64 unsigned ptrt;
150-
151148
public:
152149
ISpatial_NODE* parent; // parent node for "empty-members" optimization
153150
ISpatial_NODE* children[8]; // children nodes
154151
xr_vector<ISpatial*> items; // own items
155-
public:
152+
156153
void _init(ISpatial_NODE* _parent);
157154
void _remove(ISpatial* _S);
158155
void _insert(ISpatial* _S);
159-
BOOL _empty()
156+
bool _empty()
160157
{
161158
return items.empty() &&
162-
(0 == (ptrt(children[0]) | ptrt(children[1]) | ptrt(children[2]) | ptrt(children[3]) | ptrt(children[4]) |
163-
ptrt(children[5]) | ptrt(children[6]) | ptrt(children[7])));
159+
0 == (intptr_t(children[0]) | intptr_t(children[1]) | intptr_t(children[2]) | intptr_t(children[3]) | intptr_t(children[4]) |
160+
intptr_t(children[5]) | intptr_t(children[6]) | intptr_t(children[7]));
164161
}
165162
};
166163
////////////
167164

168165
// template <class T, int granularity>
169-
// class poolSS;
166+
// class poolSS;
170167
#ifndef DLL_API
171168
#define DLL_API XR_IMPORT
172-
#endif // #ifndef DLL_API
169+
#endif // #ifndef DLL_API
173170

174171
//////////////////////////////////////////////////////////////////////////
175172
class XRCDB_API ISpatial_DB
@@ -260,7 +257,6 @@ class XRCDB_API ISpatial_DB
260257
void update(u32 nodes = 8);
261258
BOOL verify();
262259

263-
public:
264260
enum
265261
{
266262
O_ONLYFIRST = (1 << 0),

src/xrCore/PPMd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
extern "C" {
1616
#endif
1717

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

2222
/****************************************************************************
2323
* Method of model restoration at memory insufficiency: *

0 commit comments

Comments
 (0)