Skip to content

Commit

Permalink
ECore: future proofing WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Feb 9, 2018
1 parent f810e12 commit c101668
Show file tree
Hide file tree
Showing 19 changed files with 69 additions and 58 deletions.
6 changes: 6 additions & 0 deletions src/Common/CommonImportExport.inl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
#define XRCORE_API XR_IMPORT
#endif

#ifdef XRECORE_EXPORTS
#define XRECORE_API XR_EXPORT
#else
#define XRECORE_API XR_IMPORT
#endif

#ifdef XRGAMESPY_EXPORTS
#define XRGAMESPY_API XR_EXPORT
#else
Expand Down
2 changes: 1 addition & 1 deletion src/Common/NvMender2003/NVMeshMender.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class MeshMender
FVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX3 | D3DFVF_TEXCOORDSIZE2(0) | D3DFVF_TEXCOORDSIZE3(1) |
D3DFVF_TEXCOORDSIZE3(2)
};
Vertex::Vertex() :
Vertex() :
pos(0.0f, 0.0f, 0.0f), normal(0.0f, 0.0f, 0.0f), s(0.0f), t(0.0f),
tangent(0.0f, 0.0f, 0.0f), binormal(0.0f, 0.0f, 0.0f)
{}
Expand Down
4 changes: 2 additions & 2 deletions src/Common/NvMender2003/mender_input_output.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static void fill_mender_input(const xr_vector<type_vertex>& vertices, const xr_v
for (u32 i = 0; i < vertices_number; ++i)
set_vertex(theVerts[i], vertices[i]);
// fill inputs (indices)
for (xr_vector<type_face>::const_iterator face_it = faces.begin(); face_it!=faces.end(); face_it++)
for (auto face_it = faces.cbegin(); face_it!=faces.cend(); ++face_it)
add_face(theIndices, *face_it);
}

Expand All @@ -45,7 +45,7 @@ static void retrive_data_from_mender_otput(xr_vector<type_vertex>& vertices, //
old_vertices.clear();
// save old vertices to retrive through mappingNewToOldVert data that missing in MeshMender::Vertex
old_vertices = vertices;
// retriving data
// retrieving data
const u32 face_count = faces.size();
for (u32 i = 0; i < face_count; ++i)
set_face(faces[i], theIndices[3*i + 0], theIndices[3*i + 1], theIndices[3*i + 2]);
Expand Down
9 changes: 6 additions & 3 deletions src/editors/ECore/ECore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>EDITOR;_EDITOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)Editor;$(ProjectDir)Engine;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -75,7 +76,6 @@
<ClInclude Include="Editor\ELog.h" />
<ClInclude Include="Editor\engine.h" />
<ClInclude Include="Editor\EStats.h" />
<ClInclude Include="Editor\ETextureParams.h" />
<ClInclude Include="Editor\EThumbnail.h" />
<ClInclude Include="Editor\ExportObjectOGF.h" />
<ClInclude Include="Editor\ExportSkeleton.h" />
Expand Down Expand Up @@ -115,7 +115,6 @@
<ClInclude Include="stdafx.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Editor\bone.cpp" />
<ClCompile Include="Editor\BoneEditor.cpp" />
<ClCompile Include="Editor\ColorPicker.cpp" />
<ClCompile Include="Editor\c_dinput.cpp" />
Expand Down Expand Up @@ -144,7 +143,6 @@
<ClCompile Include="Editor\ELog.cpp" />
<ClCompile Include="Editor\Engine.cpp" />
<ClCompile Include="Editor\EStats.cpp" />
<ClCompile Include="Editor\ETextureParams.cpp" />
<ClCompile Include="Editor\EThumbnail.cpp" />
<ClCompile Include="Editor\EThumbnailGroup.cpp" />
<ClCompile Include="Editor\EThumbnailObject.cpp" />
Expand Down Expand Up @@ -185,6 +183,11 @@
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
9 changes: 0 additions & 9 deletions src/editors/ECore/ECore.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@
<ClInclude Include="Editor\EStats.h">
<Filter>editor</Filter>
</ClInclude>
<ClInclude Include="Editor\ETextureParams.h">
<Filter>editor</Filter>
</ClInclude>
<ClInclude Include="Editor\EThumbnail.h">
<Filter>editor</Filter>
</ClInclude>
Expand Down Expand Up @@ -178,9 +175,6 @@
<ClInclude Include="stdafx.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Editor\bone.cpp">
<Filter>editor</Filter>
</ClCompile>
<ClCompile Include="Editor\BoneEditor.cpp">
<Filter>editor</Filter>
</ClCompile>
Expand Down Expand Up @@ -265,9 +259,6 @@
<ClCompile Include="Editor\EStats.cpp">
<Filter>editor</Filter>
</ClCompile>
<ClCompile Include="Editor\ETextureParams.cpp">
<Filter>editor</Filter>
</ClCompile>
<ClCompile Include="Editor\EThumbnail.cpp">
<Filter>editor</Filter>
</ClCompile>
Expand Down
5 changes: 2 additions & 3 deletions src/editors/ECore/Editor/EStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
// refs
class CGameFont;

