Skip to content

Commit c101668

Browse files
committed
ECore: future proofing WIP
1 parent f810e12 commit c101668

19 files changed

+69
-58
lines changed

src/Common/CommonImportExport.inl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
#define XRCORE_API XR_IMPORT
3030
#endif
3131

32+
#ifdef XRECORE_EXPORTS
33+
#define XRECORE_API XR_EXPORT
34+
#else
35+
#define XRECORE_API XR_IMPORT
36+
#endif
37+
3238
#ifdef XRGAMESPY_EXPORTS
3339
#define XRGAMESPY_API XR_EXPORT
3440
#else

src/Common/NvMender2003/NVMeshMender.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class MeshMender
108108
FVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX3 | D3DFVF_TEXCOORDSIZE2(0) | D3DFVF_TEXCOORDSIZE3(1) |
109109
D3DFVF_TEXCOORDSIZE3(2)
110110
};
111-
Vertex::Vertex() :
111+
Vertex() :
112112
pos(0.0f, 0.0f, 0.0f), normal(0.0f, 0.0f, 0.0f), s(0.0f), t(0.0f),
113113
tangent(0.0f, 0.0f, 0.0f), binormal(0.0f, 0.0f, 0.0f)
114114
{}

src/Common/NvMender2003/mender_input_output.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static void fill_mender_input(const xr_vector<type_vertex>& vertices, const xr_v
3131
for (u32 i = 0; i < vertices_number; ++i)
3232
set_vertex(theVerts[i], vertices[i]);
3333
// fill inputs (indices)
34-
for (xr_vector<type_face>::const_iterator face_it = faces.begin(); face_it!=faces.end(); face_it++)
34+
for (auto face_it = faces.cbegin(); face_it!=faces.cend(); ++face_it)
3535
add_face(theIndices, *face_it);
3636
}
3737

