From 06355bdd9fb24879b821a38fea968717af270111 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Mon, 30 Jul 2018 19:28:48 +0500 Subject: [PATCH] Revert some changes by @eagleivg --- src/Include/editor/engine.hpp | 1 + src/xrCore/_std_extensions.h | 10 ---------- src/xrEngine/Device_Initialize.cpp | 1 + src/xrEngine/device.h | 1 + src/xrEngine/engine_impl.cpp | 5 +++++ src/xrEngine/engine_impl.hpp | 1 + src/xrEngine/xrEngine.vcxproj | 3 ++- src/xrEngine/xrEngine.vcxproj.filters | 5 ++++- 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Include/editor/engine.hpp b/src/Include/editor/engine.hpp index ee88b45892e..f39f3fb3d31 100644 --- a/src/Include/editor/engine.hpp +++ b/src/Include/editor/engine.hpp @@ -19,6 +19,7 @@ class property_holder_base; class engine_base { public: + virtual bool on_message(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result) = 0; virtual void on_idle() = 0; virtual void on_resize() = 0; virtual void pause(bool const& value) = 0; diff --git a/src/xrCore/_std_extensions.h b/src/xrCore/_std_extensions.h index eb52d347ea9..de00066c489 100644 --- a/src/xrCore/_std_extensions.h +++ b/src/xrCore/_std_extensions.h @@ -216,21 +216,11 @@ inline int __cdecl xr_sprintf(char (&destination)[count], LPCSTR format_string, } #else // #ifndef MASTER_GOLD -inline int xr_strcpy(LPSTR destination, LPCSTR source) -{ - return strcpy(destination, source); -} - inline int xr_strcpy(LPSTR destination, size_t const destination_size, LPCSTR source) { return strncpy_s(destination, destination_size, source, destination_size); } -inline int xr_strcat(LPSTR destination, LPCSTR source) -{ - return strcat(destination, source); -} - inline int xr_strcat(LPSTR destination, size_t const buffer_size, LPCSTR source) { size_t const destination_length = xr_strlen(destination); diff --git a/src/xrEngine/Device_Initialize.cpp b/src/xrEngine/Device_Initialize.cpp index 61c242bf10a..bd2e8a10582 100644 --- a/src/xrEngine/Device_Initialize.cpp +++ b/src/xrEngine/Device_Initialize.cpp @@ -22,6 +22,7 @@ void CRenderDevice::initialize_weather_editor() m_editor_finalize = (finalize_function_ptr)m_editor_module->GetProcAddress("finalize"); VERIFY(m_editor_finalize); + m_engine = new engine_impl(); m_editor_initialize(m_editor, m_engine); VERIFY(m_editor); diff --git a/src/xrEngine/device.h b/src/xrEngine/device.h index a26f4dcc4f4..e8ffb6303f9 100644 --- a/src/xrEngine/device.h +++ b/src/xrEngine/device.h @@ -292,6 +292,7 @@ class ENGINE_API CRenderDevice : public CRenderDeviceBase public: void xr_stdcall on_idle(); + bool xr_stdcall on_message(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result); private: void message_loop(); diff --git a/src/xrEngine/engine_impl.cpp b/src/xrEngine/engine_impl.cpp index 52f38ca3ab9..d7182fdd845 100644 --- a/src/xrEngine/engine_impl.cpp +++ b/src/xrEngine/engine_impl.cpp @@ -26,6 +26,11 @@ engine_impl::~engine_impl() xr_delete(m_input_receiver); } +bool engine_impl::on_message(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result) +{ + return (Device.on_message(hWnd, uMsg, wParam, lParam, result)); +} + void engine_impl::on_idle() { SDL_PumpEvents(); diff --git a/src/xrEngine/engine_impl.hpp b/src/xrEngine/engine_impl.hpp index f9086740e10..853e06d3063 100644 --- a/src/xrEngine/engine_impl.hpp +++ b/src/xrEngine/engine_impl.hpp @@ -18,6 +18,7 @@ class engine_impl : public XRay::Editor::engine_base virtual ~engine_impl(); private: + virtual bool on_message(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result); virtual void on_idle(); virtual void on_resize(); virtual void pause(bool const& value); diff --git a/src/xrEngine/xrEngine.vcxproj b/src/xrEngine/xrEngine.vcxproj index f5af9575c86..b6b76f4fe2f 100644 --- a/src/xrEngine/xrEngine.vcxproj +++ b/src/xrEngine/xrEngine.vcxproj @@ -295,6 +295,7 @@ + @@ -464,4 +465,4 @@ - + \ No newline at end of file diff --git a/src/xrEngine/xrEngine.vcxproj.filters b/src/xrEngine/xrEngine.vcxproj.filters index a0764f07ce1..8e8b7363346 100644 --- a/src/xrEngine/xrEngine.vcxproj.filters +++ b/src/xrEngine/xrEngine.vcxproj.filters @@ -890,6 +890,9 @@ General + + RenderRef\Execution & 3D\Device + @@ -903,4 +906,4 @@ - + \ No newline at end of file