class ENGINE_API CEStats :

public CStatsPhysics
class ENGINE_API CEStats
: public CStats //CStatsPhysics
{
public:
float fFPS, fRFPS, fTPS; // FPS, RenderFPS, TPS
Expand Down
1 change: 0 additions & 1 deletion src/editors/ECore/Editor/ETextureParams.cpp

This file was deleted.

1 change: 0 additions & 1 deletion src/editors/ECore/Editor/ETextureParams.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/editors/ECore/Editor/EditorPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void CCustomPreferences::ApplyValues()

//---------------------------------------------------------------------------

void __stdcall CCustomPreferences::OnClose() { ApplyValues(); }
void CCustomPreferences::OnClose() { ApplyValues(); }
//---------------------------------------------------------------------------

void CheckValidate(ShortcutValue*, const xr_shortcut& new_val, bool& result)
Expand Down
2 changes: 1 addition & 1 deletion src/editors/ECore/Editor/EditorPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ECORE_API CCustomPreferences

protected:
void OnKeyboardCommonFileClick(ButtonValue* value, bool& bModif, bool& bSafe);
void__stdcall OnClose();
void OnClose();
void ApplyValues();

virtual void Load(CInifile*);
Expand Down
4 changes: 3 additions & 1 deletion src/editors/ECore/Editor/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "Engine.h"
#include "ui_main.h"

/*
CEngine Engine;
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -48,7 +49,7 @@ void CEngine::Initialize(void)
xrBinder* bindCPU = (xrBinder*)GetProcAddress(hPSGP, "xrBind_PSGP");
R_ASSERT(bindCPU);
bindCPU(&PSGP, CPU::ID.feature /*& CPU::ID.os_support*/);
bindCPU(&PSGP, CPU::ID.feature / *& CPU::ID.os_support* /);
// for compliance with editor
PSGP.skin1W = xrSkin1W_x86;
PSGP.skin2W = xrSkin2W_x86;
Expand All @@ -75,3 +76,4 @@ void CEngine::Destroy()
hPSGP = 0;
}
}
*/
4 changes: 2 additions & 2 deletions src/editors/ECore/Editor/UI_Camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class ECORE_API CUI_Camera
Fvector m_Target;

protected:
friendclass CEditorRenderDevice;
friendclass TUI;
friend class CEditorRenderDevice;
friend class TUI;

float m_Znear;
float m_Zfar;
Expand Down
20 changes: 10 additions & 10 deletions src/editors/ECore/Editor/UI_ToolsCustom.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ enum ETFlags