@@ -45,7 +45,7 @@ static void retrive_data_from_mender_otput(xr_vector<type_vertex>& vertices, //
4545
old_vertices.clear();
4646
// save old vertices to retrive through mappingNewToOldVert data that missing in MeshMender::Vertex
4747
old_vertices = vertices;
48-
// retriving data
48+
// retrieving data
4949
const u32 face_count = faces.size();
5050
for (u32 i = 0; i < face_count; ++i)
5151
set_face(faces[i], theIndices[3*i + 0], theIndices[3*i + 1], theIndices[3*i + 2]);

src/editors/ECore/ECore.vcxproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<ItemDefinitionGroup>
5555
<ClCompile>
5656
<PreprocessorDefinitions>EDITOR;_EDITOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
57+
<AdditionalIncludeDirectories>$(ProjectDir)Editor;$(ProjectDir)Engine;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
5758
</ClCompile>
5859
</ItemDefinitionGroup>
5960
<ItemGroup>
@@ -75,7 +76,6 @@
7576
<ClInclude Include="Editor\ELog.h" />
7677
<ClInclude Include="Editor\engine.h" />
7778
<ClInclude Include="Editor\EStats.h" />
78-
<ClInclude Include="Editor\ETextureParams.h" />
7979
<ClInclude Include="Editor\EThumbnail.h" />
8080
<ClInclude Include="Editor\ExportObjectOGF.h" />
8181
<ClInclude Include="Editor\ExportSkeleton.h" />
@@ -115,7 +115,6 @@
115115
<ClInclude Include="stdafx.h" />
116116
</ItemGroup>
117117
<ItemGroup>
118-
<ClCompile Include="Editor\bone.cpp" />
119118
<ClCompile Include="Editor\BoneEditor.cpp" />
120119
<ClCompile Include="Editor\ColorPicker.cpp" />
121120
<ClCompile Include="Editor\c_dinput.cpp" />
@@ -144,7 +143,6 @@
144143
<ClCompile Include="Editor\ELog.cpp" />
145144
<ClCompile Include="Editor\Engine.cpp" />
146145
<ClCompile Include="Editor\EStats.cpp" />
147-
<ClCompile Include="Editor\ETextureParams.cpp" />
148146
<ClCompile Include="Editor\EThumbnail.cpp" />
149147
<ClCompile Include="Editor\EThumbnailGroup.cpp" />
150148
<ClCompile Include="Editor\EThumbnailObject.cpp" />
@@ -185,6 +183,11 @@
185183
<PrecompiledHeader>Create</PrecompiledHeader>
186184
</ClCompile>
187185
</ItemGroup>
186+
<ItemGroup>
187+
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
188+
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
189+
</ProjectReference>
190+
</ItemGroup>
188191
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
189192
<ImportGroup Label="ExtensionTargets">
190193
</ImportGroup>

src/editors/ECore/ECore.vcxproj.filters

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@
6464
<ClInclude Include="Editor\EStats.h">
6565
<Filter>editor</Filter>
6666
</ClInclude>
67-
<ClInclude Include="Editor\ETextureParams.h">
68-
<Filter>editor</Filter>
69-
</ClInclude>
7067
<ClInclude Include="Editor\EThumbnail.h">
7168
<Filter>editor</Filter>
7269
</ClInclude>
@@ -178,9 +175,6 @@
178175
<ClInclude Include="stdafx.h" />
179176
</ItemGroup>
180177
<ItemGroup>
181-
<ClCompile Include="Editor\bone.cpp">
182-
<Filter>editor</Filter>
183-
</ClCompile>
184178
<ClCompile Include="Editor\BoneEditor.cpp">
185179
<Filter>editor</Filter>
186180
</ClCompile>
@@ -265,9 +259,6 @@
265259
<ClCompile Include="Editor\EStats.cpp">
266260
<Filter>editor</Filter>
267261
</ClCompile>
268-
<ClCompile Include="Editor\ETextureParams.cpp">
269-
<Filter>editor</Filter>
270-
</ClCompile>
271262
<ClCompile Include="Editor\EThumbnail.cpp">
272263
<Filter>editor</Filter>
273264
</ClCompile>

src/editors/ECore/Editor/EStats.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
// refs
1010
class CGameFont;
1111

12-
class ENGINE_API CEStats :
13-
14-
public CStatsPhysics
12+
class ENGINE_API CEStats
13+
: public CStats //CStatsPhysics
1514
{
1615
public:
1716
float fFPS, fRFPS, fTPS; // FPS, RenderFPS, TPS

src/editors/ECore/Editor/ETextureParams.cpp

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/editors/ECore/Editor/ETextureParams.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/editors/ECore/Editor/EditorPreferences.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void CCustomPreferences::ApplyValues()
7272

7373
//---------------------------------------------------------------------------
7474

75-
void __stdcall CCustomPreferences::OnClose() { ApplyValues(); }
75+
void CCustomPreferences::OnClose() { ApplyValues(); }
7676
//---------------------------------------------------------------------------
7777

7878
void CheckValidate(ShortcutValue*, const xr_shortcut& new_val, bool& result)

src/editors/ECore/Editor/EditorPreferences.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class ECORE_API CCustomPreferences
6868

6969
protected:
7070
void OnKeyboardCommonFileClick(ButtonValue* value, bool& bModif, bool& bSafe);
71-
void__stdcall OnClose();
71+
void OnClose();
7272
void ApplyValues();
7373

7474
virtual void Load(CInifile*);

src/editors/ECore/Editor/Engine.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "Engine.h"
99
#include "ui_main.h"
1010

11+
/*
1112
CEngine Engine;
1213
1314
//////////////////////////////////////////////////////////////////////
@@ -48,7 +49,7 @@ void CEngine::Initialize(void)
4849
4950
xrBinder* bindCPU = (xrBinder*)GetProcAddress(hPSGP, "xrBind_PSGP");
5051
R_ASSERT(bindCPU);
51-
bindCPU(&PSGP, CPU::ID.feature /*& CPU::ID.os_support*/);
52+
bindCPU(&PSGP, CPU::ID.feature / *& CPU::ID.os_support* /);
5253
// for compliance with editor
5354
PSGP.skin1W = xrSkin1W_x86;
5455
PSGP.skin2W = xrSkin2W_x86;
@@ -75,3 +76,4 @@ void CEngine::Destroy()
7576
hPSGP = 0;
7677
}
7778
}
79+
*/

src/editors/ECore/Editor/UI_Camera.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class ECORE_API CUI_Camera
2424
Fvector m_Target;
2525

2626
protected:
27-
friendclass CEditorRenderDevice;
28-
friendclass TUI;
27+
friend class CEditorRenderDevice;
28+
friend class TUI;
2929

3030
float m_Znear;
3131
float m_Zfar;

src/editors/ECore/Editor/UI_ToolsCustom.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ enum ETFlags
4848

4949
class ECORE_API CToolCustom
5050
{
51-
friendclass CCustomPreferences;
51+
friend class CCustomPreferences;
5252

5353
protected:
5454
bool m_bReady;
@@ -82,7 +82,7 @@ class ECORE_API CToolCustom
8282
u32 dwFogColor;
8383

8484
public:
85-
AnsiString m_LastFileName;
85+
xr_string m_LastFileName;
8686

8787
public:
8888
struct SDebugDraw
@@ -220,21 +220,21 @@ class ECORE_API CToolCustom
220220

221221
virtual void OnShowHint(AStringVec& SS) = 0;
222222

223-
virtual bool__fastcall MouseStart(TShiftState Shift) = 0;
224-
virtual bool__fastcall MouseEnd(TShiftState Shift) = 0;
225-
virtual void__fastcall MouseMove(TShiftState Shift) = 0;
226-
virtual bool__fastcall HiddenMode() { return m_bHiddenMode; }
227-
virtual bool__fastcall KeyDown(WORD Key, TShiftState Shift) { return false; }
228-
virtual bool__fastcall KeyUp(WORD Key, TShiftState Shift) { return false; }
229-
virtual bool__fastcall KeyPress(WORD Key, TShiftState Shift) { return false; }
223+
virtual bool MouseStart(TShiftState Shift) = 0;
224+
virtual bool MouseEnd(TShiftState Shift) = 0;
225+
virtual void MouseMove(TShiftState Shift) = 0;
226+
virtual bool HiddenMode() { return m_bHiddenMode; }
227+
virtual bool KeyDown(WORD Key, TShiftState Shift) { return false; }
228+
virtual bool KeyUp(WORD Key, TShiftState Shift) { return false; }
229+
virtual bool KeyPress(WORD Key, TShiftState Shift) { return false; }
230230
virtual bool Pick(TShiftState Shift) = 0;
231231
virtual bool RayPick(const Fvector& start, const Fvector& dir, float& dist, Fvector* pt = 0, Fvector* n = 0) = 0;
232232

233233
virtual void ShowProperties(LPCSTR focused_item) = 0;
234234
virtual void UpdateProperties(BOOL bForced = FALSE) = 0;
235235
virtual void RefreshProperties() = 0;
236236

237-
const AnsiString& GetEditFileName() { return m_LastFileName; }
237+
const xr_string& GetEditFileName() { return m_LastFileName; }
238238
CEditableObject* m_pAxisMoveObject;
239239
Fmatrix m_axis_xform;
240240

src/editors/ECore/Editor/device.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class ECORE_API CEditorRenderDevice :
9696
// Dependent classes
9797
CResourceManager* Resources;
9898
CEStats* Statistic;
99+
RenderDeviceStatictics stats;
99100

100101
CGameFont* pSystemFont;
101102

@@ -132,6 +133,9 @@ class ECORE_API CEditorRenderDevice :
132133
void ShutDown(void);
133134
void Reset(IReader* F, BOOL bKeepTextures);
134135

136+
const RenderDeviceStatictics& GetStats() const override { return stats; }
137+
void DumpStatistics(class IGameFont& font, class IPerformanceAlert* alert) override {}
138+
135139
IC CTimer* GetTimerGlobal() { return &TimerGlobal; }
136140
IC float GetRenderArea() { return m_RenderArea; }
137141
// Sprite rendering
@@ -175,9 +179,9 @@ class ECORE_API CEditorRenderDevice :
175179
Shader_xrLC_LIB ShaderXRLC;
176180

177181
private:
178-
virtual CStatsPhysics* _BCL StatPhysics() { return Statistic; }
179-
virtual void _BCL AddSeqFrame(pureFrame* f, bool mt) { seqFrame.Add(f, REG_PRIORITY_LOW); }
180-
virtual void _BCL RemoveSeqFrame(pureFrame* f) { seqFrame.Remove(f); }
182+
virtual CStats* StatPhysics() { return Statistic; }
183+
virtual void AddSeqFrame(pureFrame* f, bool mt) { seqFrame.Add(f, REG_PRIORITY_LOW); }
184+
virtual void RemoveSeqFrame(pureFrame* f) { seqFrame.Remove(f); }
181185
};
182186