class ECORE_API CToolCustom
{
friendclass CCustomPreferences;
friend class CCustomPreferences;

protected:
bool m_bReady;
Expand Down Expand Up @@ -82,7 +82,7 @@ class ECORE_API CToolCustom
u32 dwFogColor;

public:
AnsiString m_LastFileName;
xr_string m_LastFileName;

public:
struct SDebugDraw
Expand Down Expand Up @@ -220,21 +220,21 @@ class ECORE_API CToolCustom

virtual void OnShowHint(AStringVec& SS) = 0;

virtual bool__fastcall MouseStart(TShiftState Shift) = 0;
virtual bool__fastcall MouseEnd(TShiftState Shift) = 0;
virtual void__fastcall MouseMove(TShiftState Shift) = 0;
virtual bool__fastcall HiddenMode() { return m_bHiddenMode; }
virtual bool__fastcall KeyDown(WORD Key, TShiftState Shift) { return false; }
virtual bool__fastcall KeyUp(WORD Key, TShiftState Shift) { return false; }
virtual bool__fastcall KeyPress(WORD Key, TShiftState Shift) { return false; }
virtual bool MouseStart(TShiftState Shift) = 0;
virtual bool MouseEnd(TShiftState Shift) = 0;
virtual void MouseMove(TShiftState Shift) = 0;
virtual bool HiddenMode() { return m_bHiddenMode; }
virtual bool KeyDown(WORD Key, TShiftState Shift) { return false; }
virtual bool KeyUp(WORD Key, TShiftState Shift) { return false; }
virtual bool KeyPress(WORD Key, TShiftState Shift) { return false; }
virtual bool Pick(TShiftState Shift) = 0;
virtual bool RayPick(const Fvector& start, const Fvector& dir, float& dist, Fvector* pt = 0, Fvector* n = 0) = 0;

virtual void ShowProperties(LPCSTR focused_item) = 0;
virtual void UpdateProperties(BOOL bForced = FALSE) = 0;
virtual void RefreshProperties() = 0;

const AnsiString& GetEditFileName() { return m_LastFileName; }
const xr_string& GetEditFileName() { return m_LastFileName; }
CEditableObject* m_pAxisMoveObject;
Fmatrix m_axis_xform;

Expand Down
10 changes: 7 additions & 3 deletions src/editors/ECore/Editor/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class ECORE_API CEditorRenderDevice :
// Dependent classes
CResourceManager* Resources;
CEStats* Statistic;
RenderDeviceStatictics stats;

CGameFont* pSystemFont;

Expand Down Expand Up @@ -132,6 +133,9 @@ class ECORE_API CEditorRenderDevice :
void ShutDown(void);
void Reset(IReader* F, BOOL bKeepTextures);

const RenderDeviceStatictics& GetStats() const override { return stats; }
void DumpStatistics(class IGameFont& font, class IPerformanceAlert* alert) override {}

IC CTimer* GetTimerGlobal() { return &TimerGlobal; }
IC float GetRenderArea() { return m_RenderArea; }
// Sprite rendering
Expand Down Expand Up @@ -175,9 +179,9 @@ class ECORE_API CEditorRenderDevice :
Shader_xrLC_LIB ShaderXRLC;

private:
virtual CStatsPhysics* _BCL StatPhysics() { return Statistic; }
virtual void _BCL AddSeqFrame(pureFrame* f, bool mt) { seqFrame.Add(f, REG_PRIORITY_LOW); }
virtual void _BCL RemoveSeqFrame(pureFrame* f) { seqFrame.Remove(f); }
virtual CStats* StatPhysics() { return Statistic; }
virtual void AddSeqFrame(pureFrame* f, bool mt) { seqFrame.Add(f, REG_PRIORITY_LOW); }
virtual void RemoveSeqFrame(pureFrame* f) { seqFrame.Remove(f); }
};

extern ECORE_API CEditorRenderDevice EDevice;
Expand Down
2 changes: 2 additions & 0 deletions src/editors/ECore/Editor/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "ELog.h"

/*
class ENGINE_API CEngine
{
HMODULE hPSGP;
Expand All @@ -24,5 +25,6 @@ class ENGINE_API CEngine
};
ENGINE_API extern CEngine Engine;
*/

#endif // !defined(AFX_ENGINE_H__22802DD7_D7EB_4234_9781_E237657471AC__INCLUDED_)
12 changes: 5 additions & 7 deletions src/editors/ECore/Editor/render.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#ifndef renderH
#define renderH

#include "xrCDB\Frustum.h"
#include "vis_common.h"
#include "xrCDB/Frustum.h"
#include "xrEngine/vis_common.h"

#include "Layers/xrRender/blenders/Blender.h"
#include "Layers/xrRender/blenders/Blender_CLSID.h"
Expand All @@ -16,14 +16,14 @@
#include "Include/xrAPI/xrAPI.h"

// definition (Renderer)
class CRenderTarget /*:public IRender_Target*/
class CRenderTarget : public IRender_Target
{
public:
virtual u32 get_width() { return EDevice.dwWidth; }
virtual u32 get_height() { return EDevice.dwHeight; }
};