183187
extern ECORE_API CEditorRenderDevice EDevice;

src/editors/ECore/Editor/engine.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "ELog.h"
1010

11+
/*
1112
class ENGINE_API CEngine
1213
{
1314
HMODULE hPSGP;
@@ -24,5 +25,6 @@ class ENGINE_API CEngine
2425
};
2526
2627
ENGINE_API extern CEngine Engine;
28+
*/
2729

2830
#endif // !defined(AFX_ENGINE_H__22802DD7_D7EB_4234_9781_E237657471AC__INCLUDED_)

src/editors/ECore/Editor/render.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#ifndef renderH
33
#define renderH
44

5-
#include "xrCDB\Frustum.h"
6-
#include "vis_common.h"
5+
#include "xrCDB/Frustum.h"
6+
#include "xrEngine/vis_common.h"
77

88
#include "Layers/xrRender/blenders/Blender.h"
99
#include "Layers/xrRender/blenders/Blender_CLSID.h"
@@ -16,14 +16,14 @@
1616
#include "Include/xrAPI/xrAPI.h"
1717

1818
// definition (Renderer)
19-
class CRenderTarget /*:public IRender_Target*/
19+
class CRenderTarget : public IRender_Target
2020
{
2121
public:
2222
virtual u32 get_width() { return EDevice.dwWidth; }
2323
virtual u32 get_height() { return EDevice.dwHeight; }
2424
};
2525

26-
class IRender
26+
class IERender
2727
{
2828
public:
2929
enum GenerationLevel
@@ -39,9 +39,7 @@ class IRender
3939
virtual GenerationLevel get_generation() = 0;
4040
};
4141

42-
class ECORE_API CRender :
43-
44-
public IRender
42+
class ECORE_API CRender : public IERender
4543
{
4644
CRenderTarget* Target;
4745
Fmatrix current_matrix;

src/editors/ECore/Engine/NVMeshMender.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ class NVMeshMender
209209
DontWeightNormalsByFaceSize
210210
};
211211

212-
bool NVMeshMender::Munge(const NVMeshMender::VAVector& input, NVMeshMender::VAVector& output,
212+
bool Munge(const NVMeshMender::VAVector& input, NVMeshMender::VAVector& output,
213213
const float bSmoothCreaseAngleRadians = 3.141592654f / 3.0f, const float* pTextureMatrix = 0,
214214
const Option _FixTangents = FixTangents, const Option _FixCylindricalTexGen = FixCylindricalTexGen,
215215
const Option _WeightNormalsByFaceSize = WeightNormalsByFaceSize);
216-
bool NVMeshMender::MungeD3DX(const NVMeshMender::VAVector& input, NVMeshMender::VAVector& output,
216+
bool MungeD3DX(const NVMeshMender::VAVector& input, NVMeshMender::VAVector& output,
217217
const float bSmoothCreaseAngleRadians = 3.141592654f / 3.0f, const float* pTextureMatrix = 0,
218218
const Option _FixTangents = FixTangents, const Option _FixCylindricalTexGen = FixCylindricalTexGen,
219219
const Option _WeightNormalsByFaceSize = WeightNormalsByFaceSize);

src/editors/ECore/stdafx.h

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,13 @@ enum TMsgDlgBtn
9898
typedef TMsgDlgBtn TMsgDlgButtons[mbHelp];
9999

100100
// core
101-
#include <xrCore/xrCore.h>
101+
#include "xrCore/xrCore.h"
102+
#include "xrCore/_stl_extensions.h"
103+
#include "xrCore/_types.h"
104+
#include "xrCore/_fbox.h"
105+
#include "xrCommon/xr_vector.h"
106+
#include "xrCore/Animation/Bone.hpp"
107+
#include "xrCore/Animation/Motion.hpp"
102108

103109
#define AnsiString xr_string
104110

@@ -139,19 +145,22 @@ DEFINE_VECTOR(AnsiString*, LPAStringVec, LPAStringIt);
139145

140146
#include "xrPhysics/xrPhysics.h"
141147

142-
struct str_pred : public std::binary_function<char*, char*, bool>
148+
struct str_pred
143149
{
144-
IC bool operator()(LPCSTR x, LPCSTR y) const { return strcmp(x, y) < 0; }
150+
bool operator()(LPCSTR x, LPCSTR y) const { return strcmp(x, y) < 0; }
145151
};
146-
struct astr_pred : public std::binary_function<const AnsiString&, const AnsiString&, bool>
152+
153+
struct astr_pred
147154
{
148-
IC bool operator()(const AnsiString& x, const AnsiString& y) const { return x < y; }
155+
bool operator()(const AnsiString& x, const AnsiString& y) const { return x < y; }
149156
};
150157

158+
enum TShiftState { ssShift, ssAlt, ssCtrl, ssLeft, ssRight, ssMiddle, ssDouble };
159+
151160
#ifdef _EDITOR
152-
#include "Editor\device.h"
153-
#include "xrEngine\properties.h"
154-
#include "Editor\render.h"
161+
#include "Editor/device.h"
162+
#include "xrEngine/properties.h"
163+
#include "Editor/render.h"
155164
DEFINE_VECTOR(FVF::L, FLvertexVec, FLvertexIt);
156165
DEFINE_VECTOR(FVF::TL, FTLvertexVec, FTLvertexIt);
157166
DEFINE_VECTOR(FVF::LIT, FLITvertexVec, FLITvertexIt);

src/xrCore/Animation/Bone.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ class XRCORE_API CBone : public CBoneInstance, public IBoneData
392392
void ResetData();
393393
void CopyData(CBone* bone);
394394

395-
#if defined _EDITOR || defined _MAYA_EXPORT
396395
void ShapeScale(const Fvector& amount);
397396
void ShapeRotate(const Fvector& amount);
398397
void ShapeMove(const Fvector& amount);
@@ -404,11 +403,11 @@ class XRCORE_API CBone : public CBoneInstance, public IBoneData
404403
bool Pick(float& dist, const Fvector& S, const Fvector& D, const Fmatrix& parent);
405404

406405
void Select(BOOL flag) { flags.set(flSelected, flag); }
407-
bool Selected() { return !!flags.is(flSelected); }
406+
bool Selected() { return flags.is(flSelected); }
408407
void ClampByLimits();
409408

410409
bool ExportOGF(IWriter& F);
411-
#endif
410+
412411
private:
413412
IBoneData& GetChild(u16 id) { return *children[id]; }
414413
const IBoneData& GetChild(u16 id) const { return *children[id]; }

0 commit comments

Comments
 (0)