class IRender
class IERender
{
public:
enum GenerationLevel
Expand All @@ -39,9 +39,7 @@ class IRender
virtual GenerationLevel get_generation() = 0;
};

class ECORE_API CRender :

public IRender
class ECORE_API CRender : public IERender
{
CRenderTarget* Target;
Fmatrix current_matrix;
Expand Down
4 changes: 2 additions & 2 deletions src/editors/ECore/Engine/NVMeshMender.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ class NVMeshMender
DontWeightNormalsByFaceSize
};

bool NVMeshMender::Munge(const NVMeshMender::VAVector& input, NVMeshMender::VAVector& output,
bool Munge(const NVMeshMender::VAVector& input, NVMeshMender::VAVector& output,
const float bSmoothCreaseAngleRadians = 3.141592654f / 3.0f, const float* pTextureMatrix = 0,
const Option _FixTangents = FixTangents, const Option _FixCylindricalTexGen = FixCylindricalTexGen,
const Option _WeightNormalsByFaceSize = WeightNormalsByFaceSize);
bool NVMeshMender::MungeD3DX(const NVMeshMender::VAVector& input, NVMeshMender::VAVector& output,
bool MungeD3DX(const NVMeshMender::VAVector& input, NVMeshMender::VAVector& output,
const float bSmoothCreaseAngleRadians = 3.141592654f / 3.0f, const float* pTextureMatrix = 0,
const Option _FixTangents = FixTangents, const Option _FixCylindricalTexGen = FixCylindricalTexGen,
const Option _WeightNormalsByFaceSize = WeightNormalsByFaceSize);
Expand Down
25 changes: 17 additions & 8 deletions src/editors/ECore/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ enum TMsgDlgBtn
typedef TMsgDlgBtn TMsgDlgButtons[mbHelp];

// core
#include <xrCore/xrCore.h>
#include "xrCore/xrCore.h"
#include "xrCore/_stl_extensions.h"
#include "xrCore/_types.h"
#include "xrCore/_fbox.h"
#include "xrCommon/xr_vector.h"
#include "xrCore/Animation/Bone.hpp"
#include "xrCore/Animation/Motion.hpp"

#define AnsiString xr_string

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

#include "xrPhysics/xrPhysics.h"

struct str_pred : public std::binary_function<char*, char*, bool>
struct str_pred
{
IC bool operator()(LPCSTR x, LPCSTR y) const { return strcmp(x, y) < 0; }
bool operator()(LPCSTR x, LPCSTR y) const { return strcmp(x, y) < 0; }
};
struct astr_pred : public std::binary_function<const AnsiString&, const AnsiString&, bool>

struct astr_pred
{
IC bool operator()(const AnsiString& x, const AnsiString& y) const { return x < y; }
bool operator()(const AnsiString& x, const AnsiString& y) const { return x < y; }
};

enum TShiftState { ssShift, ssAlt, ssCtrl, ssLeft, ssRight, ssMiddle, ssDouble };

#ifdef _EDITOR
#include "Editor\device.h"
#include "xrEngine\properties.h"
#include "Editor\render.h"
#include "Editor/device.h"
#include "xrEngine/properties.h"
#include "Editor/render.h"
DEFINE_VECTOR(FVF::L, FLvertexVec, FLvertexIt);
DEFINE_VECTOR(FVF::TL, FTLvertexVec, FTLvertexIt);
DEFINE_VECTOR(FVF::LIT, FLITvertexVec, FLITvertexIt);
Expand Down
5 changes: 2 additions & 3 deletions src/xrCore/Animation/Bone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ class XRCORE_API CBone : public CBoneInstance, public IBoneData
void ResetData();
void CopyData(CBone* bone);

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

void Select(BOOL flag) { flags.set(flSelected, flag); }
bool Selected() { return !!flags.is(flSelected); }
bool Selected() { return flags.is(flSelected); }
void ClampByLimits();

bool ExportOGF(IWriter& F);
#endif

private:
IBoneData& GetChild(u16 id) { return *children[id]; }
const IBoneData& GetChild(u16 id) const { return *children[id]; }
Expand Down

0 comments on commit c101668

Please sign in to comment.